OSPF Neighbor States – Complete Guide with Examples

✅Overview of OSPF Neighbor FSM (Finite State Machine)

The OSPF Neighbor Finite State Machine (FSM) defines the step-by-step process that two OSPF routers go through to form an adjacency.

  • Build neighbor relationships
  • Synchronize routing information
  • Prevent routing loops

✅ Purpose of OSPF Neighbor States

  • Ensure reliable and ordered exchange of link-state information.
  • Control the formation of adjacencies only where necessary (e.g., with DR/BDR).
  • Provide a structured mechanism to detect and recover from neighbor issues.

✅ OSPF Adjacency Process Flow

  1. Routers send Hello packets to discover neighbors.
  2. Routers go through seven neighbor states.
  3. Full adjacency is formed only with DR/BDR (on multi-access networks) or all neighbors (on point-to-point links).

✅ OSPF Neighbor States (in Order)

Order State
1 Down
2 Init
3 2-Way
4 ExStart
5 Exchange
6 Loading
7 Full

✅ Meaning and Role of Each State

  • Down: No Hello packets received. Initial state.
  • Init: Hello received, but our RID not listed yet.
  • 2-Way: Bi-directional Hello exchange; DR/BDR elected here.
  • ExStart: Master/slave negotiation for DB exchange.
  • Exchange: DBD packets sent/received.
  • Loading: Missing LSAs requested and sent.
  • Full: LSDBs fully synchronized.

✅ OSPF Packet Types and Their Role in States

Packet Type Purpose Used In State
Hello Discover and maintain neighbors Down, Init, 2-Way
DBD Describe contents of LSDB ExStart, Exchange
LSR Request specific LSAs Loading
LSU Send requested LSAs Loading
LSAck Acknowledge LSUs Loading

✅ Neighbor State Transitions

From State To State Trigger
Down Init Received Hello
Init 2-Way Neighbor sees our Router ID
2-Way ExStart DR/BDR election or P2P
ExStart Exchange DBD exchange
Exchange Loading Missing LSAs detected
Loading Full All LSAs received

✅ Timers (Hello/Dead)

Default Hello Interval: 10s, Dead Interval: 40s

Mismatch prevents adjacency.

✅ DR/BDR Influence

  • DROTHERs form FULL state only with DR/BDR
  • DROTHER ↔ DROTHER = 2-Way

✅ Troubleshooting Stuck States

State Issue Cause
Init Unidirectional Hello (timers or L2)
ExStart MTU mismatch, duplicate RIDs, DR/BDR mismatch
Loading LSA corruption, authentication mismatch

✅ Useful Commands

show ip ospf neighbor
show ip ospf interface
debug ip ospf adj
debug ip ospf hello
show interface <int> | include MTU
    

✅ Summary Table of OSPF Neighbor States

State Description Common Packet Type
Down No Hello received
Init Hello received, we not seen yet Hello
2-Way Bi-directional Hello Hello
ExStart Master/slave negotiation DBD
Exchange Exchange of LSA headers DBD
Loading Requesting LSAs LSR, LSU, LSAck
Full Synchronized LSDB

OSPF Neighbor States Quiz

1. What is the first OSPF neighbor state when no Hello packets have been received?

Correct answer is A. Down state means no Hello packets received yet.

2. In which OSPF neighbor state does bidirectional communication occur?

Correct answer is D. 2-Way state indicates bidirectional Hello packet exchange.

3. During which state do OSPF routers negotiate master/slave roles?

Correct answer is C. ExStart is when routers decide who is master or slave.

4. What packet type is used during the Exchange state to describe the LSDB contents?

Correct answer is B. DBD packets list LSDB contents during Exchange state.

5. Which OSPF neighbor state requests missing LSAs using LSR packets?

Correct answer is A. Loading state uses LSR packets to request missing LSAs.

6. In broadcast networks, why do DROTHER routers remain in the 2-Way state with each other?

Correct answer is D. DROTHER routers stay in 2-Way state with each other to minimize overhead.

7. What causes OSPF neighbors to get stuck in the ExStart state?

Correct answer is B. MTU mismatch and duplicate RIDs can cause ExStart to be stuck.

8. Which command shows detailed OSPF neighbor information including state and DR/BDR?

Correct answer is A. This command lists neighbors with their OSPF states and roles.

9. What is the default Hello interval on a broadcast network?

Correct answer is C. The default Hello interval on broadcast networks is 10 seconds.

10. What OSPF neighbor state indicates that routers are fully adjacent and databases synchronized?

Correct answer is B. Full state means adjacency is complete and LSDBs are synchronized.

← Back to Home