USD ($)
$
United States Dollar
India Rupee

OSPF LSA Types Explained

Created by Deepak Sharma in Articles 26 Nov 2024
Share
«What is OSPF and How it Works?

Open Shortest Path First (OSPF) uses Link-State Advertisements (LSAs) to share routing information among routers. Each LSA type has a code associated with it to distinguish them from each other within the OSPF Network.

These LSAs are crucial for building and maintaining the link-state database (LSDB) that OSPF uses to calculate the best paths through the network.

In this article, we will understand the 11 OSPF LSA Types, and also check their working using practical lab tasks.

OSPF LSA Types

● 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)

Understanding OSPF LSA Types with Practical

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.

banner image

Configure basic IP addressing on all routers and check point-to-point connectivity. Note, that 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

banner image

banner image

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

banner image

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

banner image

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

OSPF LSA 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, it lists 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 the router LSA itself

Please note, that since the database is the 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).

banner image

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

banner image

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

banner image

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.

banner image

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.

banner image

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).

banner image

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.

banner image


OSPF LSA 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 act like pseudonode ( or virtual router).

The network LSA prepares a list of all attached routers including DR and floods 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. 

banner image

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.

banner image

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

banner image

Now again observe OSPF network LSA on R1 for expected result

banner image

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

banner image

 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.

banner image

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.

banner image

OSPF LSA Type 3: Network Summary LSA

This is one of the most important OSPF LSA types in which Area Border Routers (ABRs) generate Network Summary LSAs from an OSPF area and advertise them to another connected area. It means that through these types 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 advertise 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, 

banner image

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

banner image

 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. 

banner image

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

banner image

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.

 banner image

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.  

banner image

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

banner image

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.



Understanding OSPF LSA Type 4»
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

Related Articles

#Explore latest news and articles

OSPF States in Networking Explained 26 Nov 2024

OSPF States in Networking Explained

Do you know? OSPF states like neighbor & interface including exstart on cisco routers. Understand each adjacency phase in OSPF protocol. Read More!
OSPF ABR vs ASBR: Differences Insight 26 Oct 2024

OSPF ABR vs ASBR: Differences Insight

Explore the distinctions between ABR and ASBR in OSPF. Delve into OSPF ABR configuration details to understand their roles and functionalities.

Comments (0)

Share

Share this post with others

Contact learning advisor

Captcha image