Configuring a MAC Hash Algorithm
Context
A device usually uses a hash algorithm to learn MAC address entries to improve MAC address forwarding performance. When multiple MAC addresses map the same key value, a MAC address hash conflict may occur. This means that the device may fail to learn many MAC addresses and can only broadcast packets destined for these MAC addresses, leading to heavy increase in broadcast traffic. In this case, use an appropriate hash algorithm to mitigate the hash conflict.
A proper MAC hash algorithm can reduce MAC address hash conflicts. You are not advised to change the default hash algorithm unless you have special requirements.
MAC addresses on an interface card are stored using the following modes:
Hash bucket
The interface card that uses the hash bucket performs hash calculation for VLAN IDs and MAC addresses in MAC address entries to be stored and obtains hash bucket indexes. The MAC addresses with the same hash bucket index are stored in the same hash bucket. If a hash bucket with the maximum storage space cannot accommodate learned MAC addresses of the hash bucket, a hash conflict occurs and MAC addresses cannot be stored. The maximum number of MAC addresses learned by the interface card through the hash bucket may be not reached.
TCAM chip
The interface card that uses the TCAM mode stores all learned MAC addresses in the TCAM chip in sequence. As long as the number of learned MAC addresses does not reach the maximum value, MAC addresses can be learned. In TCAM mode, the device must be equipped with the enhanced interface card that uses the TCAM chip.
SA series, EA series, SC series, X series, EE series card and ET1D2X48SEC0 cards use the hash bucket, so the maximum number of MAC addresses learned by the SA series, EA series, SC series, X series, EE series card and ET1D2X48SEC0 card may be not reached. Other interface cards excluding SA series, EA series, SC series, X series, EE series card and ET1D2X48SEC0 cards use the TCAM mode by default.
- X series cards do not support this configuration.
You are not advised to change the default hash algorithm unless you have special requirements.
An appropriate hash algorithm can reduce hash conflicts, but cannot completely prevent them.
After the hash algorithm is changed, restart the card to make the configuration take effect.