Thursday, December 3, 2009

auto-cost reference-bandwidth command

This week, in our discussion of OSPF, we learned that Cisco uses a reference bandwidth of 10^8 divided by the interface bandwidth to determine the cost of a link. Using this formula, the cost of a FastEthernet link would be 1.

We also learned that using this calculation will not work for GigabitEthernet because OSPF will assign the interface the same cost of 1. (The value will be less than one after the calculation, but OSPF will round the result to 1).

We can change the reference bandwidth using the auto-cost reference-bandwidth command. Below, I have changed the reference bandwidth value from 100 Mbps (the default) to 1000. The cost of the GigabitEthernet link after the change has a cost of 1 - 10^9/1000000000 (1GigaEthernet).

When I changed the reference bandwith again, this time to a default of 10000, the link shows up with a cost of 10, the cost of a 10GigabitEthernet link.

Before changing reference bandwith - the cost is less than 1 but gets rounded to 1 - same as 100Mbps FastEthernet link:

R2#show ip ospf interface GigabitEthernet 0/0
GigabitEthernet0/0 is up, line protocol is up
Internet Address 192.168.1.1/24, Area 0
Process ID 1, Router ID 192.168.1.1, Network Type BROADCAST, Cost: 1 Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 192.168.1.1, Interface address 192.168.1.1
No backup designated router on this network
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:03
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 0
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
R2#

Change reference bandwidth to 1000 Mbps - 1 GigabitEthernet link:

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

After changing reference bandwith:

R2#show ip ospf interface GigabitEthernet 0/0
GigabitEthernet0/0 is up, line protocol is down
Internet Address 192.168.1.1/24, Area 0
Process ID 1, Router ID 192.168.1.1, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DOWN, Priority 1
No designated router on this network
No backup designated router on this network
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
R2#

Change reference bandwidth to make the default 10000 Mbps or 10GigabitEthernet:


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


R2#show ip ospf interface GigabitEthernet 0/0
*Dec 4 02:48:13.967: %SYS-5-CONFIG_I: Configured from console by console
GigabitEthernet0/0 is up, line protocol is up
Internet Address 192.168.1.1/24, Area 0
Process ID 1, Router ID 192.168.1.1, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 192.168.1.1, Interface address 192.168.1.1
No backup designated router on this network
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:03
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 0
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
R2#

No comments:

Post a Comment