Saturday, June 1, 2013

OSPF – Understanding the Forwarding Address (FA)













In this post we will talk about the OE2 route comparing process and to make it clear for you this is the case in which all routes are advertised by the same metric type (OE2) and the same metric value (20) so to break the tie the router uses the Forward Metric.

Hint: If the metric of the redistributed routes are different, the routers prefer the route with the lowest metric and not the lowest metric to the forwarding address (forward Metric)

Before we get into the cases of this scenario, let’s have a brief about 


Forwarding Address (FA) and the conditions to be set:

FA is a field in the LSA that can be shown by
#show ip ospf database external



To be set it has a simple two conditions:


1- OSPF should be enabled on the next-hop link.
2- The next-hop adjacency should be multi-access (NOT point-to-point or point-to-multipoint)

So according to these conditions, the initial case of the above figure would be as follows:

R1 justifies both conditions so its LSA from R3 has the FA is set:

R3#show ip ospf database external 172.16.10.0

            OSPF Router with ID (10.0.34.3) (Process ID 1)

                Type-5 AS External Link States

  Routing Bit Set on this LSA
  LS age: 1627
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 172.16.10.0 (External Network Number )
  Advertising Router: 192.168.1.1
  LS Seq Number: 80000001
  Checksum: 0x6C91
  Length: 36
  Network Mask: /24
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 20
        Forward Address: 192.168.1.6
        External Route Tag: 0

R5 failed in the second condition as it has a point-to-point next-hop link so the FA is not set:

  Routing Bit Set on this LSA
  LS age: 47
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 172.16.10.0 (External Network Number )
  Advertising Router: 192.168.2.5
  LS Seq Number: 80000003
  Checksum: 0xB7AF
  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



Case 1: Both LSAs have the FA is set

Compare the metric to reach FA in both LSAs by #show ip route FA

To have this case, you should add the following configuration:

R5(config)#interface Serial1/0
R5(config-if)#ip ospf network broadcast

This would ensure the fact that the next-hop network must NOT be (point-to-point or point-to-multipoint).

R3#show ip route               

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 2 subnets
O E2    172.16.10.0 [110/20] via 10.0.23.2, 00:00:10, FastEthernet0/0
O E2    172.16.11.0 [110/20] via 10.0.23.2, 00:00:10, FastEthernet0/0
     10.0.0.0/24 is subnetted, 4 subnets
O       10.0.12.0 [110/2] via 10.0.23.2, 00:40:05, FastEthernet0/0
C       10.0.23.0 is directly connected, FastEthernet0/0
O       10.0.45.0 [110/2] via 10.0.34.4, 00:40:05, FastEthernet0/1
C       10.0.34.0 is directly connected, FastEthernet0/1
O    192.168.1.0/24 [110/3] via 10.0.23.2, 00:40:05, FastEthernet0/0
O    192.168.2.0/24 [110/66] via 10.0.34.4, 00:40:05, FastEthernet0/1

We picked 172.16.10.0

R3#show ip ospf database external 172.16.10.0

            OSPF Router with ID (10.0.34.3) (Process ID 1)

                Type-5 AS External Link States

  Routing Bit Set on this LSA
  LS age: 438
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 172.16.10.0 (External Network Number )
  Advertising Router: 192.168.1.1
  LS Seq Number: 80000002
  Checksum: 0x6A92
  Length: 36
  Network Mask: /24
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 20
        Forward Address: 192.168.1.6
        External Route Tag: 0

  Routing Bit Set on this LSA
  LS age: 29
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 172.16.10.0 (External Network Number )
  Advertising Router: 192.168.2.5
  LS Seq Number: 80000003
  Checksum: 0x6490
  Length: 36
  Network Mask: /24
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 20
        Forward Address: 192.168.2.7
        External Route Tag: 0
         
R3#show ip route 192.168.1.6

Routing entry for 192.168.1.0/24
  Known via "ospf 1", distance 110, metric 3, type intra area
  Last update from 10.0.23.2 on FastEthernet0/0, 00:40:36 ago
  Routing Descriptor Blocks:
  * 10.0.23.2, from 192.168.1.1, 00:40:36 ago, via FastEthernet0/0
      Route metric is 3, traffic share count is 1

R3#show ip route  192.168.2.7
Routing entry for 192.168.2.0/24
  Known via "ospf 1", distance 110, metric 66, type intra area
  Last update from 10.0.34.4 on FastEthernet0/1, 00:40:41 ago
  Routing Descriptor Blocks:
  * 10.0.34.4, from 192.168.2.5, 00:40:41 ago, via FastEthernet0/1
      Route metric is 66, traffic share count is 1

Then the winner is 192.168.1.6 that has a next-hop of 10.0.23.2 as follows:

R3#show ip route 172.16.10.0
Routing entry for 172.16.10.0/24
  Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 3
  Last update from 10.0.23.2 on FastEthernet0/0, 00:00:05 ago
  Routing Descriptor Blocks:
  * 10.0.23.2, from 192.168.1.1, 00:00:05 ago, via FastEthernet0/0
      Route metric is 20, traffic share count is 1




Case 2: Both LSAs have the FA is not set

To have this case you should disable ospf from 192.168.1.0 netwrok at R1 to break the first condition then load-balance at R3 will occur.

Compare the Forward Metric to the ASBR in both LSAs by #show ip ospf border-routers



Case 3: One LSA has a set FA and the other LSA has a non-set FA

Compare the following metrics with each other
For the non-set FA: ASBR forwarding metric by #show ip ospf border-routers
For the set FA: Forwarding Address metric by #show ip route FA

R3#show ip route           

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 2 subnets
O E2    172.16.10.0 [110/20] via 10.0.34.4, 00:00:32, FastEthernet0/1
O E2    172.16.11.0 [110/20] via 10.0.34.4, 00:00:32, FastEthernet0/1
     10.0.0.0/24 is subnetted, 4 subnets
O       10.0.12.0 [110/2] via 10.0.23.2, 00:25:55, FastEthernet0/0
C       10.0.23.0 is directly connected, FastEthernet0/0
O       10.0.45.0 [110/2] via 10.0.34.4, 00:25:55, FastEthernet0/1
C       10.0.34.0 is directly connected, FastEthernet0/1
O    192.168.1.0/24 [110/3] via 10.0.23.2, 00:25:55, FastEthernet0/0
O    192.168.2.0/24 [110/66] via 10.0.34.4, 00:25:55, FastEthernet0/1

We will pick 172.16.10.0 again.

R3#show ip ospf database external 172.16.10.0

            OSPF Router with ID (10.0.34.3) (Process ID 1)

                Type-5 AS External Link States

  Routing Bit Set on this LSA
  LS age: 1627
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 172.16.10.0 (External Network Number )
  Advertising Router: 192.168.1.1
  LS Seq Number: 80000001
  Checksum: 0x6C91
  Length: 36
  Network Mask: /24
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 20
        Forward Address: 192.168.1.6
        External Route Tag: 0

  Routing Bit Set on this LSA
  LS age: 47
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 172.16.10.0 (External Network Number )
  Advertising Router: 192.168.2.5
  LS Seq Number: 80000003
  Checksum: 0xB7AF
  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

So in here we will compare the ASBR forward metric of 192.168.2.5 which is 2 as follows:

R3#show ip ospf border-routers
OSPF Process 1 internal Routing Table
Codes: i - Intra-area route, I - Inter-area route

i 192.168.1.1 [2] via 10.0.23.2, FastEthernet0/0, ASBR, Area 0, SPF 5
i 192.168.2.5 [2] via 10.0.34.4, FastEthernet0/1, ASBR, Area 0, SPF 5

With the metric to reach the FA of 192.168.1.6 which is 3 as follows:

R3#show ip route 192.168.1.6
Routing entry for 192.168.1.0/24
  Known via "ospf 1", distance 110, metric 3, type intra area
  Last update from 10.0.23.2 on FastEthernet0/0, 00:26:33 ago
  Routing Descriptor Blocks:
  * 10.0.23.2, from 192.168.1.1, 00:26:33 ago, via FastEthernet0/0
      Route metric is 3, traffic share count is 1


So the LSA of 192.168.2.5 wins by a metric of 2 compared to 3 of 192.168.1.6.

So the winning next-hop is as follows:

R3#show ip route 192.168.2.5
Routing entry for 192.168.2.0/24
  Known via "ospf 1", distance 110, metric 66, type intra area
  Last update from 10.0.34.4 on FastEthernet0/1, 00:27:12 ago
  Routing Descriptor Blocks:
  * 10.0.34.4, from 192.168.2.5, 00:27:12 ago, via FastEthernet0/1
      Route metric is 66, traffic share count is 1

Conclusion:

The value of the forwarding metric is derived according to the fact if the FA is set or not

For a non-set FA: the metric to ASBR

For a set FA: the metric to the FA and the FA should be known via inter-area or intra-area.

If the FA is known via external, it would be bypassed and not considered.

Thank you for reading and I hope this was informative for you.

Mustafa Nassef
ISP Network Engineer