MAC Address Flapping
What Is MAC Address Flapping
MAC address flapping occurs when a MAC address is learned by two interfaces in the same VLAN and the MAC address entry learned later overrides the earlier one. Figure 2-4 shows how MAC address flapping occurs. In the MAC address entry with MAC address 0011-0022-0034 and VLAN 2, the outbound interface is changed from 10GE1/0/1 to 10GE1/0/2. MAC address flapping can cause an increase in the CPU usage on the device.
MAC address flapping does not occur frequently on a network unless a network loop occurs. If MAC address flapping frequently occurs on your network, you can quickly locate the fault and eliminate the loops according to alarms and MAC address flapping records.
How to Detect MAC Address Flapping
MAC address flapping detection determines whether MAC address flapping occurs by checking whether outbound interfaces in MAC address entries change frequently.
After MAC address flapping detection is enabled, the device can report an alarm when MAC address flapping occurs. The alarm contains the flapping MAC address, VLAN ID, and outbound interfaces between which the MAC address flaps. A loop may exist between the outbound interfaces. You can locate the cause of the loop based on the alarm. Alternatively, the device can perform the action specified in the configuration of MAC address flapping detection to remove the loop automatically. The action can be quit-vlan (remove the interface from the VLAN) or error-down (shut down the interface).
As shown in Figure 2-5, a network cable is correctly connected between SwitchC to SwitchD, causing a loop between SwitchB, SwitchC, and SwitchD. When Port1 of SwitchA receives a broadcast packet, SwitchA forwards the packet to SwitchB. The packet is then sent to Port2 of SwitchA. After MAC address flapping detection is configured on SwitchA, SwitchA can detect that the source MAC address of the packet flaps from Port1 to Port2. If the MAC address flaps between Port1 and Port2 frequently, SwitchA reports an alarm about MAC address flapping to alert the network administrator.
MAC address flapping detection allows a device to detect changes in traffic transmission paths based on learned MAC addresses, but the device cannot obtain the entire network topology. It is recommended that this function be used on the interface connected to a user network where loops may occur.