OSPF N10-009

Slide 1 of 10  |  N10-009 Obj 1.1  |  Dynamic Routing
OSPF:
Open Shortest Path First
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.
10 Slides N10-009 Obj 1.1 Layer 3 — Network Concepts + Config
Slide 2 of 10
Why Dynamic Routing?
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)
ConfigurationManual per routerAutomatic discovery
Failure responseTraffic drops until fixed by handReconverges in seconds
ScaleBreaks beyond small networksDesigned for enterprise
CPU overheadNoneSPF 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.
Key Numbers
Protocol: IP 89 (not TCP/UDP)
Admin Distance: 110
Multicast: 224.0.0.5 (all OSPF)
Multicast: 224.0.0.6 (DR/BDR only)
Standard: RFC 2328 (OSPFv2)
Contrast with Distance-Vector (RIP, EIGRP)
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.
cost 5 cost 10 cost 5 cost 10 cost 3 R1 R2 R3 R4 SPF root Dijkstra running...
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 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.
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.
Router A 10.0.0.1 Down Router B 10.0.0.2 Down Hello Hello Waiting for Hello...
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.
Cost = Reference Bandwidth / Interface Bandwidth    Default reference: 100 Mbps
Interface Bandwidth Default Cost Problem?
Serial (T1)1.544 Mbps64No — distinguishable
Ethernet10 Mbps10No
Fast Ethernet100 Mbps1Yes — same as GigE
Gigabit Ethernet1 Gbps1Yes — same as 10GigE
10 GigE10 Gbps1Yes — same as FE
The Modern Fix
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.
R1 R2 R3 R4 R5 R6 R7 R8 Link change detected...
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.
! Enable OSPF process 1 router ospf 1 ! Set stable Router ID (use loopback IP) router-id 1.1.1.1 ! Advertise local networks — wildcard mask network 10.1.0.0 0.0.0.255 area 0 network 10.0.12.0 0.0.0.3 area 0 ! Adjust reference BW for modern links auto-cost reference-bandwidth 10000 ! Silence OSPF on user-facing ports passive-interface GigabitEthernet0/1
! Check neighbor state — must be FULL show ip ospf neighbor ! Verify routes learned via OSPF (O) show ip route ospf ! Inspect LSDB contents show ip ospf database ! Interface cost and hello/dead timers show ip ospf interface Gi0/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
TypeLink-stateDistance-vector
AlgorithmDijkstra SPFBellman-Ford
MetricCost (bandwidth)Hop count (max 15)
ConvergenceSecondsMinutes
Admin distance110120
Update methodEvent-triggered LSA floodPeriodic full table (30s)
ScalabilityEnterprise / WANSmall 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.
1 OSPF is a link-state protocol. Protocol 89. Admin distance 110. Standard: RFC 2328.
2 Algorithm: Dijkstra SPF. Metric: cost = reference BW / interface BW. Default reference = 100 Mbps.
3 All areas must connect to Area 0 (backbone). ABRs bridge areas. ASBRs connect to external routing domains.
4 Neighbors progress: Down → Init → 2-Way → ExStart → Exchange → Loading → Full.
5 Hello parameters must match: interval, dead interval, area ID, authentication, subnet mask (broadcast).
6 DR/BDR elected on Ethernet: highest priority wins (default 1). Tiebreaker: highest Router ID. Non-preemptive.
7 Key commands: show ip ospf neighbor, show ip route ospf, show ip ospf database.