OSPF splits routing into two cleanly separated jobs. The link-state database (LSDB) is the shared map: every router floods link-state advertisements (LSAs) describing itself, and every router in an area ends up holding an identical copy of the area's topology. The SPF algorithm (Dijkstra's shortest path first) is the calculation: each router independently runs it against that map, with itself as the root of the tree, and the results become the OSPF routes in the routing table. Understanding which half of that pipeline is misbehaving is the core skill in OSPF troubleshooting, and it is where this article fits in our full OSPF guide.
The separation matters in practice. If a route is missing from the routing table but the LSA is present in the database, the problem is on the SPF side (or a better route from another protocol won). If the LSA never made it into the database, the problem is flooding or adjacency. Two different failure domains, two different sets of show commands.
The LSDB: one map per area
All output below comes from a live Cisco Modeling Labs topology on IOS XE 17.18. In the lab: R1 and R2 share a LAN in area 0 (10.0.12.0/24), R2-R3 is a /30 in area 1, and R3 carries four loopbacks in the 172.16.0.0/22 space. R2 sits in both areas, which makes it an ABR and gives its database two complete sections:
R2# show ip ospf database
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 27 0x80000005 0x006079 2
2.2.2.2 2.2.2.2 18 0x80000005 0x005378 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
10.0.12.2 2.2.2.2 34 0x80000001 0x00BE4F
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
3.3.3.3 2.2.2.2 27 0x80000001 0x0031EC
10.0.23.0 2.2.2.2 74 0x80000001 0x001FED
172.16.0.1 2.2.2.2 27 0x80000001 0x002C40
172.16.1.1 2.2.2.2 27 0x80000001 0x00214A
172.16.2.1 2.2.2.2 27 0x80000001 0x001654
172.16.3.1 2.2.2.2 27 0x80000001 0x000B5E
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 28 0x80000003 0x00D5FA 1
3.3.3.3 3.3.3.3 19 0x80000005 0x00C3A6 6
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
10.0.23.2 2.2.2.2 28 0x80000001 0x009766
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 2.2.2.2 34 0x80000001 0x008D98
2.2.2.2 2.2.2.2 74 0x80000001 0x00FA31
10.0.12.0 2.2.2.2 74 0x80000001 0x00AA6AReading it top to bottom:
- Router Link States are type 1 LSAs, one per router per area. Area 0 has exactly two (R1 and R2). The Link count column tells you how many connections each router describes: R3's type 1 in area 1 shows 6, because it describes the /30 link plus its loopbacks.
- Net Link States are type 2 LSAs, generated by the DR of each multi-access segment. The Link ID 10.0.12.2 is the DR's interface address on the R1-R2 LAN, and the entry exists only because that segment uses the broadcast network type.
- Summary Net Link States are type 3 LSAs, and every one here lists 2.2.2.2 as the advertising router: R2 the ABR is translating area 1's networks into area 0 (the 172.16.x.1 loopbacks, the 10.0.23.0 /30) and area 0's networks into area 1 (10.0.12.0 and the router IDs). This is the mechanism behind inter-area (O IA) routes.
Within one area, every router's copy of these sections must be identical - that is the invariant OSPF is built on, and it is why summarization and filtering can only happen at area boundaries. If the type numbers are new to you, our LSA types breakdown covers all of them, and OSPF areas explained covers why the database is per area in the first place.
When SPF runs
SPF runs per area, and what triggers it depends on which LSA changed. A changed type 1 or type 2 LSA means the topology of the area itself changed, so the router reruns the full Dijkstra calculation for that area. A changed type 3, 4, or 5 LSA does not alter the area's shape - those routes hang off the tree as leaves - so the router runs a partial SPF that recalculates only the affected prefixes. That is why a flapping link inside an area is expensive for every router in that area, while a flapping external route is comparatively cheap.
The practical consequence: an ABR shields area 0 from area 1's internal instability. Routers in area 0 see area 1 only through type 3 LSAs, so a link flap inside area 1 costs them a partial recalculation instead of a full SPF.
Watching SPF: show ip ospf statistics
IOS XE keeps a log of SPF runs, how long each took, and what triggered it:
R2# show ip ospf statistics
OSPF Router with ID (2.2.2.2) (Process ID 1)
Area 0: SPF algorithm executed 6 times
Area 1: SPF algorithm executed 4 times
Summary OSPF SPF statistic
SPF calculation time
Delta T Intra D-Intra Summ D-Summ Ext D-Ext Total Reason
00:01:15 0 0 0 0 0 0 0 R
00:01:15 0 0 0 0 0 0 0 R, N, SN, SA, X
00:00:35 0 0 0 0 0 0 0 R, N
00:00:28 0 1 0 0 0 0 1 R
00:00:18 0 0 0 0 0 0 0 RThe per-area counters at the top confirm SPF is calculated separately for each area R2 belongs to. In the table, Delta T is how long ago the run happened, the middle columns are milliseconds spent in each phase (intra-area, summary, external), and Reason is the interesting part: R means a router LSA changed, N a network LSA, SN a summary network LSA, SA a summary ASBR LSA, and X an external LSA. Every run in this small lab took under a millisecond, which is typical - on modern hardware SPF itself is almost never the bottleneck. What this command is really for is spotting churn: if the counters climb steadily and the Reason column keeps showing R and N, some link in the area is flapping, and the LSA age fields in show ip ospf database will point you at the advertising router responsible.
SPF throttling
OSPF does not run SPF the instant an LSA arrives; it waits briefly so that a burst of changes (say, a router failing and taking four LSAs with it) results in one calculation, not four. IOS XE exposes this as a throttle with exponential backoff:
router ospf 1
timers throttle spf 50 200 5000The three values are milliseconds: wait 50 ms after the first topology change before running SPF, then hold 200 ms before the next run is allowed, and double that hold time on each subsequent run (400, 800, 1600...) up to a ceiling of 5000 ms. Once the network stays quiet for a full hold interval, the timers reset. Tuning down from the conservative defaults speeds up convergence after a single failure, while the growing hold time still protects the CPU during sustained instability. Values in the 50/200/5000 range are a common starting point in enterprise designs; going aggressively lower mostly makes sense where fast failure detection (BFD or tuned hellos) is already in place, since detection usually dominates total convergence time anyway.
Key Takeaways
- The LSDB is the shared per-area map built from flooded LSAs; SPF is each router's private calculation over that map, rooted at itself.
- Route missing but LSA present in
show ip ospf database: look at SPF inputs, filtering, or a competing protocol. LSA missing: look at flooding and adjacencies. - Type 1 and 2 LSA changes trigger a full per-area SPF; type 3 and 5 changes only trigger partial recalculation, which is a big part of why areas exist.
show ip ospf statisticsshows run counts, durations, and Reason codes (R, N, SN, SA, X) - climbing counters mean something is flapping.timers throttle spf 50 200 5000balances fast convergence after one failure against CPU protection during sustained churn.