{{ summaryTitle }} {{ summaryValue }} {{ summaryLine }} {{ badge.label }}{{ badge.value }}

OSPF interface cost assumptions
Enter the domain reference and its unit. Cisco IOS auto-cost reference-bandwidth commands use Mbps.
Enter the bandwidth denominator used by OSPF for this interface.
Use 0 for auto-cost, or enter the interface's configured cost.
cost
{{ workflowFeedback }}
The default floor policy preserves the normal product result when Advanced is opened.
The standard default leaves ordinary calculations unchanged.
maximum
{{ tableExportStatus.breakdown }}
FactorValueMeaningCopy
{{ row.factor }}{{ row.value }}{{ row.meaning }}
{{ tableExportStatus.guidance }}
CheckRecommendationReasonCopy
{{ row.check }}{{ row.recommendation }}{{ row.reason }}
{{ tableExportStatus.speeds }}
Interface speedRaw ratioAuto-costSeparation noteCopy
{{ row.label }}{{ row.ratio }}{{ row.cost }}{{ row.note }}
{{ chartExportStatus }}

Cost ladder

Common interface tiers on a logarithmic OSPF cost scale. Representative speed labels keep the ladder readable at every width.

Introduction:

Open Shortest Path First (OSPF) chooses routes by adding link costs along every candidate path and preferring the lowest total. Interface cost is therefore an administrative metric, not a measurement of current utilization, latency, packet loss, or monetary expense. A fast link usually receives a lower automatic cost, but only when the domain's bandwidth scale preserves a difference between that link and its neighbors.

That scale is the reference bandwidth. Automatic cost divides the reference by the interface bandwidth and turns the ratio into a positive integer. A 100 Gb/s reference gives a 10 Gb/s interface a raw ratio of 10, while a 100 Gb/s interface reaches the minimum cost of 1. If the same network kept an old 100 Mb/s reference, 1G, 10G, and 100G links would all fall below 1 before the minimum is applied, so speed differences disappear from the metric.

OSPF interface cost concepts
TermMeaningDesign consequence
Reference bandwidthShared numerator for automatic costToo low a value collapses fast links to cost 1
Interface bandwidthBandwidth value used for the denominatorA configured value may differ from physical line rate
Manual costExplicit interface metricReplaces automatic cost for that interface
Path costSum of interface costs along a routeEqual totals may produce equal-cost paths

Reference bandwidth must be planned across the OSPF domain. Changing one router alone can make the same link speed advertise different costs at different points in the topology. Manual overrides can express a design preference that bandwidth alone cannot capture, but they also hide the relationship between speed and cost and must be documented.

The arithmetic is only a pre-change check. Platform defaults, bandwidth commands, interface overrides, cost ranges, and integer handling can differ. Confirm the active interface cost and the resulting shortest paths on the actual routers before and after a routing change.

How to Use This Tool:

Use the same bandwidth values and integer policy that the target routing platform will use.

  1. Enter the domain Reference bandwidth and choose its unit. For Cisco IOS-style auto-cost configuration, the command value is expressed in Mbps.
  2. Enter the Interface bandwidth used by OSPF. Do not assume the port's nominal line rate when a bandwidth setting changes the routing value.
  3. Leave Configured override at 0 for automatic cost, or enter the positive integer configured on the interface.
  4. Open Advanced to select floor, nearest, or ceiling conversion and a cost ceiling. Match these choices to the platform or planning policy being evaluated.
  5. Compare Auto cost with Effective cost, then inspect how many speed tiers collapse to cost 1. Verify the intended path sums on the routers before changing production.

Interpreting Results:

Raw ratio is the unrounded reference-to-interface bandwidth quotient. Auto cost is that ratio after the chosen integer rule and the 1-to-ceiling bounds. Effective cost equals the manual override when one is present; otherwise it equals auto cost.

  • Minimum applied means the integer result was below 1 and was raised to 1. Several fast links may now be indistinguishable.
  • Ceiling applied means the integer result exceeded the selected ceiling and was limited there. Several slow links may collapse at the upper end.
  • Manual override means the configured integer controls the effective result even though the automatic comparison remains visible.
  • A sensible interface cost does not prove the end-to-end path is preferred; OSPF compares the sum of all costs to the destination.

Technical Details:

OSPF's link-state database carries costs used by the shortest-path calculation. The bandwidth quotient is a common vendor auto-cost convention; RFC 2328 requires an interface output cost greater than zero but does not prescribe this exact bandwidth formula or one universal rounding policy.

Formula Core:

Reference and interface bandwidth are first converted to Mbps so equivalent physical rates produce the same ratio regardless of the selected units.

Cauto= min(U, max(1, I(BrefBif) ))
OSPF interface cost formula symbols
SymbolMeaningRule
BrefReference bandwidth1 through 4,294,967 Mbps in this IOS-style model
BifInterface bandwidthPositive value converted to Mbps
IInteger policyFloor, round nearest, or ceiling
USelected cost ceilingInteger from 1 through 65,535
CautoBounded automatic costNever below 1 or above the selected ceiling

With a 100 Gb/s reference and a 10 Gb/s interface, both values normalize to 100,000 Mbps and 10,000 Mbps. The raw ratio is 10, so all three integer policies return auto cost 10. A manual cost of 250 leaves auto cost at 10 for comparison but makes effective cost 250.

Rule Core:

  1. Reject zero, negative, non-finite, or unsupported bandwidth values.
  2. Convert Kbps, Mbps, Gbps, or Tbps to Mbps and calculate the quotient.
  3. Apply the selected integer policy, then clamp the automatic result to at least 1 and at most the chosen ceiling.
  4. If configured override is greater than 0, use it as effective cost. The override must be a whole number no greater than the ceiling.

The speed comparison evaluates fixed tiers from 10 Mb/s through 400 Gb/s against the same reference, integer policy, and ceiling. Its cost-1 count reveals loss of differentiation at the fast end; it does not simulate a topology or calculate a route table.

Worked Examples:

Modern reference for a 10G uplink

A 100 Gb/s reference divided by a 10 Gb/s interface gives a raw ratio and auto cost of 10. With no override, effective cost is 10. The next check is the sum of this interface and downstream link costs along each competing route.

Fast-link collapse under an old reference

A 100 Mb/s reference divided by a 1 Gb/s interface gives 0.1. Floor conversion produces 0, so the positive minimum raises the auto cost to 1. Faster tiers also stay at 1, which signals that the reference needs review across the domain before relying on bandwidth-based path preference.

References: