Chapter 12 of 27
Single-Area OSPFv2 Fundamentals: Theory and Operation
Open the hood on OSPFv2 to see how link-state databases, LSAs, and neighbor adjacencies build a consistent view of the network.
Single-Area OSPFv2: Big Picture and Canonical Definition
Canonical OSPFv2 Definition
Open Shortest Path First version 2 (OSPFv2) is a link-state interior gateway protocol used to exchange IPv4 routing information within a single autonomous system. Lock this exact sentence in; CCNA questions often test this wording.
Interior Gateway Protocol
OSPFv2 is an Interior Gateway Protocol, meaning it runs inside one organization or autonomous system. It is used for internal routing, not for routing between different organizations on the public internet.
Link-State Nature
As a link-state protocol, OSPFv2 has each router build a full logical map of the area. All routers in the same area share an identical link-state database and run the same SPF algorithm to compute best paths.
Module Scope: Single Area
This module focuses on single-area OSPFv2, where all routers are in area 0. Multi-area design is more advanced; understanding single-area behavior is the essential CCNA foundation.
Distance-Vector vs Link-State: Why OSPFv2?
Distance-Vector in a Nutshell
Distance-vector protocols share full routing tables with neighbors. Routers only know destination, distance, and next hop, and they rely on neighbors’ views, which can cause slow convergence and loops.
Link-State in a Nutshell
Link-state protocols advertise the state of their own links using LSAs. All routers in the area receive these LSAs, build the same link-state database, and run SPF to compute best paths.
Why OSPFv2 is Popular
OSPFv2 converges faster, scales better, and avoids loops more effectively than basic distance-vector protocols like RIP. Its flexible cost metric lets you fine-tune path selection.
Key Exam Contrast
Remember: distance-vector = neighbor-based view, periodic full-table updates; link-state (OSPF) = full topology map, LSAs, SPF calculation. CCNA questions often test this conceptual difference.
OSPF Areas and the Link-State Database (LSDB) in Single-Area Designs
OSPF Areas Conceptually
An OSPF area is a logical grouping of routers and networks. Every OSPF domain has a backbone area (Area 0). In single-area designs, all routers are simply placed in Area 0.
Single-Area Behavior
In a single-area OSPF network, all routers are in Area 0 and share one common link-state database. There are no ABRs or inter-area summaries to worry about.
What is the LSDB?
The link-state database (LSDB) is the collection of all LSAs describing the area’s topology. Each router keeps its own LSDB copy, but all routers in the same area must have identical LSDB contents.
From LSDB to Routes
Routers exchange LSAs, build the LSDB, run the SPF algorithm to create a shortest path tree, and then install best paths from that tree into the routing table.
OSPFv2 Neighbor Discovery and Adjacency States (High-Level)
Why Neighbor States Matter
Before exchanging LSAs, OSPF routers must discover each other and agree on parameters. The neighbor state machine tracks progress from initial contact to fully synchronized LSDBs.
Early States: Down, Init, 2-Way
Down: no Hellos seen. Init: you receive a Hello, but it does not list you yet. 2-Way: your router ID appears in the neighbor’s Hello, confirming bidirectional communication.
Database Sync States
ExStart: routers choose master/slave for database description exchange. Exchange: they swap DBD summaries. Loading: they request and receive missing LSAs. Full: LSDBs are fully synchronized.
Hello Packets and Matching Parameters
Hello packets carry area ID, timers, mask, and authentication. If these do not match between neighbors, they will not reach the Full state. Stuck states often point to such mismatches.
Visualizing Single-Area OSPFv2: A Three-Router Campus
Topology Overview
Picture three routers in a line: R1–R2–R3. R1 connects to servers, R3 to wireless devices, and R2 links them. All run OSPFv2 in Area 0, forming a simple single-area design.
Neighbors Forming
R1 and R2 exchange Hellos and progress through Down, Init, 2-Way, ExStart, Exchange, Loading, to Full. R2 and R3 do the same, creating full adjacencies on both links.
LSAs and LSDB Synchronization
Each router floods LSAs about its links and networks. All three routers receive all LSAs, so their LSDBs contain identical information about R1, R2, R3, and attached networks.
SPF and End-to-End Routing
Each router runs SPF on the LSDB. R1 learns to reach wireless networks via R2, and R3 learns to reach server networks via R2. If links change, new LSAs trigger recalculation.
OSPFv2 LSAs: High-Level Types You Must Recognize
What is an LSA?
A Link-State Advertisement (LSA) is a structured message that describes part of the network topology. All LSAs together form the link-state database that SPF uses for path calculation.
Type 1: Router LSA
Every router generates Type 1 LSAs for each area it belongs to. These LSAs describe the router’s interfaces, their states, and OSPF costs. They are flooded only within that area.
Type 2: Network LSA
On multi-access networks, the Designated Router creates Type 2 Network LSAs. They list all routers attached to that segment and are also flooded within the area.
Other Types to Recognize
Type 3 Summary LSAs come from ABRs, and Type 5 AS-external LSAs come from ASBRs. In pure single-area labs you mainly see Type 1 and Type 2, but you must still recognize Types 3 and 5 by name.
Thought Exercise: Predicting OSPF Behavior
Work through this scenario mentally to solidify how neighbor states, LSAs, and the LSDB interact. You do not need to configure anything; just reason it out.
Scenario:
- Topology: R1–R2–R3 in a line, all in Area 0.
- All links are Ethernet, using default OSPFv2 timers.
- Initially, all neighbors are in the Full state and routes are stable.
Now imagine these events in order. After each, pause and answer the question to yourself.
- Event A: The interface between R2 and R3 goes down.
- Question A1: Which routers will detect this first?
- Question A2: Which routers will originate new LSAs?
- Question A3: What happens to routes on R1 that point to networks behind R3?
- Event B: The R2–R3 link comes back up, but R3’s OSPF interface is misconfigured with a different area ID (Area 1 instead of Area 0).
- Question B1: Will R2 and R3 reach the Full state?
- Question B2: Which neighbor state are you likely to see on R2 for R3?
- Question B3: Will R1 learn any networks from R3?
- Event C: You correct the area ID on R3 so it matches Area 0.
- Question C1: Describe the neighbor state sequence you expect between R2 and R3.
- Question C2: Once they are Full, what changes in the LSDBs on R1 and R2?
Self-check suggested answers (do not peek until you have tried):
- Event A: R2 and R3 detect the failure; they generate new Router LSAs. R1 removes routes to R3’s networks after receiving updated LSAs and running SPF.
- Event B: Area mismatch prevents a full adjacency; you typically see neighbors stuck in Init or not forming at all. R1 learns nothing from R3.
- Event C: R2 and R3 move through Down → Init → 2-Way → ExStart → Exchange → Loading → Full. Their LSDBs synchronize; R1 eventually receives LSAs about R3’s networks again and reinstalls routes.
Use this exercise style whenever you study OSPF: imagine a change, then mentally walk through neighbor states → LSAs → LSDB → SPF → routing table.
Quiz 1: Core OSPFv2 Concepts
Test your understanding of OSPFv2 fundamentals, link-state behavior, and areas.
Which statement best describes how OSPFv2 operates in a single-area (Area 0) network?
- Each router periodically sends its full routing table only to directly connected neighbors, which then forward it unchanged.
- Each router floods link-state advertisements describing its own links to all routers in the area, and every router builds an identical link-state database and runs SPF.
- A central OSPF server maintains the routing table for the entire area and pushes routes to routers when links change.
- Routers use only hop count as the metric and choose any path with the fewest hops, without maintaining a database of the topology.
Show Answer
Answer: B) Each router floods link-state advertisements describing its own links to all routers in the area, and every router builds an identical link-state database and runs SPF.
In single-area OSPFv2, each router originates LSAs describing its own links and floods them throughout the area. All routers build an identical link-state database and run the SPF algorithm to compute best paths. Periodic full-table distance-vector updates, centralized servers, and pure hop-count metrics describe other approaches, not OSPFv2.
Quiz 2: Neighbor States and LSAs
Check your ability to interpret neighbor states and LSA roles in single-area OSPFv2.
Two OSPFv2 routers on an Ethernet segment see each other's Hello packets, and each router ID appears in the other's Hello. However, they never reach the Full state and stay in ExStart. Which of the following is the most likely cause?
- The routers are configured in different OSPF areas.
- The routers have mismatched OSPF hello and dead timers.
- There is an MTU or DBD exchange issue preventing database description packets from being agreed upon.
- The Ethernet link does not support multicast, so Hello packets cannot be exchanged.
Show Answer
Answer: C) There is an MTU or DBD exchange issue preventing database description packets from being agreed upon.
If routers reach ExStart but fail to progress to Exchange/Loading/Full, a common cause is an MTU or database description (DBD) exchange issue. Area or timer mismatches usually prevent even reaching 2-Way or ExStart. If Hellos are seen with router IDs listed, multicast is clearly working.
Key OSPFv2 Terms Review
Flip these cards to reinforce core vocabulary and definitions you will see on CCNA questions.
- OSPFv2 (canonical definition)
- Open Shortest Path First version 2 (OSPFv2) is a link-state interior gateway protocol used to exchange IPv4 routing information within a single autonomous system.
- Link-state protocol
- A routing protocol in which each router describes the state of its own links in LSAs, floods these LSAs to all routers in the area, builds a link-state database, and independently runs SPF to compute best paths.
- Distance-vector protocol
- A routing protocol in which routers share routing information (distance and direction) with neighbors, typically by sending periodic routing table updates, without maintaining a full topology map.
- OSPF area
- A logical grouping of routers and networks within an OSPF domain. All routers in an area share the same link-state database for that area. Every OSPF network includes a backbone Area 0.
- Link-State Database (LSDB)
- The collection of all LSAs that describe the topology of an OSPF area. All routers in the same area must maintain identical LSDB contents.
- Router LSA (Type 1)
- An OSPF LSA generated by each router for every area it belongs to. It describes the router’s interfaces, their states, and OSPF costs within that area and is flooded only inside the area.
- Network LSA (Type 2)
- An OSPF LSA generated by the Designated Router on a multi-access network, listing all routers attached to that segment. It is flooded within the area.
- Neighbor state: 2-Way
- An OSPF neighbor state indicating bidirectional communication has been established; each router sees its own router ID in the neighbor’s Hello. On multi-access networks, DR/BDR election occurs at this stage.
- Neighbor state: Full
- The OSPF neighbor state in which two routers have fully synchronized their LSDBs. This is the desired steady state for routers that must exchange LSAs.
- Shortest Path First (SPF) algorithm
- The algorithm (Dijkstra’s algorithm) used by OSPF to compute the shortest path tree from the LSDB, from which best routes are selected and installed into the routing table.
Common CCNA Traps and How to Reason Through OSPF Questions
Trap 1: Protocol Confusion
If you see periodic full-table updates or hop-count-only metrics, that is distance-vector (like RIP), not OSPF. OSPF keywords include LSAs, LSDB, SPF, and areas.
Trap 2: Neighbor State Symptoms
Init suggests one-way Hellos; ExStart/Exchange issues often point to MTU or DBD problems; Down means no Hellos. Map the symptom to the likely cause before choosing an answer.
Trap 3: Area Scope
Remember that Type 1 and Type 2 LSAs stay within an area. In single-area CCNA questions, you can think of everything happening inside Area 0 with one shared LSDB.
Exam Reasoning Pattern
On questions, identify whether the scenario is about neighbors, LSAs, or SPF and the routing table. Then apply the chain: neighbors → LSAs → LSDB → SPF → routes to eliminate wrong options.
Key Terms
- OSPFv2
- Open Shortest Path First version 2 (OSPFv2) is a link-state interior gateway protocol used to exchange IPv4 routing information within a single autonomous system.
- OSPF area
- A logical grouping of routers and networks in an OSPF domain. All routers in an area share the same LSDB for that area; Area 0 is the backbone.
- Neighbor state
- A stage in the OSPF neighbor relationship process (Down, Init, 2-Way, ExStart, Exchange, Loading, Full) that indicates how far two routers have progressed in forming an adjacency.
- Link-state protocol
- A routing protocol in which routers flood LSAs describing their own links, build a link-state database, and run SPF to compute best paths.
- Router LSA (Type 1)
- An OSPF LSA generated by each router for each area it belongs to, describing its interfaces and link costs within that area.
- Network LSA (Type 2)
- An OSPF LSA generated by the Designated Router on a multi-access network, listing all routers attached to the segment.
- Distance-vector protocol
- A routing protocol where routers share routing information (distance and direction) with neighbors, typically via periodic table updates, without a full topology map.
- Shortest Path First (SPF)
- The algorithm (Dijkstra’s algorithm) used by OSPF to compute the shortest path tree from the LSDB and derive best routes.
- Link-State Database (LSDB)
- The collection of all LSAs that describe the topology of an OSPF area; all routers in the area maintain identical LSDB contents.
- LSA (Link-State Advertisement)
- A structured OSPF message that describes some aspect of the network topology, such as router links or multi-access networks.
- Interior Gateway Protocol (IGP)
- A routing protocol used to exchange routing information within a single autonomous system, such as OSPF, EIGRP, or IS-IS.