How OSPF works
OSPF is a link-state interior gateway protocol. Routers discover neighbours with Hello packets, establish adjacencies where required, exchange link-state information, build an LSDB and run Shortest Path First (SPF) to derive routes.
Areas and roles
Area 0 is the backbone area in a conventional multi-area design. An ABR connects OSPF areas. An ASBR injects routes from another routing domain. Area design can reduce the amount of topology information that must be maintained and can support summarisation.
Neighbour states
| State | Meaning |
|---|---|
| Down | No usable Hello relationship is established. |
| Init | Hello received, but bidirectional communication is not confirmed. |
| 2-Way | Bidirectional Hellos are established; on broadcast networks, this can be normal for non-DR/BDR peers. |
| ExStart | Database exchange roles and sequencing are established. |
| Exchange | Database Description packets are exchanged. |
| Loading | Missing LSAs are being requested. |
| Full | Adjacency database synchronisation is complete. |
LSAs
LSAs describe topology and reachability information used to construct the LSDB. The exact LSA types and scope depend on OSPF version and area design. Router-LSAs and Network-LSAs are central to the normal IPv4 OSPFv2 model; summary and external information supports inter-area and redistributed reachability.
DR and BDR
On broadcast multi-access networks, OSPF elects a Designated Router and Backup Designated Router to reduce the number of full adjacencies required. Point-to-point networks do not use DR/BDR election in the same way.
Cost and SPF
OSPF path selection uses interface costs. A common calculation is reference bandwidth divided by interface bandwidth, with the resulting value handled according to the implementation. Modern links often require an explicitly configured reference bandwidth so that 1G, 10G and faster interfaces do not collapse into the same cost unintentionally.
The OSPF Path Analyzer can calculate interface cost and run a simple Dijkstra SPF calculation over a supplied topology.
Troubleshooting
- Confirm interfaces are up and IP addressing is correct.
- Check Hello, dead interval, area, network type, authentication and MTU parameters.
- Identify the neighbour state and determine where the adjacency process stops.
- Compare LSDB/LSA contents between neighbours.
- Check route calculation, summarisation and redistribution.
- Verify the selected next hop and forwarding table.
Standards and references
- RFC 2328 — OSPF Version 2.
- RFC 5340 — OSPF for IPv6.
- Vendor documentation for implementation-specific defaults, extensions and OSPFv3 address-family behaviour.