Sub topic 7
From Down to Full: The Neighbor State Machine
This chapter assumes you know how OSPF Hello packets discover neighbors, what a router ID is, and how DR/BDR election works on a broadcast segment. Here you will follow a neighbor relationship through each state until the two routers share a synchronized database.
Why states exist
Two routers that hear each other's Hellos are only neighbors. They are not yet useful to each other. Before they can route on each other's information, they must agree on who controls the exchange and swap their link-state databases. OSPF tracks this progress with a state machine on each neighbor relationship. The state tells you how far the relationship has got and, when it stalls, where to look.
The states in order
| State | What is happening |
|---|---|
| Down | No Hello has been received from this neighbor. |
| Init | A Hello arrived, but it does not list your router ID yet. |
| 2-Way | Each router sees its own ID in the other's Hello. Two-way communication is confirmed. |
| ExStart | The routers pick a master and a slave and choose starting sequence numbers. |
| Exchange | The routers send Database Description (DBD) packets that summarize their LSDBs. |
| Loading | The routers request missing LSAs with Link-State Requests (LSRs). They receive them in Link-State Updates (LSUs). |
| Full | The databases are synchronized. The routers are fully adjacent. |
Walking through a normal bring-up
- R1 sends a Hello. R2 receives it, so R2 moves to Init for R1. R1's Hello did not yet list R2's ID, so R2 knows nothing is confirmed.
- R2 replies with a Hello that lists R1's router ID. R1 sees its own ID in that Hello and moves to 2-Way. R1's next Hello lists R2, and R2 reaches 2-Way too.
- On a point-to-point link, the routers go straight on to adjacency. On a broadcast segment, only the DR and BDR form adjacencies with every other router.
- In ExStart, the router with the higher router ID becomes master. The master controls the sequence numbers during the exchange.
- In Exchange, each router sends DBD packets listing the LSA headers it holds. These are summaries, not full LSAs.
- In Loading, each router compares the headers with its own database. It sends LSRs for LSAs it lacks or has only older copies of. The neighbor answers with LSUs, and the receiver acknowledges them with LSAcks.
- When no requests remain, the state becomes Full.
2-Way is not always a problem
On a broadcast segment, two routers that are both DROTHERs (neither is DR or BDR) stay in 2-Way with each other. This is correct behavior. It limits the number of adjacencies and the flooding traffic. Only a relationship that should reach Full but stays in 2-Way points to a fault, such as a failed DR election or a wrong network type.
Where adjacencies stall
| Stuck state | Common causes |
|---|---|
| Init | Hellos arrive but replies do not return. Look for an ACL, a one-way link, or a multicast problem. |
| 2-Way (unexpectedly) | The segment is broadcast and neither router is DR or BDR. Check priorities and election results. |
| ExStart or Exchange | MTU mismatch between the two interfaces. The large DBD packets are dropped. Duplicate router IDs can also cause this. |
| Loading | Corrupt or lost LSRs and LSUs, or an authentication problem on larger packets. |
You can watch the states with show ip ospf neighbor. The State column shows the current state, and on broadcast links it also shows the role, such as FULL/DR or 2WAY/DROTHER.
Exercise
R1 and R2 share an Ethernet segment with R3, which is the DR, and R4, which is the BDR. R1 and R2 are both DROTHERs. R1 shows R2 in 2-Way, and R1 shows R3 in Full. Is anything wrong? What would you check if R1 showed R3 stuck in ExStart?
Show answer
Nothing is wrong. Two DROTHERs stay in 2-Way with each other, and each forms a Full adjacency only with the DR and BDR. For R3 stuck in ExStart, check for an MTU mismatch on the two interfaces first, then check for a duplicate router ID.