The OSPF (Open Shortest Path First) Neighbor State Machine is a conceptual model that describes the various stages OSPF routers go through to establish and maintain adjacency with their neighbors. OSPF neighbor states are essential for understanding how OSPF routers communicate, synchronize their Link-State Databases (LSDBs), and ensure a consistent view of the network. Here’s a text-based representation of the OSPF Neighbor State Machine:
+-------------+ +--------------+ +------------+ +-------------+
| | | | | | | |
| Down +-----> Attempt +-----> Init +-----> 2-Way |
| | | (NBMA only) | | | | |
+------+------+ +------+-------+ +-----+------+ +------+------+
| | | |
| | | |
| | | 1-Way (DR/BDR |
| | | election) |
| | v |
| +-------+------+ +-----+------+ |
| | | | | |
+----------->+ ExStart +-----> Exchange +<-----------+
| | | |
+-------+------+ +-----+------+
| |
| |
| |
v v
+-------+------+ +-----+------+
| | | |
| Loading +-----> Full |
| | | |
+--------------+ +------------+
Description of States: #
-
Down: This is the initial state of OSPF neighbor formation. In this state, no Hello packets have been received from the neighbor.
-
Attempt: This state is used only in NBMA (Non-Broadcast Multi-Access) networks. The router sends unicast Hello packets to potential neighbors.
-
Init: This state signifies that a Hello packet has been received from a neighbor, but bi-directional communication hasn’t been established yet. The router itself is not yet listed in the neighbor’s Hello packet.
-
2-Way: Bidirectional communication is established when the router sees its own router ID in the neighbor’s Hello packet. In this state, DR (Designated Router) and BDR (Backup Designated Router) elections occur.
-
ExStart: In this state, the routers establish a master-slave relationship and decide on initial sequence numbers for LSDB exchange.
-
Exchange: Routers start exchanging database description (DBD) packets. This is the beginning of the LSDB synchronization process.
-
Loading: In this state, routers send Link State Request packets for the LSAs that are newer or missing in their LSDB. They receive the LSAs in Link State Update packets.
-
Full: This is the final state where the routers are fully adjacent, and the LSDBs are fully synchronized.
Transition through these states is driven by the receipt of OSPF packets, timers, and the checking of various OSPF parameters. Proper progression through these states is essential for establishing a stable OSPF network and for the correct dissemination of routing information.