USD ($)
$
United States Dollar
India Rupee

OSPF LSA Types: Cisco Explained

Created by Deepak Sharma in Articles 23 May 2024
Share


In OSPF, there are multiple routers types exist and in order to support them, multiple OSPF LSA types also available. For instance a DR (Designated Router) router type should advertise all the routers attached on the link and no other router advertises this information.

Each LSA type has a code associate with it to distinguish them from each other within the OSPF Network.


OSPF LSA Types List

● Type 1 – Router LSA

● Type 2 – Network LSA

● Type 3 – Network Summary LSA

● Type 4 – ASBR Summary LSA

● Type 5 – AS External LSA

● Type 6 – Group Membership LSA

● Type 7 – NSSA External LSA

● Type 8 – External Attributes LSA

● Type 9 – Opaque LSA (Limited to link-local scope)

● Type 10 Opaque LSA (Limited to are-local scope)

● Type 11 – Opaque LSA (Limited to AS scope)


In this blog, I will explain in detail the most important LSA type with practical examples on Cisco routers. Let’s first create a simple topology to understand each LSA.

The below is the physical topology for our OSPF scenario in which there are 5 Cisco routers. R1, R2 and R3 are directly connected to a switch while R4 is connected to R1 and R5 is connected to R2.


Configure basic IP addressing on all routers and check point to point connectivity. Note, the last octet of an IP address is the router number and each router has a loopback0 IP address as y.y.y.y/32, where y is the router number.


R1:

!

interface Gi0/0

ip address 10.1.123.1 255.255.255.0

no shut

!

interface Gi0/1

ip address 10.1.14.1 255.255.255.0

no shut

!

interface Lo0

ip address 1.1.1.1 255.255.255.255

!


R2:

!

interface Gi0/0

ip address 10.1.123.2 255.255.255.0

no shut

!

interface Gi0/1

ip address 10.1.26.2 255.255.255.0

no shut

!

interface Lo0

ip address 2.2.2.2 255.255.255.255

!


R3:

!

interface Gi0/0

ip address 10.1.123.3 255.255.255.0

no shut

!

interface Lo0

ip address 3.3.3.3 255.255.255.255

!


R4:

!

interface Gi0/1

ip address 10.1.14.4 255.255.255.0

no shut

!

interface Lo0

ip address 4.4.4.4 255.255.255.255

!


R5:

!

interface Gi0/1

ip address 10.1.26.5 255.255.255.0

no shut

!

interface Lo0

ip address 5.5.5.5 255.255.255.255

!


Check point to point connectivity from R1 to R2, R3 and R4 and also from R2 to R5




Let’s now configure OSPF on R1, R2 and R3 router’s interfaces inside area 0


R1, R2 and R3:

!

router ospf 1

network 10.1.123.0 0.0.0.255

!


Verify the OSPF neighborships between R1, R2 and R3 in area 0



Now we are in a position to understand OSPF LSA types based on above configured area 0


OSPF Type 1 Router LSA

This is the first in the list of OSPF LSA types. Router LSA has code type 1. Every router in the OSPF network generates them. It is the most fundamental type of LSA which lists all links (interfaces) of a router with states and their outgoing cost of the link.

These types of LSA are flooded within the area in which they originate. In our configured scenario, if you check the output of the command “show ip ospf database router” on any router in area 0, which list all the router LSAs in the database.

If you want to check a specific router LSA, use that specific router ID with this command, for instance on R1 check router LSA of itself

Please note, since the database is same in area 0 on all routers, you will have the same output of each of the database commands to check router LSA. For example the output of the command “show ip ospf database router 1.1.1.1” on R1 or R2 or R3 will exactly be same.

Let’s pick R2 and check R1’s router LSA details (you can take any router in the area for this output).



Here it shows that OSPF is enabled only on 1 link to advertise in area 0, which has the following properties.

- Link state ID as 1.1.1.1 based on R1’s router ID

- Link or interface has an IP address of 10.1.123.1

- Link is connected to a transit network which has a designated router with IP address 10.1.123.3

- R1 can reach to this network with a metric of 1 because it is directly connected to it


Now let’s also advertise R1’s loopback0 interface in OSPF area0 and observe its router LSA in the database on R2.


R1:

!

router ospf 1

network 1.1.1.1 0.0.0.0 area 0

!


Verify on R1 that OSPF is enabled on Lo0 and Gi0/0


Now observe R1’s router LSA on any router in the area 0, let’s say R2



Here you see OSPF is enabled on 2 links to be advertised to other routers in area 0. In addition to transit network, it shows another link which has the following properties.

- Link is connected to a stub network which is nothing but loopback network (because nothing is connected to it)

- Link IP address and mask are 1.1.1.1 and 255.255.255.255 respectively

- Metric to reach to this network is 1 because it is directly connected to this router


Now understand router LSA better, let’s configure OSPF on a link connected between R1 and R3 as OSPF network type point to point.


R1:

!

interface Gi0/2

ip address 10.1.13.1 255.255.255.0

ip ospf network point-to-point

no shut

!

router ospf 1

network 10.1.13.0 0.0.0.255 area 0

!


R3:

!

interface Gi0/2

ip address 10.1.13.3 255.255.255.0

ip ospf network point-to-point

no shut

!

router ospf 1

network 10.1.13.0 0.0.0.255 area 0

!


Verify whether OSPF is enabled on R1 and R3 on the connected link between them and forming neighbor with each other.


Now again observe R1’s router LSA on any router in the area 0, let’s say on R1 (it does not matter on which router you check database within an area it will give you same output).


In this case, there are two more links shown one is for the point to point.

- Point to point link is connected to neighbor router 3.3.3.3

- Link or interface IP address is 10.1.13.1 on which neighbor is connected

- Metric is 1 to reach to this neighbor


On the other hands, other link is showing as stub network

- Stub network is the subnet between the point to point link i.e. 10.1.13.0 with mask 255.255.255.0

- Metric to reach to this network is 1 as it is again directly connected to the router


Here is the pictorial representation of R1 and its associated OSPF enabled links, router floods this information to all routers in the area as lsa type 1.



OSPF Type 2 Network LSA

It is one of the OSPF LSA Types in a broadcast multi access network, only DR (Designated Router) generates OSPF network LSA. In this type of network, DR acts like a network while all other attached routers acts like pseudonode ( or virtual router). The network LSA prepares a list of all attached router including DR and flood it within the originating area. 

In our scenario, we have R1, R2 and R3 in a network segment and are in area 0. On any of the router (let's say R1), we can use command "show ip ospf database network" to observe network LSA. 


Since in a multi access network segment, a DR creates network LSA that means, there is only one DR in the area 0 because there is only one output. The advertising router is 2.2.2.2 which is the DR and its link IP address is 10.1.123.2 on the segment on which this router is the DR.

This command also shows that it has a list of all the attached routers like 1.1.1.1, 2.2.2.2 and 3.3.3.3 for R1, R2 and R3. Note that it also include itself in the list. 

Let's configure a link  between R2 and R3 in OSPF area 0 in a broadcast domain (default) so that we can have another DR elected on that link.


R2:

!

interface Gi0/3

ip address 10.1.23.2 255.255.255.0

no shut

!

router ospf 1

 network 10.1.23.0 0.0.0.255 area 0


R3:

!

interface Gi0/3

ip address 10.1.23.3 255.255.255.0

no shut

!

router ospf 1

 network 10.1.23.0 0.0.0.255 area 0

!

Verify the OSPF neighborship between R2 and R3 on the link connected between them


Now again observe OSPF network LSA on R1 for expected result


Here you can see that there are two entries for each DR present in area 0. One DR is on the network 10.1.123.0 (network segment between R1, R2 and R3) and another DR is on the network 10.1.23.0 (network segment between R2 nd R3). You can check the advertising router ID for identifying DRs

1. DR's Advertising router ID 2.2.2.2 with IP address is 10.1.23.2, it is two attached routers 2.2.2.2 (itself) and 3.3.3.3

2. DR's Advertising router ID 1.1.1.1 with IP address 10.1.123.1, it has three attached routers 1.1.1.1 (itself), 2.2.2.2 and 3.3.3.3

If you want to see the details of any specific DR use the command "show ip ospf database network adv-router 1.1.1.1", this command will through an output only when the router ID is a DR. You can check this output on any router in the area because database is same in all routers.

Let's check the DR 1.1.1.1 details on R3


 This command will have no output if we replace 1.1.1.1 (DR) with 3.3.3.3 (non DR), because OSPF network LSA is generated by only DR.


You can also use command "show ip ospf database network self-originate" on the DR only, if you run this command on any non DR router then it will not show you any output. 

Let's run above command on R1 as it is the DR, it will show the expected output.



OSPF Type 3 Network Summary LSA

This is one of the most important OSPF LSA types in which an Area Border Routers (ABRs) generates Network Summary LSAs from an OSPF area and advertise them to another connected area. It means that through these type of LSAs, an ABR tells internal routers of an attached area about the destination networks this ABR can reach.

Using Network Summary LSAs, an ABR also advertises the network destinations in all the connected areas to the backbone area. These LSAs also advertises the default routes which are outside to the area but within the OSPF autonomous system (AS).

Just to understand the network summary LSA better, Let's configure OSPF area 1 on the link between R1 and R4, 


R1:

!

interface Gi0/1

ip address 10.1.14.1 255.255.255.0

no shut

!

router ospf 1

 network 10.1.14.0 0.0.0.255 area 1

!


 R4:

!

interface Gi0/1

ip address 10.1.14.4 255.255.255.0

no shut

!

router ospf 1

 network 10.1.14.0 0.0.0.255 area 1

!


verify the OSPF neighborship between R1 and R4


 Now you can observer OSPF network summary LSA using command "show ip ospf database summary" on router R4 wherein R1 is the ABR because it is connecting area 0 and area 1. 


As you can see in the above output, there are 4 network summary LSA advertised by router 1.1.1.1 which is nothing but ABR. The ABR router R1 generates network LSAs of other areas (in this case area 0) based on the network destination it knows about with metric value to reach them. The ABR router R1 knows the following networks in area 0.

1. 1.1.1.1 ( R1's loopback) with metric 1 because it is directly connected network

2. 10.1.13.0 (link between R1 and R3) with metric 1, it is also directly connected

3. 10.1.123.0 (link between R1, R2 and R3) with metric 1, it is also directly connected

4. 10.1.23.0 (link between R2 and R3) with metric 2 to reach to this network

If you want to see the details of any specific network summary LSA (say 10.1.23.0) using command "show ip ospf database summary 10.1.23.0" on R4

Similarly R1 is also an ABR for area 0, so it prepared the network summary LSA from area 1 and advertise them to area 0. Let's check this behavior by observing network summary LSA on a router (say R3) in area 0.

 

As you can see here, router 1.1.1.1 is the advertising router which is an ABR and it is advertising summary LSA for network 10.1.14.0 (link between R1 and R4) in area 1.

Just to elaborate more on network summary LSA with two ABRs in the network, let's configure area 2 on links between R2 and R5, in this case R2 will be the ABR connecting area 0 and area 2.


R2 and R5:

!

router ospf 1

 network 10.1.26.0 0.0.0.255 area 2

!


Now observe summary LSA on R5, these summary LSA are generated by ABR R2 and there are total 5 LSA it is advertising in this area 2. Below is the output of the command "show ip ospf database summary", this output snipped from the bottom for brevity.  


Let's analyze any specific summary LSA from area 1 (say 10.1.14.0) that is received on R5


Here you can see that, the advertised router is R2 1.1.1.1 which is an ABR for area 2 and advertising summary LSA 10.1.14.0 with a metric value of 2.


Why Metric Value is 2?

R2 (ABR) can reach to R1 (other ARB) with a metric of 1 and R1 can reach to network 10.1.14.0 with metric 1 (because it is directly connected to it). That's why ABR R2 is adverting metric 2 for this LSA in to area 2.


I will complete the rest of the OSPF LSA types by next week.


Deepak Sharma

He is a senior solution network architect and currently working with one of the largest financial company. He has an impressive academic and training background. He has completed his B.Tech and MBA, which makes him both technically and managerial proficient. He has also completed more than 450 online and offline training courses, both in India and ...

More... | Author`s Bog | Book a Meeting

Comments (0)

Deepak Sharma

Deepak Sharma

Senior Instructor (Part Time) at UniNets Instructor role
★★★★★ 4.95
Faithful User
Expert Vendor
Golden Classes
King Seller
Fantastic Support
Loyal Writer

Upcoming batches

+91 84484 40748

Enquire Now

Share to your friends

Share

Share this post with others

Contact learning advisor

New Cisco ACI Training Live Batch Starts June 15th!
New Cisco ACI Training Live Batch Starts June 15th!
Advance your career? Don't miss out on our Cisco Application Centric Infrastructure (ACI) training ...
Enroll Now