OSPF LSA Types is the first topic you need to understand if you are trying to understand OSPF routing protocol. There are 11 different types of LSA in OSPF and we will look at each one of them, why do we have many different LSA in OSPF, we will discuss the topologies and the examples to make it more clear for everyone.
I strongly recommend checking the OSPF Training for those who want to learn more about this topic.
What is LSA in OSPF?
We should start asking the most fundamental question first about OSPF. What is LSA? LSA stands for Link State Advertisement and it carries, prefix information, interface cost, if advanced technologies such as Traffic Engineering are enabled, can carry link color information, used bandwidth, available bandwidth, and so on.
When a router receives an LSA, it is stored in the Link State Database (LSDB) of OSPF. Once the LSDBs between the routers are synchronized,
OSPF uses the SPF/Dijkstra algorithm to calculate the best path for each destination network. OSPF LSAs are information about a route that is transported inside OSPF Link State Update (LSU) packets.
We can only have scalable, resilient, fast-converged OSPF design when we understand OSPF LSAs and Area types and their restrictions
Figure -11 Different LSA Types is OSPF v2
OSPF LSA Type 1 - OSPF Router LSA
OSPF Type 1 LSA/Router LSA packets are sent between routers within the same OSPF area and do not leave the area.
An OSPF router uses Type 1 LSA to describe its own interfaces but also carries information about its neighbors to adjacent routers in the same area.
OSPF Type 1 LSA is created by each and every router in a given OSPF area, as we will see in the other LSA types, some of them are only created by special types of routers.
When the OSPF Prefix suppression type of feature is used, infrastructure prefixes are removed from Type 1 LSA, so OSPF scalability can be achieved.
OSPF LSA Type 2 - OSPF Network LSA
OSPF Type 2 LSA/Network LSA packets are generated by the OSPF Designated Router (DR) to describe all routers connected to its segment directly.
Type 2 LSA is flooded between neighbors in the same OSPF area and doesn't cross the area boundary.
Type 2 Network LSA is not desired if the OSPF connection is a point-to-point. Because there are only two points, no need for a DR/BDR election and also no need for extra Type 2 LSA. Type 2 LSA will be stored in OSPF LSDB and Routing table and their size will grow unnecessarily if the connection type is a point to point.
We want DR/BDR election, thus Network LSA, only if the connection model is Multi-access. This means that in the segment, many OSPF routers are attached.
Although it should be the subject of another post, let me just say here that, having DR/BDR election increases network convergence time. So, no Type 2/Network LSA unnecessarily!.
OSPF LSA Type 3 - OSPF Summary LSA
OSPF Type 3 LSA/Summary LSA packets are generated by the OSPF Area Border Routers (ABR) to summarize its directly connected OSPF area, and advertise inter-area router information to other areas to the ABR is connected.
Type 3 LSA is only seen when there is a hierarchical OSPF network design, meaning an OSPF Multi-area network design.
If there is only one OSPF area in the network, we can't have Type 3 LSA.
OSPF LSA Type 4 - OSPF ASBR Summary LSA
OSPF Type 4 LSA/ASBR Summary LSA is used to advertise the presence of an Autonomous System Border Router - ASBR in other areas.
Inside the same area that we have an ASBR, ASBR reachability is achieved with OSPF Type 1 LSA.
If there is Type 5 LSA, and if there is Hierarchical OSPF Network design, meaning OSPF Multi-area network design, then we can have OSPF Type 4 LSA. Otherwise, as it is said above, ASBR reachability is achieved via Type 1 LSA in a single area OSPF network design.
OSPF LSA Type 5 - OSPF ASBR External LSA
OSPF Type 5 LSA/ASBR External LSA in OSPF LSA Types is generated by the ASBR to advertise external redistributed prefixes into the OSPF domain.
These external routes/prefixes are redistributed into the OSPF network by the ASBR and seen as either E1 or E2 entries in the routing tables of the routers.
External LSA is domain-wide, meaning if we redistribute prefixes into OSPF, those redistributed prefixes are flooded everywhere, even if there are multiple areas in OSPF, every area receives them. Exceptions are Stub Area and its variations, such as Totally Stub Area, NSSA, and Totally NSSA Area.
OSPF LSA Type 6 - OSPF Group Membership LSA
OSPF Type 6 LSA was considered for the Multicast purpose, Multicast routing for OSPF but never implemented or deployed. Similar to the DVMRP protocol, it didn't last long and today for IP Multicast routing purpose, PIM - Protocol Independent Multicast is used. Although Type 6 LSA is not used, when we cover OSPF LSA Types, it was necessary to explain it too.
OSPF LSA Type 7 - OSPF Not So Stubby Area (NSSA) External LSA
OSPF Type 7 LSA/NSSA External LSA is seen in NSSA and Totally NSSA Areas when there is redistribution.
Normally Stub Areas don't allow redistribution, but as a Not So Stubby Area (NSSA), redistribution is allowed. But, redistributed prefixes are not seen as Type 5 LSA, they are seen as Type 7 LSA.
Type 7 LSA is translated to Type 5 LSA to be sent into the OSPF Area 0/Backbone Area.
If there are two NSSA ABRs, they negotiate with each other and the NSSA ABR with the lower Router ID does the translation.
OSPF LSA Type 8 - OSPF External Attributes LSA
Normally BGP prefixes are redistributed into OSPF or any other routing protocol, and BGP attributes are lost. But, you may need to carry BGP attributes with your Autonomous System between the Routers.
Let's say, for the given destination IP prefix, you have two exit points from your network, and for the outbound direction, you want to prefer one of those exit points as Primary. You can use this BGP Local Preference attribute.
Two Routers exchange the prefixes with each other, and when they check the BGP Local Preference attribute, which every Router has the higher Local Preference, that router is used as an exit point by both of the routers.
But BGP local preference e attributes cannot be carried in OSPF normally. Because of reachability, you need to redistribute from BGP to OSPF, and if you redistribute, attributes are lost.
Type 8 LSA in OSPF LSA Types, was considered for this purpose. BGP Attributes would be carried even if we would redistribute. But yet another LSA that we don't use in computer networking. Instead of this LSA, IBGP - Internal BGP is used in the networks. Hope Type 8 LSA as one of the OSPF LSA Types is understood better now.
OSPF LSA Type 9, 10, 11 - OSPF Link Scope Opaque LSA
Opaque LSAs LSA Type 9, 10, and 11 are used to extend the capabilities of OSPF.
With these LSA Types, OSPF carries many other protocol capabilities. For example, RSVP Traffic Engineering and Segment Routing Traffic Engineering requires topology information, used bandwidth, available bandwidth, reserved bandwidth, link coloring information, delay or other attributes, and so on.
BIER - Bit Indexed Explicit Replication, the newest and most scalable Multicast architecture information is conveyed with Opaque LSAs as well. OSPF Graceful Restart/GR and many other use cases we have with Opaque LSAs. Think of it as a helper to the basic OSPF mechanism. In addition to carrying prefixes and cost, much other information can be carried with them. Type 9 LSA is link scope, Type 19 is Area scope and Type 11 is AS scope Opaque LSAs.
What type of OSPF LSA is originated by ASBR routers to advertise external routes?
Let's review what we have learned. The answer to this question is Type 5 External LSA. ASBR advertises external routes as Type 5 LSA and this LSA is flooded in every area in the OSPF domain if they are not Stub or NSSA.
What information is contained within an OSPF type 4 LSA?
Type 4 LSA is used for ASBR reachability as t was explained earlier in the post as well. But, it is seen only if there is a multi-area OSPF network. In a single area OSPF network design, ASBR reachability is achieved with ASBR's Type 1 LSA.
OSPF LSA types are in general used for OSPF Scalability. Only with 1 LSA type, all the information could be carried. But when we have multiple areas, for hierarchy, we use different LSAs, as different LSAs have different duties. Understanding their restrictions and which one is allowed in which OSPF Area Types is very important to understand OSPF.