< Home

Configuring a MAC Hash Algorithm

Context

The switch typically uses a hash algorithm to learn MAC address entries. However, conflicts may occur if two or more MAC addresses produce the same hash value. In this case, the switch may fail to learn many MAC addresses and then will broadcast traffic destined for these MAC addresses. The heavy broadcast traffic increases the load on the switch. To mitigate this issue, use an appropriate hash algorithm to mitigate the hash conflict.

  • The switch uses the hash bucket to store MAC addresses. The switch 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 switch through the hash bucket may be not reached.

  • 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 function.
  • MAC addresses are distributed on a network randomly, so the best hash algorithm cannot be determined. Generally, it is recommended the default MAC hash algorithm be used unless you have specific requirements.

  • An appropriate hash algorithm can reduce hash conflicts, but cannot prevent them.

  • After the hash algorithm is changed, restart the switch to make the configuration take effect.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Configure a hash algorithm.

    • Run the mac-address hash-mode { crc16-lower | crc16-upper | crc32-lower | crc32-upper | lsb | enhanced } slot slot-id command on the S5720-EI, S6720-EI, and S6720S-EI.
    • Run the mac-address hash-mode { xor | crc } slot slot-id command on other models except the S5720-EI, S6720-EI, and S6720S-EI.

    By default, the hash algorithm is crc32-lower on the S5720-EI, S6720-EI, and S6720S-EI and crc on other models.

  3. Run mac-address hash-bucket-mode { size4 | size8 | size12 | size16 }

    The hash bucket size is configured for the MAC address table.

    By default, the hash bucket size of a MAC address table is 4.
    • This function is supported only by the S5720I-SI, S5720-LI, S5720S-LI, S5720S-SI, and S5720-SI.
    • A larger hash bucket size will lower device forwarding performance.

    • After you change the hash bucket size to a smaller value, you need to restart the switch.

Verifying the Configuration

Run the display mac-address hash-mode command to check the running and configured hash algorithms.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >