Post

OSPF LSA Types


What is OSPF LSA?

OSPF LSA (Link-State Advertisement) is a data packet used by OSPF routers to exchange information about the network’s topology and routing details. It contain critical routing data to facilitate path calculations within OSPF networks.

  1. Router LSA (Type 1): Describes the router’s directly connected links and their states. Generated by every OSPF router within an OSPF area.
  2. Network LSA (Type 2): Describes the routers connected to a broadcast or non-broadcast multi-access network segment. Generated by the Designated Router (DR) on such networks.
  3. Summary LSA (Type 3): Generated by Area Border Routers (ABRs) to advertise summarized routes between OSPF areas.
  4. ASBR Summary LSA (Type 4): Advertises information about Autonomous System Boundary Routers (ASBRs) to the rest of the OSPF domain.
  5. External LSA (Type 5): Advertises routes redistributed into OSPF from external routing domains.

There are also some additionals LSA Types but lets just keep our scope to these 5 types for now.



OSPF Topology

x

This is the full topology for this lab, where we will attempt to create all 5 LSA Types within this deployment. Let’s start



Type 1

Type 1 (Router LSA) essentially means directly connected OSPF neighbor within the same area

x

Let’s strip away all the other routers and just focus on 2 routers on Area 0, which is XE2 and XE4.
To trigger type 1 LSA, we create a point-to-point ospf connection.

XE2

1
2
3
4
interface GigabitEthernet2
 ip address 50.0.0.2 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0

XE4

1
2
3
4
interface GigabitEthernet3
 ip address 50.0.0.4 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0


Then check the neighborship status

XE2

1
2
3
4
xe2#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
4.4.4.4           0   FULL/  -        00:00:32    50.0.0.4        GigabitEthernet2


Now if we check the LSA by running “show ip ospf database”, we can see the Type 1 (Router LSA) shows up

XE2

1
2
3
4
5
6
7
8
9
xe2#show ip ospf database 

            OSPF Router with ID (2.2.2.2) (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         48          0x80000015 0x007378 4         
4.4.4.4         4.4.4.4         1035        0x80000008 0x008CFD 2  

XE4

1
2
3
4
5
6
7
8
9
10
11
xe4#show ip ospf database 

            OSPF Router with ID (4.4.4.5) (Process ID 2)

            OSPF Router with ID (4.4.4.4) (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         62          0x80000015 0x007378 4         
4.4.4.4         4.4.4.4         1047        0x80000008 0x008CFD 2  


x

Now do the same for the routers on Area 1 and Area 2 so we have 3 LSA Type 1 circulating on its own area

Area 1

XE 1

1
2
3
4
interface GigabitEthernet2
 ip address 51.0.1.1 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 1

XE 6

1
2
3
4
interface GigabitEthernet3
 ip address 51.0.1.6 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 1

Area 2

XE 3

1
2
3
4
interface GigabitEthernet2
 ip address 52.0.0.3 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 2

XE 5

1
2
3
4
interface GigabitEthernet3
 ip address 52.0.0.5 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 2



Type 2

Type 2 LSA (Network LSA) describes a connection to a neighbor with broadcast or multi-access OSPF network segment

x

In this topology, if we add a broadcast network on XE6 in the same area, all the routers in the area 1 should get a Type 2 LSA messages from the DR (Designated Router) of the broadcast network


XE 6

1
2
router ospf 1
 network 30.0.0.0 0.0.0.255 area 1

XE 8

1
2
3
router ospf 1
 network 30.0.0.0 0.0.0.255 area 1
 network 110.0.0.0 0.0.0.255 area 1

XE 9

1
2
3
router ospf 1
 network 30.0.0.0 0.0.0.255 area 1
 network 111.0.0.0 0.0.0.255 area 1


Now if we check the LSA on the routers in Area 1, we should see the LSA Type 2 coming from XE9, the elected DR with the highest loopback IP number

XE 6

1
2
3
4
5
6
7
8
xe6#show ip ospf database 

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

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
30.0.0.9        9.9.9.9         620         0x8000000B 0x00156F

XE 1

1
2
3
4
5
6
7
8
xe1#sh ip ospf database 

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

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
30.0.0.9        9.9.9.9         733         0x8000000B 0x00156F



Type 3

Type 3 (Summary LSA) is generated by Area Border Routers (ABRs) to advertise summarized routes between OSPF areas.
Type 3 LSA will distribute the LSA Type 1 and Type 2 to the other Area, packaging it as a Type 3 LSA.

x

ABRs are router that connects different OSPF areas, which in this topology will be XE4 and XE5


Once we configure XE4 and XE5 as ABR, it will start generating Type 3 LSA Messages to all routers in the deployment.

XE 4

1
2
3
4
interface GigabitEthernet2
 ip address 51.0.0.4 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 1

XE 5

1
2
3
4
interface GigabitEthernet2
 ip address 50.0.1.5 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0


We also need to configure the remaining OSPF point-to-point connecton on XE1 and XE2

XE 1

1
2
3
4
interface GigabitEthernet3
 ip address 51.0.0.1 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 1

XE 2

1
2
3
4
interface GigabitEthernet3
 ip address 50.0.1.2 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0


This is how our OSPF topology so far looks like

x


And if we try checking the LSA on one of the routers, for example the XE3 on Area 2, we should see the Type 3 LSA

1
2
3
4
5
6
7
8
9
10
11
12
13
14
xe3#show ip ospf database 

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

                Summary Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
30.0.0.0        5.5.5.5         430         0x80000002 0x009B69
50.0.0.0        5.5.5.5         430         0x80000002 0x00787B
50.0.1.0        5.5.5.5         1182        0x80000007 0x005995
51.0.0.0        5.5.5.5         430         0x80000002 0x00757C
51.0.1.0        5.5.5.5         430         0x80000002 0x00747B
110.0.0.0       5.5.5.5         430         0x80000002 0x009122
111.0.0.0       5.5.5.5         430         0x80000002 0x00842E

As we can see, all the Type 1 and Type 2 LSAs from Area 0 and 1 are present here as a Type 3 LSA on Area 2



Type 4 & Type 5

Type 5 (External LSA) advertises redistributed routes into OSPF from external routing domains, and Type 4 (ASBR Summary LSA) advertises information about Autonomous System Boundary Routers (ASBRs) to the rest of the OSPF domain.
Basically Type 5 LSA distributes the external routes into OSPF and Type 4 LSA tells the routers within OSPF how to get to the ASBR, to ultimately get to the external routes.


x

Here let’s create the external connection on XE7 with BGP.
The connection will be made to the ASBR, which will be the XE6.

XE7

1
2
3
router bgp 1
 network 40.0.1.0 mask 255.255.255.0
 neighbor 40.0.0.6 remote-as 1

XE6

1
2
router bgp 1
 neighbor 40.0.0.7 remote-as 1


Then on XE6, we’ll do a route redistribution between BGP and OSPF

1
2
3
4
5
6
router ospf 1
 redistribute bgp 1

router bgp 1
 redistribute ospf 1
 bgp redistribute-internal


Now if we check on any of the routers, here we’ll again use the router on the far end other side, XE3, we should see LSA Type 4 and Type 5 being shown

1
2
3
4
5
6
7
8
9
10
11
12
13
xe3#show ip ospf database 

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

                Summary ASB Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
6.6.6.6         5.5.5.5         239         0x80000003 0x00F316

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
40.0.1.0        6.6.6.6         44          0x80000008 0x006DCE 0 



All LSA Types

Here again is the final topology of this lab

x


And here is all the LSA messages circulating on this deployment

x


On the routers, this is how the full LSAs look like

XE1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
xe1#show ip ospf database 

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

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         1618        0x80000014 0x000DE1 4         
4.4.4.4         4.4.4.4         1236        0x8000000F 0x007A0B 2         
6.6.6.6         6.6.6.6         152         0x80000028 0x007949 4         
8.8.8.8         8.8.8.8         363         0x80000019 0x0068A5 2         
9.9.9.9         9.9.9.9         363         0x8000001A 0x003BC7 2         

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
30.0.0.9        9.9.9.9         372         0x8000000E 0x000F72

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
50.0.0.0        4.4.4.4         1236        0x80000008 0x008072
50.0.1.0        4.4.4.4         230         0x80000003 0x00896C
52.0.0.0        4.4.4.4         230         0x80000003 0x00846F

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
40.0.1.0        6.6.6.6         187         0x80000008 0x006DCE 0  

XE3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
xe3#show ip ospf database 

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

                Router Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum Link count
3.3.3.3         3.3.3.3         1634        0x8000000B 0x00641D 2         
5.5.5.5         5.5.5.5         1551        0x8000000A 0x00A8CE 2         

                Summary Net Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
30.0.0.0        5.5.5.5         779         0x80000001 0x009D68
40.0.0.0        5.5.5.5         601         0x80000001 0x001BE0
50.0.0.0        5.5.5.5         795         0x80000003 0x00767C
50.0.1.0        5.5.5.5         1551        0x80000008 0x005796
51.0.0.0        5.5.5.5         795         0x80000003 0x00737D
51.0.1.0        5.5.5.5         795         0x80000003 0x00727C
110.0.0.0       5.5.5.5         779         0x80000001 0x009321
111.0.0.0       5.5.5.5         779         0x80000001 0x00862D

                Summary ASB Link States (Area 2)

Link ID         ADV Router      Age         Seq#       Checksum
6.6.6.6         5.5.5.5         795         0x80000003 0x00F316

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
40.0.1.0        6.6.6.6         600         0x80000008 0x006DCE 0   
This post is licensed under CC BY 4.0 by the author.