Skip to content
Calcrivo

OSPF Cost Calculator

Calculate the OSPF interface cost from bandwidth and the configured reference bandwidth.

Inputs

Mbps
Mbps

Cisco default is 100 Mbps; often raised to 10000+ Mbps on modern networks.

OSPF Interface Cost

1

Raw (Unrounded) Cost

0.1000

Warning

Interface bandwidth exceeds reference bandwidth — cost floored to 1 (no differentiation from slower links).

Step by step

  1. Values used

    Interface Bandwidth = 1,000 Mbps; Reference Bandwidth = 100 Mbps

  2. OSPF interface cost

    cost = floor(reference_bandwidth / interface_bandwidth), minimum 1

  3. OSPF Interface Cost

    = 1

  4. Raw (Unrounded) Cost

    = 0.1000

  5. Warning

    = Interface bandwidth exceeds reference bandwidth — cost floored to 1 (no differentiation from slower links).

How it works

OSPF calculates a link's cost by dividing a configurable reference bandwidth by the interface's actual bandwidth, then rounding down to the nearest integer, with a minimum cost of 1. The default reference bandwidth on Cisco devices is 100 Mbps, a value set when Fast Ethernet was considered fast — any link at or above 100 Mbps produces a cost of 1, which fails to distinguish a 1 Gbps link from a 100 Gbps link. For this reason, most modern OSPF deployments raise the reference bandwidth (e.g. to 10,000 or 100,000 Mbps) so that cost values properly differentiate across the full range of link speeds in use.

Formula

OSPF interface cost

cost = floor(reference_bandwidth / interface_bandwidth), minimum 1

B_ref
Reference bandwidth (default 100 Mbps)
B_if
Interface bandwidth

Frequently Asked Questions

Why is the default OSPF reference bandwidth only 100 Mbps?

The 100 Mbps default was set when OSPF (RFC 2328) was standardized in an era when Fast Ethernet was near the top of typical link speeds. It has never been changed in the default configuration of most vendor implementations for backward compatibility, even though it now makes every link at or above 100 Mbps compute to the same minimum cost of 1.

What happens if all my links show OSPF cost 1?

It means every link's bandwidth is at or above your configured reference bandwidth, so OSPF's shortest-path calculation can no longer distinguish a fast link from a much faster one — the protocol will treat a 1 Gbps and a 100 Gbps path as equally 'good,' which can lead to suboptimal path selection on networks with mixed link speeds above the reference value.

How do I fix cost values that don't differentiate between fast links?

Raise the reference bandwidth (via the 'auto-cost reference-bandwidth' command on Cisco devices, configured consistently across the entire OSPF area/domain) to a value comfortably above your fastest link speed — many networks with 10G/40G/100G links use a reference bandwidth of 100,000 Mbps or higher so all link speeds get a distinct, proportionally accurate cost.

You might also need