Linux – Are balance-xor and 802.3ad modes of Bonding meant to provide per-flow balancing

bondinglinuxload balancing

The title says it all 🙂

Well we have 2 links, one is 1MB (CIR/ dedicated), the other is 12MB (shared). 12MB one is not at all reliable too..
So what I want is to not lose my packets into the "black-hole" of the shared link, that's why I want per-flow packet steering, not per-packet. Right now we are using balance-rr, and that mode splits them evenly across the 2 links…

So I need per-flow load-balancing. I think balance-xor seems like the right choice, right?

Best Answer

No, Mode 2 balances out each slave depending on the xmit_hash_policy. Whether you get one slave or the other depends on the NIC and/or the traffic. Trying to intentionally load balance different traffic out two slaves of different speeds is an unreliable crapshoot and not what Mode 2 is for.

LACP mandates all slaves have the same speed and duplex, so placing a 1M and 12M link into a Mode 4 bond is not a valid configuration.

To achieve what you describe, you'd use regular routing rules, or policy-based routing.