cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3784
Views
0
Helpful
12
Replies

IP CEF Load Balancing

mrana0101
Level 1
Level 1

Hello Support Community

Hope you are able to shed some light on my question.

Below output showing CEF entry for the destination 10.255.225.26 and per-destination CEF load balancing algorithm is enabled.

pe02#sh ip cef 10.255.225.26 detail 

10.255.225.26/32, epoch 2, per-destination sharing

  local label info: global/3721

  nexthop 10.183.64.254 GigabitEthernet0/0/1 label 783571

  nexthop 10.183.65.254 GigabitEthernet0/0/0 label 783571

pe02#

In 1st trace below: I see that the packet hits first to next-hop IP 10.183.65.254

pe02#traceroute 10.255.225.26 source lo0

Type escape sequence to abort.

Tracing the route to 10.255.225.26

VRF info: (vrf in name/id, vrf out name/id)

  1 10.183.65.254 [MPLS: Label 783571 Exp 0] 1 msec

    10.183.64.254 [MPLS: Label 783571 Exp 0] 0 msec

    10.183.65.254 [MPLS: Label 783571 Exp 0] 2 msec

  2 10.255.251.165 [MPLS: Label 698836 Exp 1] 52 msec 52 msec 51 msec

pe02#

In 2nd trace below: I see that the packet hits first to next-hop IP 10.183.64.254

pe02#traceroute 10.255.225.26 source lo0

Type escape sequence to abort.

Tracing the route to 10.255.225.26

VRF info: (vrf in name/id, vrf out name/id)

  1 10.183.64.254 [MPLS: Label 783571 Exp 0] 1 msec

    10.183.65.254 [MPLS: Label 783571 Exp 0] 1 msec

    10.183.64.254 [MPLS: Label 783571 Exp 0] 0 msec

  2 10.255.251.165 [MPLS: Label 698836 Exp 1] 52 msec 51 msec 52 msec

pe02#

I am wondering if it is possible that the first packet hits to next-hop 10.183.64.254 every single time? I have tried using the per-packet load sharing algorithm for CEF but to no avail.

Not sure if this may be possible to accomplish as it may be down to hash buckets?

Thanks

Ahsan Rana

Ahsan Rana
1 Accepted Solution

Accepted Solutions

Ahsan

Yes it is a round robin next hop selection (for traffic generated by the router). And this does mean that you can not configure the router to use a particular next hop as the first next hop.

HTH

Rick

HTH

Rick

View solution in original post

12 Replies 12

Joseph W. Doherty
Hall of Fame
Hall of Fame

Not sure what you're asking.

Ok, let me try once more.

Below is how my 1st trace looks like:

pe02#traceroute 10.255.225.26 source lo0
Type escape sequence to abort.
Tracing the route to 10.255.225.26
VRF info: (vrf in name/id, vrf out name/id)
  1 10.183.65.254 [MPLS: Label 783571 Exp 0] 1 msec  <<<<<<<< 1st Packet goes out via GigabitEthernet0/0/0
    10.183.64.254 [MPLS: Label 783571 Exp 0] 0 msec
    10.183.65.254 [MPLS: Label 783571 Exp 0] 2 msec
  2 10.255.251.165 [MPLS: Label 698836 Exp 1] 52 msec 52 msec 51 msec
pe02#

Below is how my 2nd trace looks like:

pe02#traceroute 10.255.225.26 source lo0
Type escape sequence to abort.
Tracing the route to 10.255.225.26
VRF info: (vrf in name/id, vrf out name/id)
  1 10.183.64.254 [MPLS: Label 783571 Exp 0] 1 msec  <<<<<<<< 1st Packet goes out via GigabitEthernet0/0/1
    10.183.65.254 [MPLS: Label 783571 Exp 0] 1 msec
    10.183.64.254 [MPLS: Label 783571 Exp 0] 0 msec
  2 10.255.251.165 [MPLS: Label 698836 Exp 1] 52 msec 51 msec 52 msec
pe02#

in above traces: the order of the 1st IP on Hop#1 is changed - marked with bold.

question is: if it is possible to keep the order of the next-hop IP the same in every trace? and we have get the same output each time we trace. the desired output for traces should be as below:

1st trace:

pe02#traceroute 10.255.225.26 source lo0
Type escape sequence to abort.
Tracing the route to 10.255.225.26
VRF info: (vrf in name/id, vrf out name/id)
  1 10.183.64.254 [MPLS: Label 783571 Exp 0] 1 msec
    10.183.65.254 [MPLS: Label 783571 Exp 0] 1 msec
    10.183.64.254 [MPLS: Label 783571 Exp 0] 0 msec
  2 10.255.251.165 [MPLS: Label 698836 Exp 1] 52 msec 51 msec 52 msec
pe02#

2nd trace:

pe02#traceroute 10.255.225.26 source lo0
Type escape sequence to abort.
Tracing the route to 10.255.225.26
VRF info: (vrf in name/id, vrf out name/id)
  1 10.183.64.254 [MPLS: Label 783571 Exp 0] 1 msec
    10.183.65.254 [MPLS: Label 783571 Exp 0] 1 msec
    10.183.64.254 [MPLS: Label 783571 Exp 0] 0 msec
  2 10.255.251.165 [MPLS: Label 698836 Exp 1] 52 msec 51 msec 52 msec
pe02#

Ahsan Rana

Part of what is going on is that you have two equal cost paths toward this destination. This is shown clearly in your output

  nexthop 10.183.64.254 GigabitEthernet0/0/1 label 783571

  nexthop 10.183.65.254 GigabitEthernet0/0/0 label 783571

And if you look at each of the traceroutes you will see that for the probe packets with TTL of 1 (the first set of probes that traceroute sends) it is alternating paths. If the first probe used 64.254 then the second probe uses 65.254, and the third probe uses 64.254. Or if the first probe uses 65.254 then the second probe will use 64.254 and the third probe will use 65.254.

If you want the first probe to always use the same next hop then you could tell traceroute to use 2 probes per TTL rather than the default 3 probes per TTL.

Note that this behavior is about forwarding traffic that is generated by the router itself. For transit traffic that the router is forwarding it should always use the same next hop. Does it really matter which next hop is used first in a traceroute?

HTH

Rick

HTH

Rick

(purpose of this question is studies related)

Thanks Rick for taking a look into this and getting me closer.

with 2 probes per TTL gives the same the next hop 65.254 in every single trace, below output for reference.

pe02#traceroute 10.255.225.26 source lo0 probe 2
Type escape sequence to abort.
Tracing the route to 10.255.225.26
VRF info: (vrf in name/id, vrf out name/id)
  1 10.183.65.254 [MPLS: Label 783571 Exp 0] 0 msec
    10.183.64.254 [MPLS: Label 783571 Exp 0] 2 msec
  2 10.255.251.165 [MPLS: Label 698836 Exp 1] 52 msec 51 msec

now the real question: is it possible to use the 2nd next-hop 64.254 as the first hop? Is there a trick which can make this happen?

Ahsan Rana

Let me try to clear something up. You say "gives the same the next hop 65.254 in every single trace". But if you look carefully in the most recent traceroute output you see that the first probe did use 65.254 as the next hop, but the second probe use 64.254 as the next hop. So both next hops are being used in the traceroute.

The thing to understand here is that for traffic generated by the router itself it alternates the next hop.  If you understand this point then it becomes easy to answer your question about whether it is possible to set it so that the router uses 65.254 as the first next hop. Yes it is. If you do a traceroute with a single probe (or a ping with a single ping packet) then it would use 65.254 as the next hop. Then the next traceroute that you do will use 64.254 as its first next hop.

HTH

Rick

HTH

Rick

appears as I was not clear on what I wanted to convey, my apologies.

specifying two probes now generates below output, where traffic via both links is load balanced.

pe02#traceroute 10.255.225.26 source lo0 probe 2
Type escape sequence to abort.
Tracing the route to 10.255.225.26
VRF info: (vrf in name/id, vrf out name/id)
  1 10.183.65.254 [MPLS: Label 783571 Exp 0] 0 msec
    10.183.64.254 [MPLS: Label 783571 Exp 0] 2 msec
  2 10.255.251.165 [MPLS: Label 698836 Exp 1] 52 msec 51 msec

in above trace 1st probes show the next-hop 10.183.65.254

2nd probe show the next-hop 10.183.64.254

Is it possible to cahnge the order of next-hops? so that the next-hop 10.183.64.254 shown by the 2nd probe is shown at 1st probe, and the next-hop 10.183.65.254 shown by the 1st probe in above trace is shown at 2nd probe - effectively producing below trace:

pe02#traceroute 10.255.225.26 source lo0 probe 2
Type escape sequence to abort.
Tracing the route to 10.255.225.26
VRF info: (vrf in name/id, vrf out name/id)
  1 10.183.64.254[MPLS: Label 783571 Exp 0] 0 msec
     10.183.65.254 [MPLS: Label 783571 Exp 0] 2 msec
  2 10.255.251.165 [MPLS: Label 698836 Exp 1] 52 msec 51 msec

Ahsan Rana

Actually it was quite clear what you want to achieve, and I thought that I provided an answer for that. But apparently my answer was not effective. So let me try to explain it in a different way.

There is a simple answer and there is a more complex (and more accurate) answer. So let me start with the simple answer:

Anything that you send originating on that router to that destination address that has a single packet (a traceroute with 1 probe, etc) will change the address used as the first next hop. So if you do a traceroute with 1 probe then the next time that you do traceroute then the first next hop will be 64.254.

And here is the more complex answer:

The simplistic answer will work this time. But it will not work every time. I believe that you are looking for a reliable (deterministic) way to predict what will be the next hop. And there is not a reliable (deterministic) way to predict what will be the next hop. When the router is generating a new packet to send to the destination it must decide what to use for the next hop. To make that decision the router looks at what it used last time and then chooses to use the other next hop this time. So if last time used 65.254 then this time will use 64.254.

HTH

Rick

HTH

Rick

Hello Rick

Appreciate your time on this and this is useful information which explains the behavior.


this also means that there is no way we can configure the router to use a particular next-hop first for cef load balanced paths and router does a round robin style next-hop selection.

Thanks!

Ahsan Rana

this also means that there is no way we can configure the router to use a particular next-hop first for cef load balanced paths and router does a round robin style next-hop selection.

Correct.  (For the very 1st CEF forwarding, I suspect CEF will start with the same interface.)

CEF does round robin by flow unless you've configured it for packet-by-packet.

Ahsan

Yes it is a round robin next hop selection (for traffic generated by the router). And this does mean that you can not configure the router to use a particular next hop as the first next hop.

HTH

Rick

HTH

Rick

Thanks Rick, appreciate your insights :)

Ahsan Rana

Ahsan

You are welcome. I am glad that our explanations have been helpful. Best wishes as you continue to study and to learn about networking. These forums are an excellent resource and I hope to see you continue to be active in the forums.

HTH

Rick

HTH

Rick
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco