OSPF Neighbor States
For OSPF to function properly, routers must establish neighbor relationships with each other. These neighbor relationships go through a series of states before becoming established.
The OSPF Neighbor States are as follows:
- Down state: There is no OSPF communication between the routers because they haven’t exchanged hello packets yet.
- Init state: Routers have sent each other hello packets but have not received any reply.
- Two-way state: Routers have received hello packets from each other and have also replied to them. In addition, they have recognized their router ID in the list of neighbors included in the hello packet sent from the OSPF neighbor. After the routers have achieved a two-way state, the DR and BDR are elected. It's important to note that the DR and BDR are assigned per segment rather than per area.
- Exstart state: One of the routers is selected as the primary router and initiates the exchange of database description (DBD) packets with the OSPF neighbor.
- Exchange state: In this state, the routers exchange DBD packets (summary of their databases).
- Loading state: Routers request missing information about the network the OSPF neighbor has information for to update its database.
- Full state: Routers have synchronized LSDBs and have the same knowledge about the network topology.
Once the OSPF neighbor relationship has reached the full state, the routers continue to exchange information and monitor the network for changes in topology. If a change is detected, the neighbor relationship will go through the neighbor states again to ensure the routers have up-to-date network knowledge.