OSPF FORWARD METRIC CONCEPT

 Difference between E1 and E2 routes:
  • If external prefixes are redistributed as E1, internal OSPF metrics are added to the OSPF Seed metric (20).
  • If external prefixes are redistributed as E2(default), internal OSPF metrics are not added to the OSPF Seed metric (20).
 Consider the diagram below:




  •  Scenario 1:External prefix 9.9.0.6/32 redistributed as E1.


R5(config-router)#redistribute rip subnets metric-type 1
—————–
We have taken FastEthernet links the topology which has default cost of “1”.
Shortest path from R1 to reach 9.9.0.6/32 is via R1-R2-R5.
1 (R1-R2 cost) + 1 (R2-R5 cost) + 20 (OSPF default seed metric) = 22.
R1#sh ip route 9.9.0.6
Routing entry for 9.9.0.6/32
  Known via “ospf 1”, distance 110, metric 22, type extern 1
  Last update from 9.9.12.2 on FastEthernet0/0, 00:04:32 ago
  Routing Descriptor Blocks:
  * 9.9.12.2, from 9.9.0.5, 00:04:32 ago, via FastEthernet0/0
      Route metric is 22, traffic share count is 1
The cost to reach 9.9.0.6/32 through the path R1-R3-R4-R5  is  23.


  • Scenario 2 : External prefix 9.9.0.6/32 redistributed as E2.


When routes are redistributed as E2, internal OSPF costs are not added. So we can expect that cost for 9.9.0.6/32 on R1 should be same. But this is not the case.
Here comes the concept of Forward Metric.
—————–
R5(config-router)#redistribute rip subnets metric-type 2
—————–
R1#sh ip route 9.9.0.6
Routing entry for 9.9.0.6/32
  Known via “ospf 1”, distance 110, metric 20, type extern 2, forward metric 2
  Last update from 9.9.12.2 on FastEthernet0/0, 00:00:03 ago
  Routing Descriptor Blocks:
  * 9.9.12.2, from 9.9.0.5, 00:00:03 ago, via FastEthernet0/0
      Route metric is 20, traffic share count is 1
We can see from above output that R1 is still taking R1-R2-R5 path to reach R6 even when prefix 9.9.0.6/32 is received on R1 with same OSPF metric 20.
This is because of Forward metric. The forward metric is cost to reach ASBR.
On R1, The forward metric to reach ASBR R5 via R2 is 2 and via R3,R4 is 3.
Therefore based on shortest Forward metric learned for R1-R2-R5 path. R1 prefers R1-R2-R5 path to reach 9.9.0.6/32.


  • Scenario 3 : Load balancing the traffic for prefix 9.9.0.6/32 on R1.
Prefix 9.9.0.6/32 is redistributed as E2(default). Increase the OSPF cost for R1-R2 link to  ” 2″  as below:
————————–
R1(Config)# int f0/0
R1(config-if)#ip ospf cost 2
—————————
This will make the Forward Metric for both paths R1-R2-R5 and R1-R3-R4-R5 as 3 and we can see two paths in the routing table for 9.9.0.6 on R1.
—————————
R1#sh ip route 9.9.0.6
Routing entry for 9.9.0.6/32
  Known via “ospf 1”, distance 110, metric 20, type extern 2, forward metric 3
  Last update from 9.9.13.3 on FastEthernet0/1, 00:01:30 ago
  Routing Descriptor Blocks:
    9.9.13.3, from 9.9.0.5, 00:01:30 ago, via FastEthernet0/1
      Route metric is 20, traffic share count is 1
  * 9.9.12.2, from 9.9.0.5, 00:01:35 ago, via FastEthernet0/0
      Route metric is 20, traffic share count is 1


  • Scenario 4: Preferring R1-R3-R4-R5 path to reach 9.9.0.6/32 (Type-E2) from R1.


Let’s change cost of R1-R2 link to 5 which will make the Forward Metric for R1-R2-R5 path as 6.
————————-
R1(config)#int f0/0
R1(config-if)#ip ospf cost 5
————————-
R1 will prefer R1-R3-R4-R5 path which has Forward Metric of 3 to reach 9.9.0.6/32.
—————————-
R1#sh ip route 9.9.0.6
Routing entry for 9.9.0.6/32
  Known via “ospf 1”, distance 110, metric 20, type extern 2, forward metric 3
  Last update from 9.9.13.3 on FastEthernet0/1, 00:07:07 ago
  Routing Descriptor Blocks:
  * 9.9.13.3, from 9.9.0.5, 00:07:07 ago, via FastEthernet0/1
      Route metric is 20, traffic share count is 1


Hope you have enjoyed reading this Post. Please share your feedback if you liked this post. You can also write to us on networkurge@gmail.com.