While forming an adjacency with each other, OSPF speaking neighbors go through several states(OSPF neighbor states) before the routers are fully adjacent with each other.
Related- OSPF Interview Questions
OSPF Neighbor States
Below is the detailed examination of OSPF states during the transition from Down to Full State –
- Down state
- Attempt state
- Init state
- 2-Way state
- Exstart state
- Exchange state
- Loading state
- Full state
Related- OSPF Timers Guide
The diagram above shows the different states OSPF routers will go through when discovering their OSPF neighbors.
Related- OSPF Packet Types
- Down – The initial state of a neighbor conversation when no “Hellos” packets have been received from the neighbour, however, Hellos can still be sent to neighbour in this state (Hellos are sent every PollInterval).If a router doesn’t receive a hello packet from a neighbor within the RouterDeadInterval time, then neighbour state changes from full to down.
- Attempt – This state applies only to neighbors on NBMA networks, where neighbors are manually configured. A DR-eligible router transitions a neighbor to the Attempt state when the interface to the neighbor first becomes Active or when the router is the DR or BDR.A router sends packets to a neighbor in Attempt state at the HelloInterval instead of the PollInterval.
- Init – This state indicates that a Hello packet has been seen from the neighbor in the last RouterDeadInterval, but two-way communication has not yet been established. A router includes the Router IDs of all neighbors in this state, in the Neighbor field of the Hello packets. If OSPF Hello parameters, such as timer values, do not match, OSPF routers will never progress beyond this state.
- 2-Way – This state indicates that the router has seen its own Router ID in the Neighbor field of the neighbor’s Hello packets, which means that a bidirectional conversation has been established.On multi-access networks, neighbors must be in this state or higher to be eligible to be elected as the DR or BDR.
Two routers will form neighbor adjacency and stay in this state if they are not the DR or BDR on the network segment, 2WAY/DROTHER
- ExStart – This state specifies that DR and BDR have been elected and master-slave relation is determined. An initial sequence number for adjacency formation is also selected.The router with the highest router ID becomes the master and begins to exchange Link State data. Only the Master router is able to increment the sequence number.
- Exchange – In this state, OSPF routers exchange DataBaseDescriptor (DBD) packets. These contain Link State Advertisement (LSA) headers describing the content of the entire Link State Database (LSD).The contents of the DataBaseDescriptor (DBD) received by the router are compared with its own Link State Database (LSD) to check if changes or additional link-state information is available from its neighbor.
- Loading – In this state, routers exchange full Link State information based on DataBase Descriptor (DBD) provided by neighbors, the OSPF router sends Link State Request (LSR) and receives Link State Update (LSU) containing all Link State Advertisements (LSAs).Link State Updates (LSU) actually act as an envelope that contains all the Link State Advertisements (LSAs) – that have been sent to neighbors with new changes or new networks learned.
- Full – Full state is the normal operating state of OSPF that indicates everything is functioning normally. In this state, routers are fully adjacent with each other and all the router and network Link State Advertisements (LSAs) are exchanged and the routers’ databases are fully synchronized.For Broadcast and NBMA media, routers will achieve the Full State with their DR and BDR router only, while for Point-to-point and Point-to-multipoint networks a router should be in the Full State with every neighboring router.
Related- OSPF Multi-area Adjacency