OSPF Blog Content

OSPF - Open Shortest Path First

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

Neighborship requirement



Whenever 2 routers wants to form the neighborship, they must agree on some parameters, and those are hello parameters, routers exchange some parameters in hello packet:
                1. Router ID should be unique
                2. Area ID should be the same
                3. subnet mask
                        a. must match on Ethernet segment
                        b. can be different on serial interface
                4. hello and dead timer must match
                5. authentication must be the same if configured
                6. Stub flag should be same




Neighbor States



Whenever routers use OSPF on interface, they exchange hello packet and verify the parameters, the very first packet is hello packet that they used to exchange and start the procedure to form the neighborship and follow some level or neighbor states to process one by one and synchromize the database.

Here are the states listed below and working:

        1. Down--both routers are not configured
        2. Init--router send hello with anf(active neighbor field) (0.0.0.0) or does not contain any ANF field
        3. 2-way--router send hello with anf(active neighbor field) (of another R.ID)
        If routers use serial link they move to next state exstart or if they are using ethernet segment they do the DR & BDR election to prevent flooding of database on multiaccess segment
Note* Later we will discuss more about DR & BDR use case
        4. Exstart--Master and Slave election will also happen in this state.
                 1.Both routers sends the DBD to each other containing few parameters
                                   a. MTU (Should be same on both interface)
                                   b. M/S bit (if bit is enable that is master, if bit is disable that indicates slave)
                                   c. More bit (More DBDs yet to come if bit is 1)

                2. Routers will first check MTU, that should be same otherwise they stuck in exstart state, To ignore MTU check we can rug (ip ospf MTU ignore) on interface level where we have lower MTU
                3.If MTU is same they verify the router ID
                4. The router with the highest router ID win the election
                5. Once routers elect Master they use Master seq number to send any DBD or to give any reply
                6. When Master sends any packet it increment sequence number by 1 everytime
                7. Master and Slave election is one time while bringing the neighborship up

        5. exchange--in this state routers exchange summary of DBD. Summary includes the Rotuer ID, Link ID, Age and Checksum of database
        6. loading --in this state routers send LSRequest to each other and actively ask for the full database and both routers reply with LSupdate that includes the complete database
        7. full--in this state both routers are adjacent

image
image
image
image