OSPF Neighbor relationship process
1. Determine the Router ID
- It is the router’s name in the OSPF process. It’s always advisable to hard code the router-id.
- Router-id > Loopbacks > Active Physical interface IP
2. Add interfaces to the link state database, done by the network command
3. Send a Hello message on chosen interfaces
- Hello message timer
|Broadcast/P-2-P networks||Every 10 seconds|
|Non-Broadcast Multi-access Networks (NBMA)||Every 30 seconds|
- Hello message packet
|Router ID||Either hard coded or interface IP address|
|Hello and Dead timer||Based on whether it’s a Broadcast/P2P/NBMA network|
|Neighbors||If the neighbor is present, it knows it is not a new relationship and resets the dead timer. If not present then it adds the neighbor.|
|Router Priority||Determines the Master/Slave router on the network segment|
|DR/BDR IP address|
|Authentication password||The authentication password should be the same, obviously.|
|Network Mask||On both the neighboring interfaces should be the same|
|Area ID||Area of both the to-be-neighbors on that segment should be the same|
- Dead Timer (4x of hello timer)
|Broadcast/P-2-P networks||Every 40 seconds|
|Non-Broadcast Multi-access Networks (NBMA)||Every 120 seconds|
4. Receive Hello (INIT state)
- If the state flaps between INIT/DOWN check the things that need to match on both the neighbors.
5. Send Hello Reply (2-WAY state)
- Checks the hello packet received from the neighbor to see if it is listed as a neighbor or not;
- If yes, resets the dead timer and continues to be an existing neighbor.
- If no, adds as a new neighbor and proceeds further to other checks.
6. Master/Slave relationship determined (EXSTART state)
- Determined by ‘Priority’ – Higher the better (Router ID breaks the tie.)
- DBD packet exchanged
7. DBDs are acknowledged and reviewed (LOADING state)
- While reviewing the DBDs if the Slave realizes that there is information missing for say 2 subnets/prefixes, the Slave will send 2 Link State Requests (LSR) and Master sends back 2 Link State Updates (LSU).
- If Master router realizes that it is missing some info about a particular prefix, it will query the slave with an LSR and the slave with reply back with an LSU containing the LSA for that prefix.
8. Neighbors are synchronized (FULL state)
- Now the SPF algorithm can be run on the LSDB that the routers now have, and they can then figure out the best path to each prefixes and put them in the routing table.