Tuesday, October 30, 2012

OSPF Summary LSA's: Type 3 & 4

And now for everyone’s favourite LSA, the Type 3 LSA!

Combined with everyone’s least favourite LSA, the Type 4 LSA!
The Type 3 (Summary) LSA is originated by Area Border Routers into one area to describe links in another area. That doesn’t sound complicated does it? Good, because it isn’t.

The Type 4 (ASBR Summary) LSA is also originated by an ABR, but it is used to describe an ASBR in one area to routers in another area.

If you care to read through RFC 2328 section 14.4.3 you’ll actually stumble upon a rather long, involved decision process on how a router selects routes that are in its RIB as candidates to be advertised as a Type 3 LSA. I’m not going to go into any real detail about that, but I thought I’d mention it since it’s worth your time to quickly glance through it.

Another note about the RFC is that it actually groups both Type 3 and Type 4 LSA’s into the same category of “Summary” LSA’s. There is of course the distinction of types, but since all the fields are the same with only a slight variance in meaning on the LSID field these two LSA’s are essentially the same.

And this is why I’m grouping these two LSA’s together here.

I’m going to first walk through a Type 3 LSA, and then we’ll look at a Type 4 LSA. Here’s the Type 3:

I should just start skipping this line eh? At least there’s a new one here. Regardless, the options are for another post.

LS Type: Summary Links(Network)

Right. This was expected.

Link State ID: 10.0.23.0 (summary Network Number)

Again, this fields we’ve seen before, however, the LSID meaning has again changed. This time the LSID represents the prefix being described.

Advertising Router: 2.2.2.2

This is the same as usual. As a point of interest this will always be the RID of an ABR since Type 3 LSA’s are always originated by an ABR.

LS Seq Number: 80000002 Checksum: 0x4D85 Length: 28

These fields we’ve also seen before and there’s nothing new to say on them.

Network Mask: /24

Here’s our prefix length. We now have a defined range for our network.

TOS: 0 Metric: 64

Yup. This is the Legacy TOS showing up again, and our metric for the link in question. What’s important here is that this is the metric of the ABR to the destination (if the ABR has multiple routes this will be the cost of the lowest cost route). It does not include any links between the router the LSA is observed on and the ABR. That value is derived from the Type 1 and 2 LSA’s contained in the OSPF database and added to this value to obtain the ultimate cost to the destination.

Here we see that the LSID is the RID of the ASBR that this LSA is describing. This differs from the prefix that was described in the Type 3.

Advertising Router: 2.2.2.2

Again, this is always going to be an ABR as only ABR’s originate Type 4 LSA’a.

LS Seq Number: 80000001 Checksum: 0x37B0 Length: 28

More blah blah blah…

Network Mask: /0

Huh? What? /0? Yup, /0.

Here’s the kicker. In reading section 12.4.3 of RFC 2328 in its entirety there is no mention of a prefix length (or mask) at all. The example LSA’s used don’t even have a prefix length included! What gives? Well, this is why you need to read things all the way through. If you skip down to A.4.4 where the the packet structure is examined you will see that there is indeed a prefix length field (subnet mask) and that there is also the following paragraph providing guidance:

Network Mask
For Type 3 summary-LSAs, this indicates the destination
network's IP address mask. For example, when advertising the
location of a class A network the value 0xff000000 would be
used. This field is not meaningful and must be zero for Type 4
summary-LSAs.

There you have it! Mystery solved.

TOS: 0 Metric: 64

Finally our last line is one we’re familiar with. And again, this metric is from the advertising router to the ASBR. If the ABR has multiple routes this will reflect the lowest cost route (the route currently in the RIB).

There’s a few other oddities about the Type 4 out there. I might do up a post on them at a later time, but for now I’m going to link over to Packetlife.net and a great post Stretch did on the topic.