Jun 042012
 

R4 does redistribution of the 4.4.4.0/24 network as a Type-7 LSA with metric-type of 1. In this case the forwarding address will be an interface attached to R4. R1 and R2 which are Border routes will retain the forwarding address when translating Type-7 to Type-5 LSA.

The forwarding address will be:

  • The highest IP address from among the loopback interfaces on which OSPF is activated
  • If there are no loopback interfaces, then the IP address of the physical interface on which OSPF is activated

With this theory, let’s check the current packet flow towards the external network. Each interface in the topology has a cost of 1.
 
Route calculation for R1: R3 which has a higher RID (33.33.33.33) than R1 (11.11.11.11) will do the Type-5 translation. R1 will get a Type-5 route and a Type-7 route each having a cost of 20. Then it calculates the cumulative cost to reach the forwarding address which will be 22 for both. Thus R1 will have an E1 route in its RIB.

R1#sh ip ospf database external | include Advertising Router|Forward Address|Metric   
  Advertising Router: 33.33.33.33
        Metric Type: 1 (Comparable directly to link state metric)
        Metric: 20
        Forward Address: 10.0.34.4
 
R1#sh ip ospf database nssa-external | include Advertising Router|Forward Address|Metric
  Advertising Router: 44.44.44.44
        Metric Type: 1 (Comparable directly to link state metric)
        Metric: 20
        Forward Address: 10.0.34.4
 
R1#sh ip route 4.4.4.0
Routing entry for 4.4.4.0/24
  Known via "ospf 1", distance 110, metric 22, type extern 1
  Last update from 10.0.14.4 on FastEthernet0/1, 03:20:07 ago
  Routing Descriptor Blocks:
  * 10.0.14.4, from 33.33.33.33, 03:20:07 ago, via FastEthernet0/1
      Route metric is 22, traffic share count is 1

Route calculation for R3: R3 will only receive a Type-7 LSA from R4, thus will have an N1 route it’s RIB

R3#sh ip route 4.4.4.0     
Routing entry for 4.4.4.0/24
  Known via "ospf 1", distance 110, metric 21, type NSSA extern 1
  Last update from 10.0.34.4 on FastEthernet0/0, 03:20:03 ago
  Routing Descriptor Blocks:
  * 10.0.34.4, from 44.44.44.44, 03:20:03 ago, via FastEthernet0/0
      Route metric is 21, traffic share count is 1

Route calculation for R2: The case is interesting with R2; it will receive a Type-5 LSA from R3, which has a forwarding address of 10.0.34.4. It then looks for an Intra area or Inter area route towards the forwarding address. It then will find out that R3 and R1 is sending a Type-3 LSA for the forwarding address. The LSA from R3 will have a metric of 1 and from R1 a metric of 2. Thus R2 will install an E1 route with a next hop of R3 and a cumulative metric of 22.

R2#sh ip ospf database external | include Forward Address|Advertising Router|Metric
  Advertising Router: 33.33.33.33
        Metric Type: 1 (Comparable directly to link state metric)
        Metric: 20
        Forward Address: 10.0.34.4
 
R2#sh ip ospf database summary 10.0.34.0 | include Metric|Advertising Router
  Advertising Router: 11.11.11.11
        TOS: 0  Metric: 2
  Advertising Router: 33.33.33.33
        TOS: 0  Metric: 1
 
R2#sh ip route 4.4.4.0
Routing entry for 4.4.4.0/24
  Known via "ospf 1", distance 110, metric 22, type extern 1
  Last update from 10.0.23.3 on FastEthernet0/1, 00:12:27 ago
  Routing Descriptor Blocks:
  * 10.0.23.3, from 33.33.33.33, 00:12:27 ago, via FastEthernet0/1
      Route metric is 22, traffic share count is 1

This means R2 will never use the path over R1 to reach the external network because of the forwarding address. What if we want to load balance traffic between R1 and R2. To achieve this, the forwarding address must be reachable with an equal metric from both ABRs.

Load sharing on R2:  One method would be to change the cost of the link of R3 pointing towards R4 (f0/0). If we increase the cost to 2, then R2 will receive 2 equal cost LSAs. I personally no not prefer this method to change costs.

R3(config)#interface f0/0
R3(config-if)#ip ospf cost 2
 
R2#sh ip ospf database summary 10.0.34.0 | in Metric|Advertising Router
  Advertising Router: 11.11.11.11
        TOS: 0  Metric: 2
  Advertising Router: 33.33.33.33
        TOS: 0  Metric: 2
 
R2#sh ip route 4.4.4.0                      
Routing entry for 4.4.4.0/24
  Known via "ospf 1", distance 110, metric 23, type extern 1
  Last update from 10.0.23.3 on FastEthernet0/1, 00:00:16 ago
  Routing Descriptor Blocks:
    10.0.23.3, from 33.33.33.33, 00:00:16 ago, via FastEthernet0/1
      Route metric is 23, traffic share count is 1
  * 10.0.12.1, from 33.33.33.33, 00:00:16 ago, via FastEthernet0/0
      Route metric is 23, traffic share count is 1

The elegant method is to change the forwarding address itself to something else. We could create a loopback interface at R4 and set it as the forwarding address by advertising it into OSPF.

R4(config)#interface loopback 99
R4(config-if)#ip address 4.4.99.4 255.255.255.255
R4(config-if)#ip ospf 1 area 3
 
R4#sh ip ospf database nssa-external self-originate    
 
            OSPF Router with ID (44.44.44.44) (Process ID 1)
 
                Type-7 AS External Link States (Area 3)
 
  LS age: 17
  Options: (No TOS-capability, Type 7/5 translation, DC)
  LS Type: AS External Link
  Link State ID: 4.4.4.0 (External Network Number )
  Advertising Router: 44.44.44.44
  LS Seq Number: 80000009
  Checksum: 0xA240
  Length: 36
  Network Mask: /24
        Metric Type: 1 (Comparable directly to link state metric)
        TOS: 0
        Metric: 20
        Forward Address: 4.4.99.4
        External Route Tag: 0

Now the forwarding address is changed to loopback 99 interfaces IP address. Now R2 will have a metric of 3 to reach the forwarding address because the ABRs will have a cost of 2. Finally we can see that R2 does load sharing across its links.

R2#sh ip ospf database external | include Forward Address|Advertising Router|Metric
  Advertising Router: 33.33.33.33
        Metric Type: 1 (Comparable directly to link state metric)
        Metric: 20
        Forward Address: 4.4.99.4
 
R2#sh ip ospf data summary 4.4.99.4 | in Metric|Advertising Router
  Advertising Router: 11.11.11.11
        TOS: 0  Metric: 2
  Advertising Router: 33.33.33.33
        TOS: 0  Metric: 2
 
R2#sh ip route 4.4.4.0
Routing entry for 4.4.4.0/24
  Known via "ospf 1", distance 110, metric 23, type extern 1
  Last update from 10.0.23.3 on FastEthernet0/1, 00:07:03 ago
  Routing Descriptor Blocks:
    10.0.23.3, from 33.33.33.33, 00:07:03 ago, via FastEthernet0/1
      Route metric is 23, traffic share count is 1
  * 10.0.12.1, from 33.33.33.33, 00:07:03 ago, via FastEthernet0/0
      Route metric is 23, traffic share count is 1

Note: I observed that IOS chooses, the last OSPF activated interface IP address as the forwarding address. This means if we create another loopback with a lower IP address than the current, it will be chosen as the forwarding address until RELOAD of the router!

R4(config)#interface loopback 50
R4(config-if)#ip address 4.4.50.4 255.255.255.255
R4(config-if)#ip ospf 1 area 3
 
R4#sh ip ospf database nssa-external | in Forward Address
        Forward Address: 4.4.50.4

After the reload the loopback interface with the highest IP address is chosen as forwarding address.

R4#sh ip ospf interface brief
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Fa0/1        1     3               10.0.34.4/24       1     P2P   1/1
Fa0/0        1     3               10.0.14.4/24       1     P2P   1/1
Lo99         1     3               4.4.99.4/32        1     LOOP  0/0
Lo50         1     3               4.4.50.4/32        1     LOOP  0/0
 
R4#sh ip ospf database nssa-external | include Forward Address
        Forward Address: 4.4.99.4