OSPF LSA Types Tutorial
OSPF uses Link State Advertisement (LSA) to build up Link State Database (LSDB) so understanding how LSA works is the key point to grasp how OSPF operates.
In the topology above:
+ R3 and R4 only belong to Area 1. R1 only belongs to Area 0. R6 and R7 only belong to Area 2. These are known as Internal Routers.
+ R2 belongs to both Area 0 and Area 1. R5 belongs to both Area 0 and Area 2. These routers are known as Area Border Routers (ABRs).
+ Area 0 is known as Backbone Area. Every router which has an interface in Area 0 can be considered a Backbone Router. All other areas must have a connection to Area 0 (except using virtual-link). Without Area 0, routers can only function within that area.
+ When a change occurs in the network topology, the router experiencing the change creates a link-state advertisement (LSA) concerning that link.
OSPF has 11 LSA Types from 1 to 11 but some of them are not used like Type 6 (Multicast LSA), 8 (used for BGP), 9, 10, 11 (Opaque LSAs). In this tutorial we will learn more about other LSA Types (types 1 to 5 and 7).
Router link LSA (Type 1) – Each router generates a Type 1 LSA that lists its active interfaces, IP addresses, neighbors and the cost to each. LSA Type 1 is only flooded inside the router’s area, it does not cross ABR.
Therefore in the topology above, all routers sends LSA Type 1 to the neighbors within its area. The ABRs (R2 & R5) send LSAs to both areas it connects to. For example, R1 sends LSA Type 1 to R2 & R5 that contains the status of its links. R3 sends LSA Type 1 to R2 only while R2 (ABR) sends to R1, R3 & R4.
Network link LSA (Type 2) – is sent out by the designated router (DR) and lists all the routers on the segment it is adjacent to. Types 2 are ﬂooded within its area only; does not cross ABR. Type 1 & type 2 are the basis of SPF path selection. For example, if R2 was elected the DR for the segment (R2-R3) & (R2-R4), it would generate a Type 2 LSA containing a list of all routers attached to it and flood inside Area 1.
Note: The broadcast and non-broadcast network types elect a DR/BDR.
Summary link LSA (Type 3) – ABRs generate this LSA to send between areas (so type 3 is called inter-area link). It gathers information it has learned on one of its attached areas and summarizes them before sending out to another area. LSAs Type 3 are injected by the ABR from the backbone area into other areas and from other areas into the backbone area. The picture below shows how LSAs Type 3 generated by R2 are propagated.
Please notice that R2 sends LSAs Type 3 to both Area 0 & Area 1. But Type 3 LSAs sent into Area 0 will contain a list of networks within Area 1, including the cost to reach these networks. Type 3 LSAs sent into Area 1 will contain a list of networks within Area 0.
Although the name of LSA Type 3 is “Summary” Link but this word is very misleading because it does not summarize our subnets to a bigger one. The word “Summary” here should be understood as “LSA Type 3 takes information from LSA Type 1 and 2 and summarizes them into Type 3 LSA”. This summarization helps reduce the detailed topology information for other areas. We should consider Type 3 “Inter-Area” LSA. Type 3 LSAs are represented by O IA keyword in the routing tables.
Summary ASBR LSA (Type 4) – Generated by the ABR to describe an ASBR to routers in other areas so that routers in other areas know how to get to external routes through that ASBR. For example, suppose R8 is redistributing external route (EIGRP, RIP…) to R3. This makes R3 an Autonomous System Boundary Router (ASBR). When R2 (which is an ABR) receive this LSA Type 1 update, R2 will create LSA Type 4 and flood into Area 0 to inform them how to reach R3. When R5 receives this LSA it also floods into Area 2.
In the above example, the only ASBR belongs to area 1 so the two ABRs send LSA Type 4 to area 0 & area 2 (not vice versa). This is an indication of the existence of the ASBR in area 1.
+ Type 4 LSAs contain the router ID of the ASBR.
+ There are no LSA Type 4 injected into Area 1 because every router inside area 1 knows how to reach R3. R3 only uses LSA Type 1 to inform R2 about R8 and inform R2 that R3 is an ASBR.
External Link LSA (LSA 5) – Generated by ASBR to describe routes redistributed into the area and point the destination for these external routes to the ASBR. These routes appear as O E1 or O E2 in the routing table. In the topology below, R3 generates LSAs Type 5 to describe the external routes redistributed from R8 and floods them to all other routers and tell them “hey, if you want to reach these external routes, send your packets to me!”. But other routers will ask “how can I reach you? You didn’t tell me where you are in your LSA Type 5!”. And that is what LSA Type 4 do – tell other routers in other areas where the ASBR is!
Multicast LSA (Type 6) are specialized LSAs that are used in multicast OSPF applications. Cisco does not support it so we will not discuss it here.
NSSA External LSA (Type 7) – Generated by an ASBR inside a Not So Stubby Area (NSSA) to describe routes redistributed into the NSSA. LSA 7 is translated into LSA 5 as it leaves the NSSA. These routes appear as N1 or N2 in the routing table inside the NSSA. Much like LSA 5, N2 is a static cost while N1 is a cumulative cost that includes the cost upto the ASBR.
We also have a GNS3 lab about OSPF LSA Types, you can read it here: http://www.digitaltut.com/ospf-lsa-types-lab.