Cisco – Using latency to calculate OSPF metrics

ciscoospf

Is it possible to configure OSPF to use latency in its link cost/metric calculations. The idea being to enable performance based routing whereby the fastest and least congested links in the network will be chosen dynamically, rather than relying on OSPF's default behaviour which results in 100Mbps links having the same cost as 1Gbps links.

Best Answer

Is it possible to configure OSPF to use latency in its link cost/metric calculations. The idea being to enable performance based routing whereby the fastest and least congested links in the network will be chosen dynamically, rather than relying on OSPF's default behaviour which results in 100Mbps links having the same cost as 1Gbps links.

Short answer: No, not with OSPF alone

Long answer:

The only way for OSPF to dynamically calculate paths based on latency / congestion is to use MPLS Traffic Engineering with offline optimizations of MPLS TE costs based on your criteria; MPLS TE uses OSPF LSAs to carry information about the label switched paths. However, MPLS Traffic Engineering is a heavy hammer and many network operations can't deal with the additional workflow introduced into provisioning or troubleshooting MPLS TE.

Another answer suggests that you should not adjust link costs based on bandwidth, and to use the role of a node for costs. I can't speak for his network, but this guidance is unnecessary in many cases since the lowest cost path in a well-designed topology automatically follows through the core of the network. I wouldn't try to adjust an inefficient topology with link costs... just make traffic flow through the core naturally and ensure that OSPF sees a 1GE as a better path than a FastEthernet link. This will naturally happen if you lay out the topology well, and use auto-cost reference-bandwidth under the OSPF process. Be sure you use this on all OSPF routers so they understand the link costs in the same way.