Calculate OSPF interface cost from link bandwidth using the reference bandwidth formula.
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.
OSPF interface cost
cost = floor(reference_bandwidth / interface_bandwidth), minimum 1
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.
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.
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.