π OSPF LSA Types β The Complete Guide (OSPFv2 & OSPFv3)
| For Interviewers | Learners | Network Engineers | Troubleshooters |
π 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 Type | Name | Role/Analogy | Generated By | Contains | Flooding Scope |
|---|
| Type 1 | Router LSA | π§ Local Scout | Every OSPF router | Interfaces, cost, link types | Within originating area |
| Type 2 | Network LSA | π’ DRβs Mandate | Designated Router (DR) | List of routers on a multi-access network | Within originating area |
| Type 3 | Summary LSA | π Area Translator | Area Border Router (ABR) | Routes to networks in other areas | Between areas (interarea) |
| Type 4 | ASBR Summary | π ASBR Locator | ABR | Route to the ASBR (not external routes) | Throughout OSPF domain (except stub areas) |
| Type 5 | AS External | π‘ Outside Messenger | ASBR | External prefixes (from redistribution) | Entire OSPF domain (except stub areas) |
| Type 7 | NSSA External | π‘οΈ Stub Exception | ASBR in NSSA | External 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 Type | Blocks | Allows | Injected Default Route |
|---|
| Stub | Type 5, 4 | Type 3 | Yes (via Type 3) |
| Totally Stubby | Type 5, 4, 3 | None | Yes (Type 3) |
| NSSA | Type 5 | Type 7 | Optional (ABR converts Type 7 to Type 5) |
| Totally NSSA | Type 5, 3 | Type 7 | Yes (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) | Name | Equivalent (OSPFv2) | Purpose | Flooding Scope |
|---|
0x2001 | Device-LSA (Router LSA) | Type 1 | Interface details (no IP info) | Area |
0x2003 | Inter-Area Prefix LSA | Type 3 | IPv6 prefixes from other areas | Area |
0x0008 | Link-LSA | N/A | Link-local and IPv6 info for local interface | Link-local |
0x2009 | Intra-Area Prefix LSA | N/A | IPv6 prefixes associated with a router/network | Area |
π‘ 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
- What LSA types form the SPF tree?
- Type 1 and 2 (OSPFv2), 0x2001 (OSPFv3)
- Which LSA types are used by ABRs?
- Whatβs the difference between E1 and E2?
- E1 adds internal cost to ASBR; E2 only uses external metric.
- Can Type 5 LSAs exist in stub areas?
- No. Stub areas block Type 5 (and Type 4).
- How is Type 7 converted in NSSA?
- ABR translates Type 7 into Type 5 before flooding outside the NSSA.
- 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
| Feature | OSPFv2 | OSPFv3 |
|---|
| IP Support | IPv4 only | IPv4 & IPv6 |
| Prefix in LSA | Inside Router LSA | Separate LSAs |
| Authentication | In protocol | IPsec (external) |
| LSA Types | Type 1β5, 7 | 0x2001, 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
