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.
- 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 126.96.36.199. However there is also a type-3 LSA for 188.8.131.52/32 in that routers LSDB. “If there is a valid reachable type-3 for 184.108.40.206/32, then why do I need Type-4 LSA”?.
Well, i made the mistake of confusing the prefix with 220.127.116.11/32 with the RID 18.104.22.168. They look the same but the have completely different functions. The prefix 22.214.171.124/32 is an OSPF routed prefix, and the RID 126.96.36.199 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 188.8.131.52 and never advertise 184.108.40.206/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.”
15 thoughts on “OSPF – Why have a Type-4 LSA?”
Finally , LSA4’s purpose is to reach ASBR , ospf doesn’t care you know or not RID of ASBR , http://packetstack.net/2012/11/15/fun-with-ospf-and-my-first-blogpost/
Great minds think alike 😉 Nice post, and thanks for adding the link.
The second last para ( the one before summary section ) should be titled “Why is Type 4 needed” ??
Thanks for the suggestion Shreeram, I have edited the heading title.
Excellent explanation on necessity of Type 4 LSA
Thanks really good explanation. . .had always pondered this one!!
Hey thanks David, glad I could help.
Perfect!! I got confused at the same point, you cleared this for me. Thanks!!
Great, thanks for the feedback Alberto.
Cheers John, just what I was looking for!
Happy to help Dom.
Thanks John for the explanation here, It finallly replies to one of my arcane doubts on OSPF stuff…!
All the way in 2020 on a lockdown. THank you for this explanation it is gold!!