On the previous lessons, pinag-usapan natin ang basic and fundamentals ng routing. Dinaanan din natin ang directly connected routes, static routes and even the basic of dynamic routes. On this lesson, we’re now moving to different types of ‘dynamic routing protocols’ na karaniwang ginagamit sa modern networks today. At ito ay ang OSPF.
Note: OSPF is the only routing protocol included in the new CCNA exam(200-301). Pero meron pa rin ibang types of dynamic routing protocols like RIP, EIGRP and BGP etc. Since ang focus ng blog na ito is CCNA, we’re only focusing what’s included the ccna curriculum.
Let’s start.
What is OSPF?
Ang OSPF is an abbreviation para sa Open-Shortest Path First. It’s an open-standard routing protocol. Meaning, it can work in other devices at hindi lang sa Cisco. Ito ay isa ring link-state routing protocol. Ibig sabihin, ang mga routers na miyembro ng OSPF ay nagpapasahan ng link-state updates to connect and communicate in the network.
Para ma-establish ang ating OSPF network, ang mga OSPF neighbor router ay nagpapalitan ng “hellos” at ito ay ipinapadala nila sa multicast address na 224.0.0.5. You can see a simple illustration below.
OSPF uses an algorithm called spf or “shortest path first” na pina-sikat ni Edsger W. Dijkstra. Ito ay humahanap ng pinaka-mabilis na way para marating ang isang destination sa pamamagitan ng pag-calculate ng “distance” or cost from the source.
For example, meron tayong 3 ways para marating ang school galing sa bahay natin. We use the shortest and fastest way by calculating our time travel for each way. Right? Parang ganun din si OSPF, kina-calculate niya ang cost ng lahat ng mga available na OSPF path para mapili ang pinaka-the-best na daan from our source to destination.
By default, si OSPF ay nagsesend ng update every 10 seconds(RIP is 30 seconds remember?). If after 4 hellos(40 seconds) at hindi nag-hello back si neighboring router, it will be tag as neighbor down. After configuration, gaya din ng ibang routing protocol, ang OSPF protocol ay ay mag-aabang at mag-papasa ng routing information sa kanyang mga neighbors through “hello messages“.
Ang “hello message” ng mga routers na miyembro ng OSPF ay naglalaman ng mga impormasyon about sa network at configurations na meron ang naturang router. As you can see in our image above, the hello message contains information like router id, area id, hello and interval timers and more.
Ang mga sumusunod na information ay kailangang tugma sa dalawang OSPF router na gustong mag-connect or mag-communicate.
- area id
- hello and dead interval timers
- authentication
- area stub flag
- network mask
Ang mga ito ay kailangan tugma at pareho sa neighboring OSPF router. If not, OSPF hello mismatch can happen. Kung sakto at pareho, kukunin ni OSPF router ang lahat ng “link state data” sa kanyang neighboring router para makabuo ng topology map at isa-save ito sa kanyang “link state database“.
Again, they send OSPF hello by default every 10 seconds. After ng 4 hellos(40 secs.) at wala pa rin response ang kabilang OSPF router, it will be tagged as down.
Gamit ang mga information sa kanyang link state database, it will calculate the “best shortest path” to each reachable subnet/network gamit ang algorithm na tinatawag na Shortest Path First (SPF) gaya nga ng nabanggit natin kanina.
Gaya dn ng ibang routing protocol, mag-crereate na ito ng 3 different tables base sa mga nakalap na information.
OSPF Table
- Neighbor table – list of all OSPF neighbor na makikipag-palitan ng route sa kanya
- Topology table – dito naman naka-save ang roadmap or lahat ng available na path from a certain network going to a certain destination
- Routing table – sa routing table naman naka-save ang “best shortest path” na gagamitin main or primary path to reach a certain network destination
OSPF Administrative distance
Ang default administrative distance ng OSPF is 110. Again, default administrative distance(or AD) ang ginagamit ng mga routers to decide kung alin ang pipiliin niyang path(malalagay sa routing table) if there are multiple routing protocols available to reach a certain destination.
Ibig sabihin, kung ang mga routing protocols papunta sa isang destination ay OSPF at RIP, mas pipiliin ni router ang OSPF dahil mas mababa ang AD nito kesa kay RIP. Pero kung ang options ni router ay EIGRP or OSPF, the router will choose EIGRP dahil mas mababa ang AD nito(which is 90).
We’re good?
Ok, let’s talk about the metric.
OSPF Metric
Kagaya ng napag-usapan natin sa mga naunang lessons, alam na natin na ang “metric” ay ginagamit din ng router to decide the best path kapag meron dalawa or higit pang path or ways to reach a certain destination using the same routing protocol.
Kung si RIP ay gumagamit ng hop count at si EIGRP naman ay gumagamit ng bandwidth and delay, si OSPF protocol ay gumagamit ng tinatawag nating cost. By default, si OSPF ay gumagamit ng reference na 100 Mbps para sa kanyang cost calculation.
Here’s the formula to get the OSPF cost is:
Example:
Ang bandwidth ng interface natin na member ng isang OSPF network is 10Mbps. The computation will be:
100(reference bandwidth) / 10(actual interface bandwidth) = 10. Therefore OSPF cost for this link is 10.
To get the cost, we just need to divide 100(the default reference bandwidth) to the actual bandwidth of the interface kagaya ng ating example.
So if for example ang bandwidth ng interface natin is 20Mbps, the formula would look like this: 100/20 = 5. 5 Ang ospf cost natin for that given interface.
Ito ang mga default ospf cost na karaniwang makikita natin sa common networks.
We can use the command “ip ospf cost [bandwidth]” sa interface ni OSPF para i-modify or i-customize ang cost na naturang interface. Later on, dadaanan natin ng masinsinan ang topic na ito para mas lalo pa natin maintinidihan. For now, that’s the basic.
OSPF Area
Kapag pinag-usapan ang OSPF protocol, ang unang pinaka “hint” natin dito ay ang tinatawag natin na “AREA“.
Gumagamit si OSPF ng area to group the network para mas madali ang management at pag-troubleshoot ng network. Bukod dito, ginagamit din ni OSPF ang concept ng areas para sa network summarization at area boundries.
Ano nga ba ang Area?
Ito ang term na ginagamit para sa grupo ng mga network or routers ni OSPF. For example, sa ating pamayanan, ang bawat mga Barangay ay pwede natin i-consider na area sa ating lugar. May kanya-kanya silang Brgy. Captain, kanya-kanyang street, mga rules etc. Pero ang mga Barangay na ito ay part pa rin ng isang bayan. At ang mga Barangay na ito ay nasasakop ng naturang bayan.
Ganun din sa OSPF protocol. Meron tayong iba’t ibang “area“(barangay), meron silang kanya-kanyang router, network, rules etc. pero they should all be connected to “area 0“(bayan).
For example, ang mga areas sa ating OSPF network ay area 1, area 2, area 3. All these areas ay dapat connected sa Area 0. Ang area 0 ang pinaka-backbone ng OSPF network. Let me give some basic illustration.
Sa ating sample image sa taas, makikita natin na meron 3 different Areas. Area 1 and Area 2 at ang Area 0. Paki-iignore mo muna yung mga label, we will get into that later.
So kung napansin mo, gaya ng nabanggit natin kanina, si Area 1 connected kay Area 0 at ganun din si Area 2. Kung meron pa tayong ibang network na gustong maging part ng OSPF network natin, one of it’s router should be connected to Area 0 too. All these routers and network are in the same AS or autonomous system.
Area 0 = the backbone area(except for external routing domain) gaya ng nasa right side ng ating sample image.
Here are some terms about OSPF areas:
- Backbone area – the central or backbone of the ospf network. It’s the area 0.
- Standard area – common ospf area(s) connected to area 0
Take note na each area ay meron kanya-kanyang network and pwede ring internal routers. As long as na may isang router on that area na connected sa Area 0, they can be part ng ating OSPF network.
Alright.
That’s enough for the basics.
By this time, you now understand the fundamentals of OSPF protocol. On the next lesson, itutuloy natin ang ‘kwentuhan’ para mas maunawaan pa natin how really OSPF works in the background.
For now, let this lesson sink in para hindi ka ma-information overload.
kolang16 says
nice blog, it is very helpful, mag tatake ako ng ccna exam this aug 20, after i found this site, aside from reviewing from dump, i started reviewing here, hope to see your update in OSPF that is what im waiting for. Keep up sir!
Arnold says
sir san kapo kumukuha ng dump? pwd hingi link sir..tnx
kolang16 says
Sir because of the internet i got a lot of valuable resources regarding Cisco CCNA R&S such as the official cert. guide and cbt videos. i havent got the chance to read or watch any of it before taking a boot camp. now that i have finished it i learned a lot about computer networks but i really want to embrace it and learn more of it. any tips on how to use the pdf and videos that are available in the internet?
Billy says
Idol you mentioned you already have the resources, the only thing you need is to commit yourself studying those resources. Yung kelangan lang, minsan sa sobrang dami mong pinagkukunan, ma-ooverload ka sa info at tatamarin ka na. Hehe. Set a goal, make plans, draft schedule of lessons or topics you’ll study on that day and then TAKE ACTION! That’s it!
You may want to read this practical way to become CCNA in the Philippines.
alex says
thank you dito idol. super ganda ng mga topics mo idol.lagi ako dito tambay..
Billy says
Welcome Idol. Paki-share na rin sa iba. Hehe. Cheers!
CCNA wanna BE says
Sir. Billy Ok lang din po ba kahit walang Area Border Router sa pagitan ni Area 1 at Area 2 papunta kay Area 0 (Backbone Router ) ?