JV
JVLessons
Engineering Reference

OSPF — The Definitive Guide

From foundations and analogies to hyperscale patterns and advanced troubleshooting

9Sections
5Topics
10Concepts
~2-4 hrsNetworkingOSPFRoutingRFC 2328Link-State
01Foundations
See something that needs updating?

What OSPF Is (and Isn't)

Interior gateway protocol for topology-aware internal routing

OSPF (Open Shortest Path First) is an interior gateway protocol used to move routes inside one organization or autonomous system. Routers describe their links, build a shared view of the network within each area, run the SPF algorithm, and choose best paths based on cost. Defined in RFC 2328 (OSPFv2) and RFC 5340 (OSPFv3), carried directly over IP protocol 89.
Plain English
Think of OSPF like a group of delivery managers sharing the same city map. Each router reports the roads it can directly see. Everyone in the same district agrees on the same map. Once the map matches, each router calculates the fastest route to every destination.
How OSPF Works — High Level
Each routerdescribes its linksRouters buildshared LSDBEach routerruns SPFBest pathinstalled in RIB

OSPF is not a protocol for exchanging routes between unrelated organizations on the public internet — that's BGP's role. And it's not a "set and forget" protocol where everything goes into Area 0. A single-area design can be valid for small environments, but areas exist for real reasons once a network grows.
The Core Distinction
BGP is a policy engine that happens to route. OSPF is a topology engine that happens to route. Both are valuable — they solve different problems.

Core Router Roles

The five roles every OSPF engineer must know

Internal Router
All interfaces in the same area. Maintains one LSDB. The simplest role.
Backbone Router
At least one interface in Area 0. Participates in the backbone LSDB.
ABR (Area Border Router)
Connects Area 0 to one or more non-backbone areas. Maintains separate LSDBs per area. The customs checkpoint between districts.
ASBR (AS Boundary Router)
Redistributes routes from outside OSPF — BGP, static, connected, EIGRP, or another OSPF domain.
DR / BDR
Designated Router and Backup. Elected on broadcast/multi-access segments to reduce adjacency count. A coordination role, not a 'best path' role.
Plain English
On a large group call, if every person tried to fully sync with everyone simultaneously, it'd be chaos. The DR is the meeting coordinator. The BDR is the backup. Everyone still participates, but coordination becomes manageable.

LSDB vs Routing Table

The most common OSPF misconception — they are NOT the same thing

Link-State Database (LSDB)
The shared topology information inside an area. The map. All routers in the same area have identical LSDBs. Contains every LSA describing links, networks, and reachability.
Routing Table (RIB)
The result of SPF calculation and route selection. The chosen directions. Each router's routing table is unique — computed from its own perspective as root of the shortest-path tree.
Plain English
LSDB = all the road knowledge. Routing table = the routes you actually plan to drive. A lot of confusion disappears once people stop treating those as the same thing.
Why This Matters Operationally
distribute-list in only filters routes from the routing table, NOT from the LSDB. OSPF requires identical LSDBs within an area — you cannot prevent LSA propagation with distribute-lists. Use area filter-list prefix at ABRs for Type 3 filtering.

Metrics & Cost

How OSPF chooses paths — and the reference bandwidth trap

Cost is calculated as Reference Bandwidth ÷ Interface Bandwidth. The default reference bandwidth is 100 Mbps, meaning FastEthernet, GigE, and 10GigE all receive a cost of 1 — a serious problem for modern networks.
Plain English
Think of cost like travel difficulty. A lower cost means an easier, more attractive path. If your reference bandwidth doesn't distinguish between a 1G and 100G link, it's like saying a footpath and a highway are equally fast.
Reference Bandwidth Impact — Default vs Tuned
Default: 100 Mbps100 Mbps→ Cost 11 Gbps→ Cost 110 Gbps→ Cost 1100 Gbps→ Cost 1ALL LOOK THE SAMETuned: 100 Gbps100 Mbps→ Cost 1,0001 Gbps→ Cost 10010 Gbps→ Cost 10100 Gbps→ Cost 1DISTINGUISHABLE
Fix This First
Set auto-cost reference-bandwidth 100000 across all routers on 100G networks so 1G, 10G, 40G, and 100G links each get meaningful, distinct cost values. This is one of the most common oversights in production OSPF.

Router ID

Small setting, big importance

Every OSPF router needs a Router ID — it identifies the router in OSPF, affects DR elections when priorities tie, and appears throughout troubleshooting output.
Plain English
This is the router's legal name in the routing system. You want it chosen intentionally, not assigned by accident.
Best Practice
Set router IDs explicitly. Never leave them to automatic selection. This improves consistency, readability, and makes troubleshooting dramatically easier.

Related Bytes

BGP — The Path Vector Protocol
NetworkingBGPRouting
Analog vs. Digital Signaling in Professional AV
NetworkingAVSignaling
OSPF — The Definitive Guide / From foundations and analogies to hyperscale patterns and advanced troubleshooting  |  v0.7
Questions or edits? Contact Jordan V. Levinson
Crafted by jvlevinson · JVLessons
Built with care, patience, and a lot of caffeine ☕
JV
JV
Sections