The mac-address hash-mode command configures a MAC hash algorithm on the device.
The undo mac-address hash-mode command restores the default MAC hash algorithm on the device.
By default, the hash algorithm on the S5720-EI, S6720-EI, and S6720S-EI is crc32-lower. The hash algorithm on other models is crc.
The S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S5735-L, S5735S-L, S5735S-L-M, S5735-S, S5735-S-I, S5735S-S, S6720-HI, S6730-H, S6730S-H, S6730-S, and S6730S-S do not support this command.
On the S5720-EI, S6720-EI, and S6720S-EI:
mac-address hash-mode { crc16-lower | crc16-upper | crc32-lower | crc32-upper | lsb | enhanced } slot slot-id
undo mac-address hash-mode [ crc16-lower | crc16-upper | crc32-lower | crc32-upper | lsb | enhanced ] slot slot-id
On devices except S5720-EI, S6720-EI, and S6720S-EI:
mac-address hash-mode { xor | crc } slot slot-id
undo mac-address hash-mode [ xor | crc ] slot slot-id
Parameter |
Description |
Value |
---|---|---|
crc |
Indicates the CRC-based hash algorithm. |
- |
crc16-lower |
Indicates the hash algorithm based on low order bits of CRC16. |
- |
crc16-upper |
Indicates the hash algorithm based on high order bits of CRC16. |
- |
crc32-lower |
Indicates the hash algorithm based on low order bits of CRC32. |
- |
crc32-upper |
Indicates the hash algorithm based on high order bits of CRC32. |
- |
lsb |
Indicates the hash algorithm based on the lowest bit of the key value. |
- |
xor |
Indicates the Exclusive-Or mode. |
- |
enhanced |
Indicates the enhanced mode. |
- |
slot slot-id |
Specifies a slot ID. |
The value depends on the device configuration. |
Usage Scenario
The device uses a hash algorithm to improve MAC address forwarding performance. If multiple MAC addresses match a key value, a hash conflict occurs.
When a hash conflict occurs, the device may fail to learn many MAC addresses and some traffic can only be broadcast. This results in heavy broadcast traffic on the device. If such a problem occurs, use an appropriate hash algorithm to reduce the hash conflict.
Precautions
MAC addresses are distributed on a network randomly, so the system cannot determine the best hash algorithm. Generally, the default hash algorithm is the best one, so do not change the hash algorithm unless you have special requirement.
An appropriate hash algorithm can only reduce hash conflicts, but cannot prevent them.
After changing the hash algorithm and saving the configuration, restart the device for the configuration to take effect.
If you run the mac-address hash-mode command multiple times, only the latest configuration takes effect.