Three sections of a database seen for the first time
A router cannot choose a path just from a list of router names. It needs to know which routers connect, which networks attach to them and what each outgoing connection costs. A link-state advertisement (LSA) is a record carrying part of that information. The link-state database (LSDB) stores the records used in OSPF's path calculation.
An LSA type tells you what a record describes, who creates it and where it can travel. An LSA is not a user packet or a route-table entry. OSPF transports LSAs inside link-state update packets, then calculates routes from the stored information.
A link-state update (LSU) is the OSPF packet that carries one or more complete LSAs. Think of the difference as the delivery message and the individual records inside it. They have separate type numbers: an LSU is OSPF packet type 4, while the records inside it can be LSA types 1, 2 or 3. An LSA type 3 is therefore not an OSPF packet type 3. Routers acknowledge LSA instances and can retransmit records when needed.
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.
A two-area network with one ABR
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.
LAN 1 is the source network, 192.168.1.0/24, behind R1. LAN 3, 192.168.3.0/24, is behind R3. A user on LAN 1 needs to reach a server on LAN 3. R2 connects the two areas. SW1 is a Layer 2 switch joining R2, R3 and R4 on one shared Ethernet subnet; it does not calculate OSPF routes.
For a host test, use PC-1 at 192.168.1.10/24 with gateway R1 Gi0/0 192.168.1.1, and the server at 192.168.3.10/24 with gateway R3 Gi0/1 192.168.3.1. R1 Gi0/1 is 10.1.12.1/30; R2 Gi0/1 is 10.1.12.2/30. On shared area 0, R2/R3/R4 Gi0/0 use 10.0.0.2/.3/.4 with /24 masks. These are interface addresses, while 1.1.1.1 through 4.4.4.4 are router IDs. The LAN interfaces are passive but selected for OSPF, so their prefixes are still advertised.
A designated router (DR) organises database exchanges on a shared segment. R4 has that role in this example. Its router ID is 4.4.4.4, while its address on the segment is 10.0.0.4. Those identifiers have different jobs.
Locate the devices, areas and advertised networks
Device key: LAN 1, LAN 3 (network / site) · R1, R2 (ABR), R3, R4 (DR) (router) · SW1 (switch)
Lines show the example’s network connections. Read the numbered steps for traffic direction and changes.
Reading the addresses
IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.
An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.
- LAN 1: Subnet 192.168.1.0/24
- R1: RID 1.1.1.1
- R2 (ABR): RID 2.2.2.2
- SW1: Subnet 10.0.0.0/24
- R3: RID 3.3.3.3
- R4 (DR): RID 4.4.4.4
- LAN 3: Subnet 192.168.3.0/24
- 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 advertises prefixes across the area border. 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.
Who writes each LSA and how far it travels
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Type 1: the router LSA
R3 creates a type 1 router LSA for area 0. It describes R3's connections in that area, including the shared segment and its own server LAN. R2 participates in two areas, so it creates a separate router LSA for each. R2's area 0 record does not include the detailed links inside area 1.
A router LSA is a protocol description of eligible OSPF links, not a complete inventory of every physical socket and CLI setting. Routers in a converged area learn each other's current topology records through flooding across adjacencies; they do not need to be directly cabled to every originator. R2's area 0 and area 1 router LSAs use the same router ID, but belong to different area databases.
Every router describes itself. Each entry in the LSA is one "link", of one of these kinds:
- Point-to-point: a Full neighbour on a point-to-point link, named by its router ID. A numbered point-to-point link can also add a separate 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 reachable subnet represented without another router beyond that entry, such as a passive LAN or loopback host route. A numbered point-to-point link also has a stub entry for its subnet.
On the R1–R2 numbered point-to-point link, the router-to-router entry identifies the neighbour and the separate subnet entry describes 10.1.12.0/30. Two link entries can therefore come from one interface. Link count is not simply a physical-interface count. A stub-network link entry is also different from an OSPF stub area; our two areas remain normal areas.
Type 2: the network LSA
The type 2 network LSA describes a shared transit segment. Transit means routers can use the segment to reach another router, rather than only end hosts. R4 creates the record because it is the DR, not because it is the border between areas.
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 itself and the neighbours fully adjacent to it. A type 2 LSA is originated while the DR has at least one Full neighbour on the segment. A LAN with a single router is just a stub network.
R3's transit entry points to 10.0.0.4, and R4's network LSA lists R3's router ID, 3.3.3.3. Together they describe the router-to-segment relationship used by the topology calculation. IP addresses that merely share a /24 do not prove this relationship; OSPF needs consistent link records. This models OSPF connectivity, not every cable or VLAN configuration inside SW1.
R4 originates the type 2 record; other routers can flood copies of it without becoming its creator. The BDR does not originate a second active network LSA for the same segment simply because it is the backup. If the DR changes, inspect the new DR address and advertising router rather than assuming 10.0.0.4 is a permanent segment identifier.
Type 3: the summary LSA
R3 needs a route to LAN 1, but it does not need every area 1 link in its database. R2 creates a type 3 summary LSA in area 0 describing LAN 1's prefix and R2's cost to it. R3 adds its own cost to reach R2. That produces an inter-area route: a route to a network in another OSPF area.
Type 1 and 2 LSAs are flooded within their own area. An ABR runs SPF in each area, then tells the other area about eligible networks it found, normally one type 3 LSA per advertised network, each with the ABR's cost to reach it. The routers in area 1 do not receive R3's or R4's area 0 type 1 LSAs. Instead they 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.
The word summary does not mean that OSPF automatically combines all of an area's subnets. Here R2 advertises separate prefixes with their masks and costs. Deliberate address aggregation is a separate ABR configuration. R2 also originates the type 3 in the receiving area; it does not change R1's type 1 into a type 3 and pass the original record through.
Why the ABR passes on results, not the map
Inside an area, routers use the same converged topology records (types 1 and 2), but each computes a tree rooted at itself. Between areas, the detail would only make databases larger and make every router rerun SPF for changes far away. So the ABR passes on reachability results, not the complete map: networks and costs. A change in area 0 may leave the advertised inter-area prefixes and costs unchanged. Other protocol maintenance and refreshes can still occur.
A remote topology change can alter a type 3 metric, withdraw an advertised prefix or leave both unchanged. If the received summary changes, the receiving router must reconsider the affected inter-area route. It does not need the remote area's full router-and-network map. Do not turn that separation into a promise that no route calculation or update can ever cross an area boundary.
Reading R3's database section by section
Link ID identifies what the LSA describes. ADV Router identifies its creator. For type 1 both fields contain the router ID. For type 2, Link ID contains the DR's interface address and ADV Router contains its router ID. Do not assume every dotted value in this output is an address to ping.
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
R3#show ip ospf database summary 192.168.1.0 LS Type: Summary Links(Network) Link State ID: 192.168.1.0 (summary Network Number) Advertising Router: 2.2.2.2 Network Mask: /24 MTID: 0 Metric: 2
The same prefix can be intra-area here and inter-area there
R2#show ip route ospf | include 192.168.1.0 O 192.168.1.0/24 [110/2] via 10.1.12.1, 00:06:20, GigabitEthernet0/1
R3#show ip route ospf | include 192.168.1.0 O IA 192.168.1.0/24 [110/3] via 10.0.0.2, 00:06:20, GigabitEthernet0/0
Using the database to find a fault
- A router's type 1 LSA is missing from another router's database. They are in the same area but may not have a working flooding path between them. Check adjacency paths, area membership and convergence before concluding that one particular cable is faulty.
- Two routers in the same area show different databases. Usually a moment during flooding; if it persists, check connectivity, adjacency paths, flooding and retransmissions. A healthy broadcast LAN can have 2-Way DROther pairs while databases synchronise through the DR/BDR. LSA age differences alone are normal.
- A LAN is in the database but not in the routing table. The LSA is there, so OSPF knows a description, not necessarily a usable route. Check SPF reachability, LSA link consistency and competing route sources before concluding that administrative distance is the cause.
The Age and Seq# columns are worth a glance too. An LSA whose age stays low and whose sequence number keeps climbing is being re-originated; rapid repeated changes can indicate instability. Normal refresh also changes sequence numbers, while retransmitting the same instance does not. Compare timestamps, logs and interface events before diagnosing a flap.
Types 1, 2 and 3 side by side
- 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.
Short lab: follow a cost change across the area boundary
Use the two-area topology in an isolated Cisco IOS or IOS XE lab, with all initial outgoing costs set to 1. On R3, inspect R1's LAN advertisement and route. The initial inter-area route to 192.168.1.0/24 should have cost 3: R3 to the shared segment, R2 to R1, then R1 to LAN 1.
show ip ospf database summary 192.168.1.0
show ip route 192.168.1.0R3, privileged EXEC. The summary's advertising router is R2, 2.2.2.2. Its metric is 2; R3 adds outgoing cost 1 to reach R2, giving route metric 3.
interface GigabitEthernet0/0
ip ospf cost 5
exitR1 only, starting in global configuration mode. Temporarily change the outgoing LAN 1 cost from 1 to 5 without changing its address or physical speed.
Repeat the two show commands on R3 after convergence. R2's type 3 metric becomes 6 and R3's route metric becomes 7. R3 still does not receive R1's area 1 type 1 LSA. Remove the temporary override with no ip ospf cost under R1 Gi0/0 and confirm the original metrics return. These expected values assume no other paths or route sources.
Optional failure check: withdraw LAN 1 without restarting OSPF
Only in the isolated lab, record the healthy host ping and the LAN 1 entries on R3. On R1, enter interface configuration for Gi0/0 and apply shutdown. This removes the live LAN interface, not the R1–R2 transit link. R1's area 1 router LSA changes; after convergence, R2 no longer advertises a usable LAN 1 prefix into area 0 and R3 loses the route. R1 can remain R2's Full transit neighbour throughout, showing why a neighbour record alone does not prove its LAN is reachable.
Restore R1 Gi0/0 with no shutdown, then check the connected LAN on R1, the type 3 metric 2 and route metric 3 on R3, and host traffic in both directions. A withdrawn LSA can briefly remain visible at maximum age while it is flushed; compare freshness and the installed route rather than treating any displayed copy as current reachability. Do not save the fault over your healthy configuration.
Test yourself on LSA types
Reference: RFC 2328: originating LSAs, SPF calculation, incremental summary updates and Cisco OSPF show-command reference. Commands use Cisco IOS/IOS XE-style syntax; output is authored for this example, not captured from a tested image. The two-area example introduces inter-area concepts beyond single-area CCNA configuration.
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.