MAC flaps observed at physical switch level connected to ESXi host.
search cancel

MAC flaps observed at physical switch level connected to ESXi host.

book

Article ID: 402719

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • ESXi host connected to physical switch through uplinks VMNICx & VMNICy on VSwitchX.
  • The virtual MACs are being learnt on both switch interfaces randomly causing interfaces to flap at switch level.

Environment

  • The Teaming and failover configuration on vSwitchX on affected ESXi host has Load balancing Policy set as Route based on IP hash. However, on working host the Load balancing Policy is set to default, Route based on originating virtual port.


    Affected host:


    On non affected host: 

Cause

To ensure that IP hash load balancing works correctly, switch interfaces must have an Etherchannel configured on the physical switch. An Etherchannel bonds multiple network adapters into a single logical link. When ports are bound into an Etherchannel, every time the physical switch receives a packet from the same virtual machine MAC address on different ports, the switch updates its content addressable memory (CAM) table correctly.

For example, if the physical switch receives packets on ports 01 and 02 from MAC address A, the switch makes a 01-A and a 02-A entry in its CAM table. As a result, the physical switch distributes the incoming traffic to the correct ports. Without an Etherchannel, the physical switch first makes a record that a packet from MAC address A is received on port 01, then updates the same record that a packet from MAC address A is received on port 02. Hence, the physical switch forwards incoming traffic only on port 02, and might result in packets not reaching their destination and overloading the corresponding uplink.

Resolution

Based on the configuration requirement, the following 2 solutions can mitigate the MAC flap issue at switch level:

  1. If ether-channel is required, keep the physical switch interfaces in Ether-channel and vSwitch Load balancing Policy set as Route based on IP hash.
  2. If ether-channel is not required, keep the physical switch interfaces as individual ports without any Ether-channel and vSwitch Load balancing Policy set as default Route based on originating virtual port.

Additional Information