CCNA online course

Link-State Advertisements (LSAs) in OSPF

Learn how OSPF LSAs describe topology, flood through areas, build the LSDB, and produce intra-area, inter-area, and external routes.

A Link-State Advertisement (LSA) is an OSPF control-plane data structure that describes topology, reachability, or external-route information. Routers flood LSAs to other OSPF routers according to the LSA's flooding scope. Each router collects the LSAs it is allowed to receive, stores them in a Link-State Database (LSDB), and runs Shortest Path First (SPF) to calculate routes.

LSAs are not routing-table entries. They are the information OSPF uses to calculate routing-table entries.

LSAs, LSU Packets, the LSDB, and the Routing Table

TermMeaning
LSAAn individual topology or reachability record, such as a Type 1 Router LSA or Type 5 AS External LSA.
LSA headerThe identifying and control portion of an LSA. It includes the LSA type, Link State ID, advertising router, age, sequence number, and checksum.
Link-State Update (LSU)An OSPF packet that carries one or more complete LSAs. An LSU is a transport container for LSAs, not an LSA type.
Link-State Database (LSDB)The collection of LSAs maintained by a router for an OSPF area. It represents the topology information available to that router.
IP routing tableThe selected best routes used to forward packets. SPF and OSPF route-selection rules determine which LSDB information becomes a route.

For example, a Type 1 LSA can describe a router's interfaces and costs, while a Type 3 LSA can describe a network in another area. These records are stored in the LSDB. SPF then uses the relevant records to calculate the lowest-cost paths. A prefix can appear in the LSDB but still be absent from the routing table because the path is not selected, is unreachable, is filtered by area rules, or loses to another route.

How OSPF Uses LSAs

  1. Neighbor discovery: OSPF routers send Hello packets and identify compatible neighbors on OSPF-enabled interfaces.
  2. Adjacency formation: Depending on the network type, routers form adjacencies and exchange database descriptions. A fully synchronized adjacency reaches the Full state.
  3. LSA origination: A router creates LSAs describing its links, attached networks, inter-area destinations, or redistributed routes.
  4. Reliable flooding: Routers send new or newer LSAs in Link-State Update packets. Neighbors acknowledge them with Link-State Acknowledgment (LSAck) packets or an equivalent acknowledgment mechanism.
  5. LSDB synchronization: Neighbors compare LSA headers and request missing or newer LSAs. Each router builds the appropriate LSDB for its area.
  6. SPF calculation: The router runs a Dijkstra-based SPF calculation over the topology information.
  7. Route installation: OSPF compares calculated paths with other OSPF paths and routing sources, then installs eligible routes in the IP routing table.

OSPF does not periodically advertise its entire routing table to every neighbor. A topology change, such as an interface failure or cost change, normally causes the responsible router to originate an updated LSA. The update is flooded, and affected routers recalculate SPF. OSPF also refreshes LSAs periodically so that valid information remains current.

How OSPF Keeps LSAs Fresh and Reliable

  • Sequence number: Indicates which version of an LSA is newer. A newer sequence number normally replaces an older copy.
  • Checksum: Helps detect corruption in the LSA contents.
  • LS Age: Tracks the age of an LSA. An LSA eventually reaches its maximum age and is removed unless a current replacement is received.
  • Acknowledgment: LSAcks confirm reliable flooding. Missing acknowledgments can cause retransmission.
  • LS Refresh: An originating router periodically refreshes its LSAs even when the topology has not changed. A refresh is not the same as a topology change.

Flooding Scope and OSPF Hierarchy

Flooding scope is the boundary within which an LSA is propagated. Common scopes are link-local, area-wide, and autonomous-system-wide.

  • Link-local scope: The LSA remains on the local link. This scope is used by some extension and opaque LSA functions.
  • Area scope: The LSA is flooded throughout one area but does not cross the area boundary as the same LSA. Types 1 and 2 are area-scoped; Types 3 and 4 are also associated with an area.
  • Autonomous-system scope: The LSA can normally be flooded throughout the OSPF autonomous system. Type 5 external LSAs use this scope unless an area type blocks them.

An OSPF area is a topology boundary that limits flooding and LSDB size. Area 0, also called the backbone area, connects other areas in a hierarchical design. An Area Border Router (ABR) has interfaces in Area 0 and at least one additional area. It summarizes information between areas. An Autonomous System Boundary Router (ASBR) injects routes from outside OSPF, usually through redistribution or explicit route origination.

These boundaries create three useful route categories:

  • Intra-area: The destination and calculating router are in the same area. These routes commonly appear as O.
  • Inter-area: The destination is in another OSPF area. These routes commonly appear as O IA and are represented between areas with Type 3 LSAs.
  • External: The destination was injected into OSPF from another routing source. These routes commonly appear as O E1, O E2, O N1, or O N2.

Core OSPFv2 LSA Types

LSA type numberLSA nameOriginating routerFlooding scopePurposeTypical CCNA use case
1Router LSAEvery OSPF router, once per areaAreaDescribes the router's links, interfaces, link costs, and connected OSPF topology information.Build the intra-area topology and calculate O routes.
2Network LSADesignated Router (DR)AreaRepresents a transit multiaccess network and the routers attached to it.Describe an Ethernet or NBMA segment with a DR.
3Summary LSAArea Border Router (ABR)AreaAdvertises networks from one area into another. It does not carry the complete remote-area topology.Provide inter-area routes shown as O IA.
4ASBR Summary LSAABRAreaProvides reachability to an ASBR located in another area.Help routers reach the ASBR associated with an external route.
5AS External LSAASBRAutonomous systemAdvertises redistributed or externally injected prefixes.Represent static, connected, or other routing-domain routes in a normal area.
7NSSA External LSAASBR inside an NSSANSSA areaAdvertises external routes inside a Not-So-Stubby Area. An appropriate ABR can translate it to Type 5.Inject an external route into an NSSA while preserving the area's external-route restriction.

Type 1: Router LSA

Every router originates one Type 1 Router LSA for each area in which it participates. It identifies the router using its Router ID and describes OSPF-enabled links, interface states, costs, and connected topology information. Type 1 LSAs are area-scoped, so routers in one area do not receive the complete Type 1 topology database of another area.

Type 2: Network LSA

On an eligible broadcast or NBMA multiaccess network, OSPF elects a DR and a backup designated router. The DR originates the Type 2 Network LSA for that segment. The LSA lists the transit network and the routers attached to it.

A Type 2 LSA does not appear on every OSPF network. Point-to-point links do not require a DR election, so they do not generate a Type 2 Network LSA. A missing Type 2 LSA on an Ethernet segment may indicate a point-to-point network type, no applicable DR election, or an adjacency that has not reached the required state.

Type 3: Summary LSA

An ABR originates Type 3 Summary LSAs to advertise networks between areas. Despite the name, a Type 3 LSA does not contain the other area's complete topology. It provides reachability information, such as a prefix and cost, allowing the receiving router to calculate an inter-area path without learning every remote link.

Type 4: ASBR Summary LSA

When an ASBR is in a different area from the router examining an external route, an ABR advertises reachability to that ASBR with a Type 4 LSA. This lets routers determine how to reach the ASBR that originated a Type 5 external LSA.

A Type 4 LSA is generally not needed for an ASBR and the examining router in the same area, because the ASBR's Type 1 LSA already describes its intra-area reachability.

Type 5: AS External LSA

An ASBR originates Type 5 AS External LSAs for routes redistributed into OSPF or otherwise injected from outside the OSPF domain. In a normal area, these LSAs normally have autonomous-system flooding scope. A Type 5 LSA can describe a static route, connected route, or route learned through another routing protocol.

Type 7: NSSA External LSA

An ASBR inside an NSSA originates Type 7 NSSA External LSAs. NSSA design allows external route injection inside an area that otherwise blocks Type 5 LSAs. An appropriate ABR translates the Type 7 information into a Type 5 LSA when the route must be advertised into normal OSPF areas.

Router Roles and LSA Origination

RoleMajor LSAs originatedReason
Internal routerType 1Describes its links and OSPF topology within each participating area.
DRType 2Represents an eligible shared multiaccess transit network and its attached routers.
ABRType 3 and, when needed, Type 4Advertises inter-area prefixes and reachability to ASBRs in other areas.
ASBRType 5 or Type 7Injects external routes into a normal area or an NSSA.

Area Types and LSA Restrictions

Area types control which external or inter-area information an area accepts. The exact commands and some default-route details vary by vendor, especially for totally stubby and totally NSSA designs.

Area typeType 3 allowedType 5 allowedType 7 allowedDefault-route behaviorKey design purpose
Normal areaYesYesNot normally usedNo special default is required; a default may be advertised normally.Supports ordinary intra-area, inter-area, and external information.
Stub areaYes, including needed summariesNoNoAn ABR commonly injects a default route so routers can reach external destinations.Reduce external LSA flooding and LSDB complexity.
Totally stubby areaNormally only a default summary is permittedNoNoThe ABR commonly supplies a default route for both external and suppressed inter-area destinations.Suppress most Type 3, Type 4, and Type 5 detail.
NSSAYesNo inbound Type 5YesA default route may be configured or injected according to the implementation and design.Allow local external injection using Type 7 while blocking incoming Type 5 LSAs.
Totally NSSANormally only a default summary is permittedNo inbound Type 5Yes for local external injectionThe ABR commonly provides a default route for suppressed inter-area and external detail.Combine NSSA local redistribution with stronger inter-area summarization.

In a stub or totally stubby area, Type 5 external LSAs are blocked. In an NSSA, Type 5 LSAs are blocked from entering the area, but a local ASBR can originate Type 7 LSAs. Totally stubby and totally NSSA terminology is vendor-specific; verify the platform's exact behavior and default-route command.

LSA Scope in Practical Topologies

Example: Single-Area Broadcast LAN

Consider three routers connected through an Ethernet switch in Area 0. Each router originates a Type 1 Router LSA. The elected DR originates one Type 2 Network LSA describing the shared Ethernet segment and the routers attached to it. The BDR and DROTHER routers do not originate a Type 2 LSA for that segment.

After adjacency formation and LSDB synchronization, all participating routers have the relevant Type 1 and Type 2 information. SPF uses those LSAs to calculate intra-area routes, which appear in the routing table with the O code.

Example: Two-Area OSPF Design

Suppose an ABR connects Area 0 and Area 10. Routers in each area maintain Type 1 LSAs for their local topology, and eligible multiaccess networks may have Type 2 LSAs. The ABR originates Type 3 Summary LSAs so routers in Area 0 can reach Area 10 prefixes and vice versa.

The receiving routers learn the remote prefixes without receiving Area 10's complete Type 1 topology. The resulting routes normally appear as O IA.

Example: Redistributing a Static Route

An ASBR can redistribute a selected static route into OSPF. In a normal area, the ASBR originates a Type 5 LSA. The route may appear as O E2 by default or as O E1 when configured with external metric type 1.

ip route 192.0.2.0 255.255.255.0 Null0
router ospf 1
 redistribute static subnets

To use an external metric type 1 in a lab:

router ospf 1
 redistribute static subnets metric-type 1

Example: NSSA External Injection

An ASBR inside an NSSA originates a Type 7 LSA for the external prefix. Within the NSSA, routers commonly display the route as O N1 or O N2. An appropriate ABR can translate the Type 7 LSA into a Type 5 LSA for other normal areas.

Example: Type 4 ASBR Reachability

Place an ASBR in Area 10 and inspect a router in another area. The remote router needs a path to the ASBR before it can use the ASBR's external information. The ABR advertises that ASBR reachability with a Type 4 LSA. If the ASBR is in the same area as the inspecting router, the local Type 1 information normally provides the needed reachability instead.

OSPF Route Codes and Their LSA Sources

Routing table codeRoute categoryPrimary LSA relationshipMetric behavior
OIntra-areaType 1 and Type 2 topology informationSPF uses internal interface costs.
O IAInter-areaType 3 Summary LSAIncludes the advertised inter-area cost and the internal cost to the ABR.
O E1External type 1Type 5 AS External LSAExternal metric plus the internal OSPF cost to reach the ASBR.
O E2External type 2Type 5 AS External LSAExternal metric is primary; internal cost to the ASBR is used as a tie-breaker or secondary consideration.
O N1NSSA external type 1Type 7 NSSA External LSAExternal metric plus internal cost to reach the NSSA ASBR.
O N2NSSA external type 2Type 7 NSSA External LSAExternal metric is primary; internal cost is considered secondarily.

Reading LSDB Output

On Cisco IOS, begin with a summary of the database and then inspect a specific LSA type:

show ip ospf neighbor
show ip ospf database
show ip ospf database router
show ip ospf database network
show ip ospf database summary
show ip ospf database asbr-summary
show ip ospf database external
show ip ospf database nssa-external
show ip route ospf
show ip protocols
FieldWhat it identifiesWhy it matters
Link State IDThe identifier for the advertised object; its meaning depends on the LSA type.Helps locate the specific router, network, prefix, or ASBR record being examined.
Advertising RouterThe Router ID of the router that originated the LSA.Identifies the source and helps detect an unexpected or duplicate Router ID.
AgeHow long the LSA has existed since origination or refresh.Useful for identifying stale information, normal refresh behavior, or a missing replacement.
Sequence NumberThe version of the LSA.A rising value indicates newer versions; repeated changes can indicate a flap.
ChecksumIntegrity value for the LSA.Helps detect corrupted LSA contents.
MetricThe cost associated with the advertised destination or external route.Helps explain SPF selection and E1, E2, N1, or N2 behavior.
Link count or attached routersLinks in a Router LSA or routers listed in a Network LSA, where applicable.Confirms whether expected interfaces, neighbors, and transit segments are represented.

The Link State ID does not have one universal meaning. In a Type 1 entry it identifies the originating router. In a Type 2 entry it identifies the network segment, commonly using the DR's interface address. In Type 3 and Type 5 entries it identifies an advertised network or prefix. Always interpret the field together with the LSA type.

Using the LSDB to Find a Missing Route

  1. Determine the expected route category: O, O IA, external, or NSSA external.
  2. Find the corresponding LSA type in the database.
  3. If the LSA is absent, ask whether it was never originated, blocked by the area type, or not flooded because adjacency synchronization failed.
  4. If the LSA exists, verify its advertising router, metric, sequence number, and age.
  5. Compare SPF's result with the routing table. The path may lose to another OSPF path or to a route from another source.

Area and LSA Troubleshooting

Missing Type 2 Network LSA

  • Check whether the interface uses broadcast or NBMA rather than point-to-point network type.
  • Check the DR and BDR roles.
  • Confirm that the OSPF adjacency is fully established.
  • Inspect the network database with show ip ospf database network.

Missing O IA Route

  • Check whether the ABR has the source prefix in its local LSDB and routing table.
  • Inspect Type 3 Summary LSAs.
  • Check whether the receiving area is totally stubby and therefore receives a default instead of detailed summaries.
  • Verify area membership, interfaces, summarization, and any filtering policy.

Missing External Route

  • Check whether the ASBR actually redistributed or originated the route.
  • Inspect Type 5 LSAs in a normal area or Type 7 LSAs in an NSSA.
  • Check whether a stub area blocks Type 5 LSAs or whether an NSSA requires Type 7 handling.
  • If the ASBR is in another area, inspect Type 4 reachability.
  • Check for a competing route with a better administrative distance or metric.

Different LSDB Contents Between Neighbors

  • Confirm that the neighbor state is Full.
  • Check area ID, authentication, MTU, network type, timers, and interface addressing on both sides.
  • Distinguish an actual synchronization problem from an intentional area boundary or LSA restriction.

Stale or Frequently Changing LSAs

  • Compare age and sequence numbers over time.
  • Look for interface flaps and unstable neighbor relationships.
  • Check for duplicate Router IDs.
  • Distinguish normal periodic refresh from repeated topology-change origination.

Basic Cisco IOS Lab Configuration

A simple OSPF process can be started with a router ID and an OSPF network statement. The wildcard mask identifies the addresses that should participate.

router ospf 1
 router-id 1.1.1.1
 network 10.0.0.0 0.0.0.255 area 0
 passive-interface default
 no passive-interface GigabitEthernet0/0

Area behavior can be demonstrated with these examples. Apply matching area-type settings on the routers that belong to the same area.

router ospf 1
 area 10 stub
 area 10 stub no-summary
 area 20 nssa
 area 20 nssa no-summary

clear ip ospf process can be useful in a controlled lab after changing a Router ID or making a major OSPF change. It resets OSPF adjacencies, so do not use it casually in production.

Additional LSA Awareness

OSPFv2 also defines opaque LSAs. Type 9 has link-local scope, Type 10 has area scope, and Type 11 has autonomous-system scope. These support extensions and specialized features and are not central to basic CCNA OSPF configuration.

OSPFv3 uses different LSA formats and adds or changes several LSA types, especially to support IPv6 addressing and separate link and prefix information. The broad principles remain the same: routers originate link-state information, flood it reliably within an appropriate scope, synchronize databases, calculate SPF, and install selected routes.

Exam-Relevant Summary

  • Type 1 is originated by every router for each area and describes the router's local topology.
  • Type 2 is originated by the DR on an eligible broadcast or NBMA multiaccess segment.
  • Type 3 is originated by an ABR for inter-area network reachability.
  • Type 4 is originated by an ABR to provide reachability to an ASBR in another area.
  • Type 5 is originated by an ASBR for external routes and is normally autonomous-system scoped.
  • Type 7 is originated by an ASBR inside an NSSA and can be translated to Type 5 by an ABR.
  • O means intra-area, O IA means inter-area, and O E1, O E2, O N1, and O N2 identify external route categories.
  • An LSDB entry does not automatically guarantee a routing-table entry.
  • Use the LSA type, Link State ID, advertising Router ID, age, sequence number, checksum, and metric together when troubleshooting.

For related fundamentals, review Configure OSPF, Configure Trunk Ports, and Computer Network Explained.