To understand Open Shortest Path First (OSPF) we need to know that OSPF uses “Cost” as the value of metric and also uses a Reference Bandwidth of 100 Mbps for cost calculation and implementation.
The simple formula to calculate the cost is by using Reference Bandwidth and divide it by interface bandwidth. Let take a look at an as I shown below:
example, in the case of 10 Mbps Ethernet , OSPF Metric Cost value is 100 Mbps / 10 Mbps = 10.
The default Reference Bandwidth of OSPF is 100 Mbps and the default OSPF cost formula doesn’t differentiate between interfaces with bandwidth faster than 100 Mbps. These days, 1 Gbps and 10 Gbps links are also common.
The according to the default OSPF metric Cost value calculation, the default OSPF Cost for Fast Ethernet interface (100 Mbps) and a Gigabit Ethernet interface (1 Gbps) are same.
If you want to change the default behavior, the cost formula can be adjusted using the “auto-cost” command under the OSPF routing process. If you are changing the default OSPF Reference Bandwidth, make sure that you have changed the OSPF Reference Bandwidth in all your OSPF Routers.
The Following table below comprises of lists of OSPF default Cost values for different interface bandwidths.