Showing results for 
Search instead for 
Did you mean: 

Problem with applying redirect-port's policy to LAG

Problem with applying redirect-port's policy to LAG

New Contributor
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 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

Valued Contributor II
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?

Valued Contributor II
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.

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?

Valued Contributor II
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.