OSPF LSA Types Explained

OSPF uses eleven different LSA types (Link State Advertisements) to build its LSDB (Link State Database) and share routing information between routers. Each LSA type has a specific purpose and flooding scope where it is flooded only within or between areas. In this lesson, we’ll look at the different LSA types, and I’ll show you how to identify them on Cisco IOS routers. We’ll focus on OSPFv2 because OSPFv3 uses a different set/format for LSAs.

LSA Types Overview

Let’s start with an overview of all LSA types:

LSA Type Name Generated By Flooding Scope
1 Router LSA Every router Within the area
2 Network LSA DR Within the area
3 Summary LSA ABR Into other areas
4 Summary ASBR LSA ABR Into other areas
5 External LSA ASBR Entire OSPF domain
6 Multicast LSA N/A N/A (not used)
7 NSSA External LSA ASBR (in NSSA) Within the NSSA only
8 External attribute LSA for BGP N/A N/A (not used)
9 Opaque LSA (link-local) Router Link-local scope
10 Opaque LSA (area-local) Router Within the area
11 Opaque LSA (AS-wide) Router Entire OSPF domain

For many students, visualizing helps them understand and remember. I like to visualize OSPF LSAs as jigsaw puzzle pieces. One jigsaw means nothing, but all of them together give us the total picture…for OSPF, this is the LSDB.

LSA Type 1

Here’s the first LSA Type:

Ospf Type 1 Router Lsa Two Routers

Each router within the area will flood a type 1 router LSA within the area. In this LSA, you will find a list of all the directly connected links of this router. How do we identify a link?

  • The IP prefix on an interface.
  • The link type. There are 4 different link types:
Link Type Description Link ID
1 Point-to-point connection to another router. Neighbor router ID
2 Connection to transit network. IP address of DR
3 Connection to stub network. IP Network
4 Virtual Link Neighbor router ID

Here is a short explanation of what each of these are:

  • Point-to-point (type 1): Used for serial point-to-point connections like PPP, HDLC, or Frame Relay point-to-point sub-interfaces.
  • Transit network (type 2): A multi-access network (like Ethernet) where there is more than one OSPF neighbor, requiring a DR/BDR election.
  • Stub network (type 3): A network segment with only one OSPF router, such as a loopback interface or an Ethernet interface with no OSPF neighbors. This has nothing to do with stub areas.
  • Virtual link (type 4): Used for OSPF virtual links.

The router LSA always stays within the area.

Point-to-point

Let’s see what this looks like on a real router. If you want to see for yourself, here is the topology. We’ll take a look at all type 1 LSAs that R1 generates:

R1#show ip ospf database router self-originate

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 0)

  LS age: 74
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 1.1.1.1
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000006
  Checksum: 0x5DB2
  Length: 48
  Number of Links: 2

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 2.2.2.2
     (Link Data) Router Interface address: 192.168.12.1
      Number of MTID metrics: 0
       TOS 0 Metrics: 10

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 192.168.12.0
     (Link Data) Network Mask: 255.255.255.0
      Number of MTID metrics: 0
       TOS 0 Metrics: 10

Let me break down what we see here. There are two items that can be confusing at first:

Link connected to: another Router (point-to-point)
 (Link ID) Neighboring Router ID: 2.2.2.2
 (Link Data) Router Interface address: 192.168.12.1
  TOS 0 Metrics: 10

This tells OSPF which neighbor it is, in this case, 2.2.2.2 (R2). The link ID shows that IP address, and the link data shows 192.168.12.1, which is the IP address of R1. This information is used to build the SPF topology. The other item we see is:

Link connected to: a Stub Network
 (Link ID) Network/subnet number: 192.168.12.0
 (Link Data) Network Mask: 255.255.255.0
  TOS 0 Metrics: 10

This is the router LSA for link type 3, so you get to see it right along with link type 1. This tells OSPF what subnet is reachable on this link. In this case, it’s 192.168.12.0 with a subnet mask of 255.255.255.0. This information is what a router uses to install 192.168.12.0/24 in its routing table. Here’s what this LSA looks like in a packet capture:

Frame 18: Packet, 110 bytes on wire (880 bits), 110 bytes captured (880 bits) on interface eth1, id 0
Ethernet II, Src: aa:bb:cc:00:02:10 (aa:bb:cc:00:02:10), Dst: aa:bb:cc:00:01:10 (aa:bb:cc:00:01:10)
Internet Protocol Version 4, Src: 192.168.12.2, Dst: 192.168.12.1
Open Shortest Path First
    OSPF Header
    LS Update Packet
        Number of LSAs: 1
        LSA-type 1 (Router-LSA), len 48
            .000 0001 1110 0010 = LS Age (seconds): 482
            0... .... .... .... = Do Not Age Flag: 0
            Options: 0x22, (DC) Demand Circuits, (E) External Routing
            LS Type: Router-LSA (1)
            Link State ID: 2.2.2.2
            Advertising Router: 2.2.2.2
            Sequence Number: 0x80000006
            Checksum: 0xfc0e
            Length: 48
            Flags: 0x00
            Number of Links: 2
            Type: PTP      ID: 1.1.1.1         Data: 192.168.12.2    Metric: 10
            Type: Stub     ID: 192.168.12.0    Data: 255.255.255.0   Metric: 10

You can see the same two links as we saw on the router.

Packet Capture: OSPF LSA Type Network

LSA Type 2

The second LSA type (network LSA) is created for multi-access networks:

Ospf Three Routers Dr Network Lsa Type 2

The network LSA, or type 2, is created for each multi-access network. Remember the OSPF network types? The broadcast and non-broadcast network types require a DR/BDR. If this is the case, you will see these network LSAs being generated by the DR. You won’t see them when you use a different network type such as point-point or point-to-multipoint (non-broadcast). In this LSA, we will find all the routers that are connected to the multi-access network, the DR, and, of course, the prefix and subnet mask.

In my example above, we will find R1, R2, and R3 (the DR) in the network LSA. We will also see the prefix 192.168.123.0 /24 in this LSA. Last thing to mention: the network LSA always stays within the area.

Let’s have a look.

R3#show ip ospf database network self-originate 

            OSPF Router with ID (3.3.3.3) (Process ID 1)

                Net Link States (Area 0)

  LS age: 441
  Options: (No TOS-capability, DC)
  LS Type: Network Links
  Link State ID: 192.168.123.3 (address of Designated Router)
  Advertising Router: 3.3.3.3
  LS Seq Number: 80000002
  Checksum: 0x4ADE
  Length: 36
  Network Mask: /24
        Attached Router: 3.3.3.3
        Attached Router: 1.1.1.1
        Attached Router: 2.2.2.2

Let me break down what we see here.

The Link State ID is set to 192.168.123.3, which is the IP address of the DR’s interface on the multi-access segment. This is one of the key differences from a Type 1 LSA, where the Link State ID is the router ID. With Type 2 LSAs, the Link State ID always reflects the DR’s interface IP address on that segment.

The Network Mask tells OSPF the size of the multi-access subnet, in this case /24. This is used along with the Link State ID to derive the subnet address (192.168.123.0/24).

The Attached Routers section lists the router IDs of every router that has fully formed an adjacency with the DR on this segment. In this case:

  • 3.3.3.3 – R3 (the DR itself)
  • 2.2.2.2 – R2 (the BDR)
  • 1.1.1.1 – R1

This is what makes the Type 2 LSA so important. On a multi-access network like Ethernet, instead of every router describing its relationship to every other router (which would create an n-squared problem), the DR generates a single Type 2 LSA that represents the entire segment and all routers attached to it. Every other router then simply points to the DR in its Type 1 LSA rather than to each individual neighbor.

Here’s what this LSA looks like in a packet capture:

Frame 6: Packet, 146 bytes on wire (1168 bits), 146 bytes captured (1168 bits) on interface eth1, id 0
Ethernet II, Src: aa:bb:cc:00:03:10 (aa:bb:cc:00:03:10), Dst: IPv4mcast_05 (01:00:5e:00:00:05)
Internet Protocol Version 4, Src: 192.168.123.3, Dst: 224.0.0.5
Open Shortest Path First
    OSPF Header
    LS Update Packet
        Number of LSAs: 2
        LSA-type 1 (Router-LSA), len 48
        LSA-type 2 (Network-LSA), len 36
            .000 1110 0001 0000 = LS Age (seconds): 3600
            0... .... .... .... = Do Not Age Flag: 0
            Options: 0x22, (DC) Demand Circuits, (E) External Routing
                0... .... = DN: Not set
                .0.. .... = (O) Opaque: Not set
                ..1. .... = (DC) Demand Circuits: Supported
                ...0 .... = (L) LLS Data block: Not Present
                .... 0... = (N) NSSA: Not supported
                .... .0.. = (MC) Multicast: Not capable
                .... ..1. = (E) External Routing: Capable
                .... ...0 = (MT) Multi-Topology Routing: No
            LS Type: Network-LSA (2)
            Link State ID: 192.168.123.3
            Advertising Router: 3.3.3.3
            Sequence Number: 0x80000002
            Checksum: 0x4ade
            Length: 36
            Netmask: 255.255.255.0
            Attached Router: 3.3.3.3
            Attached Router: 1.1.1.1
            Attached Router: 2.2.2.2

You can see the same information that we saw on the router. The destination address is 01:00:5e:00:00:05, which is the multicast MAC address for 224.0.0.5. This LSA will be flooded to all OSPF routers on the segment.

Packet Capture: OSPF LSA Type Network

LSA Type 3

Let’s look at the third LSA type:

Ospf Type 3 Summary Lsa

Type 1 router LSAs always stay within the area. OSPF, however, works with multiple areas, and you probably want full connectivity within all of the areas. R1 is flooding a router LSA within the area, so R2 will store this in its LSDB. R3 and R4 also need to know about the networks in Area 2.

R2 is going to create a Type 3 summary LSA and flood it into area 0. This LSA will spread throughout the rest of our OSPF network. This way, all the routers in other areas will know about the prefixes from other areas. 

The LSA type 3 generated by R2 is not flooded by R3 into area 51 but regenerated. Each ABR will regenerate the LSA type 3.

The name “summary” LSA is very misleading. By default OSPF is not going to summarize anything for you. There is, however, a command that lets you summarize inter-area routes. Take a look at my OSPF summarization lessonif you are interested. If you are looking at the routing table of an OSPF router and see some O IA entries, you are looking at LSA type 3 summary LSAs. Those are your inter-area prefixes!

Let’s have a look. We’ll start with R1, which has a loopback interface with network 11.11.11.11/32 and we’ll follow it all the way to R4. This is what it looks like:

R1#show ip ospf database router self-originate

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 1)

  LS age: 1337
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 1.1.1.1
  Advertising Router: 1.1.1.1
  LS Seq Number: 800000F7
  Checksum: 0xDE02
  Length: 60
  Number of Links: 3

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 11.11.11.11
     (Link Data) Network Mask: 255.255.255.255
      Number of MTID metrics: 0
       TOS 0 Metrics: 1

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 2.2.2.2
     (Link Data) Router Interface address: 192.168.12.1
      Number of MTID metrics: 0
       TOS 0 Metrics: 10

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 192.168.12.0
     (Link Data) Network Mask: 255.255.255.0
      Number of MTID metrics: 0
       TOS 0 Metrics: 10

This is the type 1 router LSA which shows up as a stub network with a /32 mask and a metric of 1. This type 1 LSA stays inside area 1. R2 receives it, but it does not forward it into area 0.

We can verify that R2 learns this:

R2#show ip ospf database router adv-router 1.1.1.1

            OSPF Router with ID (2.2.2.2) (Process ID 1)

                Router Link States (Area 1)

  LS age: 1353
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 1.1.1.1
  Advertising Router: 1.1.1.1
  LS Seq Number: 800000F8
  Checksum: 0xDC03
  Length: 60
  Number of Links: 3

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 11.11.11.11
     (Link Data) Network Mask: 255.255.255.255
      Number of MTID metrics: 0
       TOS 0 Metrics: 1

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 2.2.2.2
     (Link Data) Router Interface address: 192.168.12.1
      Number of MTID metrics: 0
       TOS 0 Metrics: 10

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 192.168.12.0
     (Link Data) Network Mask: 255.255.255.0
      Number of MTID metrics: 0
       TOS 0 Metrics: 10

This is the exact same type 1 LSA from R1, but as seen from R2. It shows up in the routing table like this:

R2#show ip route ospf

      11.0.0.0/32 is subnetted, 1 subnets
O        11.11.11.11 [110/11] via 192.168.12.1, 5d18h, Ethernet0/1

R2 is in an ABR, so it generates a type 3 LSA and floods it into area 0. You can see it here:

R2#show ip ospf database summary 11.11.11.11

            OSPF Router with ID (2.2.2.2) (Process ID 1)

                Summary Net Link States (Area 0)

  LS age: 1951
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 11.11.11.11 (summary Network Number)
  Advertising Router: 2.2.2.2
  LS Seq Number: 800000F6
  Checksum: 0xD334
  Length: 28
  Network Mask: /32
        MTID: 0         Metric: 11

The Link State ID is now the network prefix (11.11.11.11), not a router ID as we saw with type 1 LSAs. The advertising router is R2. The advertised metric by R2 is the total cost (11) to reach 11.11.11.11/32 via area 1.

Now let’s take a look at R3:

R3#show ip ospf database summary 11.11.11.11

            OSPF Router with ID (3.3.3.3) (Process ID 1)

                Summary Net Link States (Area 0)

  LS age: 29
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 11.11.11.11 (summary Network Number)
  Advertising Router: 2.2.2.2
  LS Seq Number: 800000F7
  Checksum: 0xD135
  Length: 28
  Network Mask: /32
        MTID: 0         Metric: 11 


                Summary Net Link States (Area 2)

  LS age: 566
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 11.11.11.11 (summary Network Number)
  Advertising Router: 3.3.3.3
  LS Seq Number: 800000F7
  Checksum: 0x18E0
  Length: 28
  Network Mask: /32
        MTID: 0         Metric: 21

There are two items here. The first LSA is the type 3 summary LSA that R3 receives from R2. That’s the one it installs in its routing table:

R3 receives this Type 3 LSA and installs 11.11.11.11/32 in its routing table:

R3#show ip route ospf

      11.0.0.0/32 is subnetted, 1 subnets
O IA     11.11.11.11 [110/21] via 192.168.23.2, 5d18h, Ethernet0/1

The second LSA is the type 3 summary LSA that R3 generates to flood into area 2. As you can see, this is a new LSA, and the metric (21) is the total cost to reach 11.11.11.11/32 from R3’s perspective.

Now let’s see what R4 has:

R4#show ip ospf database summary 11.11.11.11

            OSPF Router with ID (4.4.4.4) (Process ID 1)

                Summary Net Link States (Area 2)

  LS age: 617
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 11.11.11.11 (summary Network Number)
  Advertising Router: 3.3.3.3
  LS Seq Number: 800000F7
  Checksum: 0x18E0
  Length: 28
  Network Mask: /32
        MTID: 0         Metric: 21

R4 sees the type 3 summary LSA from R3 in its database and installs this in the routing table:

R4#show ip route ospf

      11.0.0.0/32 is subnetted, 1 subnets
O IA     11.11.11.11 [110/31] via 192.168.34.3, 5d18h, Ethernet0/1

The total metric is 31. That’s the advertised metric from R3 (21) plus the cost from R4 to reach R3, which is 10.

LSA Type 4

Time for the fourth LSA type:

Ospf Type 4 Summary Asbr Lsa Topology

In this example, R1 redistributes information from the BGP router into OSPF. This makes R1 an ASBR (Autonomous System Border Router). R1 will flip a bit in the router LSA to identify itself as an ASBR. When R2, who is an ABR, receives this router LSA, it will create a type 4 summary ASBR LSA and flood it into area 0. This LSA will also be flooded in all other areas and is required so that all OSPF routers know where to find the ASBR.

The type 4 LSA is only needed for routers in areas other than the ASBR. Routers in the same area can locate the ASBR directly from the type 1 LSA. Stub areas don’t receive type 5, so they don’t need or receive type 4 either.

Let’s look at this in action.

Configurations

Want to take a look for yourself? Here you will find the startup configuration of each device.

R1

hostname R1
!
ip cef
!
interface Loopback0
 ip address 11.11.11.11 255.255.255.255
!
interface Ethernet0/1
 ip address 192.168.12.1 255.255.255.0
 ip ospf network point-to-point
!
router ospf 1
 router-id 1.1.1.1
 network 192.168.12.0 0.0.0.255 area 1
 network 11.11.11.11 0.0.0.0 area 1
!
end

R2

hostname R2
!
ip cef
!
interface Ethernet0/1
 ip address 192.168.12.2 255.255.255.0
 ip ospf network point-to-point
!
interface Ethernet0/2
 ip address 192.168.23.2 255.255.255.0
 ip ospf network point-to-point
!
router ospf 1
 router-id 2.2.2.2
 network 192.168.12.0 0.0.0.255 area 1
 network 192.168.23.0 0.0.0.255 area 0
!
end

R3

hostname R3
!
ip cef
!
interface Ethernet0/1
 ip address 192.168.23.3 255.255.255.0
 ip ospf network point-to-point
!
interface Ethernet0/2
 ip address 192.168.34.3 255.255.255.0
 ip ospf network point-to-point
!
router ospf 1
 router-id 3.3.3.3
 network 192.168.23.0 0.0.0.255 area 0
 network 192.168.34.0 0.0.0.255 area 2
!
end

R4

hostname R4
!
ip cef
!
interface Ethernet0/1
 ip address 192.168.34.4 255.255.255.0
 ip ospf network point-to-point
!
router ospf 1
 router-id 4.4.4.4
 network 192.168.34.0 0.0.0.255 area 2
!
end

In the LSA Type 3 section, we checked 11.11.11.11/32 as an OSPF network. R1 advertised it natively in OSPF, and it traveled across areas as a type 3 LSA.

This time, we’ll redistribute the loopback interface with 11.11.11.11/32 into OSPF. This turns R1 into an ASBR. Redistributing an interface might sound weird but it works and it saves us the trouble of adding another router to the topology. Let’s start with R1:

R1#show ip ospf database router self-originate

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 1)

  LS age: 824
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 1.1.1.1
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000002
  Checksum: 0x6BA6
  Length: 48
  AS Boundary Router
  Number of Links: 2

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 2.2.2.2
     (Link Data) Router Interface address: 192.168.12.1
      Number of MTID metrics: 0
       TOS 0 Metrics: 10

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 192.168.12.0
     (Link Data) Network Mask: 255.255.255.0
      Number of MTID metrics: 0
       TOS 0 Metrics: 10

The output above shows AS Boundary Router. The loopback 11.11.11.11/32 no longer appears here as a stub network because it’s no longer an OSPF network. The 11.11.11.11/32 network will show up as a type 5 LSA, which we’ll look at later. What matters here is that R1’s Type 1 LSA now identifies it as an ASBR.

R2 receives this type 1 LSA and can see that R1 is an ASBR:

R2#show ip ospf database router adv-router 1.1.1.1

            OSPF Router with ID (2.2.2.2) (Process ID 1)

                Router Link States (Area 1)

  LS age: 906
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 1.1.1.1
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000002
  Checksum: 0x6BA6
  Length: 48
  AS Boundary Router
  Number of Links: 2

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 2.2.2.2
     (Link Data) Router Interface address: 192.168.12.1
      Number of MTID metrics: 0
       TOS 0 Metrics: 10

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 192.168.12.0
     (Link Data) Network Mask: 255.255.255.0
      Number of MTID metrics: 0
       TOS 0 Metrics: 10

This is the same type 1 LSA from R1 as seen from R2. Routers within area 1 can use this LSA to locate the ASBR directly.

Routers in other areas, however, will never see this LSA type. R2 knows about R1 from area 1’s LSDB. Because R1 is flagged as an ASBR, R2 generates a Type 4 ASBR Summary LSA and floods it into area 0. This LSA tells routers in other areas how to reach the ASBR (R1). Here’s what LSA type 4 looks like:

R2#show ip ospf database asbr-summary

            OSPF Router with ID (2.2.2.2) (Process ID 1)

                Summary ASB Link States (Area 0)

  LS age: 1011
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(AS Boundary Router)
  Link State ID: 1.1.1.1 (AS Boundary Router address)
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000001
  Checksum: 0x75B0
  Length: 28
  Network Mask: /0
        MTID: 0         Metric: 10

This looks similar to a type 3 LSA, but there are two important differences:

  • The LS type is “Summary Links (AS Boundary Router)” instead of “Summary Links (Network)”.
  • The link state ID is R1’s router ID (1.1.1.1) instead of a network prefix.
  • The metric of 10 is the cost of R2 to reach R1.

R3 and any other router in Area 0 can now use this LSA to find the path to the ASBR. R3 receives this Type 4 LSA from R2:

R3#show ip ospf database asbr-summary

            OSPF Router with ID (3.3.3.3) (Process ID 1)

                Summary ASB Link States (Area 0)

  LS age: 1044
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(AS Boundary Router)
  Link State ID: 1.1.1.1 (AS Boundary Router address)
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000001
  Checksum: 0x75B0
  Length: 28
  Network Mask: /0
        MTID: 0         Metric: 10 


                Summary ASB Link States (Area 2)

  LS age: 1043
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(AS Boundary Router)
  Link State ID: 1.1.1.1 (AS Boundary Router address)
  Advertising Router: 3.3.3.3
  LS Seq Number: 80000001
  Checksum: 0xBB5C
  Length: 28
  Network Mask: /0
        MTID: 0         Metric: 20

R3 has two LSAs, one for each area that R3 is connected to. The first one is the same type 4 LSA that R2 originated. R3 is in Area 0, so it can use its own SPF tree to find R2, and then add R2’s advertised cost of 10 to calculate the total cost to reach R1 (1.1.1.1).

Just like with type 3 LSAs, R3 does not simply forward R2’s type 4 LSA into area 2. R3 generates a new type 4 LSA and floods it into area 2. Here’s what you see in this second LSA:

  • R3 is the advertising router (3.3.3.3).
  • The metric is 20. That’s the total cost for R3 to reach R1.

R4 now receives the type 4 LSA, which was generated by R3:

R4#show ip ospf database asbr-summary

            OSPF Router with ID (4.4.4.4) (Process ID 1)

                Summary ASB Link States (Area 2)

  LS age: 1130
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(AS Boundary Router)
  Link State ID: 1.1.1.1 (AS Boundary Router address)
  Advertising Router: 3.3.3.3
  LS Seq Number: 80000001
  Checksum: 0xBB5C
  Length: 28
  Network Mask: /0
        MTID: 0         Metric: 20

R4 now knows that R1 (1.1.1.1) is an ASBR and that the cost to reach it is 20 (R3’s advertised metric).

The type 4 LSA only tells routers where the ASBR is. It says nothing about the external prefix 11.11.11.11/32 itself. That information is added in a type 5 External LSA, which we’ll cover in the next section.

When R4 wants to reach 11.11.11.11/32, it combines two pieces of information:

  • The Type 5 LSA: tells R4 that 11.11.11.11/32 was originated by ASBR 1.1.1.1
  • The Type 4 LSA: tells R4 how to reach ASBR 1.1.1.1

Together, these two LSAs give R4 everything it needs to install the external route in its routing table.

Here’s an overview:

Step LSA Type Advertising Router Link State ID Metric Where It Lives
R1 flags itself as ASBR Type 1 (E bit set) R1 (1.1.1.1) 1.1.1.1 Area 1 only
R2 advertises ASBR reachability Type 4 R2 (2.2.2.2) 1.1.1.1 10 Area 0 only
R3 regenerates ASBR reachability Type 4 R3 (3.3.3.3) 1.1.1.1 20 Area 2 only

LSA Type 5

What about LSA type 5? Let’s check it out:

Ospf Type 5 External Lsa Topology

Same topology, but I’ve added a prefix (5.5.5.0/24) on our RIP router. This prefix will be redistributed into OSPF. R1 (our ASBR) will take care of this and create a type 5 external LSA for this. Don’t forget we still need the type 4 summary ASBR LSA to locate R1. If you ever tried redistribution with OSPF, you might have seen O E1 or O E2 entries. Those are the external prefixes and our type 5 LSAs. E2 is the default, which only uses the external cost set by the ASBR. The internal OSPF cost to reach the ASBR is not added. With the E1, we use the external cost plus the internal OSPF cost to reach the ASBR.

Configurations

Want to take a look for yourself? Here you will find the startup configuration of each device.

R1

hostname R1
!
ip cef
!
interface Loopback0
 ip address 11.11.11.11 255.255.255.255
!
interface Ethernet0/1
 ip address 192.168.12.1 255.255.255.0
 ip ospf network point-to-point
!
router ospf 1
 router-id 1.1.1.1
 redistribute connected route-map CONNECTED_TO_OSPF
 network 192.168.12.0 0.0.0.255 area 1
!
ip access-list standard R1_L0
 10 permit 11.11.11.11
!
route-map CONNECTED_TO_OSPF permit 10 
 match ip address R1_L0
!
end

R2

hostname R2
!
ip cef
!
interface Ethernet0/1
 ip address 192.168.12.2 255.255.255.0
 ip ospf network point-to-point
!
interface Ethernet0/2
 ip address 192.168.23.2 255.255.255.0
 ip ospf network point-to-point
!
router ospf 1
 router-id 2.2.2.2
 network 192.168.12.0 0.0.0.255 area 1
 network 192.168.23.0 0.0.0.255 area 0
!
end

R3

hostname R3
!
ip cef
!
interface Ethernet0/1
 ip address 192.168.23.3 255.255.255.0
 ip ospf network point-to-point
!
interface Ethernet0/2
 ip address 192.168.34.3 255.255.255.0
 ip ospf network point-to-point
!
router ospf 1
 router-id 3.3.3.3
 network 192.168.23.0 0.0.0.255 area 0
 network 192.168.34.0 0.0.0.255 area 2
!
end

R4

hostname R4
!
ip cef
!
interface Ethernet0/1
 ip address 192.168.34.4 255.255.255.0
 ip ospf network point-to-point
!
router ospf 1
 router-id 4.4.4.4
 network 192.168.34.0 0.0.0.255 area 2
!
end

In the previous section, we saw how the type 4 ASBR Summary LSA tells routers in other areas how to reach the ASBR. But the type 4 LSA says nothing about the actual external prefix. That’s the job of the type 5 external LSA.

When R1 redistributes 11.11.11.11/32 into OSPF, it generates a type 5 LSA to advertise that external prefix to the rest of the OSPF domain. Unlike type 3 and type 4 LSAs, the type 5 LSA is not regenerated by an ABR. It floods across all areas unchanged. Let’s have a look. We’ll start with R1:

R1#show ip ospf database external self-originate

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Type-5 AS External Link States

  LS age: 1426
  Options: (No TOS-capability, DC, Upward)
  LS Type: AS External Link
  Link State ID: 11.11.11.11 (External Network Number )
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000001
  Checksum: 0xCDA2
  Length: 36
  Network Mask: /32
        Metric Type: 2 (Larger than any link state path)
        MTID: 0 
        Metric: 20 
        Forward Address: 0.0.0.0
        External Route Tag: 0

Let’s break down what we have here:

  • Link State ID is the external network prefix (11.11.11.11). This is what other routers will install in their routing tables.
  • Advertising Router is R1 (1.1.1.1) — the ASBR that originated this LSA. This is the value that routers use to look up the matching Type 4 LSA.
  • Metric Type is 2 (E2). This is the default for redistributed routes.
  • Metric is 20. This is the external cost assigned during redistribution.
  • Forward Address is 0.0.0.0, which means traffic should be sent to the ASBR itself (R1).

Let’s check the other routers. Since LSA type 5 is flooded unchanged throughout the OSPF domain, we should see the same thing on all routers. Here is R2:

R2#show ip ospf database external 11.11.11.11

            OSPF Router with ID (2.2.2.2) (Process ID 1)

                Type-5 AS External Link States

  LS age: 1483
  Options: (No TOS-capability, DC, Upward)
  LS Type: AS External Link
  Link State ID: 11.11.11.11 (External Network Number )
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000001
  Checksum: 0xCDA2
  Length: 36
  Network Mask: /32
        Metric Type: 2 (Larger than any link state path)
        MTID: 0 
        Metric: 20 
        Forward Address: 0.0.0.0
        External Route Tag: 0

The LSA is the same as the one R1 originated. Same thing on R3:

R3#show ip ospf database external 11.11.11.11

            OSPF Router with ID (3.3.3.3) (Process ID 1)

                Type-5 AS External Link States

  LS age: 1688
  Options: (No TOS-capability, DC, Upward)
  LS Type: AS External Link
  Link State ID: 11.11.11.11 (External Network Number )
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000001
  Checksum: 0xCDA2
  Length: 36
  Network Mask: /32
        Metric Type: 2 (Larger than any link state path)
        MTID: 0 
        Metric: 20 
        Forward Address: 0.0.0.0
        External Route Tag: 0

And also on R4:

R4#show ip ospf database external 11.11.11.11

            OSPF Router with ID (4.4.4.4) (Process ID 1)

                Type-5 AS External Link States

  LS age: 7
  Options: (No TOS-capability, DC, Upward)
  LS Type: AS External Link
  Link State ID: 11.11.11.11 (External Network Number )
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000002
  Checksum: 0xCBA3
  Length: 36
  Network Mask: /32
        Metric Type: 2 (Larger than any link state path)
        MTID: 0 
        Metric: 20 
        Forward Address: 0.0.0.0
        External Route Tag: 0

R4 now has everything it needs to install 11.11.11.11/32 in its routing table:

  • The Type 5 LSA tells R4 the external prefix is 11.11.11.11/32, originated by ASBR 1.1.1.1, with an external metric of 20.
  • The Type 4 LSA tells R4 that ASBR 1.1.1.1 is reachable via R3 with a cost of 20.

Because this is an E2 route, R4 installs it with the external metric of 20:

R4#show ip route ospf

      11.0.0.0/32 is subnetted, 1 subnets
O E2     11.11.11.11 [110/20] via 192.168.34.3, 00:34:24, Ethernet0/1
O IA  192.168.12.0/24 [110/30] via 192.168.34.3, 00:34:24, Ethernet0/1
O IA  192.168.23.0/24 [110/20] via 192.168.34.3, 00:34:24, Ethernet0/1

The O E2 tag confirms this is an external OSPF route with a type 2 metric.

Here’s an overview of everything we have seen:

LSA Type Advertising Router Link State ID Purpose
Type 1 (E bit set) R1 (1.1.1.1) 1.1.1.1 Identifies R1 as ASBR within Area 1
Type 4 R3 (3.3.3.3) 1.1.1.1 Tells Area 2 routers how to reach the ASBR
Type 5 R1 (1.1.1.1) 11.11.11.11 Advertises the external prefix domain-wide

LSA Type 6

What about OSPF LSA type 6? The most important thing to know about LSA Type 6 is that it is obsolete and never used in modern networking.

OSPF is designed to route unicast traffic, and in the past, developers created an extension to OSPF called Multicast OSPF (MOSPF), which is defined in RFC 1584.

The idea was to allow OSPF to handle multicast traffic, so that an OSPF router could tell other OSPF routers that it has receivers for a specific multicast group. When a host wanted to join a multicast group (usually communicating via IGMP), the local router would generate a type 6 LSA.

OSPF routers could then build a map of where the multicast receivers are located, run SPF to calculate a multicast distribution tree, and forward multicast traffic in the right direction.

The idea sounds nice, but it was never adopted. The main issue was that it doesn’t scale. Every router must maintain a state for each active multicast group. Also, whenever a new multicast source starts sending traffic, OSPF routers must run the SPF algorithm to calculate a new multicast tree. This increases your CPU load and memory usage.

In modern networks, we use Protocol Independent Multicast (PIM).

LSA Type 7

Let’s look at LSA type 7:

Ospf Type 7 External Lsa Topology

NSSA areas do not allow type 5 external LSAs. In my picture, R1 is still our ASBR, redistributing BGP information into OSPF.

Since type 5 is not allowed, we have to think of something else. That’s why we have a type 7 external LSA that carries the exact same information but is not blocked within the NSSA area. R2 (ABR) will translate this type 7 into a type 5 and flood it into the other areas. These have the same logic as the O E1 and O E2 routes:

  • N1 translates to E1
  • N2 translates to E2.

Let’s look at this in action.

Configurations

Want to take a look for yourself? Here you will find the startup configuration of each device.

R1

hostname R1
!
ip cef
!
interface Loopback0
 ip address 11.11.11.11 255.255.255.255
!
interface Ethernet0/1
 ip address 192.168.12.1 255.255.255.0
 ip ospf network point-to-point
!
router ospf 1
 router-id 1.1.1.1
 area 1 nssa
 redistribute connected route-map CONNECTED_TO_OSPF
 network 192.168.12.0 0.0.0.255 area 1
!
ip access-list standard R1_L0
 10 permit 11.11.11.11
!
route-map CONNECTED_TO_OSPF permit 10 
 match ip address R1_L0
!
end

R2

hostname R2
!
ip cef
!
interface Ethernet0/1
 ip address 192.168.12.2 255.255.255.0
 ip ospf network point-to-point
!
interface Ethernet0/2
 ip address 192.168.23.2 255.255.255.0
 ip ospf network point-to-point
!
router ospf 1
 router-id 2.2.2.2
 area 1 nssa
 network 192.168.12.0 0.0.0.255 area 1
 network 192.168.23.0 0.0.0.255 area 0
!
end

R3

hostname R3
!
ip cef
!
interface Ethernet0/1
 ip address 192.168.23.3 255.255.255.0
 ip ospf network point-to-point
!
interface Ethernet0/2
 ip address 192.168.34.3 255.255.255.0
 ip ospf network point-to-point
!
router ospf 1
 router-id 3.3.3.3
 network 192.168.23.0 0.0.0.255 area 0
 network 192.168.34.0 0.0.0.255 area 2
!
end

R4

hostname R4
!
ip cef
!
interface Ethernet0/1
 ip address 192.168.34.4 255.255.255.0
 ip ospf network point-to-point
!
router ospf 1
 router-id 4.4.4.4
 network 192.168.34.0 0.0.0.255 area 2
!
end

We’ll use the same topology as with LSA type 5, but area 1 is now configured as an NSSA. Because Area 1 is an NSSA, R1 generates a type 7 NSSA external LSA instead of a type 5. Type 7 LSAs are only valid inside the NSSA. When they reach the ABR (R2), it converts the type 7 into a type 5 so the rest of the OSPF domain can learn about the external prefix.

The type 7 LSA works similarly to type 5, but it exists only within the NSSA. The ABR is responsible for translating it into a type 5 so routers outside the NSSA can learn the external prefix. Let’s look at the type 7 LSA on R1 first:

R1#show ip ospf database nssa-external self-originate

            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Type-7 AS External Link States (Area 1)

  LS age: 440
  Options: (No TOS-capability, Type 7/5 translation, DC, Upward)
  LS Type: AS External Link
  Link State ID: 11.11.11.11 (External Network Number )
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000001
  Checksum: 0x14DB
  Length: 36
  Network Mask: /32
        Metric Type: 2 (Larger than any link state path)
        MTID: 0 
        Metric: 20 
        Forward Address: 192.168.12.1
        External Route Tag: 0

Let’s break down what we have here:

  • Link State ID is the external network prefix (11.11.11.11). This is what other routers will install in their routing tables.
  • Advertising Router is R1 (1.1.1.1) — the ASBR that originated this LSA.
  • Metric Type is 2 (N2). This is the default for redistributed routes in an NSSA.
  • Metric is 20. This is the external cost assigned during redistribution.
  • Forward Address is 192.168.12.1. Unlike type 5 LSAs, type 7 LSAs typically have a non-zero forward address. This is the address of the
  • ASBR’s interface inside the NSSA. Routers use this address to forward traffic directly to R1 rather than to the ABR.

Now let’s check R2, our ABR. R2 sits between Area 1 (the NSSA) and Area 0. It receives the type 7 LSA from R1 and translates it into a type 5 LSA for the rest of the domain. We should see both LSA types on R2:

R2#show ip ospf database nssa-external 11.11.11.11

            OSPF Router with ID (2.2.2.2) (Process ID 1)

                Type-7 AS External Link States (Area 1)

  LS age: 475
  Options: (No TOS-capability, Type 7/5 translation, DC, Upward)
  LS Type: AS External Link
  Link State ID: 11.11.11.11 (External Network Number )
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000001
  Checksum: 0x14DB
  Length: 36
  Network Mask: /32
        Metric Type: 2 (Larger than any link state path)
        MTID: 0 
        Metric: 20 
        Forward Address: 192.168.12.1
        External Route Tag: 0

R2 has the same type 7 LSA as R1. Now, let’s check if R2 has generated the translated type 5:

R2#show ip ospf database external 11.11.11.11

            OSPF Router with ID (2.2.2.2) (Process ID 1)

                Type-5 AS External Link States

  LS age: 485
  Options: (No TOS-capability, DC, Upward)
  LS Type: AS External Link
  Link State ID: 11.11.11.11 (External Network Number )
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000001
  Checksum: 0x8A6B
  Length: 36
  Network Mask: /32
        Metric Type: 2 (Larger than any link state path)
        MTID: 0 
        Metric: 20 
        Forward Address: 192.168.12.1
        External Route Tag: 0

The translated type 5 LSA shows Advertising Router 2.2.2.2. This is R2, the ABR that did the translation. You don’t see R1 in this LSA, however, R2 preserves the Forward Address (192.168.12.1) from the original type 7. This is important because routers outside the NSSA use this forward address to send traffic directly to R1.

Because the type 5 LSA is now advertised by R2 (not R1), in this case, there is no need for a type 4 ASBR summary LSA. Routers outside the NSSA need to reach R2, which is already known through normal OSPF. Let’s confirm R3 and R4 only see the translated type 5:

R3#show ip ospf database nssa-external

            OSPF Router with ID (3.3.3.3) (Process ID 1)

There is nothing here. No type 7 LSAs. We do have LSA type 5:

R3#show ip ospf database external 11.11.11.11

            OSPF Router with ID (3.3.3.3) (Process ID 1)

                Type-5 AS External Link States

  LS age: 532
  Options: (No TOS-capability, DC, Upward)
  LS Type: AS External Link
  Link State ID: 11.11.11.11 (External Network Number )
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000001
  Checksum: 0x8A6B
  Length: 36
  Network Mask: /32
        Metric Type: 2 (Larger than any link state path)
        MTID: 0 
        Metric: 20 
        Forward Address: 192.168.12.1
        External Route Tag: 0

R3 only sees LSA type 5. Here is R4:

R4#show ip ospf database nssa-external

            OSPF Router with ID (4.4.4.4) (Process ID 1)

Same thing, nothing here. Here is the type 5 LSA:

R4#show ip ospf database external 11.11.11.11

            OSPF Router with ID (4.4.4.4) (Process ID 1)

                Type-5 AS External Link States

  LS age: 536
  Options: (No TOS-capability, DC, Upward)
  LS Type: AS External Link
  Link State ID: 11.11.11.11 (External Network Number )
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000001
  Checksum: 0x8A6B
  Length: 36
  Network Mask: /32
        Metric Type: 2 (Larger than any link state path)
        MTID: 0 
        Metric: 20 
        Forward Address: 192.168.12.1
        External Route Tag: 0

Here is the routing table of R4:

R4#show ip route ospf

      11.0.0.0/32 is subnetted, 1 subnets
O E2     11.11.11.11 [110/20] via 192.168.34.3, 00:10:35, Ethernet0/1
O IA  192.168.12.0/24 [110/30] via 192.168.34.3, 00:10:35, Ethernet0/1
O IA  192.168.23.0/24 [110/20] via 192.168.34.3, 00:10:36, Ethernet0/1

R4 installs the prefix as O E2 with a metric of 20. From R4’s perspective, this looks identical to the type 5 example. The type 7 to type 5 translation at R2 is completely transparent to routers outside Area 1.

SA Type Advertising Router Link State ID Scope Purpose
Type 1 (E bit set) R1 (1.1.1.1) 1.1.1.1 Area 1 Identifies R1 as ASBR within Area 1
Type 7 R1 (1.1.1.1) 11.11.11.11 Area 1 only Advertises the external prefix inside the NSSA
Type 5 (translated) R2 (2.2.2.2) 11.11.11.11 Domain-wide Advertises the external prefix outside the NSSA

LSA Type 8

Type 8 External Attribute LSA was designed to carry BGP attributes across OSPF domains. However, like Type 6, it is rarely implemented in practice and is not supported by most vendors, including Cisco. Modern networks use MP-BGP for carrying extended attributes instead.

LSA Type 9

LSA type 9 is an opaque LSA. The word “opaque” means that OSPF itself doesn’t interpret the data inside these LSAs. Instead, they act as containers that carry information for other applications or extensions. What makes each opaque type unique is its flooding scope. A type 9 Opaque LSA has a link-local flooding scope.

Type 9 LSAs are used when information only needs to be shared between directly connected neighbors. One example is OSPF Graceful Restart (also called non-stop forwarding). When a router is about to restart its OSPF process, it sends a type 9 Opaque LSA called a Grace LSA to its directly connected neighbors. This tells them: “I’m restarting, please don’t remove me from the topology.” The neighbors don’t need to flood this information any further since only the directly connected routers need to act on it.

LSA Type 10

A type 10 Opaque LSA has an area-local flooding scope. In that sense, its flooding scope is similar to type 1 and type 2 LSAs.

Type 10 is the most commonly seen Opaque LSA. Its main use case is MPLS Traffic Engineering (MPLS TE). MPLS is a complex topic, and MPLS TE is even more so. Don’t worry about this one if you are new to OSPF. When you enable MPLS TE, routers need to share additional link information that standard LSAs don’t carry, such as:

  • Available bandwidth per priority level
  • Maximum reservable bandwidth
  • Interface color/affinity (admin-group)
  • TE metric

This extra information is flooded within the area using type 10 Opaque LSAs. OSPF doesn’t interpret this data itself. Instead, the TE process on each router reads it and builds a separate Traffic Engineering Database (TED) that RSVP uses to compute label-switched paths.

Another common use is Segment Routing. When you enable Segment Routing with OSPF, the SID (Segment ID) information for each prefix and adjacency is distributed through type 10 Opaque LSAs.

If you have MPLS TE or Segment Routing enabled, you will see entries here. On a plain OSPF setup without these features, this section will typically be empty.

LSA Type 11

A type 11 Opaque LSA has an AS-wide flooding scope. It is flooded throughout the entire OSPF domain, across all areas, similar to how a type 5 external LSA is flooded. Just like type 5 LSAs, type 11 LSAs are not flooded into stub and NSSA areas.

Type 11 was originally intended for applications that need to distribute opaque information to every router in the OSPF domain. In practice, however, type 11 Opaque LSAs are rarely seen in production networks. Most OSPF extensions that use Opaque LSAs (like MPLS TE and Segment Routing) only need area-local scope, so they use type 10 instead.

Conclusion

That’s it! Those are all the LSA types we have for OSPF and their different functions. Here is one more overview:

LSA Type Name Generated By Flooding Scope
1 Router LSA Every router Within the area
2 Network LSA DR Within the area
3 Summary LSA ABR Into other areas
4 Summary ASBR LSA ABR Into other areas
5 External LSA ASBR Entire OSPF domain
6 Multicast LSA N/A N/A (not used)
7 NSSA External LSA ASBR (in NSSA) Within the NSSA only
8 External Attribute LSA ASBR Within the area
9 Opaque LSA (Link-local) Every router Local network link
10 Opaque LSA (Area-local) Every router Within the area
11 Opaque LSA (AS scope) Every router Entire OSPF domain

I can recommend looking at the OSPF LSDB a couple of times when you are doing labs.

Tags:


Forum Replies

  1. Great job,your example are very smooth to learn .

  2. very concise exlanation! :slight_smile:

  3. I have to tell you that I have seen different videos and took CCNP Training and never understood completely the Area Types but you explain it so easy that I understand now.
    Thanks

  4. In the above topology, when I redistribute connected on R2 and R3, R1 sees only one LSA type 4. It’s for R2 showing how to get to R3. Why don’t we also see an LSA type 4 for R2’s redistributed routes? Does a directly connected router not generate an LSA type 4 for its redistributed routes? Whew!

  5. Hi,

    In your explanation about LSA type 5, you wrote :
    “Here you can see the type 5 external LSA in the LSDB. Keep in mind that router R2 and R3 both are in area 0.”

    But, in the design, we can see that there are in area 1 ?

    Regards.

186 more replies! Ask a question or join the discussion by visiting our Community Forum