A real-life situation
You run show ip ospf database on a router for the first time and get three sections of entries headed Router Link States, Net Link States and Summary Net Link States, full of IDs that look like IP addresses but aren't always. Each section is a different kind of LSA. Once you know who writes each kind and what it describes, the database becomes a readable map of the network, and a powerful troubleshooting tool.
The network in this lesson
To see all three types, this lesson uses a small network with two areas. R2 is the ABR (area border router): its Gi0/1 is in area 1 and its Gi0/0 in area 0. In area 0, R2, R3 and R4 share one Ethernet segment, 10.0.0.0/24, where R4 is the DR. The R1–R2 link is configured as point-to-point. All interfaces are gigabit with the default reference bandwidth, so every interface costs 1.
- 1. Area 1: two router LSAs. R1 and R2 each describe their area 1 links. These stay inside area 1.
- 2. Area 0: three router LSAs. R2, R3 and R4 each describe their area 0 links. R2 writes a separate router LSA for each area it is in.
- 3. Area 0: one network LSA. R4, the DR, describes the 10.0.0.0/24 segment and lists R2, R3 and R4 as attached.
- 4. R2 summarises each area into the other. Into area 0: 192.168.1.0/24 and 10.1.12.0/30. Into area 1: 10.0.0.0/24 and 192.168.3.0/24. Each with R2's cost to reach it.
What the three LSA types are
| Type | Created by | Describes | Flooded to | Link State ID |
|---|---|---|---|---|
| 1 Router | Every router, once per area it is in | The router's links in that area: neighbours, segments, subnets, and their costs | Its own area only | The router ID |
| 2 Network | The DR of a multi-access segment | The segment's mask and every router attached to it | Its own area only | The DR's interface IP address |
| 3 Summary | An ABR | A network in another area and the ABR's cost to reach it | Into the other area(s) | The network address |
Type 1: the router LSA
Every router describes itself. Each entry in the LSA is one "link", of one of these kinds:
- Point-to-point: a neighbour on a point-to-point link, named by its router ID. A point-to-point link also adds a stub entry for its subnet.
- Transit network: a shared segment with a DR. The entry points at the DR, and the details are in that segment's type 2 LSA.
- Stub network: a subnet with no OSPF neighbours, such as a passive LAN or a loopback.
Type 2: the network LSA
On a shared segment, listing every neighbour in every router's LSA would repeat the same information many times. Instead, each router only says "I'm on the segment whose DR is 10.0.0.4", and the DR writes one type 2 LSA listing everybody. A type 2 LSA only exists while the DR has at least one Full neighbour on the segment. A LAN with a single router is just a stub network.
Type 3: the summary LSA
Type 1 and 2 LSAs never leave their area. An ABR runs SPF in each area, then tells the other area about the networks it found, one type 3 LSA per network, each with the ABR's cost to reach it. The routers in area 1 therefore never see R3 or R4 or the shared segment: they only learn "10.0.0.0/24 and 192.168.3.0/24 are reachable through R2 at these costs". That is how areas keep the database small. Routes learned this way show as O IA (inter-area). Despite the name, a summary LSA usually describes one network; it only covers a range if the ABR is configured to summarise.
Why it works this way
Inside an area, every router needs the full detail (types 1 and 2) to run SPF and build the same tree. Between areas, the detail would only make databases larger and make every router rerun SPF for changes far away. So the ABR passes on the result, not the map: a list of networks and costs. A change in area 0 that doesn't change any reachable network or cost causes nothing in area 1.
How to read them in the database
R3#show ip ospf database OSPF Router with ID (3.3.3.3) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 2.2.2.2 2.2.2.2 312 0x80000004 0x00B2C1 1 3.3.3.3 3.3.3.3 305 0x80000005 0x0041D7 2 4.4.4.4 4.4.4.4 298 0x80000003 0x00E83A 1 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 10.0.0.4 4.4.4.4 298 0x80000002 0x009A12 Summary Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 10.1.12.0 2.2.2.2 350 0x80000001 0x00C46E 192.168.1.0 2.2.2.2 350 0x80000001 0x0021F0
R3#show ip ospf database router 3.3.3.3 LS Type: Router Links Link State ID: 3.3.3.3 Advertising Router: 3.3.3.3 Number of Links: 2 Link connected to: a Transit Network (Link ID) Designated Router address: 10.0.0.4 (Link Data) Router Interface address: 10.0.0.3 TOS 0 Metrics: 1 Link connected to: a Stub Network (Link ID) Network/subnet number: 192.168.3.0 (Link Data) Network Mask: 255.255.255.0 TOS 0 Metrics: 1
R3#show ip ospf database network 10.0.0.4 LS Type: Network Links Link State ID: 10.0.0.4 (address of Designated Router) Advertising Router: 4.4.4.4 Network Mask: /24 Attached Router: 4.4.4.4 Attached Router: 2.2.2.2 Attached Router: 3.3.3.3
R1#show ip route ospf 10.0.0.0/8 is variably subnetted, 3 subnets, 3 masks O IA 10.0.0.0/24 [110/2] via 10.1.12.2, 00:06:20, GigabitEthernet0/1 O IA 192.168.3.0/24 [110/3] via 10.1.12.2, 00:06:20, GigabitEthernet0/1
show ip ospf database summary 192.168.1.0Details of one type 3 LSA: the network, mask, the ABR that created it and its metric.
What goes wrong and how to troubleshoot it
- A router's type 1 LSA is missing from another router's database. They are in the same area but there is no working adjacency path between them. Go back to the neighbour table.
- Two routers in the same area show different databases. Usually a moment during flooding; if it persists, an adjacency is not Full. In a healthy area every router lists the same LSAs.
- A LAN is in the database but not in the routing table. The LSA is there, so OSPF knows the network. A route with a lower administrative distance may be winning, or the next hop is unreachable.
Common mistakes
- Expecting a type 2 LSA on a point-to-point link or on a LAN with a single router.
- Thinking every router creates type 2 LSAs. Only the DR does.
- Reading the Link State ID as the same thing in every type: router ID (type 1), DR address (type 2), network (type 3).
- Expecting area 1 routers to see area 0's router LSAs. They only see type 3 summaries.
💡 Exam tip: match each type to its creator and scope: type 1 every router, own area; type 2 the DR, own area; type 3 the ABR, into other areas. Know that O IA routes come from type 3 LSAs and that show ip ospf database lists them all.
Key takeaways
- Type 1 (router): every router, per area, lists its links and costs. Stays in the area.
- Type 2 (network): the DR of a multi-access segment lists the attached routers. Stays in the area.
- Type 3 (summary): the ABR advertises networks from one area into another, with its cost. Shown as O IA.
- Inside an area routers share the map; between areas the ABR shares only the results.
Check yourself
Which router creates the type 2 LSA for the 10.0.0.0/24 segment?
Does R1, in area 1, have R3's type 1 router LSA in its database?
R1's routing table shows O IA 192.168.3.0/24. Which LSA type taught R1 this route?
In a type 1 router LSA, what does a 'Stub Network' link describe?
The default route from Advertising a default route is a fourth kind, type 5, listed under Type-5 AS External Link States.