OSPF LSA Types Explained

Hello Prashant

Such a configuration works just fine. If you have two ABRs that connect two areas, say area 0 and area 10 together, then you will have two Type 3 Summary LSAs injected area 0. Both will inform routers in area 0 about routes that exist in area 10. Now if you want OSPF to prefer one ABR to the other, you can play around with OSPF costs to ensure that routing will prefer one ABR over another. More info about OSPF cost can be found at this lesson:

I hope this has been helpful!

Laz

Hello ,

I was going through ospf ,in this we have missed bits type & also after applying i cannot see OSPF database inspite of this you have only mentioned the show ip ospf routes ,so its hard to compare what lsa will be there when change in stub areas,
Please do reply me on anurag1991gautam@gmail.com

Hello Anurag

Thanks for your post!

When you say “bits type” are you referring to the OSPF options field that is found in hello packets, database description packets, and LSAs, correct? You can find out more about this particular feature in the following subsection of the related RFC 2328:

https://www.rfc-editor.org/rfc/rfc2328#appendix-A.2

The OSPF database can be viewed by using the command show ip ospf database. More information about this can be found at the following lesson:

I’m not sure if I answered your questions, but if you have any further questions feel free to ask them here.

I hope this has been helpful!

Laz

Perfect content, Thank you very much.

One question if you may, after reading some article, it seems to me that LSA 2 network type is kind of redundant, isn’t LSA 1 sufficient for routers to draw the whole picture of the network? why do we need LSA 2?

Thank you for the amazing content.

Hello Oussama

Indeed Type 1 LSAs would sufficiently inform OSPF routers of a full topology. However, Type 2 LSAs are used specifically by DRs. Remember that when you have a multiaccess topology (i.e. Ethernet) with three or more OSPF routers on the same subnet, elections take place to determine which routers on the network segment become the DR and BDR. This distinction requires that the LSAs sent by non-DRs (Type 1) and those sent by DRs (Type 2) differ. And they must differ because a Type 2 LSA contains information about all of the routers found on a particular network segment.

Theoretically, if we did away with DRs and BDRs, then we wouldn’t need Type 2 LSAs. But because we need them to make OSPF more efficient in especially larger topologies, we use the TYpe 2 LSA.

I hope this has been helpful!

Laz

In link type , there is link connected to stub network also there ?

Hello Sims

Hmm, I’m not quite sure what you’re asking, but I’ll do my best to share with you how LSAs work when you have a stub network.

In OSPF, a stub network is defined as a network with only a single connection to other networks. It means that the network only has one way in and one way out.

When Type 1 LSAs are stored within an OSPF router, they contain information about the connection to each of their OSPF neighbors. Within this information is found the type of link, and one of those types of links is the stub type. You can see that in the first table of the lesson.

If we take a look at a Wireshark capture of an OSPF update, we can see this information clearly. The following shows packet number 12 of this particular capture:

Notice that this OSPF update contains many different LSA types, one of which is an LSA Type 1. This type is expanded, and we can see the type of link that this particular LSA indicates, which is a stub. (See highlighted indicators). Does that make sense?

I hope this has been helpful!

Laz

Hi @ReneMolenaar

In the “OSPF LSA Types Explained” chapter, you use a topology to verify and show the different types of LSA.

I have a few questions.

  1. You use fast ethernet links. So that means the Network type is broadcast multi-access network. So there is a DR and BDR election. Based on the master/slave election:
    a. R2 is the DR for Area0 and R1 is the BDR for Area0.
    b. R3 is the DR for Area1 and R2 is the BDR for Area1.
    I am considering the loopback IP addresses on each router.

Is this correct?

  1. Now if my understanding is correct:
    a. All LSAs (Type-1 to Type-7 excluding Type-6) are sent to DR/BDR which is 224.0.0.6.
    b. All LSAs that are received by DR/BDR are relayed to all SPF routers using the multicast address, 224.0.0.5.
    Is my understanding correct?

  2. Based on your explanation, I have a few. questions regarding the LSDB. I copied the topology you’ve used to explain Type-4 and Type-5 LSAs.

on R3:
The Type-2 Network LSAs for Area-1 as denoted by Summary Net Link States (Area 1)

  1. . Why do we see 1.1.1.1 and 192.168.12.0 in R3’s LSDB?
    1.1.1.1 is the router-id for R1 and 192.168.12.0 is the network in Area0.
    R3 is in Area1. Network LSAs stay within the area based on your notes. But Area0 network LSA is seen in Area1. Also the Adv Router is 2.2.2.2 which is R2. R2 is part of Area0 and Area1.
    Please explain.

  2. Also while explaining Type-5 and Type-7 LSAs, you are "redistributing" directly connected routes on R1 and R3.
    a. We need Type-5 and Type-7 ONLY when there are new routes being injected into OSPF routers by the ASBR. Is this correct?
    b. I also understand the Default routes will also have a Type-5 External LSA. So when ASBR is injecting routes via redistribution on to OSPF routers and if the redistributed routes have a default route, then it is marked as Type-5 LSA. Is my understanding correct?

  3. Generic ASBR Questions:
    a. An ASBR is a OSPF router attached to routers running any IGP protocol. Is this correct?
    b. A router that is not attached to other router but still injects it’s static and default routes via redistribution into OSPF is also called as an ASBR router. Is this correct?

  4. Summary:
    a. Router LSAs: Generated by all routers within an area. Sent to all other routers.
    b. For all LSAs, Destination IP address for multi-access network is 224.0.0.6. Then DR replays this to all routers via 224.0.0.5. Is this correct?
    c. For all LSAs, Destination Address for point-to-point links is 224.0.0.5. Is this correct?
    d. Summary LSA (type-3)and ASBR summary LSAs (type-4) are generated by ABR. Is this correct?
    e. External LSA is generated by ASBR and propagated to other areas including area0 by ABR. Other area routers need Type-4 and Type-5 LSAs for reaching external LSA networks. Is this correct?
    f. Type-7 (External LSA for NSSA): ABR converts Type-7 to Type-5 LSA to propagate them to other area routers. ABR has both Type-7 and Type-5 in it’s LSDB. However other routers have only Type-5 LSAs in their LSDB. Is this correct?

I am trying to connect the dots and the gaps from what I’ve studied so far. I apologise for the lengthy/redundant questions.

Hello Adhithya

I’ll do my best to address all of your questions.

Some clarification on operations and terminology are needed here. First of all, the master/slave election is a different process than the DR/BDR election. Secondly, a DR/BDR election does not take place on a per Area basis, but on a per multiaccess segment basis. In other words, on a per broadcast domain basis. In this example there is only one multiaccess segment in each area, but if there were more, you would have multiple DR/BDR elections within an area. The rest of your explanation is correct.

Actually, only Type 1 LSAs are sent to the DR and BDR when they exist on a multi-access network. Type 2 are actually generated by a DR itself, and types 3, 4, 5, and 7 are flooded throughout an area to all OSPF routers. All of the above LSAs use the All OSPF Routers multicast address of 224.0.0.5, while only the Type 1 LSAs that are targeted for the DR and BDR use 224.0.0.6.

Those networks are under the “Summary Net Link States” section of the database. That section refers to Type 3 LSAs, so it is correct. These are type 3 LSAs that have entered Area 1, and that’s why it says “Area 1”. They are advertised by 2.2.2.2 which is R2, which is an ABR, and only ABRs generate Type 3 LSAs. Does that make sense?

In that example, the 11.11.11.0/24 network is being advertised. This network, as seen in the diagram, is OUTSIDE of the OSPF domain. That makes R1 an ASBR, so it generates a type 7 LSA.

Yes that is correct.

What makes an ASBR an ASBR is if it has at least one interface connected to a network that is not participating in OSPF. That network may or may not connect to other routers outside of the OSPF domain.

I hope this has been helpful!

Laz

1 Like

ospftypes
the practice exam question on this topic has the following answers:
R1 > R2 - type 1 + 5 LSA
R2 > R3 - type 4 + 5 LSA
R3 > R4 - type 4 + 5 LSA

I understand the type 4 + 5 for each OSPF ‘type’.
But does every router not use a type 1 within its’s area? So every router, within area 0, 2, 51 should all use type 1’s as part of the OSPF process? I am specifically focused on the type 1 here and cannot see why a type 1 is used R1 > R2 only, even with the ‘flipping of the bit’?

Hello Harry

Yes, every router will use Type 1 LSAs within its own area to share routes with its neighbors. However, the specific diagram shows an LSA that is generated by R1 which is an ASBR, and is propagated throughout the rest of the OSPF topology. So that LSA you see being sent from R2 to R3 is the same LSA that has been relayed from R1. And when it reaches R3, it is propagated into Area 51. So the arrows you see indicate the propagation of the same LSA that was originated by R1 and sent throughout the OSPF topology.

When this happens, R1 as an ASBR can send both Type 1 and Type 5 LSAs to R2. When R2 receives that LSA, it will relay it only as a Type 4 and/or Type 5. Similarly, when R3 receives it, it will relay it only as a Type 4 and/or Type 5.

So the question pertains to the original LSA that was generated by R1 and propagated throughout the topology, not LSAs that were generated by R2 and R3. Does that make sense?

I hope this has been helpful!

Laz

Hi Lazarus,

Appreciate the detail in the response and this clarifies the question for me!

Thanks
Harry

1 Like
R1#show ip ospf database
Link ID         ADV Router      Age         Seq#       Checksum Link count
10.0.13.1       10.0.13.1       1865        0x80000007 0x002244 3
R1#show ip ospf database router 10.0.13.1

   Link connected to: a Transit Network
     (Link ID) Designated Router address: 10.0.13.3
     (Link Data) Router Interface address: 10.0.13.1
      Number of MTID metrics: 0
       TOS 0 Metrics: 1

I am a little confused with this Link ID for type 1 LSA, when I type show ip ospf database LInk ID for that LSA T1 is 10.0.13.1 , but when I am looking into: show ip ospf database router 10.0.13.1 for that IP it shows me the DR link ID : (Link ID) Designated Router address: 10.0.13.3, shouldn’t be the same?
I feel like there is something that I don’t get, can you help me? Thanks.

Hello Fleancu

In OSPF, the Link ID for Type 1 LSAs (also known as Router LSAs) is the Router ID of the router that generated the LSA. In your case, it is 10.0.13.1.

When you issue the command show ip ospf database router 10.0.13.1, you are seeing the detailed information about the Type 1 LSAs generated by router 10.0.13.1.

The Link connected to: a Transit Network part tells you that this router has a link to a network where there is more than one router, and OSPF has elected a Designated Router (DR). The Link ID here represents the Router ID of the DR on that network, which is 10.0.13.3 in your case. This does not have to be the same as the Router ID of the router that generated the LSA.

So, in short, there is no need for the Router ID (Link ID in the first command) and the Designated Router’s ID (Link ID in the second command) to be the same. Even though they have the same name, they represent different things within the framework of each command.

I hope this has been helpful!

Laz

1 Like

Type 7 – External LSA: also known as not-so-stubby-area (NSSA) LSA: As you can see area 2 is a NSSA (not-so-stubby-area) which doesn’t allow external LSAs (type 5). To overcome this issue we are generating type 7 LSAs instead.

What is the reason LSA5 is not allowed in NSSA ? please explain it by example.

Hello Alpesh

To help understand the nature of NSSAs, I suggest you take a look at a series of lessons about stub areas. First of all, take a look at this Introduction to OSPF stub areas lesson. In it you will see this diagram that shows the different types of stub areas:

You will see that the NSSA allows ASBRs but not Type 5 LSAs. Indeed no stub area allows type 5 LSAs!! You can also look at this lesson about the NSSA areas.

The purpose of not allowing type 5 LSAs is to reduce the size of the routing table within these stub networks. This essentially means that any specific prefixes learned from outside of the area are not allowed within the area, and thus cannot be injected into the local routing table. If you have an ASBR however, you still want the information about networks outside of the area that is provided by the ASBR to enter, so that’s why we have the type 7 LSAs. Does that make sense?

I hope this has been helpful!

Laz

Hello Rene, it supposed to be the ABR router that generates the Type-4 LSA based on the received Type-2 LSA where a bit has been fliped to locate the ASBR, right ?

Hello Sathish

Indeed, in Rene’s examples in his post, the ASBR (R3) sends a type 1 LSA within area 1 and it sets the ASBR bit which is essentially a flag within the Type 1 LSA indicating that it is an ASBR. R2, which is the ABR receives this and generates the TYpe 4 Summary ASBR LSA. This is depicted in the following diagram from the lesson as well:

I hope this has been helpful!

Laz

1 Like