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 2 3 4 374
  1. Abdullah Albyati
    April 1st, 2014

    Hi everyone check out my website me and my brother are making free CCNA training we already have 2 videos uploaded and working on the rest.

    http://www.techpicks.net/free-ccna-training.html
    Thank You

  2. Ravi
    April 17th, 2014

    Great Job Bro, Thanks a million

  3. Jenny
    April 22nd, 2014

    Wonderful, a concise way for me to review. Straight and to-the-point thanks!!

  4. Ashu Mudgil
    May 9th, 2014

    thanks buddy…great job done..thanks once again.

  5. Chandana
    May 19th, 2014

    Hello,

    I have a question. There is a reference to R1, R2, with 192.168.x.x IP addresses. It will be nice if the topology diagram is listed somewhere, I will be able to relate better.

    Thanks

  6. M.umar
    June 5th, 2014

    hi guys !!

    i want to attempt CCNA please help me and suggest dumps

  7. Anonymous
    June 27th, 2014

    really help full gr8 work dude

  8. Bast83
    July 3rd, 2014

    To 9tut: New OSPF question about the process of building the adjacency.You must provide the good stage position between Exstart, Exchange, Loading and Full. You have to put these steps in the right postion.

  9. Anonymous
    July 15th, 2014

    Thank you, nice article.
    It would be nice if you could append it and explain the elusive reasons for DR and BDR routers. I’m still not crystal on that.

  10. Alex
    July 17th, 2014

    This is true watson is no longer valid. please send me the valid VCE. Thank you my email is :alexandrodvd8@gmail.com

  11. FRED
    July 19th, 2014

    Hi, can someone send me the last valid VCE to take icnd1 please? Freddybita@gmail.com

    Thanks in advance

  12. Cel
    July 22nd, 2014

    I’ll take a vice if possible for icnd1 plz. Scheduled exam July 29th. Thx!!!! Celvsmachine@gmail.com

  13. Cel
    July 22nd, 2014

    ^^^^ * VCE thx

  14. Saurabh Shah
    July 30th, 2014

    Hello, i am looking for CCNA(200-120) dumps and cracked VCE file. Please help me. My email ID is shahsaurabh_25@yahoo.co.in

  15. zaifi
    August 2nd, 2014

    god one…

  16. zaifi
    August 2nd, 2014

    good* one….

  17. alberto
    August 13th, 2014

    hello, what about multi area ospf, v2 v3 is this covered here sorry if it is and i didn’t see it

  18. Ron
    August 14th, 2014

    Hi, Can someone send me the last valid VCE CCNA 200-120 please? armymanpk@yahoo.com
    Thanks in advance
    Ron

  19. les123
    August 20th, 2014

    Would somone also send me the latest VCE VVNA 200-120 please? les123@aol.com
    Thanks
    les123

  20. les123
    August 20th, 2014

    that should have been CCNA -200-120.

    Thanks

    les123

  21. Dwayne
    September 30th, 2014

    Can someone also send my the latest VCE CCNA 200-120 please?
    Thanks
    ribtip18@gmail.com

  22. Dwayne
    September 30th, 2014

    This is a great learning forum for network engineers. The information is spot on. I just found this site and is very greatful of the people who put it together. Please keep up the good work team.

  23. Faith
    October 5th, 2014

    Hello, i am looking for CCNA(200-120) dumps and cracked VCE file. Please help me. Email: faithmbugua200@yahoo.com

  24. jasu
    October 10th, 2014

    thanks for this type of information about ospf

  25. Nigel
    October 19th, 2014

    Anyone seen any OSPFv3 questions on the 200-120 exams? Specifically, any involving OSPF configurations using IPv6?

  26. rehan
    October 20th, 2014

    Note: DD works like table fo content.

    fo should be of !

    cheers…

  27. rehan
    October 20th, 2014

    By reading DD, the receiving router can determine what it is missing and them ask the sender to transmit required LSAs..

    them should be then :)

  28. vindanas
    October 20th, 2014

    I’ve passed CCNA 972 .thanks to 9tut.Aii the bet guys!!!

  29. ISHITA
    November 4th, 2014

    GOOD…

  30. Yoni
    November 11th, 2014

    Hi 9tut

    I II test nex week, i need least dump,, plese ,,,send to >> Osmandun7@gmail.com Tanks a lat

  31. Anonymous
    December 24th, 2014

    Question No. 8 for summarization is not understood properly, can someone explain how ?

  32. Anonymous
    December 24th, 2014

    Question 6:

    Refer to the exhibit. What is the most efficient summarization that R1 can use to advertise its networks to R2?

    autosummarize

    A. 172.1.0.0/22

    B. 172.1.0.0/21

    C. 172.1.4.0/22

    D. 172.1.4.0/24
    172.1.5.0/24
    172.1.6.0/24
    172.1.7.0/24

    E. 172.1.4.0/25
    172.1.4.128/25
    172.1.5.0/24
    172.1.6.0/24
    172.1.7.0/24

  33. duump
    January 6th, 2015

    dear Anonymous

    the answer is C 172.1.4.0/22
    because that’s prefix 22 have 1022 ip active and then the range ip is 172.1.4.1 until 172.1.7.254 and have network-id = 172.1.4.0 broadcast = 172.1.7.255 , i hope my answere help you CMIIW

  34. Aditaya
    January 16th, 2015

    Use sign R2 In place of R1 in d second router figure. U have named R1 at 2 places but with different interfaces

  35. khan
    January 22nd, 2015

    Watson data is very usefull. 98% question are from Watson. today I passed ccna exam.

  36. ImmiRavian
    February 11th, 2015

    @9tut EIGRP is also now open-standard. Kindly make correction above in OSPF tutorial’s 1st page.

  37. 9tut
    February 11th, 2015

    @ImmiRavian: Yes, thanks for your detection. We updated it.

  38. Anonymous
    March 10th, 2015

    could you modify the name of the Router at the end of the first page ?
    When you are talking about the router 2, please write router R2 and not R1 as in your example.

  39. 9tut
    March 10th, 2015

    @Anonymous: Thanks for your detection. We have just updated it.

  40. K Mahesh babu
    May 22nd, 2015

    thanks 9tut…..its very helpful to me.

Comment pages
1 2 3 4 374
Add a Comment