OSPF

OSPF Link-State Advertisements: What an LSA Is

OSPF link-state advertisements LSA feature image, PingLabz
Table of Contents
In: OSPF, Fundamentals

OSPF is a link-state protocol, and the "link state" it routes on is a database. Link-state advertisements, or LSAs, are the individual records in that database. Before you can make sense of LSA types, areas, or why a route is or is not in the table, you need a clear picture of what a single LSA actually is and how it gets everywhere it needs to be. This post covers exactly that - the LSA as a building block, not the type catalog.

For the full picture, see the OSPF complete guide.

What an LSA is

An LSA is one record describing one piece of the network: a router and its links, a network segment and the routers on it, a route from another area, or an external route redistributed into OSPF. Each router builds LSAs describing the parts of the topology it knows directly, and floods them to its neighbors. The collected set of every LSA in an area is the link-state database (LSDB).

The key property: every router in an area holds an identical copy of that area's LSDB. They all start from the same raw data. Each then runs the SPF (Dijkstra) algorithm against its own copy to compute its own shortest-path tree. Same database, different root, different tree - that is the whole idea of a link-state protocol.

The LSA is not the route

This distinction matters. An LSA is topology data. A route is the result of running SPF over that data. The LSDB can contain a perfectly valid LSA for a destination that still does not appear in your routing table, because SPF found no path to it, or a better non-OSPF route won. When you troubleshoot OSPF, "is the LSA in the database" and "is the route installed" are two separate questions, checked with two separate commands.

The LSA header

Every LSA, regardless of type, carries the same 20-byte header. These fields are what flooding and the database use to decide if two LSAs are the same record and which copy is newer.

LS Age
Seconds since the LSA was originated. Counts up. Caps at MaxAge (3600s).
LS Type
Type 1-7 - router, network, summary, ASBR-summary, external, NSSA-external.
Link State ID
Identifies what the LSA describes (a router ID, a network address, etc.).
Advertising Router
The router ID of whoever originated this LSA.
Sequence Number
Increments each time the LSA is re-originated. Higher wins.
Checksum
Integrity check over the LSA contents.

The combination of LS Type + Link State ID + Advertising Router uniquely identifies an LSA. When a router receives an LSA matching one it already has, it compares sequence numbers: higher sequence is newer and replaces the old copy. Equal sequence means a duplicate, which is ignored.

How LSAs flood

OSPF flooding is reliable, which means acknowledged. When a router originates or receives a new LSA, it sends it to its neighbors in a Link State Update (LSU) packet. Each neighbor that accepts it returns a Link State Acknowledgment (LSAck). An unacknowledged LSA is retransmitted. This is why an LSDB stays consistent: nothing is "fire and forget."

Flooding has scope. Most LSA types flood only within their area - that area boundary is the reason OSPF scales, because a topology change in one area does not force every router in every other area to re-run SPF. Type 5 external LSAs are the exception; they flood through the whole OSPF domain except into stub areas.

LSA aging and refresh

The LS Age field counts upward from 0. Two thresholds matter:

  • Refresh at 1800 seconds. The router that originated an LSA re-floods it every 30 minutes with a fresh age of 0 and an incremented sequence number, so a still-valid LSA never actually expires.
  • MaxAge at 3600 seconds. If an LSA ever reaches 3600s without a refresh, it is considered dead. The router floods it one last time at MaxAge to tell everyone to remove it, and every router purges it from the LSDB and re-runs SPF.

Flooding an LSA to MaxAge is also how OSPF explicitly withdraws a route: to retract an LSA, the originator re-floods it set to MaxAge.

The LSA types, briefly

There are six common LSA types, each describing a different scope of the network - router links, multi-access segments, inter-area routes, the ASBR location, external routes, and the NSSA variant of externals. Each type has its own flooding scope and its own role in SPF. That catalog is a topic of its own; see the dedicated OSPF LSA types article for the full type-by-type breakdown.

Reading the database

R2# show ip ospf database

            OSPF Router with ID (10.255.0.2) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age   Seq#       Checksum Link count
10.255.0.1      10.255.0.1      221   0x80000007 0x00A1B2 3
10.255.0.2      10.255.0.2      198   0x80000009 0x00C3D4 4
10.255.0.3      10.255.0.3      210   0x8000000A 0x00E5F6 2

Each row is one LSA. ADV Router is who originated it, Age is the LS Age counting up toward 3600, and Seq# is the sequence number - higher is newer. To see the full contents of a single LSA rather than the summary list, use show ip ospf database router 10.255.0.1.

Common gotchas

LSA is in the database but the route is not in the routing table
The LSDB is topology data; SPF still has to find a path. Check next-hop reachability and competing routes.
LSDBs differ between two routers in the same area
An adjacency is not Full, so flooding never completed between them. Check neighbor state first.
An old route will not disappear
The withdrawing router must flood the LSA at MaxAge. If it cannot reach part of the area, the purge does not propagate.
LSA age sitting near 3600
The originator stopped refreshing - likely down or partitioned. The LSA is about to be purged.

Key takeaways

An LSA is a single record of topology - one router, one segment, one external route. The full set of LSAs in an area is the link-state database, and every router in the area holds an identical copy, then runs SPF on it independently. An LSA is data, not a route; a route is what SPF produces. Every LSA shares a header whose Type, Link State ID, and Advertising Router identify it, and whose sequence number decides which copy is newer. LSAs flood reliably with acknowledgments, refresh every 30 minutes, and die at a MaxAge of 3600 seconds, which is also the mechanism OSPF uses to withdraw a route.

For the OSPF cluster, see the OSPF pillar.

Written by
More from Ping Labz
Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to Ping Labz.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.