Thursday, December 30, 2021

Understanding OSPF LSA Types

This covers the different LSA types in OSPF and how they behave in OSPF AS.

PURPOSE OF LINK-STATE ADVERTISEMENTS (LSAs) IN OSPF

OSPF's LSDB is built using LSAs advertised by routers within the OSPF AS. These LSAs are complied in the LSDB with a LSID to identify them. The OSPF SPF algorithm uses these LSAs to calculate paths to destinations. There are different LSAs for different aspects of OSPF from internal area information to inter area (IA) routes shared by ABRs between areas to external routes through ASBRs running redistribution.

LSA TYPE 1 - ROUTER LSA

Type 1 LSAs are generated by a router and will contain information on all its connected links which are OSPF enabled. This information consists of:
  • For non-DR elected interfaces, lists the router's interface subnet number/mask and interface OSPF cost.
  • For interfaces with an elected DR, it lists the IP address of the DR with a notation that the interfaces connects to a transit network.
Every router in an area will create a single an Type 1 LSA for themselves and flood it through the same area it is in. ABRs on the other hand create multiple Type 1 LSAs, an LSA for each area they are in and flood it to the the areas the LSAs describe. As the ABR as one RID, that will be the same on each LSA.

The LSID for Type 1 LSAs is the RID of the advertising router and are listed as "O" in the routing table.

LSA TYPE 2 - NETWORK LSA

Type 2 LSAs are used on Multiaccess (MA) networks where there are multiple adjacencies over a shared broadcast domain. Once the DR has been elected, it will then create Type 2 LSAs for the subnet. OSPF cannot represent multiple routers on a single subnet using a link connection to all four routers. OSPF defines a Type 2 network LSA as a transit network. 

Each router's Type 1 LSA will describe a connection to this transit network which is then molded into a Type 2 LSA by the DR and uses it's interface IP as the LSID to show it is a Type 2 LSA. This is flooded within the local area as Type 1 LSAs are.

These are listed as "O" routes in the routing table.

LSA TYPE 3 - SUMMARY LSA

ABRs don't simply forward all Type 1 and 2 LSAs to other areas, that wpuld increase the complexity of the SPF algorithm as well as take up more memory. Instead, the ABR will summaries the subnets of an area and forward that out to simply say subnet XYZ exists in Area 2. 

These LSAs aren't detailed like Type 1 and 2 LSAs. The ABR will use the subnet's address as the LSID and include its own RID so others know which ABR advertised the route. Although it is called a Summary LSA, it doesn't summaries the subnets but the term simply means it isn't as detailed.

These are listed as "OIA" routes in the routing table.

LSA TYPE 4 - SUMMARY ASBR LSA

These are only created when an ABR recieves a Type 5 LSA from an ASBR. The LSA will bascially list the RID of a ASBR and the cost to get to it from said ABR. This is flooded out to all connected areas. The LSID used for these LSAs is the ASBR's RID.

The importance of these is when there are multiple possible paths to subnets external to the OSPF AS to act as tie breakers for routing for Type 2 External Routes.

LSA TYPE 5 - EXTERNAL LSA

Routes from an external AS are flooded through the OSPF AS through the ASBR. These LSAs are flooded to all none stubby areas, stubby areas will have to use default routes as they don't allow Type 5 LSAs in the area. The ASBR will generate a Type 5 LSA for each subnet including the following information.
  • LSID which is the subnet IP address
  • Mask which is the subnet mask
  • Advertising Router which is the RID of the ASBR
  • Metric which is set by the ASBR
  • External Metric Type which can either be Type 1 or Type 2
There are two metric types used, External Type 1 or External Type 2. These are displayed in the routing table as either "E1" or "E2". 
  • External Type 2 routes will just use the metric set by the ASBR, if there is multiple paths then having the same metric means it will then use the Type 4 LSA to calcualte which has the better cost. This is basically the cost of the ABR to the ASBR added to the existing metric.
  • External Type 1 routes will use the metric set by the ASBR but then add on the internal costs. 

LSA TYPE 6 - MULTICAST LSA

These are used when routing using multicast through the MODPF routing protocol and this LSA isn't supported on Cisco products.

LSA TYPE 7 - EXTERNAL LSA

This is basically the same as a Type 5 LSA. As Type 5 LSAs cannot enter stubby area, the Type 7 LSA was developed to get round this if an ASBR is found within a stuby area. The Type 7 LSA is flooded within the stubby area but as it reaches the ABR, it is then converted to a Type 5 LSA and flooded through the normal areas.

The External Route types here are the same but in the routing table will use "N1" or "N2" rather than the "E1" and "E2" that Type 5 LSAs use.

LSA TYPE 8 - EXTERNAL ATTRIBUTES LSA FOR BGP

This LSA is for use with the Border Gateway Protocol (BGP) 


No comments:

Post a Comment