Post

OSPF LSA Types

OSPF LSA Types

🌐 OSPF LSA Types – The Complete Guide (OSPFv2 & OSPFv3)

For InterviewersLearnersNetwork EngineersTroubleshooters

πŸ” What are LSAs in OSPF?

LSA (Link-State Advertisement) is the core building block of OSPF (Open Shortest Path First). Each router generates LSAs to describe its local view of the network, which is then stored in the Link-State Database (LSDB). Routers use these LSAs to build a full topology map and compute shortest paths using Dijkstra’s SPF algorithm.

πŸ“˜ OSPFv2 LSA Types (IPv4)

OSPFv2 uses 6 primary LSA types to describe the network. Here’s a detailed technical breakdown.

LSA TypeNameRole/AnalogyGenerated ByContainsFlooding Scope
Type 1Router LSA🧭 Local ScoutEvery OSPF routerInterfaces, cost, link typesWithin originating area
Type 2Network LSA🏒 DR’s MandateDesignated Router (DR)List of routers on a multi-access networkWithin originating area
Type 3Summary LSA🌐 Area TranslatorArea Border Router (ABR)Routes to networks in other areasBetween areas (interarea)
Type 4ASBR SummaryπŸ“ ASBR LocatorABRRoute to the ASBR (not external routes)Throughout OSPF domain (except stub areas)
Type 5AS ExternalπŸ“‘ Outside MessengerASBRExternal prefixes (from redistribution)Entire OSPF domain (except stub areas)
Type 7NSSA ExternalπŸ›‘οΈ Stub ExceptionASBR in NSSAExternal prefixes (NSSA redistribution)Only in NSSA; converted to Type 5 by ABR

🧠 Technical Notes:

  • Type 1 & 2: Form the intra-area SPF tree.
  • Type 3 & 4: Used for interarea routing.
  • Type 5 & 7: Used for external routes (redistributed).

βš™οΈ Route Calculation & LSA Behavior

βœ… Intra-area vs. Interarea Routes

  • Intra-area (Type 1 & 2) always preferred over interarea (Type 3).
  • SPF is computed per area for intra-area routes.

🌐 External Routes (Type 5 & 7)

  • Two types:
    • E1/N1: Includes cost to ASBR + external metric.
    • E2/N2 (default): Only includes external (seed) metric; doesn’t increase with distance.

🧱 Stub Area Rules

Area TypeBlocksAllowsInjected Default Route
StubType 5, 4Type 3Yes (via Type 3)
Totally StubbyType 5, 4, 3NoneYes (Type 3)
NSSAType 5Type 7Optional (ABR converts Type 7 to Type 5)
Totally NSSAType 5, 3Type 7Yes (Type 3)

🧬 OSPFv3 LSA Types (IPv6 Support)

OSPFv3 is modular and supports both IPv4 and IPv6, with prefixes separated from topology data.

LSA Type (Hex)NameEquivalent (OSPFv2)PurposeFlooding Scope
0x2001Device-LSA (Router LSA)Type 1Interface details (no IP info)Area
0x2003Inter-Area Prefix LSAType 3IPv6 prefixes from other areasArea
0x0008Link-LSAN/ALink-local and IPv6 info for local interfaceLink-local
0x2009Intra-Area Prefix LSAN/AIPv6 prefixes associated with a router/networkArea

πŸ’‘ Design Insight:

  • OSPFv3 separates IP prefixes from topology, optimizing SPF recalculation.
  • SPF is based on Router (0x2001) & Network LSA equivalents only.

πŸ”Ž Interview Questions & Revision Highlights

  1. What LSA types form the SPF tree?
    • Type 1 and 2 (OSPFv2), 0x2001 (OSPFv3)
  2. Which LSA types are used by ABRs?
    • Type 3 and Type 4
  3. What’s the difference between E1 and E2?
    • E1 adds internal cost to ASBR; E2 only uses external metric.
  4. Can Type 5 LSAs exist in stub areas?
    • No. Stub areas block Type 5 (and Type 4).
  5. How is Type 7 converted in NSSA?
    • ABR translates Type 7 into Type 5 before flooding outside the NSSA.
  6. Why does OSPFv3 move prefix info out of Router LSAs?
    • To decouple topology from IP addresses and optimize SPF calculations.

🧭 Quick Comparison Table: OSPFv2 vs OSPFv3

FeatureOSPFv2OSPFv3
IP SupportIPv4 onlyIPv4 & IPv6
Prefix in LSAInside Router LSASeparate LSAs
AuthenticationIn protocolIPsec (external)
LSA TypesType 1–5, 70x2001, 0x2003, 0x0008, 0x2009, etc.

βœ… Summary: Why LSA Types Matter

Understanding OSPF LSA types is critical for: - Designing scalable multi-area networks. - Diagnosing routing loops or blackholes. - Mastering OSPF behavior for certification (CCNA/CCNP/CCIE). - Performing high-level interviews or deep troubleshooting.

πŸ™Œ Connect With Me

GitHub LinkedIn YouTube Gmail

This post is licensed under CC BY 4.0 by the author.