Network

OSPF Cost Calculator

Calculate OSPF interface costs from bandwidth and reference bandwidth, compare path totals, and fix the default that makes every link above 100 Mbit/s indistinguishable.

Last reviewed by the Radiatus Cloud team

Interface costs appear here.

Compare two paths

Path comparison appears here.

Need this monitored 24/7?

Radiatus delivers managed cloud & network operations.

Discuss managed ops

The default reference bandwidth stopped making sense in 1998

OSPF calculates interface cost as reference bandwidth divided by interface bandwidth, with a default reference of 100 Mbit/s. A 100 Mbit/s link therefore costs 1, and because cost is an integer with a minimum of 1, so does a gigabit link, a ten gigabit link and a hundred gigabit link. On any modern network the default makes every fast interface identical, so OSPF picks paths by hop count rather than by capacity and routinely prefers a slow path with fewer hops.

Raise it once, everywhere, or not at all

The fix is to raise the reference bandwidth so the fastest link in the network still produces a cost above 1. The critical constraint is that it must be identical on every router in the OSPF domain: routers with different reference bandwidths calculate different costs for the same link, and the resulting inconsistent view of the topology produces routing loops and suboptimal paths that are extremely difficult to diagnose because each router's own view is internally consistent.

Cost is unitless and the path total is what matters

OSPF sums the cost of every outgoing interface along a path and chooses the lowest total. Because it is a sum, a path with several moderately fast links can lose to one with a single very fast link, which is usually correct. Equal cost paths are load balanced, and the default maximum on most platforms is four, so deliberately engineering equal costs is how multipath is achieved.

Related tools

  • Port Scanner — Check which common ports respond on a host and understand what each exposed service means. Scan only systems you are authorised to test.
  • DNS Misconfiguration — Analyze DNS records (TXT, SPF) for security gaps.
  • TLS Compat Tester — Check client-server compatibility for TLS versions.
  • Firewall Rule Risk — Evaluate firewall rules for over-permissive exposure.

Frequently Asked Questions

What reference bandwidth should I use?

High enough that your fastest link still costs more than 1. On a network with 100 Gbit/s links, use 100000 or higher. The value must be identical on every router in the domain, so choose one with headroom for future upgrades rather than one that fits today exactly.

What happens if routers disagree on the reference bandwidth?

They calculate different costs for the same links, so each has a different view of the topology while being internally consistent. That produces suboptimal routing and, in some topologies, loops. It is one of the hardest OSPF faults to diagnose because every router looks correct on its own.

Can I set a cost manually instead?

Yes, with ip ospf cost on the interface, and that overrides the calculation entirely. It is the right approach for traffic engineering on specific links, and it becomes unmanageable as a substitute for setting the reference bandwidth correctly across the network.

How does equal cost multipath work?

Paths with identical total cost are load balanced, up to a platform maximum that defaults to four on most equipment. Deliberately engineering equal costs is how multipath is achieved, and a single differing cost anywhere along one path removes it from the set.

Is a lower cost always better?

OSPF always chooses the lowest total cost, so yes within the protocol. Whether that is the best path depends on whether cost reflects what you care about: it derives from bandwidth alone and knows nothing about latency, jitter, monetary cost or current utilisation.

Privacy & Security

Everything runs in your browser; nothing is uploaded.

Data: None
Client-side-Side
Active
v1.0

How to Use

Set your reference bandwidth and interface speeds to see the resulting costs and path metrics.

Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.