OSPF LSA Types Explained

Hi Rene,

Thanks for the explanation. Does that mean type 4 LSA will not be seen in the routing table? Or does this mean only that type 4 and type 5 are combined when you issue show ip route and the flags are O E1 or O E2?

Thanks,

image

Hi Rene,

As you can see I made a slightly different topology using a multipoint or non-broadcast network for OSPF. Please let me know if I am on the right track of understanding this :wink:

I know that type 3 is inter-area summary routes that have tag O IA when you do show IP route on r1 to see routes advertised by r5.

rtr1#sh IP route ospf | s IA     
   D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
O IA     10.1.0.2/32 [110/10] via 10.0.0.2, 00:24:51, Ethernet0/0
O IA     10.1.0.3/32 [110/10] via 10.0.0.3, 00:25:11, Ethernet0/0
O IA     10.1.0.4/32 [110/10] via 10.0.0.4, 00:25:01, Ethernet0/0
O IA     10.1.0.12/32 [110/20] via 10.0.0.4, 00:24:38, Ethernet0/0
                  [110/20] via 10.0.0.3, 00:25:11, Ethernet0/0
                  [110/20] via 10.0.0.2, 00:24:48, Ethernet0/0
  12.0.0.0/32 is subnetted, 1 subnets
O IA     12.12.12.12 [110/21] via 10.0.0.4, 00:24:38, Ethernet0/0
                 [110/21] via 10.0.0.3, 00:25:11, Ethernet0/0
                 [110/21] via 10.0.0.2, 00:24:48, Ethernet0/0

rtr1#sh ip ospf database | b Summary
            Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.1.0.2        2.2.2.2         1750        0x80000001 0x00AA7D
10.1.0.2        3.3.3.3         1693        0x80000001 0x00F029
10.1.0.2        4.4.4.4         1701        0x80000001 0x00D243
10.1.0.3        2.2.2.2         1701        0x80000001 0x000518
10.1.0.3        3.3.3.3         1745        0x80000001 0x0082A0
10.1.0.3        4.4.4.4         1721        0x80000001 0x00C84C
10.1.0.4        2.2.2.2         1701        0x80000001 0x00FA21
10.1.0.4        3.3.3.3         1723        0x80000001 0x00DC3B
10.1.0.4        4.4.4.4         1745        0x80000001 0x005AC3
10.1.0.12       2.2.2.2         1701        0x80000001 0x00AA69
10.1.0.12       3.3.3.3         1723        0x80000001 0x008C83
10.1.0.12       4.4.4.4         1690        0x80000002 0x006C9E
12.12.12.12     2.2.2.2         1701        0x80000001 0x009168
12.12.12.12     3.3.3.3         1723        0x80000001 0x007382
12.12.12.12     4.4.4.4         1691        0x80000002 0x00539D

*** I know that this prefixes/routes/network/subnets come from area 1 since I define it as suchā€¦

*** Now if I do the show ip ospf database asbr-summary on the ABR r2,r3 and r4

rtr2#sh ip ospf database asbr-summary 

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

            Summary ASB Link States (Area 0)

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

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

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

rtr3#sh ip ospf database asbr-summary 

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

            Summary ASB Link States (Area 0)

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

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

  LS age: 78
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(AS Boundary Router)
  Link State ID: 12.12.12.12 (AS Boundary Router address)
  Advertising Router: 4.4.4.4
  LS Seq Number: 80000001
  Checksum: 0x3DB4
  Length: 28
  Network Mask: /0
    MTID: 0         Metric: 10 
	
rtr4#sh ip ospf database asbr-summary 

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

            Summary ASB Link States (Area 0)

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

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

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

*** I can see it in the sh ip ospf database as well

rtr2#sh ip ospf database | b Summary ASB
            Summary ASB Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
12.12.12.12     2.2.2.2         1807        0x80000005 0x007184
12.12.12.12     3.3.3.3         1808        0x80000005 0x00539E
12.12.12.12     4.4.4.4         56          0x80000006 0x0033B9

rtr3#sh ip ospf database | b Summary ASB
            Summary ASB Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
12.12.12.12     2.2.2.2         1860        0x80000005 0x007184
12.12.12.12     3.3.3.3         1859        0x80000005 0x00539E
12.12.12.12     4.4.4.4         108         0x80000006 0x0033B9

rtr4#sh ip ospf database | b Summary ASB
            Summary ASB Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
12.12.12.12     2.2.2.2         1403        0x80000005 0x007184
12.12.12.12     3.3.3.3         1404        0x80000005 0x00539E
12.12.12.12     4.4.4.4         1664        0x80000005 0x0035B8

Am I right in my analysis?

Thanks so much,

Hi Network lessons team,

Thanks for your topic, it helped me making sense about LSA operation. But acctually Iā€™m having a little bits confuse about LSA Type 4 and LSA Type 5.
In my point, I thought LSA Type 4 just only notice the router in difference area about ASBR router. But why it needs to know ASBR position? Because when ABR advertise LSA Type 5, itā€™s already having a Advertising Router information (itā€™s the ASBR IP), and router in other area can base on this field to choose next-hop.

I hope that you can make sense to me. Thank you so much!

Thinh Cao Minh
thinhbk90@gmail.com

Hello Thinh

LSA type 4 is generated by an ABR not the ASBR. Using the topology in the lesson, it is R2 that generates the LSA type 4.
image
By sending an LSA type 4, R2 essentially informs all OTHER areas that the ASBR can be reached via itself.

LSA Type 5 on the other hand is generated by the ABSR not the ABR. This essentially contains information about the destination networks that are redistributed into the OSPF domain.

So, Type 5 contains the destination networks while type 4 contains the information of how to find the ASBR (via R1). Now why do we need both? Why isnā€™t all the information contained within one of these rather than both? Well, Type 5 external LSAs are flooded to all areas and the detailed next-hop information may not be available in all those those areas so the type 4 LSA is also necessary for complete information.

I hope this has been helpful!

Laz

2 Likes

Hi Rene,
Very Informative lesson :slight_smile:

I have a question "I just want to advertise a prefix , there is no neighboring building issue with other Router " So what will be recommended command Network or redistribution ??

br//zaman

Hello Zaman

It all depends on the nature of your topology. If you have one OSPF area for your whole network and you are not using another routing protocol in another autonomous system, then the network command is sufficient to advertise the prefix in question.

If your network has several OSPF areas or borders an autonomous system that is running another routing protocol, then in order to learn those routes within the OSPF area, redistribution is the way to do it.

I hope this has been helpful!

Laz

A post was merged into an existing topic: Troubleshooting OSPF Neighbor Adjacency

Rene, please help me understand this better. With regards to LSA type 1, the lesson says in this LSA youā€™ll find all directly connected links of this router. But the output of sh ip ospf database command, the Router Link Status, only shows the link ID of the routers in the area. The way it was worded made me think it would show the IP addresses of all the links in the area, but the output only shows all the routers in the area.

Also, for the net link state states, the only network Iā€™m seeing in the output is the network that connects the routers (i.e, 192.168.12.2 in your example). My initial thought is that it would show all networks, but it appears as though the type 2 LSA only shows the network that connects all routers.

Is my understanding of all this correct? Thank you.

1 Like

Hello Mike

It is true that the Type 1 LSAs themselves contain information about that directly connected links of each router. Refer to the diagram in the lab.
image
The Type 1 LSA that is generated by R1 will contain the 1.1.1.0/24 subnet and the 1192.168.12.0/24 subnet.

Now, when you display the OSPF database on a router such as R1 for example, what you are seeing is not the contents of the LSAs generated by R1, but the list of routers from which R1 has received LSAs. So, in the output for the Router Link States, you should see Link ID 1.1.1.1 and 2.2.2.2 which are R1 and R2:
image
You wonā€™t see R3 because it is in a different area and Type 1 LSAs by definition are limited to the area in which they were generated.

You bring up a very good point with your question because this clarifies what you are actually seeing with the ip ospf database command. For the Type 1 LSAs, you are not even seeing the contents of the LSAs, but just their source.

Concerning your second question, remember that Type 2 LSAs are created for each multi-access network where two or more OSPF routers are connected. Interface L0 on R1 may be a multi-access network, but there are no other OSPF routers on that segment, therefore there are no DR/BDR elections, therefore it is not a multi-access network as seen by OSFP. OSPF considers a network a multi-access network when a DR/BDR has been elected. The only such network in Area 0 is the 192.168.12.0/24 subnet, and thus it is the only one that shows up under the Net Link States.

I hope this has been helpful!

Laz

1 Like

This was helpful. Thank you!

1 Like

Hi Rene,

I have a question. In the below output for LSA type 1 and type 2, can u explain how the link-id and adv router is determined. What is the diff between link-id and link state id

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

Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         30          0x80000003 0x004CD9 2
2.2.2.2         2.2.2.2         31          0x80000002 0x0048E9 1

Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.12.2    2.2.2.2         31          0x80000001 0x008F1F

Can u explain for below type-3 LSA how the link-id and adv router is determined

Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
3.3.3.3         2.2.2.2         17          0x80000001 0x00D650
192.168.23.0    2.2.2.2         66          0x80000001 0x00A70C

Hi,

What happens is that 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 all OSPF routers know where to find the ASBR.

Can you explain " flip a bit in the router LSA"

Thanks

Hello sims

When sending LSAs, if the sender is an ASBR, then there is a specific bit in the LSA headers that is flipped in order to indicate that it is indeed an ASBR that is sending the LSA. Specifically, if it is 1 it is changed to 0 and if it is 0 it is changed to 1. I have been unable to find the specific field that is changed, however @ReneMolenaar may be able to more sufficiently answer your question.

I hope this has been helpful!

Laz

Hi All,

I am reading the following when talking about R1 redistributing rip routes.

ā€œWhat happens is that R1 will flip a bit in the router LSA to identify itself as an ASBRā€.

Is this bit flipped in all the router LSAs (type 1) from R1or is this bit flipped only for a specific router LSA from R1?

Hello Robert

R1 will flip a bit in the LSA Type 1 because it is an ASBR. The flipping of the bit occurs only for Type 1 LSAs.

I hope this has been helpful!

Laz

Hello Network lessons team,

thank you so much for this good explanation, can you please provide me some other topologies for practice. please

Hello Faraz

Take a look at Reneā€™s GNS3Vault page that has many lab scenarios for many networking technologies. The link below shows those for OSPF and include topologies for examining LSA types as well:

I hope this has been helpful!

Laz

R2 will translate this type 7 into a type 5 and flood it into the other areas.
is it true.

Hello Bahri

Yes this is true. R2 is an ABR and it will receive the type 7 LSA from the NSSA area and will incorporate its information into its OSPF database. It will then send out a type 5 LSA into Area 0 with the information learned from the type 7 LSA.

I hope this has been helpful!

Laz