OSPF neighbours do not simply appear; they negotiate their way through a state machine that discovers each other, elects roles, and synchronises databases. The state machine is worth knowing cold, because a stuck adjacency announces exactly which stage failed — and therefore exactly what to check.
The states in order
- Down — no hello heard from the neighbour within the dead interval (or ever).
- Attempt — NBMA networks only: unicast hellos are being sent to a manually configured neighbour that has not yet answered.
- Init — a hello was received, but our own router ID is not yet listed in it: the neighbour has not heard us.
- 2-Way — our router ID appears in the neighbour's hello; communication is bidirectional. DR/BDR election happens here, and on multi-access networks two DROther routers correctly stop here forever.
- ExStart — the routers negotiate a master/slave relationship (higher router ID is master) and initial sequence numbers for database description exchange.
- Exchange — Database Description (DBD) packets are exchanged: summaries of each router's LSDB contents, like tables of contents.
- Loading — each router requests the LSAs it is missing via Link-State Request packets and receives them in Link-State Updates.
- Full — databases are synchronised; the adjacency is complete and appears in SPF calculations.
What must match before any of this works
Hellos carry the adjacency contract. For two routers to pass Init, these must agree: area ID, area type flags (stub/NSSA), hello and dead intervals, subnet and mask (on broadcast networks), and authentication. MTU has its own trap: it is checked in the DBD exchange, so an MTU mismatch produces the classic symptom of neighbours cycling between ExStart and Exchange forever — visible, reproducible, and fixed with matching MTUs or ip ospf mtu-ignore.
R1# show ip ospf neighborNeighbor ID Pri State Dead Time Address Interface3.3.3.3 1 FULL/DR 00:00:36 10.1.13.3 Gi0/12.2.2.2 1 FULL/BDR 00:00:31 10.1.12.2 Gi0/04.4.4.4 1 2WAY/DROTHER 00:00:34 10.1.14.4 Gi0/2
Reading stuck states as diagnoses
- Stuck in Down/Attempt — hellos not arriving: interface down, wrong network statement, passive-interface, or an ACL/firewall eating protocol 89.
- Stuck in Init — one-way visibility: the neighbour hears us but we never appear in its hello, or vice versa; usually authentication or a unidirectional filter.
- Stuck in 2-Way — correct for DROther pairs; a problem only on point-to-point links, where it suggests a priority-0-everywhere misconfiguration on a broadcast segment.
- Flapping between ExStart and Exchange — MTU mismatch until proven otherwise; second suspect is duplicate router IDs.
- Stuck in Loading — corrupted or filtered LSAs; rare, and usually a software or transmission problem.
The dead timer defaults to four times the hello: 40 seconds on broadcast and point-to-point networks, 120 on NBMA. Sub-second failure detection belongs to BFD rather than aggressive OSPF timers — BFD offloads the detection to a lightweight hardware-assisted session and simply tells OSPF when to react, which is both faster and cheaper than 250 ms hellos. When an adjacency misbehaves, debug ip ospf adj narrates every transition of this state machine in real time — one of the most instructive debugs in all of IOS.