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.
- Router ID (RID) – (dotted.quad format – looks like an IP address, often matches lo0 IP address)
- Prefix/Mask (the prefix information e.g. 192.168.1.0/24)
- Forwarding Address (defaults to 0.0.0.0, which means ‘follow-path-to-RID’). We’ll assumed an all-zeros forwarding address for this post.
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:
- Receive type-5, read the ASBRs RID. If the ASBR’s RID isn’t in your area graph then…
- We need a glue record. Look for type-4 with a LinkID matching the ASBRs RID. This type-4 was advertised by your ABR, which you can locate in your area graph, then…
- Look for type-1 for ABRs RID and caculate path to ABR.
Where did I get confused?
In many networks you configure OSPF using the following convention:
- Name the RID after the primary loopback interface of the OSPF router
- Advertise that loopback into OSPF with a /32 mask.
When I looked at the type-5 LSA of a router in remote area, it had a RID of 22.214.171.124. However there is also a type-3 LSA for 126.96.36.199/32 in that routers LSDB. “If there is a valid reachable type-3 for 188.8.131.52/32, then why do I need Type-4 LSA”?.
Well, i made the mistake of confusing the prefix with 184.108.40.206/32 with the RID 220.127.116.11. They look the same but the have completely different functions. The prefix 18.104.22.168/32 is an OSPF routed prefix, and the RID 22.214.171.124 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 126.96.36.199 and never advertise 188.8.131.52/32 into OSPF. OSPF will still work, thanks to the type-4 LSA.
- The OSPF RID is a node-identifer. It uses an IP address format, but it is an ID and does not need to match any interface present on the box.
- All intra-area routers can locate the ASBR RID as a node in the graph for that area.
- The ABR strips the prefix information from Type-1s and Type-2 and throws away the topology information before forwarding prefixes as Type-3 LSAs.
- Routers in other areas see a Type-5 with a meaningless RID. They might have a type-3 prefix that looks like the ASBRs RID, but this doesn’t help it find the ASBR.
- The type-4 generated by the ABR is needed as a glue record, so that routers can ‘anchor’ the unknown ASBR RID against as reachable via a well-known node, the local ABR.
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.”