NetworkSherpa

OSPF – Why have a Type-4 LSA?

Type-4  LSAs always seemed like an ugly afterthought to me.  I know it’s irrational and ignorant but the type-4 seemed to disturb the symmetry of OSPF.  I cursed the type-5 for needing this kludgy type-4 helper. However, time was short, so I acknowledged my ignorance, rote-learned the type-4 and moved on.
When I later revisited OSPF for a deeper understanding I got confused and questioned if a type-4 really was necessary.  [Hint: John Moy is considerably smarter than me! ]  In this post I show you where I got stuck and what I learned about the type-4.

 
 

A quick review of the type-5 LSA

Let’s start by looking at a few of the key fields in a type-5 LSA.

In a regular area the type-1 and type-2 LSAs are used to build a full shared view of the topology; an interconnected topology graph of  router nodes and interconnecting links. The nodes and links are identified by router identifier (RID) and link identifier.

ABR hides area topology info from other areas

Within the ASBR’s native area it can survive by identifying itself using it’s RID.  That’s because the ASBR’s RID has meaning for those area-internal routers;  they recognise that RID place that node in the topology graph they’ve build for that area.
However, for scaling purposes the ABR deliberately hides all of the ASBR-area topology from area 0, and just sends prefixes using type-3 LSAs sent with the ABRs RID.   “Hey area 0,  just come to me (ABRs RID) if you want to reach prefixes from this area”.  All the other backbone routers can place the ABRs RID as a node in their area 0 topology graph.  All is good with the world again.

Why is the type-4 needed?

The type-5 is flooded across all non-stub areas. But the ASBRs RID only makes sense to routers in it’s native area, and isn’t helpful to non-native routers.  If the RID advertised by the Type-5 isn’t meaningful, then the path to it’s advertised prefix can’t be resolved.  External prefix => unreachable.
Well… that’s a bit shit. So, a type-4 asbr-summary LSA is needed to help make the ASBR reachable and, by extension make the associated type-5 prefix valid.  The type-4 acts like a glue record, and uses the ABRs well known RID as a care-of address for the ASBR and it’s advertised prefixes.
Now the process is:

Where did I get confused?

In many networks you configure OSPF using the following convention:

When I looked at the type-5 LSA of a router in remote area, it had a RID of 1.1.1.1.  However there is also a type-3 LSA for 1.1.1.1/32 in that routers LSDB.  “If there is a valid reachable type-3 for 1.1.1.1/32, then why do I need Type-4 LSA”?.
Well, i made the mistake of confusing the prefix with 1.1.1.1/32 with the RID 1.1.1.1. They look the same but the have completely different functions.  The prefix 1.1.1.1/32 is an OSPF routed prefix, and the RID 1.1.1.1 is a label for that router in the graph built for it’s native area. The RID is functionally equivalent to a name.
Also, you need to remember that the convention of naming the RID after loopback 0 is optional. The RID doesn’t have to be the loopback of the router.   I can set the ASBRs RID to 1.1.1.1 and never advertise 1.1.1.1/32 into OSPF.   OSPF will still work, thanks to the type-4 LSA.

Sherpa summary

From RFC 2328 Section 4.2
“To utilize external routing information, the path to all routers advertising external information must be known throughout the AS (excepting the stub areas). For that reason, the locations of these AS boundary routers are summarized by the (non-stub) area border routers.”