OSPF is a link-state routing protocol which is used to find the best path between the source and the destination. The SPF algorithm is used to determine the best path. OSPF enabled routers exchange LSAs to update and maintain LSDBs. LSAs act as database records and provide specific OSPF network details. Currently, 11 different types of LSAs are described in RFCs for OSPF. The first five LSA types are important for the implementation of multiarea OSPF.
- LSA Type 1: Router LSA
- LSA Type 2: Network LSA
- LSA Type 3: Summary LSA
- LSA Type 4: ASBR Summary LSA
- LSA Type 5: ASBR External LSA
- LSA Type 6: Group Membership LSA
- LSA Type 7: Not So Stubby Area (NSSA) External LSA
- LSA Type 8: External Attributes LSA (OSPFv2) / Link-Local LSA (OSPFv3)
- LSA Type 9: Link Scope Opaque (OSPFv2) / Intra Area Prefix LSA (OSPFv3)
- LSA Type 10: Area Scope Opaque LSA
- LSA Type 11: AS (Autonomous System) Scope Opaque LSA
OSPF LSA Type 1
LSA Type 1 is generated by every router for each link that belongs to an area. They are flooded only within an area to which they belong. Link ID of this LSA is the Router ID of the router that generated it. In the type 1 LSA routers advertise their directly connected OSPF-enabled links and forward their network information to OSPF neighbours. The LSA contains the information of directly connected interfaces, link types, and link states.
ABRs subsequently advertise the networks learned from the type 1 LSAs to other areas as type 3 LSAs. The type 1 LSA link ID is identified by the Router ID of the originating router. The figure 1 below illustrates the OSPF LSA Type 1. Bothe Routers are the member of Area-x and x is an OSPF area. The LSAs are exchange within the area.
OSPF LSA Type 2
The designated routers sent type-2 LSAs to all other routers present in the same area (multiaccess and non-broadcast multiaccess (NBMA). The type-2 LSAs contain the DR and BDR IP information and also the state of other routers that are part of the same network.
Both LSA types 1 and type 2 be present in all areas and are never flooded outside of the area. The link-state ID for a network LSA is the IP interface address of the DR that advertises it.
OSPF LSA Type 3
Area Border Routers (ABRs) used type 3 LSAs to advertise networks from other areas. ABRs collect type 1 LSAs in the LSDB. When OSPF area becomes converged, the ABR routers create a type 3 LSA for each of its learned OSPF networks and inject the LSA to the backbone area. Therefore, an ABR with many OSPF routes must create type 3 LSAs for each network.
The LSA includes the IP information and Router I’d of ABR that is advertising these LSA. It advertised networks from an area to the rest of the areas in AS. Type 3 LSA is flooded to multiple areas throughout the network and increase OSPF scalability with use of summary prefixes.
Figure 3 illustrates the LSA Type 3, ABR-1 receives LSA type 1 from Area 10 and creates a Type 3 Summary LSA, then floods it into Area 0. Similarly, ABR-2 (between Area 0 and Area 20) creates a Type 3 Summary LSA and floods it into Area 20. When
R4 receives type 3 LSA, it does not cause a router to run the SPF algorithm, the type 3 Summary LSAs appear as OIA entry in the routing table of R4.
In a large OSPF deployment with lots of networks, propagating type 3 LSAs can cause major flooding problems. So manual route summarization is best practice and recommended on the ABRs.
OSPF LSA Type 4
Type 4 LSAs (Summary ASBR LSA) are similar to type 3 LSAs except the type 4 LSAs are generated from the autonomous system border router (ASBR) instead of Area Border Router (ABRs). Type 4 and type 5 LSAs are used jointly to recognize an ASBR and advertise external networks into an OSPF routing domain.
An ABR generates type 4 summary LSA when an ASBR exists within an area. A type 4 LSA identifies the ASBR and provides a route to it. All traffic destined to an ASBR requires routing table information of the ASBR that originated the external routes.
Figure 4 illustrates the type 4 LSAs. The ABR (R2) receives the type 1 LSA from R1 and then creates LSA type 4 (Summary ASBR LSA). As shown in the figure, the R1 identifying itself as an ASBR. The LSA includes a special bit known as the external bit or “e” bit. The “e” bit identifies the router as an ASBR. The ABR notices the e bit in the LSA and builds a type 4 LSA, and then floods the type 4 LSA to the backbone (area 0). The link-state ID is set to the ASBR router ID.
OSPF LSA Type 5
Autonomous system external LSAs are generated by ASBRs and contain routes to networks that are external to the current autonomous system (AS). Link-state ID is network number advertised in LSA. Type 5 LSAs are flooded to the entire autonomous system. It is not flooded into any stub areas.
Type 5 describes routes that are redistributed into the area. These are routes are considered external routes and add into the routing table with “OE1” or “OE2”. We have already discussed the OE1 and OE2 routes in the types of OSPF routers. The difference in these is how the cost is calculated for a route. A typical example of an Type 5 LSA would be a default route (internet) as shown in figure 5 below. The external route/prefix is redistributed into the OSPF network by the ASBR (R1) and seen as O E1 or O E2 entries in other OSPF routers routing tables.
As illustrates in figure 5, the ASBR generates type 5 LSAs for each of its external routes and floods it into the OSPF area. Consequent ABRs also flood the type 5 LSA into other areas. Routers in other areas use the information from the type 4 LSA to reach the external routes.
OSPF LSA TYPE 6
It is a Group Membership LSA designed for Multicast OSPF (MOSPF), a protocol that supports multicast routing through OSPF. Cisco is not supporting MOSPF and nor it is widely used. So it can be skip because it’s not being used.
LSA TYPE 7
Type 7 LSAs are only found within a not so stubby area where type 5 external LSAs does not allow. The type 7 LSAs is generated by the ASBR within the NSSA to describe external routes. It acts as a mask for Type 5 LSA packets to allow them to move through these special areas and reach the ABR that can translate LSA Type 7 packets back to LSA Type 5 packets. Type 7 external LSA carries the same information but is not blocked within the NSSA area.
When type 7 LSA leaves the NSSA, it is translated to a type 5 LSA by the ABR. These routes read updated from type 7 LSA show up in the routing table with the N1 and N2 designation.
LSA TYPE 8
This type is used to work with BGP. LSA Type 8 packets in OSPFv2 (IPv4) are called External Attribute LSAs and are used to transfer BGP attributes throughout an OSPF network. This feature is not supported by most the routers. With OSPFv3, This type is redefined to carry IPv6 information throughout the OSPF network.
LSA Type 9
This type is commonly referred to as a link-state opaque LSA. For OSPFv3 it’s redefined to handle a communication prefix for a special area type called Stub Area. As link-local advertisements, they are not flooded outside of a single link to another device.
LSA TYPE 10
LSA type 10 (OSPF Area Scope Opaque LSA )is used to flood OSPF information through other area routers even if these routers do not process this information to extend OSPF functionality.
LSA TYPE 11
Type 11 (OSPF As Scope Opaque LSA) packets do the same job as Type 10 packets but are not flooded into special area types like Stub areas.