I want to create some posts about the actual behavior of OSPF in regards to external routes in different areas and how everything behaves. It might take more than a few posts, but I hope you’ll keep reading them 🙂
The first one, is about redistributing external routes into a normal OSPF area. A “normal” OSPF area is an area which allows all kinds of LSA’s. This means we can have an external source in this area. In a “normal” external routes will be present as a type 5 LSA. This type 5, will either be an E1 or an E2 route. The difference being that the metric associated with the LSA will increase with an E1 and it will not with an E2 route. The default is an E2 route and the default metric is 20.
This is the topology I will use for this post:
A little explanation on the topology first.
Area 0 configured with a single router (R1) as well as an ABR (R2) connecting to area 1. In area 1 we have two routers, R3 and R4.
Both of these routers are ASBR’s, redistributing the 100.100.100.0/24 network into area 1. The router ID’s of all routers have been set to their individual router-numbers, so R1 is 1.1.1.1, R2 2.2.2.2 and so forth.
My goal with this part is to show how the 100.100.100.0/24 network will show up in different places. What LSA’s will be where, and how each router selects the best path. We expect the 100.100.100.0/24 network to be present as a type 5 LSA. More specifically a type 5, metric-type 2. We also expect that we will see this LSA from multiple routers, because the same network is being imported from two routers (R3 and R4). We know that the flooding scope of type 5’s is domain wide, so we expect to see these everywhere. We also expect a type 4 (ASBR) LSA to appear on R1, as it doesnt know how to get to R3 and R4 because they are in a different area.
First off, this is how we redistribute the external networks into area 1:
This is what we see on R2’s area 1:
So far, so good. We get our type 5 LSA’s on R2 in area 1. All being equal, what will show up in the routing table on R2 because of this?
We get equal cost load-sharing out of this. Okay, the reason why, being that the cost to get to each ASBR is the same. This is known as the forwarding metric.
We can verify this by checking more detailed information about the route:
Here we see that the forwarding metric to reach both ASBR’s is 10. Another way to check to see what the metric to reach an ABR/ASBR is, is by using the border-router command:
Now, lets check R1’s OSPF database, and especially what it contains in regard to type 4 and 5’s:
What’s being displayed here are two type 4 and two type 5 LSA’s. Knowing that R2 is an ABR, R2 has created the two type 4 LSA’s. The reason it does this is so that R1 knows how to get to the ASBR’s.
We can take a closer look at the type 5 LSA’s:
Pay attention to the forwarding address, which has been set to 0.0.0.0. This means that we will use the cost to the ABR (R2) to reach this destination.
Okay. So we need to consult our type 4 LSAs to determine how to get to each of these:
Okay, so we see that we need to get to 2.2.2.2 to get to both ASBR’s. Since we only have this one ABR to get to the ASBR’s, there’s really no choice in the matter.
But… which LSA will it then choose to believe? Well, it will always choose the lowest cost path to the ASBR, all else being equal. Again we can check this by examining the detailed route information:
There we have it, the forwarding metric of 74 (one serial interface cost + one FastEthernet interface cost).
But i would like you to pay special attention to whois LSA it chooses to believe. You see it?
Yes, its the one from 4.4.4.4. That is the choice. If all else being equal, as it is since its the same ABR, it chooses the highest router-id.
This really has no bearing on what path it will choose in this case. But just to verify it, lets change the router-id on R3 to 33.33.33.33 which makes it higher than R4’s router-id, and lets check the route on R1 again:
The LSA choice has changed to 33.33.33.33. Interesting huh?
So to answer our questions. The type 5 LSA’s will show up everywhere (in regular areas at least). These are created by the ASBR’s. If nessecary any ABR will create type 4 LSA’s to provide information on how to get to these ASBR’s.
Since the cost to both ASBR’s is the same, R2 will install both routes into its RIB.
R1 will, all else being equal, and the same ABR is used, base its LSA decision on the highest router-id. In our case it will install one route into its RIB, simply because we use the same ABR to get to the ASBR’s.
Its important to remember that even though we can mentally know that since R1 only has one way “out”, it will only install one route, that a decision is made, based on certain criterias.
Also note, that this test only shows what happens with equal cost routes. Remember the normal OSPF selection process which overrides everything else:
- Intra-area routes, 2) Inter-area routes, 3) External Type 1, 4) External Type 2. Also, we have not touched the route metric itself, which will also tilt the selection. Always best metric before any route is being based on the forwarding address.
I hope that with this we have covered some of the commands I will use in subsequent posts which will show more obscure decision processes with OSPF.
Until next time. Take care!