< Home

(Optional) Configuring a Load Balancing Mode

Context

An Eth-Trunk uses flow-based load balancing. Flow-based load balancing ensures that frames of the same data flow are forwarded on the same physical link and those of different data flows are forwarded on different physical links.

You can configure a common load balancing mode in which IP addresses or MAC addresses of packets are used to load balance packets; you can also configure an enhanced load balancing mode for Layer 2, IP, and MPLS packets.

Load balancing is valid only for outgoing traffic; therefore, the load balancing modes for the interfaces at both ends of a link can be different and do not affect each other.

If an incorrect load balancing mode is configured, traffic will be unevenly load balanced among Eth-Trunk member interfaces. The following restrictions apply when configuring a load balancing mode:
  • In practical services, you need to configure a proper load balancing mode based on traffic characteristics. When a parameter of traffic changes frequently, you can set the load balancing mode based on this parameter to ensure that the traffic load is balanced evenly. For example, if IP addresses in packets change frequently, use the load balancing mode based on dst-ip, src-ip, or src-dst-ip so that traffic can be properly load balanced among physical links. If MAC addresses in packets change frequently and IP addresses are fixed, use the load balancing mode based on dst-mac, src-mac, or src-dst-mac so that traffic can be properly load balanced among physical links.

  • If the majority of service traffic is MPLS packets, you need to set the enhanced load balancing mode. You can run the mpls field command in the load balancing profile view to configure the load balancing mode of MPLS packets.

  • On a network where an Eth-Trunk and a stack are configured, if the local-preference enable command is run to configure an Eth-Trunk interface to preferentially forward local traffic, traffic arriving at the local device is preferentially forwarded through Eth-Trunk member interfaces of the local device. This function is enabled by default. If there is no Eth-Trunk member interface on the local device, traffic is forwarded through Eth-Trunk member interfaces on another device. This forwarding mode effectively saves bandwidth resources of member devices in the stack and improves traffic forwarding efficiency.

Procedure

  • Configure a common load balancing mode.
    1. Run system-view

      The system view is displayed.

    2. Run interface eth-trunk trunk-id

      The Eth-Trunk interface view is displayed.

    3. Run load-balance { dst-ip | dst-mac | src-ip | src-mac | src-dst-ip | src-dst-mac }

      By default, the switch load balances packets based on src-dst-ip.

      The S2720-EI, S5720I-SI, S5720-LI, S5720S-LI, S5720S-SI, S5720-SI, S5730S-EI, S5730-SI, S6720-LI, S6720S-LI, S6720S-SI, and S6720-SI use the src-dst-ip, source TCP or UDP port number, and destination TCP or UDP port number in the hash algorithm for load balancing regardless of whether you configure this parameter.

      The S2720-EI, S5720I-SI, S5720-LI, S5735-L, S5735S-L, S5735S-L-M, S5720S-LI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730S-EI, S5730-SI, S6720-LI, S6720S-LI, S6720S-SI, and S6720-SI support only one load balancing mode globally. If the load balancing mode of an Eth-Trunk is modified, the modification takes effect on all Eth-Trunks. If an Eth-Trunk is created, the load balancing mode of the Eth-Trunk is the same as that of the original Eth-Trunks on the switch.

  • Configure an enhanced load balancing mode.
    1. Run system-view

      The system view is displayed.

    2. Run load-balance-profile profile-name

      A load balancing profile is created and its view is displayed. Only one load balancing profile can be created.

    3. Run the following commands as required. You can configure a load balancing mode for Layer 2 packets, IPv4 packets, IPv6 packets, and MPLS packets respectively.

      • Run l2 field [ dmac | l2-protocol | smac | sport | vlan ] *

        A load balancing mode is configured for Layer 2 packets.

        By default, the switch load balances Layer 2 packets based on the source MAC address (smac) and destination MAC address (dmac).

      • Run ipv4 field [ dip | l4-dport | l4-sport | protocol | sip | sport | vlan ] *

        A load balancing mode is configured for IPv4 packets.

        By default, the switch load balances IPv4 packets based on the source IP address (sip) and destination IP address (dip).

      • Run ipv6 field [ dip | l4-dport | l4-sport | protocol | sip | sport | vlan ] *

        A load balancing mode is configured for IPv6 packets.

        By default, the switch load balances IPv6 packets based on the source IP address (sip) and destination IP address (dip).

      • Run mpls field [ 2nd-label | 3rd-label | dip | dmac | l4-dport | l4-sport | protocol | sip | smac | sport | top-label | vlan ] * A load balancing mode is configured for MPLS packets.

        By default, the switch load balances MPLS packets based on the two outer labels (top-label and 2nd-label).

        On the S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-HI, S6730-H, S6730S-H, S6730-S, and S6730S-S, when the enhanced load balancing mode is used for an Eth-Trunk, configure known unicast packets (such as GRE packets) to be load balanced based on the inner IP address, outer IP address, or both by using the unicast load-balance enhanced { inner-ip | outer-ip } * command.

    4. Run quit

      Return to the system view.

    5. Run interface eth-trunk trunk-id

      The Eth-Trunk interface view is displayed.

    6. Run load-balance enhanced profile profile-name

      The load balancing profile is applied.

    • If the value of member-number configured for an Eth-Trunk using the assign trunk { trunk-group group-number | trunk-member member-number }* command is larger than 16 on the S6720-EI and S6720S-EI or larger than 32 on the S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6730-H, S6730S-H, S6730-S, and S6730S-S, only the enhanced mode can be used for load balancing. If the enhanced mode is not used, problems such as packet loss and uneven load balancing may occur.

    • Enhanced load balancing is only supported by the following models: S5720-EI, S5720-HI, S5730-HI, S5730S-EI, S5730-SI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720-LI, S6720S-EI, S6720S-LI, S6720S-SI, S6720-SI, S6730-H, S6730S-H, S6730-S, and S6730S-S.

    • The preceding load balancing modes apply only to known unicast traffic. To configure a load balancing mode for broadcast, unknown-unicast, and multicast (BUM) traffic, run the unknown-unicast load-balance { dmac | smac | smacxordmac | enhanced [ lbid ] } command in the system view. Load balancing for BUM traffic is only supported by the following models: S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S. Only the S5720-EI, S6720-EI, and S6720S-EI support the lbid parameter.

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