Course menu

Course 9: OSPFLesson 4.4 (11 of 20 in this course)80 of 118 in the CCNA series

OSPF LSA types 1, 2 and 3

Router, network and summary LSAs: who creates each one, what it describes, how far it travels and how to read it in the database.

Intermediate · 12 min read

What you will learn

After this lesson, you can name the router, network and summary LSAs, say which router creates each and how far it travels, and find each one in show ip ospf database.

  • Router LSA
  • Network LSA
  • Summary LSA
  • show ip ospf database

An LSA (link-state advertisement) is one entry of OSPF's link-state database. Each type describes something different: type 1 a router and its links, type 2 a shared segment with a DR, type 3 a network in another area. Routers flood LSAs and every router in an area holds identical copies.

In simple terms: The OSPF map is made of many small cards. Each router writes a card about itself, the DR writes one about each shared LAN, and the routers between areas write cards about networks on the other side.

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.

Gi0/0Gi0/1 .1.2 Gi0/110.1.12.0/30Gi0/0 .2Gi0/0 .3Gi0/0 .4Gi0/1LAN 1192.168.1.0/24R1RID 1.1.1.1R2 (ABR)RID 2.2.2.2SW110.0.0.0/24R3RID 3.3.3.3R4 (DR)RID 4.4.4.4LAN 3192.168.3.0/24
  1. 1. Area 1: two router LSAs. R1 and R2 each describe their area 1 links. These stay inside area 1.
  2. 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. 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. 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

TypeCreated byDescribesFlooded toLink State ID
1 RouterEvery router, once per area it is inThe router's links in that area: neighbours, segments, subnets, and their costsIts own area onlyThe router ID
2 NetworkThe DR of a multi-access segmentThe segment's mask and every router attached to itIts own area onlyThe DR's interface IP address
3 SummaryAn ABRA network in another area and the ABR's cost to reach itInto 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

Example output · based on Cisco documentation; exact format varies by platform and software version
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
Router Link States are type 1: one per router in area 0, named by router ID. R3 has 2 links (the shared segment and LAN 3), R2 and R4 have 1 each in this area. Net Link States are type 2: one for the segment, named by the DR's address 10.0.0.4. Summary Net Link States are type 3: the two area 1 networks, both from R2. (Checksums are illustrative.)
Example output · based on Cisco documentation; exact format varies by platform and software version
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's own type 1 LSA in detail. The transit network entry points at the DR, 10.0.0.4. The stub network is LAN 3. TOS 0 Metrics is each link's cost.
Example output · based on Cisco documentation; exact format varies by platform and software version
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
The type 2 LSA: the segment's mask and the three attached routers, written by the DR.
Example output · based on Cisco documentation; exact format varies by platform and software version
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
In area 1, R1 learns area 0's networks from type 3 LSAs, so they show as O IA. The cost is R1's cost to R2 (1) plus the cost R2 put in the LSA: 1 for 10.0.0.0/24, 2 for LAN 3.
show ip ospf database summary 192.168.1.0

Details 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

✅ 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

Predict · scenario 1

Which router creates the type 2 LSA for the 10.0.0.0/24 segment?

Predict · scenario 2

Does R1, in area 1, have R3's type 1 router LSA in its database?

Predict · scenario 3

R1's routing table shows O IA 192.168.3.0/24. Which LSA type taught R1 this route?

Predict · scenario 4

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.

FAQ

Do I need multiple areas for the CCNA?
The CCNA 200-301 exam expects you to configure single-area OSPF. Type 1 and type 2 LSAs exist in every single-area network. Type 3 appears as soon as there are two areas, and you will meet it in real networks and in O IA routes, so it is worth understanding even though multi-area design itself is beyond the CCNA.
What about LSA types 4, 5 and 7?
Type 5 carries routes from outside OSPF, such as the default route from default-information originate. Type 4 tells other areas how to reach the router that created a type 5, and type 7 is a type 5 inside a special kind of area (NSSA). Types 4 and 7 are beyond the CCNA.
Why is there no type 2 LSA on point-to-point links?
A type 2 LSA is written by a DR, and point-to-point links have no DR. Each router's own type 1 LSA describes the link instead.