OSPF Cost Bandwidth Calculator
Computes OSPF interface cost using the 100 Mbps reference divided by link bandwidth.
—
OSPF Cost Formula & Reference Bandwidth
The Open Shortest Path First protocol (OSPFv2 for IPv4, OSPFv3 for IPv6) is a link-state IGP standardized in RFC 2328. Every interface gets a metric called cost, which comes from cost = reference_bandwidth / interface_bandwidth, rounded down and never less than 1. Routers flood Link-State Advertisements (LSAs) around, then run Dijkstra's SPF algorithm to work out a shortest-path tree to every prefix.
On Cisco IOS the default reference bandwidth is 100 Mbps. A 100 Mbps Fast Ethernet link costs 1, and here's the catch: so does a 1 Gbps or 10 Gbps link, because the protocol can't tell them apart. The fix in a modern datacenter is to raise the reference with auto-cost reference-bandwidth 100000 (100 Gbps), which puts 10 Gbps at cost 10 and 1 Gbps at cost 100. You have to set the same value on every router in the area, or the metrics stop lining up.
Applications
OSPF breaks large networks into areas joined by a backbone (area 0). The routers sitting on area boundaries are ABRs (Area Border Routers), and the ones redistributing external routes are ASBRs (Autonomous System Boundary Routers). In WAN design, cost tuning is how you make fiber win out over a microwave link, how you set up failover between a primary and backup circuit, and how you spread load across equal-cost multipath (ECMP) parallel paths.
FAQ
Why does 10 Gbps default to cost 1? The default reference bandwidth of 100 Mbps caps any link ≥ 100 Mbps at cost 1. The formula rounds down and won't go below 1, so everything that fast lands on the floor.
Can I set cost manually? You can. Putting ip ospf cost <n> on the interface overrides whatever the formula computed, which comes in handy when you want path selection driven by policy.
What is the difference between OSPFv2 and OSPFv3? OSPFv3 (RFC 5340) handles IPv6 natively, no longer ties adjacency to the IP subnet, and operates per-link rather than per-subnet. The cost formula stays exactly the same.
Related Tools
TCP Bandwidth-Delay Product
Multiplies link bandwidth in Mbps by round-trip time in milliseconds to size the TCP window that keeps the pipe full, reported in bytes, KB and MB.
EIGRP Metric Calculator
Estimates EIGRP composite metric from minimum bandwidth and cumulative delay in the path.
TCP Window BDP Calculator
Computes ideal TCP window size from bandwidth (Mbps) and RTT (ms) using bandwidth-delay product.
ERC-20 Transfer Cost Calculator
Estimate the cost of an ERC-20 token transfer (about 65k gas) on the Ethereum network. Enter the gas price and see the total in ETH and US dollars.
Low-cost vs Conventional Travel Savings
Shows savings from choosing low-cost travel (hostel, street food, public transport) over conventional.
CAC (Customer Acquisition Cost)
Divides total marketing and sales spend by the number of new customers won in the same period, giving the average cost of acquiring one customer.
The results provided by this tool are for general informational and educational purposes only and do not constitute professional, financial, medical, legal, tax or accounting advice. Always confirm important decisions with a qualified professional and official sources.