OSPF auto-cost reference-bandwidth: Design, Verification & Best Practices
In any network running OSPF (Open Shortest Path First), understanding how routing decisions are made is critical. OSPF selects the best path based on interface cost, which is derived from bandwidth. However, as link speeds increase, the default OSPF reference bandwidth quickly becomes insufficient.
This is where the auto-cost reference-bandwidth command becomes essential.
What Is OSPF Cost?
OSPF calculates interface cost using the formula:
Cost = Reference Bandwidth / Interface Bandwidth
By default, the reference bandwidth is 100 Mbps. While this was suitable in Fast Ethernet environments, it causes all modern high-speed links (1G, 10G, 40G, 100G) to appear identical in cost.
Why Adjust Reference Bandwidth?
Without adjusting the reference bandwidth:
- 1 Gbps and 10 Gbps links both calculate to cost 1
- OSPF cannot prefer faster paths
- Traffic engineering becomes impossible
To correct this, configure:
Router(config)# router ospf 87
Router(config-router)# auto-cost reference-bandwidth 1000
This sets the reference bandwidth to 1000 Mbps, allowing OSPF to distinguish between FastEthernet, Gigabit, and higher-speed links.
Verifying Interface Cost
Router# show ip ospf interface GigabitEthernet0/0
GigabitEthernet0/0 is up, line protocol is up
Internet Address 10.1.1.1/24, Area 0
Process ID 87, Router ID 1.1.1.1
Cost: 1
State DR, Priority 1
After Updating Reference Bandwidth
Router(config)# router ospf 87
Router(config-router)# auto-cost reference-bandwidth 10000
Router# show ip ospf interface GigabitEthernet0/0
Cost: 10
This confirms that OSPF now differentiates link speeds accurately.
IPv6 Version (OSPFv3)
In IPv6 networks, OSPFv3 uses the same cost calculation logic. The configuration is identical:
Router(config)# router ospfv3 10
Router(config-router)# auto-cost reference-bandwidth 10000
Important: OSPFv2 and OSPFv3 maintain separate processes. Reference bandwidth must be configured independently for IPv4 and IPv6.
OSPF vs EIGRP Cost Comparison
| Aspect | OSPF | EIGRP |
|---|---|---|
| Metric Type | Cost (Bandwidth-based) | Composite (Bandwidth + Delay) |
| Default Bandwidth Reference | 100 Mbps | Based on interface BW |
| Tuning Method | auto-cost reference-bandwidth | bandwidth / delay / variance |
| Granularity | Moderate | High |
| Vendor Support | Open standard | Cisco-centric |
Pitfalls & Real-World Case Studies
Pitfall 1: Inconsistent Reference Bandwidth
If routers in the same OSPF domain use different reference bandwidth values, they may calculate different costs for the same path. This can cause:
- Suboptimal routing
- Asymmetric traffic
- Routing loops in extreme cases
Pitfall 2: Ignoring Interface Bandwidth Command
OSPF relies on the configured interface bandwidth. If the bandwidth command is not
accurately set, cost calculations will be incorrect—even with the right reference bandwidth.
Real-World Case Study
A data center migration introduced 10G uplinks, but the reference bandwidth remained at 100 Mbps. Traffic continued to traverse legacy 1G links, causing congestion and packet loss until the reference bandwidth was corrected network-wide.
Further Reading
For a deeper understanding of OSPF architecture and behavior, visit the OSPF Wikipedia page .
Final Thoughts
The auto-cost reference-bandwidth command is not optional in modern networks—it is
foundational. Without it, OSPF cannot make intelligent decisions in high-speed environments.
Proper planning, consistent deployment, and verification ensure optimal and predictable routing.
No comments:
Post a Comment