OSPF Load Balancing: preferring the path with the least latency
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2013 10:44 AM - edited 03-04-2019 07:50 PM
Hi,
I am currently load balancing between two paths to my remote site. However, one path has a 300ms rtt and the other is 250ms rtt. I would of course prefer the later. Without messing with the OSPF Cost, is it possible to prefer the second path?
Thank you.
- Labels:
-
Routing Protocols

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2013 10:58 AM
Hi yes you can another option is to configure the 300 ms path to use another area other than area 0 and have the 250 ms path be on area 0 so the path takes the backbone area.
but the less intrusive is cost at the interface level or route maps and adjusting metrics being sent to the remote router.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2013 11:22 AM
Thanks Juan! I'm not sure of the actual impact if i modify the area os the links Could you expound on the other option
"route maps and adjusting metrics being sent to the remote router."
Here's a simple diagram for your reference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2013 11:57 AM
Perhaps we need a little clarification about what you mean and what results you really want. In the original post you say that you are load balancing between two paths. I assume that this means that you are actively using both paths and sending some traffic over one path and some traffic over the other path. Is this an accurate understanding?
Then you say that you would prefer the lower latency path. Does this still mean that you want to use both paths but to send more traffic over the lower latency path? Or does this mean that you would be satisfied if the lower latency path were preferred and carried all the traffic and the higher latency path was a backup?
Modifying the OSPF cost on one of the interfaces will result in the second alternative where one path is preferred, carries all the traffic, and the other path is a backup.
OSPF does equal cost load balancing and if the two paths have equal cost then OSPF will treat them equally. It is not possible to use OSPF and achieve the result that one path carries more of the traffic than the other path and both paths carry some traffic. You might achieve this with EIGRP or with Performance Routing. But you can not achieve it with OSPF.
HTH
Rick
Rick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2013 12:09 PM
Hi Rick,
I would prefer not to load balance because access in terms of speed, to a remote application will vary. Prioritize the 250ms path and the 300ms path would be a backup link would be the goal.
Yes, i was hoping there is another way than modifying the cost.
Thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2013 12:14 PM
Is there a specific reason for avoiding 'cost'
because with this, you can achieve exactly what you want in a single command.
Sent from Cisco Technical Support iPhone App
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2013 12:20 PM
With OSPF I do not believe that there is any other option that works other than adjusting the OSPF cost on the interface. And that will give you exactly the result that you say you desire - OSPF will prefer the lower cost (lower latency) path and will use the higher cost (higher latency) path as a backup.
HTH
Rick
Rick

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2013 01:06 PM
You can configure a route-map on B for the routes sent to C to have higher metrics than the routes on D and set the maximum paths to 1 on the remote router C so it does not install multiple routes into the routing table. Give that a try but a simple interface cost adjustment will fix your problem and the way to go
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2013 05:52 PM
Do you really think that a route map on B will affect OSPF advertisements? Remember that OSPF advertises LSAs (not routes per se) and that while a route map might affect advertisement of metrics for routes it does not have the capability to change the parameters advertised in OSPF LSAs.
HTH
Rick
Rick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2013 05:24 AM
good point I agree how about if you changed the metric-type?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2013 05:38 AM
how do you change the metric type for one path without affecting the other path?
What the original poster says he wants is to get away from equal cost load balancing and to have a preferred path and a backup path. In OSPF the way to do that is to change the cost. You can accomplish that either directly by assigning an OSPF cost to an interface or you can do it indirectly by changing the bandwidth statement on one of the interfaces, which will change the OSPF calculation of the cost. I believe it is better to directly assign the cost than it is to change the bandwidth.
HTH
Rick
Rick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2013 07:23 AM
Great points and you are right.
