OSPF – External routes Part 1: Type 5's in a normal area.


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:

OSPF Part 1 Topology

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:

R3(config-router)#int loo0
R3(config-if)#ip add 100.100.100.100 255.255.255.0
R3(config-if)#router ospf 1
R3(config-router)#redistribute connected subnets
R4(config-router)#int loo0
R4(config-if)#ip add 100.100.100.100 255.255.255.0
R4(config-if)#router ospf 1
R4(config-router)#redistribute connected subnets

This is what we see on R2’s area 1:

Router Link States (Area 1)
Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         1995        0x80000003 0x009EF8 1
3.3.3.3         3.3.3.3         5           0x80000004 0x00612B 1
4.4.4.4         4.4.4.4         511         0x80000004 0x002360 1
 Net Link States (Area 1)
Link ID         ADV Router      Age         Seq#       Checksum
172.16.0.4      4.4.4.4         1978        0x80000002 0x00330D
 Summary Net Link States (Area 1)
Link ID         ADV Router      Age         Seq#       Checksum
192.168.12.0    2.2.2.2         1996        0x80000002 0x0097E6
 Type-5 AS External Link States
Link ID         ADV Router      Age         Seq#       Checksum Tag
100.100.100.0   3.3.3.3         5           0x80000001 0x006FF7 0
100.100.100.0   4.4.4.4         511         0x80000001 0x005112 0

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?

R2#sh ip ro | beg Gate
Gateway of last resort is not set
C    192.168.12.0/24 is directly connected, Serial0/0
     100.0.0.0/24 is subnetted, 1 subnets
O E2    100.100.100.0 [110/20] via 172.16.0.4, 02:02:25, FastEthernet0/0
                      [110/20] via 172.16.0.3, 01:53:59, FastEthernet0/0
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.0.0 is directly connected, FastEthernet0/0

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:

R2#sh ip ro 100.100.100.0 255.255.255.0
Routing entry for 100.100.100.0/24
 Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 10
 Last update from 172.16.0.3 on FastEthernet0/0, 02:00:10 ago
 Routing Descriptor Blocks:
 * 172.16.0.4, from 4.4.4.4, 02:08:36 ago, via FastEthernet0/0
 Route metric is 20, traffic share count is 1
 172.16.0.3, from 3.3.3.3, 02:00:10 ago, via FastEthernet0/0
 Route metric is 20, traffic share count is 1

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:

R2#sh ip os border-routers
OSPF Process 1 internal Routing Table
Codes: i - Intra-area route, I - Inter-area route
i 4.4.4.4 [10] via 172.16.0.4, FastEthernet0/0, ASBR, Area 1, SPF 6
i 3.3.3.3 [10] via 172.16.0.3, FastEthernet0/0, ASBR, Area 1, SPF 6

Now, lets check R1’s OSPF database, and especially what it contains in regard to type 4 and 5’s:

R1#sh ip os data
 OSPF Router with ID (1.1.1.1) (Process ID 1)
 Router Link States (Area 0)
Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         1771        0x80000007 0x00851D 2
2.2.2.2         2.2.2.2         1759        0x80000007 0x002874 2
 Summary Net Link States (Area 0)
Link ID         ADV Router      Age         Seq#       Checksum
172.16.0.0      2.2.2.2         1759        0x80000006 0x002247
 Summary ASB Link States (Area 0)
Link ID         ADV Router      Age         Seq#       Checksum
3.3.3.3         2.2.2.2         1759        0x80000004 0x001308
4.4.4.4         2.2.2.2         219         0x80000005 0x00E233
 Type-5 AS External Link States
Link ID         ADV Router      Age         Seq#       Checksum Tag
100.100.100.0   3.3.3.3         1955        0x80000004 0x0069FA 0
100.100.100.0   4.4.4.4         260         0x80000005 0x004916 0

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:

R1#sh ip os data external
 OSPF Router with ID (1.1.1.1) (Process ID 1)
 Type-5 AS External Link States
 LS age: 198
 Options: (No TOS-capability, DC)
 LS Type: AS External Link
 Link State ID: 100.100.100.0 (External Network Number )
 Advertising Router: 3.3.3.3
 LS Seq Number: 80000005
 Checksum: 0x67FB
 Length: 36
 Network Mask: /24
 Metric Type: 2 (Larger than any link state path)
 TOS: 0
 Metric: 20
 Forward Address: 0.0.0.0
 External Route Tag: 0
 Routing Bit Set on this LSA
 LS age: 492
 Options: (No TOS-capability, DC)
 LS Type: AS External Link
 Link State ID: 100.100.100.0 (External Network Number )
 Advertising Router: 4.4.4.4
 LS Seq Number: 80000005
 Checksum: 0x4916
 Length: 36
 Network Mask: /24
 Metric Type: 2 (Larger than any link state path)
 TOS: 0
 Metric: 20
 Forward Address: 0.0.0.0
 External Route Tag: 0

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:

R1#sh ip os data asbr-summary
 OSPF Router with ID (1.1.1.1) (Process ID 1)
 Summary ASB Link States (Area 0)
 Routing Bit Set on this LSA
 LS age: 143
 Options: (No TOS-capability, DC, Upward)
 LS Type: Summary Links(AS Boundary Router)
 Link State ID: 3.3.3.3 (AS Boundary Router address)
 Advertising Router: 2.2.2.2
 LS Seq Number: 80000005
 Checksum: 0x1109
 Length: 28
 Network Mask: /0
 TOS: 0  Metric: 10
 Routing Bit Set on this LSA
 LS age: 406
 Options: (No TOS-capability, DC, Upward)
 LS Type: Summary Links(AS Boundary Router)
 Link State ID: 4.4.4.4 (AS Boundary Router address)
 Advertising Router: 2.2.2.2
 LS Seq Number: 80000005
 Checksum: 0xE233
 Length: 28
 Network Mask: /0
 TOS: 0  Metric: 10

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:

R1#sh ip ro 100.100.100.0 255.255.255.0
Routing entry for 100.100.100.0/24
 Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 74
 Last update from 192.168.12.2 on Serial0/0, 02:14:59 ago
 Routing Descriptor Blocks:
 * 192.168.12.2, from 4.4.4.4, 02:14:59 ago, via Serial0/0
 Route metric is 20, traffic share count is 1

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:

R1#sh ip ro 100.100.100.0 255.255.255.0
Routing entry for 100.100.100.0/24
 Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 74
 Last update from 192.168.12.2 on Serial0/0, 00:00:03 ago
 Routing Descriptor Blocks:
 * 192.168.12.2, from 33.33.33.33, 00:00:03 ago, via Serial0/0
 Route metric is 20, traffic share count is 1

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:

1) 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!