Back to Glossary Index
Layer 3 RoutingDomain 3.0

OSPF Open Shortest Path First

The most widely deployed Interior Gateway Protocol (IGP) in enterprise networks. OSPF is a Link-State routing protocol. Rather than routing by "rumor" like legacy distance-vector protocols, OSPF ensures every router has a complete, identical map of the entire network, calculating the absolute fastest path mathematically using Dijkstra's Shortest Path First (SPF) algorithm.

The Link-State Database (LSDB)

OSPF operates through a strict sequence of discovery, synchronization, and calculation to build its routing table:

1. Hello PacketsRouters multicast "Hello" packets out of OSPF-enabled interfaces every 10 seconds to discover neighbors and form adjacencies. Timers and area IDs must match perfectly to form an adjacency.
2. LSA FloodingOnce neighbors are established, routers exchange Link-State Advertisements (LSAs). An LSA contains the state and cost of the router's directly connected links.
3. LSDB SyncRouters collect all flooded LSAs and place them into the Link-State Database (LSDB). Every single router in an OSPF area will have the exact same identical LSDB.
4. SPF AlgorithmThe router runs the SPF math against the completed LSDB, calculating the cumulative "Cost" (based on interface bandwidth) to reach every destination. The absolute best paths are injected into the IPv4 routing table.

CCNA Exam Gotchas

[!]

Administrative Distance (110)

If a router learns about 192.168.1.0/24 from a Static Route, and learns about the same subnet from OSPF, which route makes it into the routing table?

The router uses Administrative Distance (Trustworthiness) to decide. The AD of a Static Route is 1. The AD of OSPF is 110. Lower is better. The Static Route wins. (OSPF's internal "Cost" metric is only used to break ties between multiple OSPF routes, never against other protocols).

[!]

The Router ID Election

Every OSPF router requires a unique Router ID (RID) to participate. The election order is rigid:
1. A manually configured router-id command.
2. If none, the highest active IPv4 address on a Loopback interface.
3. If no loopbacks, the highest active IPv4 address on a physical interface.