I find it quite hard to remember the distribution algorithms and the advantages of each teaming mode with switch configuration, so I’ve made a summary with pointers to grab when needed again.
Use it to your advantage 🙂
Outbound traffic can be distributed among the available links in many ways. One rule that guides any distribution algorithm is to try to keep all packets associated with a single flow (TCP-stream) on a single network adapter. This rule minimizes performance degradation caused by reassembling out-of-order TCP segments.
NIC teaming in Windows Server 2012 R2 supports the following traffic load distribution algorithms:
Since VMs have independent MAC addresses, the VM’s MAC address or the port it’s connected to on the Hyper-V switch can be the basis for dividing traffic. There is an advantage in using this scheme in virtualization. Because the adjacent switch always sees a particular MAC address on one and only one connected port, the switch will distribute the ingress load (the traffic from the switch to the host) on multiple links based on the destination MAC (VM MAC) address. This is particularly useful when Virtual Machine Queues (VMQs) are used as a queue can be placed on the specific NIC where the traffic is expected to arrive. However, if the host has only a few VMs, this mode may not be granular enough to get a well-balanced distribution. This mode will also always limit a single VM (i.e., the traffic from a single switch port) to the bandwidth available on a single interface.
Windows Server 2012 R2 uses the Hyper-V Switch Port as the identifier rather than the source MAC address as, in some instances, a VM may be using more than one MAC address on a switch port.
This algorithm creates a hash based on address components of the packet and then assigns packets that have that hash value to one of the available adapters. Usually this mechanism alone is sufficient to create a reasonable balance across the available adapters.
The components that can be specified, using PowerShell, as inputs to the hashing function include the following:
– Source and destination TCP ports and source and destination IP addresses (this is used by the user interface when “Address Hash” is selected)
– Source and destination IP addresses only
– Source and destination MAC addresses only
The TCP ports hash creates the most granular distribution of traffic streams resulting in smaller streams that can be independently moved between members. However, it cannot be used for traffic that is not TCP or UDP-based or where the TCP and UDP ports are hidden from the stack, such as IPsec-protected traffic. In these cases, the hash automatically falls back to the IP address hash or, if the traffic is not IP traffic, to the MAC address hash.
This algorithm takes the best aspects of each of the other two modes and combines them into a single mode.
– Outbound loads are distributed based on a hash of the TCP Ports and IP addresses. Dynamic mode also rebalances loads in real time so that a given outbound flow may move back and forth between team members.
– Inbound loads are distributed as though the Hyper-V port mode was in use. See Section above for more details.
The outbound loads in this mode are dynamically balanced based on the concept of flowlets. Just as human speech has natural breaks at the ends of words and sentences, TCP flows (TCP communication streams) also have naturally occurring breaks. The portion of a TCP flow between two such breaks is referred to as a flowlet. When the dynamic mode algorithm detects that a flowlet boundary has been encountered, i.e., a break of sufficient length has occurred in the TCP flow, the algorithm will opportunistically rebalance the flow to another team member if apropriate. The algorithm may also periodically rebalance flows that do not contain any flowlets if circumstances require it. As a result the affinity between TCP flow and team member can change at any time as the dynamic balancing algorithm works to balance the workload of the team members.
Teaming Mode with Load Balancing
Switch Independent / Address Hash
This configuration will distribute the load through the use of the selected level of address hashing. It defaults to using TCP ports and IP addresses to seed the hash function.
Because a given IP address can only be associated with a single MAC address for routing purposes, this mode receives inbound traffic on only one team member (the primary member). This means that the inbound traffic cannot exceed the bandwidth of one team member no matter how much is getting sent.
This mode is best used for:
a) Active/Standby mode teams with just 2 team members; and
b) Teaming in a VM.
In all other cases where this configuration was recommended in Windows Server 2012 the new configuration, Switch Independent/Dynamic, described in the section below, should provide better performance.
Switch Independent / Hyper-V Port
This configuration will send packets using all active team members distributing the load based on the Hyper-V switch port number. Each Hyper-V port will be bandwidth limited to not more than one team member’s bandwidth because the port is affinitized to exactly one team member at any point in time.
Because each Hyper-V port is associated with a single team member, this mode receives inbound traffic for the VM’s switch port on the same team member the switch port’s outbound traffic uses. This also allows maximum use of Virtual Machine Queues (VMQs) for better performance over all.
In all cases where this configuration was recommended in Windows Server 2012 the new configuration, Switch Independent/Dynamic, described below , will provide better performance.
Switch Independent / Dynamic
This configuration will distribute the load based on the TCP Ports address hash as modified by the Dynamic load balancing algorithm. The Dynamic load balancing algorithm will redistribute flows to optimize team member bandwidth utilization so individual flow transmissions may move from one active team member to another. The algorithm takes into account the small possibility that redistributing traffic could cause out-of-order delivery of packets so it takes steps to minimize that possibility.
The receive side, however, will look identical to Hyper-V Port distribution. Each Hyper-V switch port’s traffic, whether bound for a virtual NIC in a VM (vmNIC) or a virtual NIC in the host (vNIC), will see all its inbound traffic arriving on a single NIC.
This mode is best used for teaming in both native and Hyper-V environments except when:
a) Teaming is being performed in a VM,
b) Switch dependent teaming (e.g., LACP) is required by policy, or
c) Operation of a two-member Active/Standby team is required by policy.
Windows server 2012 NIC Teaming – Windows server 2012 NIC Teaming modes- Windows server 2012 NIC Teaming- NIC Teaming in Windows Server 2012 – Windows Server 2012 R2 NIC Teaming