load-balance

Function

The load-balance command configures a load balancing mode for an Eth-Trunk interface, and this command is used for unicast packets only.

The undo load-balance command restores the default load balancing mode, and this command is used for unicast packets only.

By default, the load balancing mode of an Eth-Trunk interface is per-flow load balancing, which uses hash factors configured in the slot view for each service.

Format

load-balance { src-dst-mac | src-dst-ip | packet-all }

load-balance symmetric-hash [ complement ]

undo load-balance

Parameters

Parameter Description Value
src-dst-mac

Indicates that Eth-Trunk interfaces perform load balancing based on source and destination MAC addresses.

-

src-dst-ip

Indicates that Eth-Trunk interfaces perform load balancing based on source and destination IP addresses.

-

packet-all

Indicates that Eth-Trunk interfaces perform load balancing based on all the packets.

-

symmetric-hash

Indicates symmetric load balancing.

-

complement

Indicates the compensation mode for symmetric load balancing.

-

Views

Eth-Trunk interface view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
forwarding write

Usage Guidelines

Usage Scenario

A data flow is a group of datagrams with the same source and destination MAC addresses and source and destination IP addresses. For example, a Telnet or FTP connection between two devices is a data flow.

Frames of the same data flow sent from an interface rather than a trunk interface can arrive at the destination in sequence because only one physical connection exists between the two devices. However, if a trunk interface is configured, multiple physical links exist between two devices. The first sent frame may arrive later than the second sent frame.

To prevent frame disorder, a data forwarding mechanism is introduced into the trunking technology to ensure that the frames of the same data flow are sent to the destination in sequence. This mechanism distinguishes data flows based on MAC or IP addresses and sends diagrams that belong to the same data flow over the same physical link.

After the data forwarding mechanism is introduced:

  • Frames with the same source and destination MAC addresses are transmitted over the same physical link.
  • Packets with the same source and destination IP addresses are transmitted over the same physical link.

    To ensure the bandwidth usage of each link of an Eth-Trunk interface, specify packet-all to perform per-packet load balancing.

    To ensure that data packets arrive at the destination in sequence, specify src-dst-mac or src-dst-ip to perform per-flow load balancing based on MAC or IP addresses.

    To transmit a data flow and its reverse flow on the same link, run the load-balance command. Specify symmetric-hash on the source device to configure the symmetrical load balancing mode and specify symmetric-hash complement on the destination device to configure the compensation mode for symmetrical load balancing.

Configuration Impact

If packet-all is specified to perform per-packet load balancing, note the following points:

  • Per-packet load balancing takes a packet as a transmission unit and distributes packets among member links for transmission.
  • Per-packet load balancing guarantees the bandwidth usage but not the data sequence. It may cause packet disorder. Therefore, it applies to scenarios where the data sequence is not strictly required. If parameter packet-all is specified, the command load-balance hash-fields ip { l2 | l3 | l4 } configured does not take effect.

    If src-dst-mac or src-dst-ip is specified to perform per-flow load balancing, note the following points:
  • Per-destination load balancing differentiates data flows based on MAC or IP addresses. Datagrams that belong to the same data flow are transmitted over the same physical link.
  • Per-destination load balancing guarantees the data sequence but not the bandwidth usage.The parameter src-dst-mac takes effect after running the command portswitch to change the mode of an Eth-Trunk interface from Layer 3 to Layer 2.

Precautions

If the load-balance command is run more than once, the latest configuration overrides the previous one, and the load-balance command can take effect to the unicast traffic.

Symmetric load balancing support only Eth-Trunk interfaces, and does not support non Eth-Trunk interfaces and ECMP scenarios.

When the function is configured on P-nodes, hash factors of traffic on different directions of GRE,IPv6 over IPv4 and GTP, tunnels may be different, which may cause traffic to be hashed to different links.Whether to reverse IP addresses on both directions is ensured by configuration. Choose the parameter symmetric-hash to configure symmetric load balancing, and choose the parameter symmetric-hash complement to configure the compensation mode for symmetric load balancing.

Example

# Configure Eth-Trunk 1 to work in symmetric load balancing mode.
<HUAWEI> system-view
[~HUAWEI] interface eth-trunk 1
[*HUAWEI-Eth-Trunk1] load-balance symmetric-hash
Copyright ? Huawei Technologies Co., Ltd.
Copyright ? Huawei Technologies Co., Ltd.
< Previous topic Next topic >