08-21-2015 04:44 PM - edited 03-08-2019 01:28 AM
Pretty straight forward question....L3 device with equal cost paths to destination. Both next hops are equal distance in terms of AD and metric (think shared segment with 3 devices). Traceroute will show both next hops when in the reply. Now, how does the router determine the first probe to send to? And how do you change this behavior?
For example, traceroute 8.8.8.8 will send probe to both 10.1.1.1 and 10.1.1.2 (equal cost next hops). Now, was 10.1.1.1 the first probe sent simply because its lower? How do you change this behavior such that 10.1.1.2 will be sent the first probe first?
Reply....
1 - 10.1.1.1
10.1.1.2
08-22-2015 12:49 PM
Since they are equal cost, the router randomly pick one or the other. So the router will load balance the traffic between the 2 next hops. Now, this load balancing is not always 50/50. It could be 40/60 or 70/30 and so on. If you change the behavior by changing the metric or cost than that is not equal cost and so there is no load balancing, but rather active/stand-by.
HTH
08-22-2015 01:08 PM
Reza,
It doesn't seem to be random as the traceroute will always pick the same next hop first no matter how many traceroutes you do.
Also, there MUST be a way to change this behavior so that the router will choose next hop option 2 first instead of next hop option 1 first. (This wasn't some random question I came up with)
Thanks
Sean
08-22-2015 01:35 PM
Sean,
By default the router does per destination load balancing. So, if the first destination is 8.8.8.8 the router may take 1.1 and if the second destination is 8.8.4.4 the router may take 1.2.
Have a look at these 2 docs for more info
http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/5212-46.html
http://www.cisco.com/c/en/us/td/docs/ios/ipswitch/configuration/guide/12_4/isw_12_4_book/cef_load_balancng.html#wp1062771
HTH
08-22-2015 01:40 PM
Reza,
If I do a traceroute to 8.8.8.8 multiple times, it will always choose 1.1 as you noted above. Now, again, the first question... how does IOS choose 1.1 as the first choice? it cant be random as the real question/scenario is to change this behavior and to use the second NH first.
Sean
08-23-2015 03:10 PM
Sean
Perhaps you can share with us what is your real question or real objective? Why would it be important to change which next hop is chosen first? If we knew that we might be able to offer better suggestions.
In the good old days when I learned Cisco networking there was a fairly simple answer (and the answer would have led to the behavior that each successive traceroute would have alternated which first hop was used). Back in the day when we had only process switching and fast switching, then for process switched packets (like traceroute generated from the router) the router would track which next hop had been most recently used and would use the other next hop for the next packet to that destination. Things changed as Cisco introduced CEF. I suspect that the answer to your question about which next hop is used first depends on the content of the CEF tables. My guess is that in the CEF table one route is listed first with the other route as an alternate and that for the traceroute it looks I the CEF table and begins with the first entry. It would require someone with more expertise in CEF than I have to tell you whether it is possible to change which of the next hops if listed first in the table.
HTH
Rick
08-23-2015 08:30 PM
Thanks Rick and Reza....this question didn't arise out of thin air....just looking for some help after failing to find an answer after hours looking at documentation and asking others...
10-20-2015 06:53 PM
Did you ever find the answer for your question? I am interested to know if there was a solution to the problem.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide