OSPF LSA types and how to read the OSPF database
In short: OSPF describes the network with different LSA types. Routers describe themselves with type 1, DRs describe shared segments with type 2, ABRs pass prefixes between areas with type 3 and point to ASBRs with type 4, and external routes arrive as type 5, or type 7 inside an NSSA. Reading the database by type tells you exactly where a route came from.
Why there are several LSA types
The link-state database (LSDB) is not one big list of routes. It is a set of building blocks, each describing a different part of the network. Some blocks describe routers and links in detail; others summarise whole areas or bring in routes from outside OSPF. The type of an LSA tells you what it describes, who created it and how far it may be flooded.
The types you meet every day
| Type | Created by | Describes | Link-state ID |
|---|---|---|---|
| 1 Router | Every router, once per area it belongs to | Its own OSPF links in that area, their costs and neighbours | Router ID of the originator |
| 2 Network | The DR of a broadcast or non-broadcast segment | The segment and every router attached to it | DR's interface IP address |
| 3 Summary | ABR | A prefix in another area, with the ABR's cost to it | The network address |
| 4 ASBR summary | ABR | How to reach an ASBR that sits in another area | ASBR's router ID |
| 5 AS external | ASBR | A route redistributed from outside OSPF | The network address |
| 7 NSSA external | ASBR inside an NSSA | An external route inside a not-so-stubby area; the ABR converts it to type 5 | The network address |
Types 1 and 2 never leave their area. Inside an area every router has the full picture, so SPF there is true link-state routing. Between areas, ABRs only pass on prefixes and costs in type 3 LSAs. Type 5 LSAs flood everywhere except stub-type areas, which is why stub areas exist. If an ASBR is in a different area from you, you also need the type 4 LSA to work out the cost of getting to it.
The opaque types 9, 10 and 11 carry extra data for other features at link, area and domain scope. Graceful restart uses type 9 and MPLS traffic engineering uses type 10. You rarely need to read them, but it helps to know why they appear.
How an inter-area route is built
Because each ABR re-originates type 3 LSAs with itself as the advertising router, a router in area 2 only knows that a prefix is reachable through its ABR at a certain cost. It does not see the routers and links in area 1. That hides detail, reduces SPF work and is the reason all areas must connect through area 0: it stops type 3 information from looping between areas.
Reading show ip ospf database
The plain command lists every LSA header, grouped by area and type. Headings such as Router Link States, Net Link States, Summary Net Link States, Summary ASB Link States and Type-5 AS External Link States map to types 1, 2, 3, 4 and 5. Each line shows the link ID, the advertising router, the age, the sequence number and the checksum. To see the content, add the type and optionally the link-state ID.
show ip ospf database
show ip ospf database router 10.0.0.1
show ip ospf database network
show ip ospf database summary 172.16.20.0
show ip ospf database asbr-summary
show ip ospf database external 0.0.0.0
show ip ospf database self-originate
show ip ospf database database-summary
- Find the prefix you are interested in. If it is under type 3, the advertising router is the ABR that brought it into this area.
- If it is under type 5, note the advertising router: that is the ASBR. Check whether it is in your area (type 1 present) or another one (type 4 present).
- For an intra-area problem, read the type 1 LSA of each router on the path and check the links and costs they list.
- Compare
database-summarycounts between routers in the same area. They should be identical; a difference means a flooding problem.
Real-world example: a mystery default route
At a university, a new branch router suddenly sent all internet traffic through a backup link. show ip route showed an O*E2 default route, but nobody remembered adding one. The engineer ran show ip ospf database external 0.0.0.0 and found two type 5 LSAs for the default route from two different advertising routers. One was the main internet router; the other was a test firewall in a lab that someone had connected to the production OSPF area with default origination enabled. Because the lab ASBR was nearer, its default won. Removing the lab firewall from OSPF fixed the path, and the team added OSPF authentication to stop it happening again.
Practice
Which LSA type would you look at to see every router attached to a shared Ethernet segment?
A router in area 3 sees a type 5 LSA from an ASBR in area 1. Which other LSA does it need to calculate the cost?
Do type 1 LSAs from area 1 appear in the database of a router that is only in area 2?
Key takeaways
- Type 1 (router) and type 2 (network) LSAs describe the topology inside one area.
- ABRs pass prefixes between areas in type 3 LSAs and point to ASBRs with type 4.
- External routes are type 5, or type 7 inside an NSSA.
- The advertising router field tells you who brought a route into the database.
- Routers in the same area should hold identical databases.
Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.