Bandwidth Setting and Cost Explanation in OSPF:
==========
10 Mb
10*1000 = Kb = 10000 Kb
10000*1000 = 10000000 b
100000000
---------
10000000
=10
=============================
Fast Ethernet:
==============
100 Mb
100 * 1000 = 1000000 Kb
100000 * 1000 = 100000000 b
100000000
---------
100000000
=1
100000000
---------
64
=1562500 b
1562500 / 1000 = 1562.5 Kb
1562.5 / 1000 = 1.56 Mb
OSPF Reference Bandwidth
OSPF uses a simple formula to calculate the OSPF
cost for an interface with this formula:
cost = reference bandwidth / interface bandwidth
The reference bandwidth is a value in Mbps that
we can set ourselves. By default this is 100Mbps on Cisco IOS routers. The
interface bandwidth is something we can lookup.
To see your Reference Bandwidth –
Let’s take a look at an example of how this
works. I’ll use this router:
The router above has two interfaces, a
FastEthernet and a serial interface:
R1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.1.1 YES manual up up
Serial0/0 192.168.2.1 YES manual up up
Let’s enable OSPF on these interfaces:
R1(config)#router ospf 1
R1(config-router)#network 192.168.1.0 0.0.0.255
area 0
R1(config-router)#network 192.168.2.0 0.0.0.255
area 0
After enabling OSPF we can check what the
reference bandwidth is:
Router#show ip ospf | include Reference
Reference
bandwidth unit is 100 mbps
By default this is 100 Mbps. Let’s see what cost
values OSPF has calculated for our two interfaces:
Router#show interfaces FastEthernet 0/0 |
include BW
MTU 1500
bytes, BW 100000
Kbit/sec, DLY 100
usec
Router#show ip ospf interface FastEthernet 0/0
| include Cost
Process ID
1, Router ID 192.168.1.1, Network Type BROADCAST, Cost: 1
The FastEthernet interface has a bandwidth of
100.000 kbps (100 Mbps) and the OSPF cost is 1. The formula to calculate the
cost looks like this:
100.000 kbps reference bandwidth / 100.000
interface bandwidth = 1
Changing the reference bandwidth
To
change the reference bandwidth, enter a command such as the following at the
OSPF configuration level of the CLI.
ITBD(config)# router ospf
device(config-ospf-router)#
auto-cost reference-bandwidth 500
The reference bandwidth
specified in this example results in the following costs:
- 10
Mbps port’s cost = 500/10 = 50
- 100
Mbps port’s cost = 500/100 = 5
- 1000
Mbps port’s cost = 500/1000 = 0.5, which is rounded up to 1
The costs for 10 Mbps and
100 Mbps ports change as a result of the changed reference bandwidth. Costs for
higher-speed interfaces remain the same.
Syntax: [no]
auto-cost { reference-bandwidth num | use-active-ports }
The num parameter
specifies the reference bandwidth and can be a value from 1 - 4294967. The
default is 100.
To restore the reference
bandwidth to its default value and thus restore the default costs of interfaces
to their default values, enter the following command.
ITBD(config-ospf-router)# no
auto-cost reference-bandwidth
Router#configure terminal
Enter configuration commands, one per
line. End with CNTL/Z.
Router(config)#interface
Ethernet0
Router(config-if)#bandwidth 10000000
Router(config-if)# exit
The other way of affecting the cost of an interface is through the "ip
ospf cost" command on the interface itself, this will override
the calculated cost.
Router1(config)#int f1/0
Router1(config-if)#ip ospf cost 12345
Router(config-if)# exit
Verification commands
1) Router#sh ip ospf interface fa0/0 | in Cost
Process ID 100, Router ID
10.1.1.2, Network Type BROADCAST, Cost:
10
2)Router#sh ip ospf interface brief
Interface PID
Area IP
Address/Mask Cost State Nbrs F/C
Fa0/0
100
0
10.1.1.2/24
10 BDR 1/1
Red Prism Group ins one of the best Django coaching in Noida. Learn Django from industry expert with practical training, live projects and got your certificate.
ReplyDelete