OSPF Reference Bandwidth

This topic is to discuss the following lesson:

2 Likes

well explained.

“It now has a cost of 1 which means that a Gigabit interface would end up with a cost of 1.”

Did you mean 10? :wink:

1 Like

Oops yes :slight_smile: Just fixed it! Thanks Scott.

1 Like

check this command its not working

Router#show ip ospf | include Reference
 Reference bandwidth unit is 100 mbps

this one is working

Router#show ip protocols | include Reference

1 Like

Hey Rene,
I’ve seen auto-cost reference-bandwidth as well as reference-bandwidth.
Is there any difference between those two commands or are they just IOS version dependent?
Thank you!

I have only seen auto-cost reference-bandwidth for OSPF (both in IOS 12 and 15). There is a reference-bandwidth command, but it is in the NX-OS and unrelated to OSPF.

1 Like

well explained
thanks

HI Rene,

Do you have to set the reference bandwidth on both sides of a link? Is there a way of distributing a reference bandwidth throughout an OSPF area?

Hi Max,

There is no way to synchronize the reference bandwidth so you’ll have to configure it yourself.

It’s not mandatory to use the same metric on both sides, you could use different metrics if you want.

sir
i am little bit confused in refrence bandwidth
1> if i have gigabyte link in my side router and other side router also has a gigabyte link from which they are connected so i will set reference bandwidth to 1000mbps on both side router its compulsory
2> if i have gigabyte link in my side router and other side router has a fastethernet link from which they are connected so in this topology what we will do we will change the reference bandwidth on fastethernet router or not
(((Cisco IOS will warn you that you should do this on all OSPF routers ))) what about this line means

Hello Harshit

Fundamentally, reference bandwidth should always be the same on all routers taking part in OSPF. Now if you choose to use 1000 Mbps as the reference bandwidth or 10000Mbps, or even 100 Mbps, it doesn’t make a difference what the speeds on your interfaces are, as long as all routers are choosing costs based on the same reference bandwidth.

Now in the case where you have a GigabitEthernet interface connected to a FastEthernet interface, it shouldn’t make a difference. This is because if these two interfaces were connected, the GigabitEthernet link would revert to to 100Mbps, and the reference bandwidth used would refer to that speed rather than the GigabitEthernet speed. So even if you use 100Mbps or 1000Mbps for the reference bandwidth, the result would still be good.

Rule of thumb: always have the same reference bandwidth on all OSPF routers.

I hope this has been helpful!

Laz

1 Like

OSPF Unit 1: Chapter: Introduction to OSPF | Reference Bandwidth & Interface Bandwidth

I went through your video & Notes, i tried much, But I am not understanding,

  1. What is Reference Bandwidth & Interface Bandwidth in OSPF?

let me tell you, correct me please if i am wrong.

As per my understanding:

Interface Bandwidth Means: Device/ Router Physical Interface Bandwidth. Isn’t it?
Ex: 1000Mb: Gig0/0, 100Mb: Fa0/0, 10Mb: Eth0/0. Am i rite?

Reference Bandwidth Means: It is the Link Bandwidth. Isn’t it?
Ex: Internet Link: 50Mbps, MPLS Link: 10Mbps, P2P Link:2Mbps, Leased Line: 40Mbps. Am i rite?

I dint understand the below sentence in the OSPF Chapter, Unit 1: Chapter: Introdcution to OSPF

The reference bandwidth is a default value on Cisco routers which is a 100Mbit interface. You divide the reference bandwidth by the bandwidth of the interface and you’ll get the cost.

Acc to you: what is reference bandwidth is a default value on Cisco routers?

Hope you would help me soon.

Thanks,
Sanjay

Hello Sanjaykumar

There are several definitions involved here. These are the following:

Physical interface bandwidth is the bandwidth that the actual interface is capable of. For Ethernet this is typically 10, 100, 1000 Mbps, or 10 Gbps. This of course can be adjusted using the speed command in the interface configuration mode to one of these compatible speeds. Note here that the actual physical bandwidth does not get involved at all with the configuration of reference and interface bandwidth for OSPF.

Interface bandwidth is a configurable value that is attached to an interface. If you do a show interface command, you will see it like so:

Router#show inter gig 0/0
GigabitEthernet0/0 is administratively down, line protocol is down (disabled)
  Hardware is CN Gigabit Ethernet, address is 0060.478b.9501 (bia 0060.478b.9501)
  MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)

!<-- output omitted -->

In the above output you can see the value of interface bandwidth in the fourth line after the characters BW. For the above interface, the default value of BW is 1000000 Kbps which is 1 Gbps, which is the physical speed of the interface.

Now, interface bandwidth is configurable. You can change it on each interface using the bandwidth command. By changing the bandwidth, you do not change the actual bandwidth of the physical interface! But, it is a value that can be configured to be used by dynamic routing protocols, such as OSPF, to calculate metrics. So you can adjust the interface bandwidth of each particular interface to affect the metric assigned by OSPF, and thus affect the routing decisions being made.

Now the reference bandwidth is a global value per OSPF instance that is used in the overall calculation of the metric. By default, the reference bandwidth is 100 Mbps. This means that when the metric is calculated, we do the following:

reference bandwidth / interface bandwidth

So if we have an interface configured with an interface bandwidth of 100Mbps, with a default reference bandwidth of 100Mbps then we would have a cost of:

100 Mbps / 100Mbps = 1

The problem with this is that if we have an interface with a reference bandwidth of 1000 Mbps, the calculation would be:

100 Mbps / 1000 Mbps = 0.1

But because metric can only have integer values, this would be rounded up to 1.

So a GigabitEthernet interface and a FastEthernet interface, with their default interface bandwidths, would be considered to have the same cost in OSPF.

So why do we use such a small reference bandwidth? Because OSFP was developed many years ago, when 100Mbps was the fastest Ethernet available at the time.

To solve this problem, we can either go to all the interfaces on our routers and reduce the interface bandwidth values (remember this does not change the actual speeds, but only changes the evaluation of the metric by routing protocols) or we can simply change the single reference bandwidth that will allow the metric calculations to take larger speeds into account, such as 1 Gbps, 10 Gbps, 40 Gbps and beyond.

I hope this has been helpful!

Laz

Hi, I was looking at my OSPF setting on Cisco ASA. I don’t understand why would the interface cost is 10 instead of 1?
Capture

Hello Helen

According to most Cisco references, it’s not possible to change the reference bandwidth unit on the Cisco ASA at least as of version 9.8. But you can change the cost on an interface manually using the ospf cost XXX command using the interface mode. More info on this can be found here:

Check to see if the cost has been manually configured on this interface.

I hope this has been helpful!

Laz

Hi Laz,

Thank you for the document. My question is the cost = reference BW/ Interface BW which in this case is 100/1000. Why the cost is 10 instead of 1?

Thanks

Hello Helen

I went in and fired up a Cisco ASA and found that the OSPF cost on all interfaces is actually 10 regardless of the reference bandwidth or the interface speed. Looking at Cisco documentation, there is nothing very clear about why this behaviour takes place. It actually says that:

The ASA calculates the cost of an interface based on link bandwidth rather than the number of hops to the destination. The cost can be configured to specify preferred paths.

But this does not seem to be the case. I am using a Cisco ASA Software Version 9.9(2) and all costs are indeed 10.

Digging a little further, I have found from a Cisco Press publication the following:

The unitless OSPF cost for the interface becomes interface_cost (0 to 65535; the default is 10). The higher the interface bandwidth, the lower the cost value becomes. A firewall has a default cost of 10 for all interfaces, regardless of their speeds. This behavior is different from Cisco routers running Cisco IOS Software, where both Fast Ethernet and Gigabit Ethernet have a cost of 1.

Practically speaking, it seems that the Cisco publication is correct, at least for the versions of ASA that you and I are using, and not the documentation. Further, it seems strange that OSPF actually has a reference bandwidth configured and stated in the output of the show ospf command even though it is not used to calculate the OSPF cost for interfaces.

It’s just one of those strange things that Cisco engineers have designed into the ASA without actually having that functionality. It’s just another one of those peculiar differences between IOS and ASA.

I hope this has been helpful!

Laz

Thank you very much Laz. Wish you a good day!

1 Like

Hi ,

So when reference bandwidth is adjusted it will be applied to all the interface associated on the Router so accordingly calculation will be made , am i right ?

Regards
shaan