Home > OSPF Tutorial

OSPF Tutorial

December 3rd, 2010 Go to comments

In this article we will learn about the OSPF Routing Protocol

Open-Shortest-Path-First (OSPF) is the most widely used interior gateway protocol routing protocol on the world because it is a public (non-proprietary) routing protocol while its biggest rival, EIGRP, is a Cisco proprietary protocol so other vendors can’t use it (edit: EIGRP has become a public routing protocol since 2013). OSPF is a complex link-state routing protocol. Link-state routing protocols generate routing updates only when a change occurs in the network topology. When a link changes state, the device that detected the change creates a link-state advertisement (LSA) concerning that link and sends to all neighboring devices using a special multicast address. Each routing device takes a copy of the LSA, updates its link-state database (LSDB), and forwards the LSA to all neighboring devices.

Note:

+ OSPF routers use LSA (Link State Advertisement)to describe its link state. LSDB stores all LSAs.

+ A router uses Router LSA to describe its interface IP addresses.

+ After OSPF is started on a router, it creates LSDB that contains one entry: this router’s Router LSA.

There are five types of OSPF Link-State Packets (LSPs).

OSPF_example.jpg

+ Hello: are used to establish and maintain adjacency with other OSPF routers. They are also used to elect the Designated Router (DR) and Backup Designated Router (BDR) on multiaccess networks (like Ethernet or Frame Relay).

+ Database Description (DBD or DD): contains an abbreviated list of the sending router’s link-state database and is used by receiving routers to check against the local link-state database

+ Link-State Request (LSR): used by receiving routers to request more information about any entry in the DBD

+ Link-State Update (LSU): used to reply to LSRs as well as to announce new information. LSUs contain seven different types of Link-State Advertisements (LSAs)

+ Link-State Acknowledgement (LSAck): sent to confirm receipt of an LSU message

 

Key points

+ Is a public (non-proprietary) routing protocol.

+ Is the only link-state routing protocol you learn in CCNA

+ This works by using the Dijkstra algorithm

+ Information about its neighbors (local connectivity) is sent to the entire network using multicasting

+ Routing information is shared through Link-state updates (LSAs)

+ HELLO messages are used to maintain adjacent neighbors. By default, OSPF routers send Hello packets every 10 seconds on multiaccess and point-to-point segments and every 30 seconds on non-broadcast multiaccess (NBMA) segments (like Frame Relay, X.25, ATM).

+ Is a classless routing protocol because it does not assume the default subnet masks are used. It sends the subnet mask in the routing update.

+ Supports VLSM and route summarization

+ Uses COST as a metric which CISCO defines as the inverse of the bandwidth

+ Uses AREAs to subdivide large networks, providing a hierarchical structure and limit the multicast LSAs within routers of the same area — Area 0 is called backbone area and all other areas connect directly to it. All OSPF networks must have a backbone area

+ Only support IP but it’s not bad as we are all using IP, right? :)

Area Border Routers (ABR) are any routers that have one interface in one area and another interface in another area

Let’s see an example of OSPF

Suppose OSPF has just been enabled on R1 & R2. Both R1 and R2 are very eager to discover if they have any neighbors nearby but before sending Hello messages they must first choose an OSPF router identifier (router-id) to tell their neighbors who they are. The Router ID (RID) is an IP address used to identify the router and is chosen using the following sequence:

+ The highest IP address assigned to a loopback (logical) interface.

+ If a loopback interface is not defined, the highest IP address of all active router’s physical interfaces will be chosen.

+ The router ID can be manually assigned

In this example, suppose R1 has 2 loopback interfaces & 2 physical interfaces:

+ Loopback 0: 10.0.0.1

+ Loopback 1: 12.0.0.1

+ Fa0/0: 192.168.1.1

+ Fa0/1: 200.200.200.1

As said above, the loopback interfaces are preferred to physical interfaces (because they are never down) so the highest IP address of the loopback interfaces is chosen as the router-id -> Loopback 1 IP address is chosen as the router-id.

OSPF_choose_router_id.jpg

Suppose R1 doesn’t have any loopback interfaces but it has 2 physical interfaces:

+ Fa0/0: 210.0.0.1 but it is shut down

+ Fa0/1: 192.168.1.2 (is active)

Although Fa0/0 has higher IP address but it is shutdown so R1 will choose Fa0/1 as its router-id.

OSPF_choose_router_id_2.jpg

Now both the routers have the router-id so they will send Hello packets on all OSPF-enabled interfaces to determine if there are any neighbors on those links. The information in the OSPF Hello includes the OSPF Router ID of the router sending the Hello packet.

Comments (190) Comments
Comment pages
  1. mayor_martin
    December 20th, 2012

    OSPF Tutorial page 1 says “Uses COST as a metric which CISCO defines as the inverse of the bandwidth”. What does that exactly mean?

  2. 9tut
    December 21st, 2012

    @mayor_martin: The formula of cost:
    Cost = Reference / Bandwidth.
    By default, Reference is 100000 [ Kb/s ].

    We can see Cost is inverse of Bandwidth.

  3. Vivek S
    December 30th, 2012

    Very useful tutorial about OSPF.

  4. shifa
    January 3rd, 2013

    is the ccna exam as same as the dump and simulation on 9tut

  5. rick
    January 21st, 2013

    yes shifa but you must download and practise latest dumps,so best of luck for your exam

  6. Justin
    February 4th, 2013

    I find this OSPF tutorial very vague – you don’t even mention DR/BDR or that actually LSA’s are sent to the DR/BDR via multicast 224.0.0.6 and then redistributed to all other routers in the area via multicast 224.0.0.5 to reduce traffic and ensure routers have consistent LSDBs. Isn’t that correct or am I wrong?

  7. Anonymous
    February 11th, 2013

    @ rick, pls can u help me with current dumps, i’m planning writing my own in two weeks time. my e-mail is: michaelskywave@yahoo.com

  8. avanita
    February 20th, 2013

    Can you please send me the link to the latest dumps.
    id is avanita25@yahoo.co.in
    How close are the questions on this site to the real CCNA exam ?

  9. azeemullah
    February 28th, 2013

    any one please send me latest ccna dumps to this mail id : skazeemullah@gmail.com

  10. Muhammad
    March 19th, 2013

    what does the router say when you try to asigsn the privilege level 15? I would check what level your current user has also. Run a show privilege’ command to find out

  11. Adeel
    March 28th, 2013

    Hello Guys I hope you will be fine there. I have CCNA (640-802) Vouchers on
    special discount of 58% for World wide, with six months expiry date till you
    purchase. Each voucher cost 60USD.
    Details Required For CCNA Voucher For Discount Processing:
    1-Full Name. 1st Name & Last Name (as you want to appear on certificate & documents)
    2-Country.
    3-City.
    4-State.
    5-Pin Code (or Area Code)
    6-Residential Address (or where you can collect your Certificate or further correspondence
    can be received)
    Add me on Skype through this information which is written below:
    Skype Name: rockon660
    you can also email me at this email address which is written below:
    madeelqaiser@gmail.com
    If you have any Questions feel free to contact me.
    Thanks,
    Best regards,
    Adeel

  12. Richard
    April 16th, 2013

    9tut.com i enjoy your tutorial on ospf, quite understandable, thanks.

  13. james
    May 2nd, 2013

    9tut yo are greet keep, it up

    i am want to sit for my ccna exam by end of may. can any onesend me the latest dump
    my email is kariokojim@yahoo.com

  14. Haitham al-dhabiani
    May 7th, 2013

    9tut THX very much

    i need some advice before exam CCNA and latest dump

    my e-mail is engineer.haytham@yahoo.com

  15. Nahro
    May 12th, 2013

    Hi All,
    I am confused with auto-summary command, anyone can tell me Why we need it and What is a benefit of using it in all routing protocols (RIP, EIGRP and OSPF ) ?
    I appreciate.

  16. alper
    May 18th, 2013

    What does loopback do? Can you explain?

  17. alper
    May 19th, 2013

    Nahro, it reduces the network traffic by sending an ip address instead of dozens.

  18. M7
    May 20th, 2013

    hii
    @ alper
    What does loopback do ?

    the most benefits of loop back interface it is always turn on ” because is logic interface ”

    so I use loop back interface always to identify the router to make ” telent ,ping —etc”

  19. M7
    May 20th, 2013

    the configuratuion is easy

    in configuration mode

    router # interface loopback 55

    router # ip add “ip of network” ” subnet mask of network”

    just lke this

    55 can replace by any number

    note: always loop back interface is up .

  20. Arsalan
    May 21st, 2013

    increadible tutorial.
    arsalan_duli@yahoo.com

  21. malik
    May 22nd, 2013

    can someone email me the latest dumps. Also does anyone know when the CCNA exam is changing?
    shahram3272gmail.com

  22. logan
    June 4th, 2013

    nice concepts…….

  23. @Smart@
    June 7th, 2013

    please help me in this question

    What is the type of LSA?

  24. @Smart@
    June 7th, 2013

    @9tut@

    please help me in this question

    What is the type of LSA?

  25. Mongnguyen
    June 11th, 2013

    Anyone please send me the latest dump to sidegrove@yahoo.com. thank you in advance

  26. Paddie
    June 14th, 2013

    very useful tutorial, keep the good work up guys.

  27. rose
    July 12th, 2013

    can anyone send me the latest dumps, i am planning to give ccna exam within 15days.. Please
    send me on my mail id rj.nidcity@gmail.com

  28. Jelena
    July 21st, 2013

    Hello all,
    Is there any kind person who would mail me latest dumps? My email: jelena234@hotmail.com

  29. ahmed sheikh
    July 28th, 2013

    any one please send me lates ccna dumps and any tutorial which might help me to pass may exam

    ahmedfaaf@hotmail.co.uk

  30. vishal
    August 5th, 2013

    Please please suggest which ccna certif icate is good prepare ccna routing and switching , security please

  31. Pete
    August 24th, 2013

    Hello Guys, good summary to OSPF, can someone send latest dumps to ped.figueroa@gmail.com. or where can I get them from? I am taking test next week. Thank you all.

  32. Vaibhav
    August 24th, 2013

    i am appearing for CCNA. Please send me the latest dumps on vaibhavgopal.dange@gmail.com.
    thanks

  33. Vaibhav
    August 24th, 2013

    i am appearing for CCNA next week

  34. moe
    August 27th, 2013

    I’m going to write CCNA next month..Can anyone plz send the latest dumps at moh_moez@yahoo.com

  35. CiscoER
    September 7th, 2013

    The Last Router should be labeled R2 *not* R1. I hope you all saw that
    **It’s a Rubicon**

  36. Tati
    September 25th, 2013

    Hi, does 9tut operate in other language? exemple French?

  37. Anonymous
    October 29th, 2013

    very simple and understandable information about ospf

  38. Syed
    November 13th, 2013

    please send me the latest 200-120 CCNA dumps on syed.asad@basecampdata.org

  39. Amit
    December 1st, 2013

    9 tuts is so great —– but …this may also be some useful. http://www.routeralley.com/ra/docs/ospf.pdf

  40. Nfally Sonko
    December 24th, 2013

    I am about to sit to the ccna 200-120 in second week of January.I would be grateful if you can send me the latest dumps at sonkonn@yahoo.co.uk

  41. Zamil Mesteliyev
    January 21st, 2014

    people,im gonna have exam after 2 weeks pls send me the atest dumps pls pls z.mesteliyev@gmail.com

  42. Sugumar
    January 30th, 2014

    Any new dumps for ccna 200-120

  43. Rick CCNA
    February 6th, 2014

    Taking ICND1 IN 2 WEEKS. Can some Saint out there send me the latest dumps please ?? rick27mp@yahoo.com.. I would be sooo thankkful..

  44. techie923
    February 7th, 2014

    same here, taking the 100-101 soon. any update dumps out there would be helpful. thx

  45. techie923
    February 7th, 2014
  46. Anonymous
    March 9th, 2014

    can any1 plz send me the 100-101 ICND1 dumps on wtohfa88@live.com

  47. kd
    March 15th, 2014

    “Suppose OSPF has just been enabled on R1 & R2. Both R1 and R2 are very eager to discover if they have any neighbors nearby but before sending Hello messages they must first choose an OSPF router identifier (router-id) to tell their neighbors who they are. The Router ID (RID) is an IP address used to identify the router and is chosen using the following sequence:”
    The router ID is a 32 bit number. It appears in the same quad dotted decimal format as an IP address, but it is not. If the router does not have a router ID specified, then the OSPF will chose the IP address on the first interface that comes up and use that as the RID.

  48. Amir Reza
    March 24th, 2014

    Hi,
    Seems that there is typing mistake in here :

    …using the following sequence:
    + The highest IP address assigned to a loopback (logical) interface.
    + If a loopback interface is not defined, the highest IP address of all active router’s physical interfaces will be chosen.
    + The router ID can be manually assigned

    In fact the sequence is :
    1- Manually assigned RID using #router-id A.B.C.D (router command)(even if A.B.C.D is not one of our interfaces’ IP)
    2- Highest IP of assigned Loopback
    3- Highest IP of active interfaces (up/up – up/down – but not down/down)

  49. faizal237
    March 25th, 2014

    thank you 9tut.

  50. Ash
    March 27th, 2014

    can someone email me the latest ICND2 dumps please: ahaghighi@aol.co.uk

Comment pages
Add a Comment