USD ($)
$
United States Dollar
India Rupee

Explore OSPF LSA Types in the OSPF database

By Aadharsh Gupta in 14 May 2023 | 11:12 pm
Aadharsh Gupta

Aadharsh Gupta

Student
Loyal User
Forums Top User
Posts: 6
Likes: 13
Member since: 14 May 2023

Please explain how can I explore OSPF LSA Types in the OSPF database with a scenario examples.

14 May 2023 | 11:12 pm
2 Likes
Deepak Sharma

Deepak Sharma

Instructor
Loyal User
Expert Vendor
Golden Classes
King Seller
Fantastic Support
Loyal Writer
Posts: 7
Likes: 35
Followers: 147
Member since: 28 Mar 2023
Location: India/Delhi

In OSPF, there are several LSA types that are used to exchange routing information between OSPF routers. The most common OSPF LSA types are:


Type 1 - Router LSA

Type 2 - Network LSA

Type 3 - Summary LSA

Type 4 - ASBR Summary LSA

Type 5 - External LSA


Now let's take a look at most command OSPF LSA types from 1 to 5 with configuration examples and database entry for each type based on the scenario:


Type 1 - Router LSA

The Type 1 LSA is generated by every router in an OSPF area to describe its directly connected links and the state of those links. This LSA type is used to build the topology database within an area. Here is an example configuration for Router 1 in Area 0:


router ospf 1

 network 10.0.0.0 0.255.255.255 area 0

 network 192.168.1.0 0.0.0.255 area 1

 network 192.168.2.0 0.0.0.255 area 2


In this configuration, we're specifying the networks that are connected to Router 1 and assigning them to their respective OSPF areas. When Router 1 starts OSPF, it will generate a Type 1 LSA for each of its interfaces, which will be flooded throughout Area 0.


Here is an example of a Router 1 Type 1 LSA in the OSPF database for Area 0:


Link ID         ADV Router      Age  Seq#       Checksum Link count

10.0.0.1        10.0.0.1        246  0x80000003 0x00F7D5  1

10.0.0.2        10.0.0.1        248  0x80000003 0x00F7D4  1

192.168.1.1     10.0.0.1        331  0x80000003 0x00DD49  1

192.168.2.1     10.0.0.1        331  0x80000003 0x00DA51  1


In this database entry, we can see that Router 1 has four links, one of which is its loopback interface (Link ID 10.0.0.1) and the other three are its interfaces to the networks in Area 1 and Area 2.


Type 2 - Network LSA

The Type 2 LSA is generated by the Designated Router (DR) on a multi-access network to describe the set of routers that are connected to the network. Here is an example configuration for Router 2 in Area 1:


router ospf 1

 network 192.168.1.0 0.0.0.255 area 1


In this configuration, we're specifying that Router 2 is connected to the 192.168.1.0/24 network, which is part of Area 1. When Router 2 becomes the DR for this network, it will generate a Type 2 LSA to describe the set of routers that are connected to this network. Here is an example of a Type 2 LSA for the 192.168.1.0/24 network in the OSPF database for Area 1:


Link ID         ADV Router      Age  Seq#       Checksum

192.168.1.0     10.0.0.2        130  0x80000001 0x002F0F


In this database entry, we can see that the Designated Router for the 192.168.1.0/24 network is Router 2 (ADV Router 10.0.0.2). This LSA is flooded throughout Area 1 and is used by other routers in the area to determine the topology of the network.


Type 3 - Summary LSA

The Type 3 LSA is generated by an Area Border Router (ABR) to describe routes to networks outside of its own OSPF area. Here is an example configuration for Router 3, which is the ABR between Area 0 and Area 2:


router ospf 1

 network 10.0.0.0 0.255.255.255 area 0

 network 192.168.2.0 0.0.0.255 area 2

 redistribute connected subnets


In this configuration, we're specifying that Router 3 is connected to both Area 0 and Area 2, and we're also configuring it to redistribute connected subnets into OSPF. When Router 3 generates a Type 3 LSA for the 192.168.2.0/24 network, it will advertise it into Area 0 as a summary route. Here is an example of a Type 3 LSA for the 192.168.2.0/24 network in the OSPF database for Area 0:


Link ID         ADV Router      Age  Seq#       Checksum  Route

192.168.2.0     10.0.0.3        181  0x80000002 0x0024C4  192.168.2.0/24


In this database entry, we can see that the Type 3 LSA is generated by Router 3 (ADV Router 10.0.0.3) and is advertising the 192.168.2.0/24 network as a summary route. This LSA is flooded throughout Area 0 and is used by other routers in the area to reach the 192.168.2.0/24 network.


Type 4 - ASBR Summary LSA

The Type 4 LSA is generated by an ABR to describe the location of an Autonomous System Boundary Router (ASBR) that is advertising external routes into OSPF. Here is an example configuration for Router 3, which is also the ASBR in this scenario:


router ospf 1

 network 10.0.0.0 0.255.255.255 area 0

 network 192.168.2.0 0.0.0.255 area 2

 redistribute connected subnets

 redistribute static metric-type 1 subnets


In this configuration, we're specifying that Router 3 is redistributing both connected and static routes into OSPF, and we're also configuring the metric-type to be 1 for these routes. When Router 3 generates a Type 5 LSA to advertise the external routes, it will also generate a Type 4 LSA to describe its own location as an ASBR. Here is an example of a Type 4 LSA in the OSPF database for Area 0:


Link ID         ADV Router      Age  Seq#       Checksum

10.0.0.3        10.0.0.3        181  0x80000001 0x0074F6


In this database entry, we can see that the Type 4 LSA is generated by Router 3 (ADV Router 10.0.0.3) and is advertising its own router ID as the location of the ASBR. This LSA is flooded throughout Area 0 and is used by other routers in the area to determine the location of the ASBR.


Type 5 - External LSA

The Type 5 LSA is generated by an ASBR to advertise external routes into OSPF. Here is an example configuration for Router 3, which is the ASBR in this scenario:


router ospf 1

 network 10.0.0.0 0.255.255.255 area 0

 network 192.168.2.0 0.0.0.255 area 2

 redistribute connected subnets

 redistribute static metric-type 1 subnets


In this configuration, we're specifying that Router 3 is redistributing both connected and static routes into OSPF, and we're also configuring the metric-type to be 1 for these routes. When Router 3 generates a Type 5 LSA to advertise the external routes, it will also generate a Type 4 LSA to describe its own location as an ASBR. Here is an example of a Type 5 LSA in the OSPF database for Area 2:


Link ID         ADV Router      Age  Seq#       Checksum  Route

192.168.3.0      10.0.0.3        182  0x80000001 0x007728  E2 192.168.3.0/24


In this database entry, we can see that the Type 5 LSA is generated by Router 3 (ADV Router 10.0.0.3) and is advertising the external route for the 192.168.3.0/24 network. The E2 in the Route column indicates that the cost of this external route is being advertised without modification by OSPF. This LSA is flooded throughout Area 2 and is used by other routers in the area to reach the 192.168.3.0/24 network.


Overall, understanding the different OSPF LSA types and how they are generated and flooded through the network is crucial for building and maintaining an efficient and reliable OSPF topology. 


14 May 2023 | 11:38 pm
5 Likes
Aadharsh Gupta

Aadharsh Gupta

Student
Loyal User
Forums Top User
Posts: 6
Likes: 13
Member since: 14 May 2023
quote-right
Reply to Deepak Sharma

In OSPF, there are several LSA types that are used to exchange routing information between OSPF routers. The most common OSPF LSA types are:

Thanks for the explanation, what are the commands to check the OSPF database for LSA Type 1, Type 3 and Type 5

15 May 2023 | 08:26 am
3 Likes
Aadharsh Gupta

Aadharsh Gupta

Student
Loyal User
Forums Top User
Posts: 6
Likes: 13
Member since: 14 May 2023

Thanks @Robert Travis for the good explanation!! 


15 May 2023 | 05:22 pm
2 Likes
Pramila Sharma

Pramila Sharma

Student
Loyal User
Forums Top User
Posts: 3
Likes: 4
Member since: 26 Apr 2023

Can someone please make me understand OSPF LSA Type 4 ? I watched few OSPF videos and other documents but not able to understand LSA Type 4. This forum topic seems appropriate. Thanks in advance.

15 May 2023 | 08:41 pm
3 Likes
Dcancerian

Dcancerian

Student
Loyal User
Posts: 4
Likes: 10
Member since: 28 Mar 2023

Hello,


I have recently gone through this blog where OSPF LSA Type 4 is briefly explained in an easiest possible way with a short example.

https://uninets.com/blog/understanding-ospf-lsa-type-4


OR

https://uninets.online/blog/understanding-ospf-lsa-type-4


I hope this will help.


Regards,

15 May 2023 | 09:08 pm
3 Likes
Hemant Pandaya

Hemant Pandaya

Student
Loyal User
Forums Top User
Posts: 6
Likes: 4
Member since: 15 Sep 2023

Nice explanation!! but I believe more in practicals rather than only theory. Anyways it is a good read.

16 Oct 2023 | 11:21 pm
0 Likes

Report

Please describe about the report short and clearly.

Cisco SD-WAN Training – Starts Nov 23rd at 10 AM IST
Cisco SD-WAN Training – Starts Nov 23rd at 10 AM IST
Boost Your Networking Career with Expert-Led Cisco SD-WAN Training with Lab Access.
Day
Hr
Min
Sec
Register Now