OSPF cost calculation pitfall with high bandwidth interfaces


Cisco is using the (Reference bandwidth/interface Bandwidth) formula to calculate OSPF cost values of different interfaces; where the reference bandwidth is 10^8 by default.

Using this given formula the cost of FastEthernet links would be 1 and the cost of Ethernet links is 10.

This default reference bandwidth value is o­nly suitable for links with bandwidth value less than or equal to 100Mbit.However interfaces with higher bandwidth values will have cost values of less than 1.

This leads to routing problems because OSPF will assign all interfaces with bandwidth above 100Mbit the same cost of 1 (OSPF is rounding up all fractions to 1).

Cisco provides a solution for this problem by allowing the change of the Reference bandwidth using the command auto-cost reference-bandwidth to an appropriate value.

In the following example we are changing the reference bandwidth value from 100 to 1000 before installing GigaEthernet interface in o­ne of our routers in order to avoid the problems that may arise by OSPF giving the same cost to GigaEthernet and FastEthernet interfaces.

!-- Before changing the Reference value FastEthernet Cost is 1

R2(config-router)#do sh ip ospf int b
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Fa0/0 1 0 151.1.23.2/24 1 BDR 1/1
Se1/0 1 1 151.1.12.2/24 64 P2P 1/1

R2(config-router)#auto-cost reference-bandwidth 1000
% OSPF: Reference bandwidth is changed.
Please ensure reference bandwidth is consistent across all routers.

!-- After changing the refernce bandwidth value to 1000, GigaEthernet cost will be 1 and FastEthernet Cost is 10

R2(config-router)#do sh ip ospf int b
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Fa0/0 1 0 151.1.23.2/24 10 BDR 1/1
Se1/0 1 1 151.1.12.2/24 647 P2P 1/1

Check Also

Best AI tools list