load-balance hash-fields mac

Function

The load-balance hash-fields mac command specifies hash factors of the interface board that are used for flow-based load balancing in VPLS or common Layer 2 forwarding.

The undo load-balance hash-fields mac command restores the default configuration.

By default, the hash factors are specified as l4 on the interface board in VPLS or common Layer 2 forwarding.

Format

load-balance hash-fields mac { l2 | l3 | l4 | label-ip }

undo load-balance hash-fields mac

Parameters

Parameter Description Value
l2

Indicates that hash factors are the source MAC address and destination MAC address. This means that the hash calculation is performed based on the source MAC address and destination MAC address for the traffic in the upstream direction of interfaces. The parameter is specified if the source MAC address and destination MAC address are hashable.

-

l3

Indicates that hash factors are the source IP address and destination IP address. This means that the hash calculation is performed based on the source IP address and destination IP address for the traffic in the upstream direction of interfaces. The parameter is specified if the source IP addresses and destination IP addresses are hashable.

-

l4

Indicates that hash factors are the source IP address, destination IP address, source port number, destination port number, and protocol number. This means that the hash calculation is performed based on these hash factors for the traffic in the upstream direction of interfaces. The parameter is specified if the source IP address and destination IP address are not hashable.

-

label-ip

Indicates that hash factors are the MPLS labels. This means that the hash calculation is performed based on labels encapsulated into non-IP packets. This parameter is recommended.For an IP packet, hash calculation is performed based on the IP address and the packet's ToS field. For an MPLS packet with the inner layer not being the IP header, load balancing is performed based on MPLS labels.

-

Views

Slot view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
forwarding write

Usage Guidelines

Usage Scenario

This command is used to specify the hash factors that are used for traffic load balancing at the AC end of the PE in VPLS or common Layer 2 forwarding.

The load balancing function is implemented using the hash algorithm on the upstream interface board. Traffic is hashed based on traffic characteristics, which are called hash factors. If hash factors are more hashable, traffic will be more evenly load-balanced. The device has default values of the hash factors used for load balancing of different service types of packets. Traffic is load balanced based on the default hash factors depending on the service types of packets on the upstream interface board. To implement load balancing better, configure hash factors based on traffic types.

Configuration Impact

The load-balance hash-fields mac command is cyclic in nature, and only the latest configuration takes effect. After the command is configured, the hash calculation is performed based on the new hash factors.

Follow-up Procedure

If this command is configured but traffic load balancing cannot be performed well in the AC end of the PE in the VPLS or common Layer 2 forwarding, you can run the load-balance hash-arithmetic command to modify the hash algorithm itself.

Precautions

In VS mode, this command is supported only by the admin VS.

The preceding configurations apply to ECMP (NHP based load balancing) and trunk logical interfaces (load balancing based on trunk tables). That is, ECMP and trunk load balancing behaviors are the same.

This command takes effect in EVPN-MPLS and EVPN-VXLAN scenarios.

Example

# Set the hash factor of the interface board to l4.
<HUAWEI> system-view
[~HUAWEI] load-balance hash-fields mac l4
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >