OSPF part 2

LSA Types

There are 6 common used (by Cisco) LSA types:

LSA type 1 updates describe the router itself: interfaces (in the area), list of neighbor routers and the router ID (RID). The RID is transmited by a linkstate-ID in this hello packet. The linkstate-ID is equal to the RID.

LSA type 2 updates represent a transit subnet for which a DR is elected. The LSID are the RID of the DR IP’s address on that particular subnet. I’ts only active on subnets with a active DR. For subnets without a DR (like a point-to-point), type 1 packets are enough for creating the topology database. Inside one area, only LSA types 1 and 2 are send out. All the routers can create a topology table with only these type 1 and 2 LSA’s. A “show ip ospf database” lists all the received LSA types.

LSA type 3 updates contains summaries of area’s: a ABR does not forward type 1 and 2 LSA’s. A ABR creates summary addresses for the other connected area. This Type 3 update contains the subnet, the subnetmask and a cost to reach that particular subnet. The cost to reach a subnet in an other area is done by:

  • Calculated cost to reach the ABR that advertised the type 3
  • The listed cost in the type 3

These two costs reduces the SFP calculations in the other area. In case of a link failure in area 1: all routers in area 1 have to do a recalculation. Because of these type 3 packet’s, routers in area 0 do not have to do a recalculation. This is called partial run.
Removing routes advertised type 3’s, could be done by just removing the route from the database and stop advertising it. This could result in some invalid routes on other routers, because of the “maxage” timer. It’s better to to remove the route instead: this triggers the router to set the age of that route to the maxage.  This age is advertised throughout the network so all routes remove that route from their databases.

Type 5

There are 2 possbile external routes: E1 and E2. The difference: The metric of E1 routes will increase at every hop. E2 routes keep the same metric throughout the OSPF network.
When a ASBR advertises a E2 network, a type 5 LSA is created: this LSA contains the metric.
When a ABR floods this Type 5 into the other area, the ABR creates a type 4 LSA, containing the ABR’s metric to reach the ASBR who created the type 5.  Other routers can calculate their metric from this type 4, the same way as type 3’s are processed. To calculate the cost for a E1 route, on a non-ASBR (in a differenct area) use a 2 step calculation and a third step to add the external cost:

  • It takes the costs to the neareset ABR
  • It added the cost of the ABR to the ASBR advertisting the type 5 (this cost is advertised in the type 4)
  • The external metric configured in the redistribution config. 

Type 7 is a different one, it doens’t really exist in OSPF. Type 7 updates are type 5 updates, encapsulated to a Type 7. This Type 7 LSA only transits through the not-so-stubby area. At the next ABR router, the Type 7 header is removed, so only the (original) type 5 LSA is left over. This type 5 is forwarder throughout the OSPF network like all other updates.

Stubby area

The ABR for a stubby area forwards type 1, 2, 3 and 4 LSA types. External routes are not advertised a stubby area. Instead of these routes, a default route (0.0.0.0 0.0.0.0) is being used.

Totally stubby area

The ABR in a totally stubby area forwards only type 1 and 2 LSA’s into that area. All other routers/networks are reached by a default route.

Not so stubby area

A NSSA (not so stubby area) is a stubby or totally stubby area with a external network connected. A ASBR is being used in this area. This ASBR creates Type 7 LSA’s.