Troubleshooting IP-Hash outbound NIC selection
search cancel

Troubleshooting IP-Hash outbound NIC selection

book

Article ID: 310847

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

Symptoms:
If you have configured a NIC team for your VMkernel traffic using 2 physical uplinks, EtherChannel, and 2 storage target IP's, you may experience the following symptoms if you are using IP-Hash for load balancing:
  • The vSwitch's traffic is not balanced across uplink adapters.
  • All traffic is transmitted out of a single uplink adapter.


Environment

VMware ESX 4.0.x
VMware vCenter Server 4.1.x
VMware ESXi 4.1.x Embedded
VMware ESX Server 3.0.x
VMware VirtualCenter 2.0.x
VMware ESX Server 3.5.x
VMware vSphere ESXi 5.0
VMware ESXi 4.1.x Installable
VMware vCenter Server 4.0.x
VMware vCenter Server 5.0.x
VMware VirtualCenter 2.5.x
VMware ESXi 4.0.x Installable
VMware ESXi 4.0.x Embedded
VMware ESX 4.1.x

Resolution

This issue may occur if the calculated hash returns the same result based on the source IP and both destination IP's.
To resolve this issue, use this example to manually calculate the IP-Hash with the IP's you are using to help you choose 2 target IP's that utilize both uplinks on the vSwitch.

To convert the NFS IP addresses to Hex:
  1. Use any online IP Hex Converter tool to convert the IP addresses to Hex.

    This is an example we used a vSwitch with 2 uplinks, EtherChannel and IP-Hash:


    Links = 2 (0 and 1)
    VMKnic 10.0.0.10 = 0xa00000a
    NFS1 10.0.0.20 = 0xa000014
    NFS2 10.0.0.22 = 0xa000016

  2. Use the following IP-Hash formula to calculate the outbound uplink:

    VMKnic > NFS1 (0xa00000a Xor 0xa000014 =1E) % 2= 0
    VMKnic > NFS2 (0xa00000a Xor 0xa000016 =1C) % 2= 0

    1. On any scientific calculator, select Hex and Qword.
    2. Enter the VMKnic IP in HEX format (a00000a) and click Xor.
    3. Enter NFS1 IP in HEX format (a000014) and click =.
    4. Press Mod, press 2 for the number of uplinks, then click =. The result is 0.
    5. Repeat steps a-e, using the NFS2 IP (a000016) in step c. The result is also 0.

      IP-Hash chooses the first uplink in the team because they both have result of 0.

To ensure that IP-Hash balances outbound traffic:

  1. Change the IP for NFS2 from 10.0.0.22 to 10.0.0.21.
  2. Use any online IP Hex Converter tool to convert the IP addresses to Hex.

    For example:

    Links = 2 (0 and 1)
    VMknic 10.0.0.10 = 0xa00000a
    NFS1 10.0.0.20 = 0xa000014
    NFS2 10.0.0.21 = 0xa000015

  3. Use the following IP-Hash formula to calculate the outbound uplink:

    VMKnic > NFS2 (0xa00000a Xor 0xa000015 =1F) % 2= 1

    1. On any scientific calculator, select Hex and Qword.
    2. Select Hex and Qword.
    3. Enter the VMKnic IP in HEX format (a00000a) and click Xor.
    4. Enter NFS2 IP in HEX format (a000015) and click =.
    5. Press Mod, press 2 for the number of uplinks, then click =. The result is 1.

      Now the IP-Hash algorithm returns a different result. IP-Hash now balances the outbound traffic across both vSwitch uplinks.


Additional Information

For additional information about Etherchannel, see Etherchannel Sample Configuration (1004048).