Problem with applying redirect-port's policy to LAG

  • 0
  • 1
  • Problem
  • Updated 1 year ago
  • Solved
I need to forward some traffic form a port ingress trough a LAG. so i wrote a policy and used "redirect-port [LAG_MASTER_PORT]" feature to do that.
It works but i found that traffic load-balancing  is not based on my sharing algorithm!
My sharing algorithm is address-based custom and ipv4 hash XOR and I found that when i change members of LAG to a number from divisors of 32 (2,4,8,16,32) load-balancing works based on sharing algorithm.
My EXOS version is 16.1.3.6-patch1-9 and according to User Guide16.1 redirect-port must apply load sharing algorithm.
I'm reading last recommended EXOS's release_notes, but no thing about this problem mentioned.

Please aid me if you have any experience with redirect-port
Photo of omar khaled

omar khaled

  • 132 Points 100 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of Hagemann, Olaf

Hagemann, Olaf, Employee

  • 1,306 Points 1k badge 2x thumb
To be honest, I don't get the point. You say it works when you are using divisors of 32. What exactly is not working?
Photo of omar khaled

omar khaled

  • 132 Points 100 badge 2x thumb
thanks for your response,

My problem is that active numbers of LAG ports is not divisors of 32. for example i have 5 ports in LAG and i need this 5 port. i should disable 1 port to distribute traffic correctly. By the way if i do limit active ports to divisors of 32, when a link goes down or fail for any reason, my load-balancing will be failed.
Photo of Hagemann, Olaf

Hagemann, Olaf, Employee

  • 1,306 Points 1k badge 2x thumb
Your load balancing will not fail at all, but the traffic is just not equally balanced between the physical links. Any load sharing algorithm is based on a modulo division. Let's say it is modulo 32. If the number of physical links is not a divisor of 32, some links will be choosen more often for certain hash values than others. So if you have 5 links, links 1 and 2 will have some more traffic than the links 3, 4 and 5. But the load sharing itself works fine. So if you loose any link in a LAG just the relation between the links will change, but the load sharing keeps working.

Cheers
Olaf
Photo of omar khaled

omar khaled

  • 132 Points 100 badge 2x thumb
tank's for your reply;
 
In my case first problem is that traffic not equally balanced between physical links, as you mentioned.

but there is another problem: traffic distribution isn't symmetric!

According to UserGuide (for all EXOS versions) with XOR hash algorithm (and source-and-destination sharing algorithm) packets should distribute symmetric.

in my test "redirect-vlan" works symmetric, but "redirect-port" is asymmetric. unfortunately in my case i need symmetric distribution and can't use "redirect-vlan".


for my curiuse i think after modulo 32, it calculate modulo [NUMBERS_OF_ACTIVE_PORTS] and then select egress port. is this correct?


Photo of Hagemann, Olaf

Hagemann, Olaf, Employee

  • 1,306 Points 1k badge 2x thumb
The switch calculates a hash based on the criteria you define with the algorithm. (l2, L2 and L3, and so on).
Then there is a modulo division performed on that hash. The result of the division defines the physical port. Let's say you have 4 ports in a LAG. If the result is 0, it will use port 1, if it is 1, it will use port 2 and so on. So it looks like this:
r0-p1, r1-p2, r2-p3, r3-p4, r4-p1, r5-p2, r6-p3, r7-p4, r8-p1, r9-p2, r10-p3, r11-p4..........r28-p1, r29-p2, r30-p3, r31-p4

So if the number of active port is a divisor of 32, each port will be statistically equally used. As the size of the packets differ, it is actually just the number of packets for the certain hashes. Also the hash itself is statistically calculated over a large number of flows. Means, the more flows you have, the more equally the distribution is. One particular flow always uses the same physical port. Which also means that one single flow can never have more bandwidth than one physical link in a LAG.