What this note covers

The LSDB (Link-State Database) is the collection of all LSAs a
router has received — its complete picture of the topology. Different
LSA types describe different pieces of that topology, and each is
generated by a specific role and flooded within a specific scope.
Once the LSDB is synchronized, SPF runs on it.

The LSDB

The database SPF runs on

  • The LSDB must be identical on all routers within an area.
  • It’s built from received LSAs, exchanged during adjacency
    formation (DBD → LSR → LSU → LSAck).
  • Once every router in the area holds the same LSDB, each one runs
    SPF independently on that shared data.
  • A topology change floods the affected LSA and triggers a partial
    SPF re-run
    — the database is updated, never wiped.

Transit vs Stub network

Two ways a link is described in a Router LSA

  • Transit network — a segment with a DR election (multiple
    OSPF routers share it, traffic transits through it). Described using
    the DR’s IP.
  • Stub network — a segment with no OSPF neighbors (e.g. a LAN
    with only hosts, or a loopback). Nothing transits it; it’s just an
    endpoint. Described by its logical network, mask and cost.

Note this “stub network” is a link descriptor — not the same as a
stub area (see 08 - Special Area Types (Stub - TS - NSSA)).

The LSA types

TypeNameGenerated byFlooding scope
1Router LSAEvery OSPF routerWithin its area only
2Network LSAThe DR (multi-access only)Within its area only
3Summary LSAABRInto other areas
4ASBR SummaryABRInto areas outside the ASBR’s
5AS ExternalASBREntire OSPF domain
7NSSA ExternalASBR inside an NSSAWithin the NSSA (→ translated to 5)

Type 1 — Router LSA

Note

  • Generated by every OSPF device; describes all of that router’s
    links. Flooded only within the area where it was created.
  • Describes four kinds of link: Transit (DR network),
    Stub (no neighbors), Point-to-Point (direct link to another
    OSPF device), and Virtual Link.
  • Verify: show ip ospf database router.

Type 2 — Network LSA

Note

  • Generated by the DR on multi-access segments.
  • Lists the routers attached to the segment and the segment’s logical
    network. Flooded only within the area.
  • No DR (point-to-point) → no Type 2 LSA.
  • Verify: show ip ospf database network.

Type 3 — Summary LSA

Note

  • Generated by the ABR to advertise the networks of one area
    into another (carries network, cost and next hop).
  • Receiving this LSA does not trigger a full SPF run — inter-area
    routes are computed more simply (distance-vector-like between areas).
  • Verify: show ip ospf database summary.

Type 4 — ASBR Summary

Note

  • Generated by the ABR to tell routers in other areas how to
    reach the ASBR
    .
  • Inside the ASBR’s own area, its identity is known via the Type 1
    LSA; outside that area, a Type 4 is needed.
  • Verify: show ip ospf database asbr-summary.

Type 5 — AS External LSA

Note

  • Generated by the ASBR for routes redistributed from outside
    the OSPF domain (another protocol, a default route, or directly
    connected external networks).
  • Flooded through the entire OSPF domain, regardless of area
    (except into stub/NSSA areas, which block it).
  • Verify: show ip ospf database external.

Type 7 — NSSA External LSA

Note

  • Used inside an NSSA, where Type 5 is not allowed. An ASBR in the
    NSSA originates Type 7 for its external routes.
  • The ABR translates Type 7 into Type 5 as the routes leave the
    NSSA toward the rest of the domain.

Redistribution uses two LSA types

When external routes enter OSPF, they’re carried as Type 5
normally, or as Type 7 when the ASBR sits inside an NSSA. That’s
the “redistribution via two LSA types” idea in one line.

Types you’ll see listed but rarely use

Obsolete / advanced — know they exist

  • Type 6 (Group Membership / MOSPF) — multicast extension,
    obsolete, not used on modern networks.
  • Type 8 / 9 (Opaque LSAs in OSPFv2) — generic containers for
    extensions like MPLS Traffic Engineering. In OSPFv3 the
    numbers 8 and 9 mean something different (Link LSA and Intra-Area
    Prefix LSA) — see 11 - OSPFv3 (IPv6).
  • Type 10 / 11 (Opaque) — area-scope and AS-scope opaque LSAs,
    also for extensions like MPLS-TE.

These appear in the full LSA table but are not core to CCNA/early
CCNP study — recognize the names, don’t sink time here yet.

The SPF (Dijkstra) algorithm

Added — how the best path is actually computed

Once the LSDB is complete, each router runs Dijkstra’s SPF:

  1. The router places itself as the root of the tree.
  2. It examines the LSDB and adds the lowest-cost link to reach
    each neighbor, then the next lowest, building outward.
  3. It keeps selecting the cheapest not-yet-added path until every
    network is placed on the shortest-path tree.
  4. The results become intra-area routes in the routing table.

Key points:

  • Every router computes the tree from its own perspective — the
    root is always “me,” so each router gets a different tree from the
    same LSDB.
  • Cost is the metric it minimizes (see
    09 - Metric, Path Selection & Route Types).
  • SPF is CPU-intensive, which is the whole reason areas exist: to
    limit how big the LSDB — and therefore the SPF calculation — gets.

LSA scope summary

Which LSAs cross area boundaries

  • Type 1 and 2 never leave their area.
  • Type 3 and 4 are how the ABR carries information between
    areas.
  • Type 5 floods the whole domain (blocked only by stub/NSSA).