You will get excellent responses about channel bonding-specific issues from the bonding-devel@xxxxxxxxxxxxxxxxxxxxx mailing list. Read below for some explainations. On 12/21/05, AndyLiebman@xxxxxxx <AndyLiebman@xxxxxxx> wrote: > Question about how Linux bonding mode=2 handles changing loads from a single > client doing video editing over a network. > > Here's the specific scenario. I have 4 Gigabit Ethernet lines running from a > Linux server to a switch that supports static link aggregation. I have > configured the Linux adapters with: > > modprobe bonding mode=2 > ifenslave bond0 eth0 eth1 eth2 eth3 > > If I connect 4 Windows clients to the switch, I can see that as each client > "comes on line" and starts requesting data, the data is being transmitted > from a different port out of the 4 ports that are part of the "static > aggregation" or trunk. > > So, the load is getting balanced between the four Gigabit channels. So far > so good. And I see great performance on the editing workstations. > > However, my question is, what happens if the load changes? For instance, say > today I am editing "compressed DV video" (3.8 MB/sec) on eight clients. If > the balancing is fair, I might end up with two clients sending and receiving > data on each Gigabit port that's part of the aggregation or trunk. > > But tomorrow let's say I start editing "uncompressed standard definition > video" (roughly 22 MB/sec) on two clients. And let's say it just so happens > that yesterday those two clients were both "assigned" the same port for > communicating with the server. Communicating through the same port would have been > fine for compressed DV video, but might not be so good for two streams of 22 > MB/sec uncompressed video. Will the switch and/or the Linux bonding mode=2 > algorithm reassign which port is associated with which client based on the > changing load? Or am I stuck with the original port assignment until I reboot the > client or the switch? > > And what happens if I'm editing DV video (3.8 MB/sec) at 9 am, but change to > uncompressed video (22 MB/sec) at 10 am? The balance between clients that > worked at 9 am might be terrible at 10 am. > > I haven't actually seen this problem in the real world, but I'm wondering > how the "static link aggregation" and "balanced XOR" standard handles this. > > In contrast, I can see that when I set the bonding module to "mode=0", the > data is ALWAYS parceled out between the four ports. But I get terrible > performance on the client workstations when editing uncompressed video. There must > be a lot of "out of order packets" with "mode=0" that trip up the workstation > running the video editing program. So, "mode=2" seems like a better bet. But > I would like to understand how it works over time. The load balancing for balance-xor is simply a formula involving the MAC address, and is not related to the actual *load* at all. Some background: When dealing with link aggregation each system only has control over the algorithm used to decide how to *send* frames, but has no control over how to *receive* them. This means that you could end up with your system sending over ports 1 and 2, and the switch sends the reply traffic over ports 3 and 4. Unlikely, but possible. In reality most switches use some combination of MAC address, IP address, and source/destination ports (for TCP and UDP traffic) to determine which port to send on. In the case of bonding, unless you have a very recent kernel (2.6.14? I forget when it was added) that supports the xmit_hash_policy, you won't be able to use anything besides MAC address to do the load balancing. So, in summary, bonding load balancing has nothing to do with the actual load. Jason - : send the line "unsubscribe linux-net" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html