OSPF Blog Content

OSPF - Open Shortest Path First

OSPF Explained Step By Step With Practicals From CCNA To CCIE Level

OSPF Loop-Prevention



In OSPF to prevent the routing update loop or to prevent the database loop, it use a concept of sequence number added in each database
Sequence number is generated by the router who is the real originator of the database
Sequence number can only be modified by the originating router in two condition
        a. Upon receiving new change in the interfaces ip or network change
        b. If no changes happen, then after every 1800 sec routers originate same update again with higher sequence number and flood to all the routers
If a router is holding a database with a sequence number 0x80000002, then it will never receive any update for the same database with same sequence number from any of the router in the domain
When it will get the same database with higher sequence number then only it will accept, and only real origiantor can change the sequence number

Lets check steps one by one how the routers prevent the loop by using sequence number

1. Router-1 will send a database with sequence number 0x80000002 towards R2
        a. Router 2 will accept it and will install this in the database table

Output with Sequence number
R2#show ospfv3 database

         OSPFv3 1 address-family ipv6 (router-id 2.2.2.2)
                 Router Link States (Area 0)

ADV Router          Age          Seq#          Fragment ID Link count Bits
1.1.1.1          1663          0x80000002 0          1          None
2.2.2.2          1610          0x80000002          0          1          None

2. Now Router-2 will send the same database without any change towards Router-3
        a. Router-3 will accept it and will install in the database
3. Now Router-3 will send the same database without any change towards Router-4
        a. Router-4 will also accept it and will install in the database
4. Now this time Router-4 will send the same database without any change towards Router2
        a. But this time Router-2 will check and observer that i do already have that update with same sequence number, so it is a duplicate update not a new update so it will discard it

This is how the routers prevent the loop in the case of OSPF database exchange

OSPF database timers



        * Whenever a OSPF router originate database it start with 0 and all the routers install the database and start the timer
        * A database is originated again in two condition
                At the time of a change in network
                If no changes occur, OSPF router originate it again after 1800 sec including all the prefixes and details
        * If a router do not get the database till next 3600 sec, that particular database considered as age timeout and will be flushed

image
image
image
image