Open Shortest Path First (OSPF) is an open-standard interior gateway protocol used to route IPv4 networks. OSPFv2 is the version emphasized for IPv4 and CCNA single-area OSPFv2; OSPFv3 primarily serves IPv6. Its name combines open implementation with Shortest Path First, the Dijkstra algorithm used to calculate routes. section 18.0
OSPF routers build routes through three practical steps:
- Form neighbor relationships with other OSPF-enabled routers. section 18.1
- Exchange link-state advertisements (LSAs) and organize them into a link-state database (LSDB), creating a shared map of the topology. section 18.1.1
- Run SPF against the LSDB and install the best routes. section 18.0 section 17.3.1
Figure 18.1 Routers flood LSAs within the OSPF area to ensure all routers have an identical LSDB. The LSAs that make up the LSDB contain information about each router’s connected networks, such as their cost. R1’s LSA indicates that it is connected to 10.0.0.0/30, 10.0.0.4/30, and 10.1.1.0/24, each with a cost of 1.
Use the topology figure to see how routers flood LSAs through an OSPF area so every router can maintain an identical LSDB. section 18.1.1
OSPF divides a network into logical areas. Area 0 is the backbone, and other areas must connect to it. Multi-area designs reduce LSDB size and SPF work while containing instability. OSPF cost is the metric: a route’s cost is the cumulative cost of its outgoing interfaces. By default, interface cost derives from the 100-Mbps reference bandwidth, with values below 1 treated as 1. section 18.5
Troubleshooting a failed adjacency
R1 and R2 must match their area number, subnet and netmask, hello and dead timers, authentication, and relevant network settings. Their router IDs must be unique. For example, changing R2’s area from 1 to 0 restores a Full neighbor relationship; changing its hello interval from 10 to 5 seconds brings the adjacency down until the default is restored. section 18.3.3
On Cisco routers, activate OSPF on an interface with `ip ospf process-id area area-number`. Verify neighbors with `show ip ospf neighbor`, OSPF interfaces with `show ip ospf interface brief`, and learned routes with `show ip route ospf`. A route such as `O 192.168.3.0/24 [110/2]` identifies OSPF and its cost metric. section 18.3.3 section 17.3.1
