OSPF – External routes Part 2: Type 5’s in multiple normal areas.
Welcome back to the 2nd post about OSPF and external routes.
Last time we spoke of OSPF and how it behaves in regard of external routes in a single “normal” area.
By normal, it implies an area that accepts all types of LSA’s.
For the sake of completeness, I want to create the same scenario, but this time, the same route is redistributed into two different regular areas. This will make it apparent to you which LSA/route will be prefered under a couple of different circumstances.
What i want to accomplish with this post, is to demonstrate how type 5 LSA’s are flooded throughout the OSPF domain. I will also show how each router chooses what path to use getting to the 100.100.100.0/24 external network.
The topology i will be using is shown below:
As you can see, the topology contains 5 routers. It is split up into 3 areas. Area 0, Area 1 and Area 2.
R1 is a single-area router, residing solely in area 0.
Two of the routers (R2 and R3) are ABR routers. Router R4 and R5 are ASBR’s in area 1 and area 2 respectively.
All of the routers IP addresses ends in their router-numbers. All the routers OSPF router-id is set to the number in each octet (So R1 is 1.1.1.1 and so forth).
The network we are redistributing into the OSPF domain is 100.100.100.0/24.
First of, lets see what R4 and R5 have in their link state database:
R4:
R4#sh ip os data OSPF Router with ID (4.4.4.4) (Process ID 1) Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 2.2.2.2 2.2.2.2 143 0x80000006 0x008979 2 4.4.4.4 4.4.4.4 826 0x80000004 0x00CF2A 2 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 172.17.0.0 2.2.2.2 887 0x80000001 0x00A28A 192.168.0.0 2.2.2.2 932 0x80000001 0x00FFC1 Summary ASB Link States (Area 1) Link ID ADV Router Age Seq# Checksum 5.5.5.5 2.2.2.2 820 0x80000001 0x003F96 Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 100.100.100.0 4.4.4.4 825 0x80000001 0x005112 0 100.100.100.0 5.5.5.5 827 0x80000001 0x00332C 0
And R5:
R5#sh ip os data OSPF Router with ID (5.5.5.5) (Process ID 1) Router Link States (Area 2) Link ID ADV Router Age Seq# Checksum Link count 3.3.3.3 3.3.3.3 1097 0x80000004 0x009164 2 5.5.5.5 5.5.5.5 1028 0x80000004 0x00D317 2 Summary Net Link States (Area 2) Link ID ADV Router Age Seq# Checksum 172.16.0.0 3.3.3.3 343 0x80000003 0x008C9B 192.168.0.0 3.3.3.3 1097 0x80000001 0x00E1DB Summary ASB Link States (Area 2) Link ID ADV Router Age Seq# Checksum 4.4.4.4 3.3.3.3 342 0x80000003 0x004B88 Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 100.100.100.0 4.4.4.4 1033 0x80000001 0x005112 0 100.100.100.0 5.5.5.5 1029 0x80000001 0x00332C 0
As you can see, on R4 we have a type 4 LSA describing how to get to the ASBR 5.5.5.5 (R5). This is expected as R4 have no idea on how to get to R5 since its in a different area, and hence we dont receive any type 1 LSA describing this router. The reverse can be seen on R5.
On both routers we have two type 5 LSA’s. This is also OK since type 5 LSA’s will be flooded to all regular areas.
And lets now check out what R1 sees:
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 42 0x80000002 0x002723 1 2.2.2.2 2.2.2.2 43 0x80000002 0x00EB54 1 3.3.3.3 3.3.3.3 43 0x80000002 0x00AD89 1 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 192.168.0.3 3.3.3.3 43 0x80000001 0x009A0B Summary Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 172.16.0.0 2.2.2.2 80 0x80000001 0x004AED 172.17.0.0 3.3.3.3 79 0x80000001 0x002013 Summary ASB Link States (Area 0) Link ID ADV Router Age Seq# Checksum 4.4.4.4 2.2.2.2 70 0x80000001 0x0009DA 5.5.5.5 3.3.3.3 70 0x80000001 0x00BC1F Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 100.100.100.0 4.4.4.4 91 0x80000001 0x005112 0 100.100.100.0 5.5.5.5 126 0x80000001 0x00332C 0
As can be seen, on R1 we have 2 type 4 LSA’s present. Each one representing an ASBR in a different area. We also receive 2 type 5 LSA’s. Again, one from each ASBR.
Remember that the type 4 LSA’s are being created by the ABR’s, R2 and R3 respectively. We can verify this by checking out the type 4’s in more detail:
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: 264 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: 80000001 Checksum: 0x9DA Length: 28 Network Mask: /0 TOS: 0 Metric: 64 Routing Bit Set on this LSA LS age: 263 Options: (No TOS-capability, DC, Upward) LS Type: Summary Links(AS Boundary Router) Link State ID: 5.5.5.5 (AS Boundary Router address) Advertising Router: 3.3.3.3 LS Seq Number: 80000001 Checksum: 0xBC1F Length: 28 Network Mask: /0 TOS: 0 Metric: 64
The “Link State ID:” field lists the ASBR’s router-id. The “Advertising Router:” field lists the ABR that created the type 4 LSA.
So getting back to our 100.100.100.0/24 route. On R1 we get two equal type 5 LSA’s, so we install them both into the routing table:
Gateway of last resort is not set 100.0.0.0/24 is subnetted, 1 subnets O E2 100.100.100.0 [110/20] via 192.168.0.3, 00:23:03, FastEthernet0/0 [110/20] via 192.168.0.2, 00:22:53, FastEthernet0/0 172.17.0.0/24 is subnetted, 1 subnets O IA 172.17.0.0 [110/74] via 192.168.0.3, 00:23:03, FastEthernet0/0 172.16.0.0/24 is subnetted, 1 subnets O IA 172.16.0.0 [110/74] via 192.168.0.2, 00:22:53, FastEthernet0/0 C 192.168.0.0/24 is directly connected, FastEthernet0/0
And here’s the detail on the route:
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.0.2 on FastEthernet0/0, 00:45:12 ago Routing Descriptor Blocks: * 192.168.0.3, from 5.5.5.5, 00:45:22 ago, via FastEthernet0/0 Route metric is 20, traffic share count is 1 192.168.0.2, from 4.4.4.4, 00:45:12 ago, via FastEthernet0/0 Route metric is 20, traffic share count is 1
I want you to pay attention to the forwarding metric again. Even though its in seperate areas and the metric for the route itself is still 20, we meassure the cost to the ASBR, which right now is 74 for both.
Lets alter the cost to get to R4, and see what happens:
R2(config)#int s0/0 R2(config-if)#ip ospf cost 100
And the detail of the route on R1:
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.0.3 on FastEthernet0/0, 00:48:41 ago Routing Descriptor Blocks: * 192.168.0.3, from 5.5.5.5, 00:48:51 ago, via FastEthernet0/0 Route metric is 20, traffic share count is 1
Allright, there we go. Now we only have a single path to the 100.100.100.0/24 route, because we made the distance to the ASBR (4.4.4.4) that much larger. We can confirm our reasoning by checking the border-router command:
R1#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 [110] via 192.168.0.2, FastEthernet0/0, ASBR, Area 0, SPF 3 I 5.5.5.5 [74] via 192.168.0.3, FastEthernet0/0, ASBR, Area 0, SPF 3 i 2.2.2.2 [10] via 192.168.0.2, FastEthernet0/0, ABR, Area 0, SPF 3 i 3.3.3.3 [10] via 192.168.0.3, FastEthernet0/0, ABR, Area 0, SPF 3
Here we have proof that the distance to the ASBR comes into play. 110 versus 74, and the 74 wins.
An interesting effect of changing the cost to 4.4.4.4 so dramatically is that R2 will now also choose the path over R3 in order to get to 100.100.100.0/24:
R2#sh ip ro 100.0.0.0/24 is subnetted, 1 subnets O E2 100.100.100.0 [110/20] via 192.168.0.3, 00:05:43, FastEthernet0/0
I hope this post has shed some light on the same topic as last time, but emphasized what happens when the route originates in multiple areas.
Until next time, take care!!