load-balance hash-fields mpls

Function

The load-balance hash-fields mpls command configures a hash factor an interface board uses to perform hash calculation to load-balance MPLS traffic per flow.

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

By default, ip is used as the hash factor an interface board uses to perform hash calculation to load-balance MPLS traffic per flow.

Format

load-balance hash-fields mpls { payload-header | label | ip | ip-tos | mac }

undo load-balance hash-fields mpls

load-balance hash-fields mpls { label | ip | ip-tos | mac }

Parameters

Parameter Description Value
label

Indicates that the hash factor is the label. Hash factors vary with the number of MPLS label layers.

  • If the number of MPLS labels is less than or equal to five, hash factors are all MPLS labels.
  • If the number of MPLS labels is greater than five, hash factors are the five outer most MPLS labels.

-

ip

Indicates that the hash factor is the IP address. Hash factors vary with the number of MPLS label layers.

  • If the number of MPLS label layers is less than or equal to five:
  • If an MPLS packet carries an IP packet, the hash factors are the SIP, DIP, SP, DP, and protocol.
  • If an MPLS packet carries an IP packet but not a TCP/UDP packet, the hash factors are the SIP, DIP and protocol.
  • If an MPLS packet carries a non-IP packet, the hash factors are the all MPLS labels.
  • If the number of MPLS label layers is greater than five, the hash factors are the outer most five MPLS labels.

-

payload-header

Indicates that the hash factor is payload-header.

If the number of MPLS label layers is less than or equal to five:

  • If an MPLS packet carries an IP TCP/UDP packet, the hash factors are the SIP, DIP, SP, DP, and protocol.
  • If an MPLS packet carries an IP packet but not a TCP/UDP packet, the hash factors are the SIP, DIP and protocol.
  • If an MPLS packet carries a non-IP packet, the hash factor is the inner most MPLS label and the first 12 bytes of the payload.

If the number of MPLS label layers is greater than five, the hash factors are the outer most five MPLS labels.

-

ip-tos

Load-balances MPLS packets per flow based on the IP and IP ToS value.

  • If the number of MPLS label layers is less than or equal to five:
  • If an MPLS packet carries an IP packet, the hash factors are the SIP, DIP, SP, DP, protocol, and IP ToS.
  • If an MPLS packet carries an no-IP packet, the hash factors are the SIP, DIP, protocol, and IP ToS.
  • If an MPLS packet carries a non-IP packet, the hash factors are all MPLS labels.
  • If the number of MPLS label layers is greater than five, the hash factors are the outer most five MPLS labels.

-

mac

Indicates that the hash factor is mac first. If after inner label is not mac:

Hash factors vary with the number of MPLS label layers.

If the number of MPLS label layers is less than 5 or equal to 5:

  • If what an MPLS packet carries is an IP TCP/UDP packet, the hash factors are SIP, DIP, SP, DP, and protocol.
  • If what an MPLS packet carries is an IP packet but not a TCP/UDP packet, the hash factors are SIP, DIP and protocol.
  • If what an MPLS packet carries is an non-IP packet, the hash factor is the innermost MPLS label and the first 12 bytes of the payload.

If the number of MPLS label layers is larger than 5, the hash factor are the outermost 5 MPLS labels.

-

Views

Slot view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
forwarding write

Usage Guidelines

Usage Scenario

The load-balance hash-fields mpls command takes effect only on label switching traffic on a transit node of an MPLS tunnel.

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.

The

load-balance hash-fields mpls command is used to adjust the hash factor in MPLS forwarding:

  • If MPLS label-based load balancing has high performance, specify label.
  • If MPLS label-based load balancing has low performance, specify label.

    For example, if an L2VPN is attached to the AC end of a PE in a large-scale L3VPN, labels of MPLS packets that enter the inbound interface of a P device are the same, but destination MAC addresses encapsulated in the MPLS packets are different. In this case, to perform traffic load balancing on the P device, specify the hash factor as the payload header but not the MPLS label. When MPLS packets carry non-IP packets, specifying the payload-header parameter may cause out-of-order traffic. Therefore, the ip parameter can be used in this case. If different service flows or users use different ToS values in the same IP flow and load balancing is required, you are advised to specify the ip-tos parameter.

Configuration Impact

If the load-balance hash-fields mpls command is run more than once, only the latest configuration takes effect. After the command is configured, the hash calculation is performed based on the new hash factor.

Precautions

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

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

Example

# Set the hash factor to payload-header for the board in slot 1.
<HUAWEI> system-view
[~HUAWEI] slot 1
[*HUAWEI-slot-1] load-balance hash-fields mpls payload-header
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >