Sub topic 12
Reading LSA Types 1, 2, 3, 4, and 5
This chapter assumes you know how OSPF neighbors reach the Full state, what an area is, and what ABRs and ASBRs do. It covers the five LSA types you meet most often. It shows what each one carries, who originates it, how far it floods, and how to read it in the database.
Why LSA types exist
The link-state database (LSDB) holds link-state advertisements (LSAs). One LSA format could not describe everything, because the data has different scopes. Links inside an area are known to every router in that area. Routes in other areas, and routes redistributed from outside OSPF, are not.
Each LSA type answers one question:
| Type | Name | Originated by | Flooding scope | Describes |
|---|---|---|---|---|
| 1 | Router LSA | Every router | Its own area | The router's links and their costs |
| 2 | Network LSA | The DR | Its own area | The routers attached to a multi-access segment |
| 3 | Summary LSA | ABR | Into other areas | An inter-area prefix and its cost |
| 4 | ASBR Summary LSA | ABR | Into other areas | How to reach an ASBR |
| 5 | AS External LSA | ASBR | Whole AS, except stub areas | An external prefix |
Types 1 and 2 build the topology inside an area. Types 3, 4 and 5 carry reachability information that is not part of that topology.
Type 1: Router LSA
Every OSPF router creates one Type 1 LSA per area it belongs to. The LSA lists each of the router's links in that area. Each entry has a link type, a link ID, link data and a cost.
- Point-to-point: the link ID is the neighbor's router ID.
- Transit: the link ID is the DR's interface address. This is a broadcast segment with a DR.
- Stub: the link ID is the network address, such as a LAN with no neighbors or a passive interface.
The LSA's Link State ID and Advertising Router are both the originating router's router ID. A Type 1 LSA never leaves its area. An ABR creates a separate Type 1 LSA for each area it touches.
Routers also set flag bits in this LSA. The B bit marks an ABR. The E bit marks an ASBR. This is how other routers learn who plays which role.
Type 2: Network LSA
A transit segment has several routers on one broadcast network, so it needs one shared representation. The DR originates a Type 2 LSA for the segment. It lists the segment's subnet mask and the router ID of every router attached to it, including the DR.
The Link State ID is the DR's interface IP address on the segment. SPF treats the segment as a pseudonode. Each router links to the pseudonode, and the pseudonode links back to each router at cost 0. If the DR changes, the old Type 2 LSA is flushed and a new one appears with a different Link State ID.
Point-to-point links have no DR, so they produce no Type 2 LSA.
Type 3: Summary LSA
An ABR does not forward Type 1 and Type 2 LSAs across an area boundary. It runs SPF in each area, then advertises each intra-area prefix into the other areas as a Type 3 LSA. The LSA carries the prefix, mask and the ABR's cost to reach it.
A router in another area cannot see the topology behind the prefix. It knows only the cost to reach the ABR plus the cost the ABR advertises. This is distance-vector behavior between areas. For that reason, all inter-area traffic must pass through area 0. An ABR does not accept Type 3 LSAs from a non-backbone area as input for building summaries toward other areas.
Type 4: ASBR Summary LSA
A Type 5 LSA names the ASBR that originated it, and routers in other areas do not have the ASBR's Type 1 LSA. Without it they could not compute the path to the ASBR. The ABR fills that gap with a Type 4 LSA. The Link State ID is the ASBR's router ID. The advertising router is the ABR.
A Type 4 LSA is not a route to a network. It is a route to a router. It appears only when the ASBR is in a different area from the router that needs the path. If the ASBR sits in the same area, the router already knows how to reach it from Type 1 data.
Type 5: AS External LSA
An ASBR originates a Type 5 LSA for each prefix it redistributes into OSPF. It carries the prefix, mask, metric type (E1 or E2), external metric, and a forwarding address. Type 5 LSAs flood through the whole AS and are never changed by ABRs. They do not flood into stub areas.
To use a Type 5 route, a router first resolves the path to the ASBR. That uses Type 1 data in the same area, or a Type 4 LSA from another area. If neither exists, the external route is not installed.
Reading the database
On a Cisco IOS router, use show ip ospf database to list LSAs by type:
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 externalThe summary view groups LSAs under headings such as "Router Link States (Area 0)". Each row shows these columns:
- Link ID: the Link State ID. Its meaning depends on the type.
- ADV Router: the router ID that originated the LSA.
- Age: seconds since origination. LSAs refresh every 30 minutes and expire at 60 minutes.
- Seq#: the sequence number. A higher value is newer.
A reliable way to decode a row is to read Link ID and ADV Router together. In a Type 3 row, the Link ID is the prefix and the ADV Router is the ABR. In a Type 5 row, the Link ID is the external prefix and the ADV Router is the ASBR.
Common errors
- A Type 5 route is missing in a remote area. Check that the ASBR's Type 4 LSA is present. If the ABR is not originating it, the area may be a stub, or the ABR has no path to the ASBR.
- Summary routes disappear. Type 3 LSAs depend on the ABR having a working area 0 connection. A disconnected ABR does not originate them.
- An unexpected Type 2 LSA appears. A broadcast network type on a two-router link creates a DR election. Set the network type to point-to-point if you want no Type 2 LSA.
- Duplicate router IDs. Two routers with the same ID overwrite each other's Type 1 LSAs. The LSDB then flaps, and sequence numbers climb rapidly.
Exercise
Router X is in area 2 and learns an external prefix from an ASBR in area 0. Which LSA types must X hold to install the route, and which router originates each one?
Show answer
X needs the Type 5 LSA for the prefix, originated by the ASBR, and a Type 4 LSA for the ASBR, originated by the ABR between area 2 and area 0. Without the Type 4 LSA, X cannot resolve the path to the ASBR, so the external route is not installed.
Exercise
A LAN segment has three routers and a DR. Which LSA lists all three routers, and who originates it?
Show answer
The Type 2 Network LSA lists all three routers. The DR originates it, and its Link State ID is the DR's interface address on the segment.