Latest Posts



Translate

Total Pageviews

Monday, 26 November 2012

Troubleshooting IP-Hash outbound NIC selection


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.

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.
Source:-
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1007371