Link-state routing. Dijkstra's algorithm. The enterprise standard.
Your company has 3 offices connected by routers. Static routes worked for 2 offices, but the third just came
online and nothing is reachable. You could add more static routes — or you could let OSPF discover
paths dynamically and fix itself when the topology changes.
Static routes require manual updates. That breaks at scale.
Static Routes — The Problem
Every path must be configured by hand on every router. When the third office comes online,
you add routes on every device that needs to reach it. When a link fails, traffic stops
until you manually reroute. 3 offices is manageable. 30 is not.
Dynamic Routing — The Fix
Routers discover neighbors, exchange topology information, and calculate best paths
automatically. When a link fails, they recalculate and reroute without human
intervention. The network heals itself.
Factor
Static
Dynamic (OSPF)
Configuration
Manual per router
Automatic discovery
Failure response
Traffic drops until fixed by hand
Reconverges in seconds
Scale
Breaks beyond small networks
Designed for enterprise
CPU overhead
None
SPF calculations on change
Office 3 just connected. With static routes, you touch every router by hand. With OSPF,
the routers announce the new network and update each other within seconds.
Slide 3 of 10
OSPF Overview
Link-state protocol. Every router builds a complete map of the network.
Link-State
Each router floods information about its own links to every other router.
Every router ends up with an identical map — the Link-State Database (LSDB).
No one guesses. Everyone knows the full topology.
Dijkstra SPF
With the LSDB, each router runs Dijkstra's Shortest Path First algorithm —
placing itself at the root and calculating the lowest-cost path to every
destination. That result populates the routing table.
Distance-vector protocols share routing tables with neighbors — routers only know what their
neighbors tell them. Link-state protocols share topology data — every router builds the map
itself and calculates its own paths. Link-state converges faster and scales further.
When Office 3 connects, its router floods a Link-State Advertisement to the entire OSPF domain.
Every router receives it, updates its LSDB, and runs SPF. All three offices can reach each other
within seconds — no static route changes required.
Slide 4 of 10
OSPF Areas & Router Types
Areas limit LSA flooding. Area 0 is the mandatory backbone.
Area Types
Area 0 — Backbone
All other areas must connect to Area 0 directly or via a virtual link. All inter-area traffic passes through it.
Non-Backbone Areas
Area 1, 2, etc. Reduce SPF scope and LSA flooding. Each area runs SPF independently — changes in Area 1 don't trigger SPF recalculation in Area 2.
Router Types
ABR — Area Border Router
Sits on the boundary between two areas. Maintains one LSDB per area and passes summarized routes between them.
ASBR — AS Boundary Router
Connects OSPF to another routing domain (BGP, EIGRP, static). Redistributes external routes into OSPF as Type 5 LSAs.
DR / BDR — Designated Router
Elected on multi-access segments (Ethernet). Reduces adjacency count from O(n2) to O(n). BDR takes over if DR fails.
DR election: Highest OSPF priority wins (default 1, range 0-255). Priority 0 = never DR.
Tiebreaker: highest Router ID. Election is non-preemptive — an existing DR keeps its role until it fails.
Slide 5 of 10
Neighbor Adjacency — Hello Packets
OSPF neighbors must reach Full state before exchanging routes.
Down
No Hellos received
→
Init
Hello received, not bidirectional
→
2-Way
Bidirectional — DR/BDR election here
→
ExStart
Master / Slave negotiation
→
Exchange
DBD packets — LSDB summaries
→
Loading
LSR / LSU — filling gaps
→
Full
LSDBs synchronized
Hello Packet — What Must Match
Hello Interval (default 10s broadcast / 30s NBMA), Dead Interval (4x Hello),
Area ID, Authentication, Subnet mask (on broadcast networks), Stub area flag.
Mismatch on any of these = no adjacency.
Common Adjacency Failures
MTU mismatch stalls at ExStart/Exchange state. Mismatched timers keep the
neighbor at Init. ACLs blocking protocol 89 or 224.0.0.5 prevent Hellos entirely.
Passive interface on both ends = silent failure.
Office 3's router sends Hello packets on all OSPF interfaces. The headquarters router replies.
They progress through the states and hit Full. Now their LSDBs are identical and SPF runs.
Slide 6 of 10
OSPF Cost — Reference Bandwidth / Interface BW
Lower cost = preferred path. OSPF sums cost across every outbound interface along a path.
On any network with GigE or faster links, adjust the reference bandwidth so costs are
distinguishable. Example: set to 10,000 Mbps (10 Gbps) so GigE = 10, 10GigE = 1.
Command: auto-cost reference-bandwidth 10000
(in Mbps). Must be consistent across all OSPF routers.
Path cost = sum of outbound interface costs along the path.
If two paths tie, OSPF load-balances across both (up to 4 equal-cost paths by default).
Override manually:ip ospf cost [value]
on an interface. Useful when bandwidth doesn't reflect actual path preference.
Slide 7 of 10
LSA Types — What Gets Flooded
Link-State Advertisements carry the topology. Each type has a specific scope.
Type 1 — Router LSA
Generated by every router. Lists all of that router's links and their costs. Flooded within its own area only.
Type 2 — Network LSA
Generated by the DR on multi-access (Ethernet) segments. Lists all routers attached to that network. Stays within the area.
Type 3 — Summary LSA
Generated by ABRs. Carries inter-area route summaries into other areas. This is how Office 1 learns about Office 3's subnets.
Type 4 — ASBR Summary
Generated by ABRs. Describes how to reach an ASBR (the router that connects OSPF to an external routing domain).
Type 5 — External LSA
Generated by ASBRs. Carries routes redistributed into OSPF from outside (BGP, static, EIGRP). Flooded across the entire OSPF domain.
Type 7 — NSSA External
Like Type 5, but used inside a Not-So-Stubby Area (NSSA) that blocks Type 5 LSAs. ABR converts Type 7 to Type 5 at the area boundary.
Exam focus: Type 1 and 2 stay within the area. Type 3 crosses area boundaries via ABRs.
Type 5 floods the whole domain (except stub areas). Know which types stub areas block.
Slide 8 of 10
OSPF Configuration — Cisco IOS
Three offices, three routers. Enable OSPF and advertise networks into Area 0.
Basic Setup (all three routers)
! Enable OSPF process 1router ospf 1! Set stable Router ID (use loopback IP)router-id1.1.1.1! Advertise local networks — wildcard masknetwork10.1.0.0 0.0.0.255 area 0
network10.0.12.0 0.0.0.3 area 0
! Adjust reference BW for modern linksauto-cost reference-bandwidth10000! Silence OSPF on user-facing portspassive-interfaceGigabitEthernet0/1
Verification
! Check neighbor state — must be FULLshow ip ospf neighbor! Verify routes learned via OSPF (O)show ip route ospf! Inspect LSDB contentsshow ip ospf database! Interface cost and hello/dead timersshow ip ospf interfaceGi0/0
Router ID stability matters: OSPF uses the Router ID to identify LSAs. If the Router ID
changes (because a high-IP interface went down), OSPF reconverges unnecessarily.
Always pin it with router-id or a loopback interface.
Slide 9 of 10
Convergence & OSPF vs RIP
Convergence is how fast all routers agree on the topology after a change.
OSPF Convergence
When a link fails, the adjacent router floods an updated LSA immediately.
Every router receives it, updates its LSDB, and re-runs SPF.
Convergence typically completes in under 10 seconds on a well-tuned network.
With BFD (Bidirectional Forwarding Detection) added, failure detection drops to milliseconds.
RIP Convergence
RIP sends full routing table updates every 30 seconds.
A failed route isn't declared dead until the holddown timer expires (180 seconds default).
Total convergence can take 3-5 minutes. Unacceptable for production networks.
Also limited to 15 hops — OSPF has no hop limit.
Feature
OSPF
RIP v2
Type
Link-state
Distance-vector
Algorithm
Dijkstra SPF
Bellman-Ford
Metric
Cost (bandwidth)
Hop count (max 15)
Convergence
Seconds
Minutes
Admin distance
110
120
Update method
Event-triggered LSA flood
Periodic full table (30s)
Scalability
Enterprise / WAN
Small networks only
Slide 10 of 10 | N10-009 Obj 1.1
OSPF in Three Offices
Office 3 came online. Static routes on every router would have required manual changes across the
entire network — and would have broken again on the next topology change. OSPF solved it automatically:
routers sent Hello packets, formed Full adjacencies, flooded
LSAs, built identical LSDBs, and ran Dijkstra SPF
to populate routing tables. All three offices can now reach each other — and if any link fails,
the network reconverges in seconds without a single manual command.
7 Facts to Carry Out of This Presentation
1OSPF is a link-state protocol. Protocol 89. Admin distance 110. Standard: RFC 2328.