The OSPF Adjacency State Machine (ASM) defines the states a router transitions through to form a fully adjacent neighbor relationship in Open Shortest Path First (OSPF). These states, outlined in RFC 2328 (Section 10.1), are Down, Attempt, Init, 2-Way, Exstart, Exchange, Loading, and Full. This post details each state, transition triggers, and troubleshooting tips.
OSPF Neighbor States
OSPF routers progress through the following states to establish adjacency:
Down:
Initial state; no Hello packets received from the neighbor.
Hello packets can be sent, but no response has been received.
Transitions to:
Init: Upon receiving a Hello packet from the neighbor.
Attempt: In NBMA environments for manually configured neighbors.
Reverts to Down from Full if:
No Hello packets are received within the Router Dead Interval
The neighbor is manually removed from the configuration.
Attempt (NBMA only):
Applies to manually configured neighbors in Non-Broadcast Multi-Access (NBMA) networks (e.g., Frame Relay).
Router sends unicast Hello packets at the poll interval to neighbors from which no Hellos have been received within the dead interval.
Transitions to Init upon receiving a Hello packet.
Init (Initialize):
Router has received a Hello packet from the neighbor, but its own Router ID is not listed in the neighbor’s Hello packet.
Indicates one-way communication; the neighbor has not yet acknowledged the local router.
Transitions to 2-Way when the local router’s Router ID is seen in the neighbor’s Hello packet.
2-Way:
Bi-directional communication established; each router sees its own Router ID in the neighbor’s Hello packet.
Decision point for adjacency:
Broadcast/NBMA: Routers form full adjacency only with the Designated Router (DR) and Backup Designated Router (BDR); DROTHERs remain in 2-Way with other DROTHERs (normal state).
Point-to-Point/Point-to-Multipoint: Routers proceed to full adjacency with all neighbors.
Transitions to Exstart for neighbors selected for full adjacency (e.g., DR/BDR on broadcast, all neighbors on point-to-point).
Note: Receiving a Database Descriptor (DBD) packet in Init can also trigger a transition to 2-Way, though this is rare.
Exstart (Exchange Start):
Initiates link-state database (LSDB) exchange between routers forming full adjacency (e.g., with DR/BDR on broadcast networks, P2P, P2MP).
Establishes a master-slave relationship:
Router with the higher Router ID becomes the master, controlling DBD sequence numbers.
Master/slave is per-neighbor and independent of DR/BDR roles
MTU is compared; a mismatch prevents DBD exchange and stalls the process.
Configuration to Ignore MTU:
IOS/IOS XE:
R1(config)# interface GigabitEthernet0/0
R1(config-if)# ip ospf mtu-ignore
IOS XR:
XR(config)# router ospf 1
XR(config-ospf)# area 0
XR(config-ospf-ar)# interface GigabitEthernet0/0/0/0
XR(config-ospf-ar-if)# mtu-ignore enable
XR(config-ospf-ar-if)# commit
Transitions to Exchange once the master-slave relationship and initial DBD sequence number are agreed upon.
Exchange:
Routers exchange Database Descriptor (DBD) packets containing LSA headers to describe their LSDB.
The master increments DBD sequence numbers, acknowledged by the slave.
Routers compare received DBDs with their LSDB to identify missing or newer LSAs.
Transitions to Loading if LSAs need to be requested; otherwise, to Full if databases are synchronized.
Loading:
Routers exchange full LSAs based on DBD comparison.
Link-State Request packets are sent for missing or outdated LSAs.
Link-State Update packets deliver the requested LSAs, which are acknowledged.
Transitions to Full once all requested LSAs are received and the LSDB is synchronized.
Full:
Routers are fully adjacent, with synchronized LSDBs.
Normal state for:
DR/BDR with all routers on broadcast/NBMA networks.
All neighbors on point-to-point/point-to-multipoint networks.
State Transition Summary
Troubleshooting Stuck States
Down: Check interface status, OSPF configuration, or Hello packet reachability (e.g., ACLs, unicast issues in NBMA).
Init: Verify Hello packet contents (Router ID, area ID, authentication, network type compatibility).
2-Way: Normal for DROTHERs in broadcast/NBMA; if unexpected, check DR/BDR election or network type.
Exstart: Check MTU mismatch (show ip ospf interface)
Exchange/Loading: Verify LSA request/update issues (debug ip ospf packet), network congestion, or LSDB inconsistencies.
Not Reaching Full: Check for authentication mismatches, duplicate Router IDs, or LSA flooding issues.
Verification Commands
Use the following Cisco IOS/IOS XE commands to monitor and troubleshoot adjacency states:
Show IP OSPF Neighbor:
R1# show ip ospf neighbor
Displays neighbor state (e.g., Full, 2-Way), role (DR/BDR/DROTHER), and Router ID.
Show IP OSPF Interface:
R1# show ip ospf interface [type number]
Shows interface settings (e.g., Hello/Dead intervals, MTU, network type).
Debug OSPF Adjacency:
R1# debug ip ospf adj
Displays state transitions and adjacency issues (use cautiously in production).
Debug OSPF Packet:
R1# debug ip ospf packet
Shows packet-level details (e.g., Hello, DBD, LSA mismatches).
IOS XR Equivalents:
show ospf neighbor
show ospf interface [type number]
debug ospf adj
debug ospf packet
Key Considerations
2-Way: 2-Way is normal for DROTHER-to-DROTHER relationships in broadcast/NBMA networks.
MTU Mismatch: Critical in Exstart; use mtu-ignore only as a last resort, as it risks packet fragmentation.
Master-Slave: Determined by Router ID, not DR/BDR role, ensuring orderly DBD exchange.