Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Configuring Load Balancing Based on MPLS Labels

 

Load balancing occurs on a per-packet basis for MPLS flows on supported platforms. Entropy, or random distribution, is essential for the uniform distribution of packets to their next hops. By default, when load balancing is used to help distribute traffic, Junos OS employs a hash algorithm to select a next-hop address to install into the forwarding table. Whenever the set of next hops for a destination changes, the next-hop address is reselected by means of the hash algorithm. You can configure how the hash algorithm is used to load-balance traffic across a set of equal-cost label switched paths (LSPs).

To ensure entropy for VPLS & VPWS traffic, Junos OS can create a hash based on data from the IP header and as many as three MPLS labels (the so-called top labels).

In some cases, as the number of network feature that use labels grows (such as MPLS Fast Reroute, and RFC 3107, RSVP and VPN) data in the top three labels can become static and thus not a sufficient source for entropy. Load balancing can become skewed as a result, or the incidence of out-of-order packet delivery may rise. For these cases, labels from the bottom of the label stack can be used (see Table 1, below for qualifications). Top labels and bottom labels cannot be used at the same time.

Note

MPC cards do not support the regular hash key configuration. For the MPC-based hash key configuration to be effective, you need an enhanced-hash-key configuration.

Load balancing is used to evenly distribute traffic when the following conditions apply:

  • There are multiple equal-cost next hops over different interfaces to the same destination.

  • There is a single next hop over an aggregated interface.

An LSP tends to load-balance its placement by randomly selecting one of the equal-cost next hops and using it exclusively. The random selection is made independently at each transit router, which compares Interior Gateway Protocol (IGP) metrics alone. No consideration is given to bandwidth or congestion levels.

This feature applies to aggregated Ethernet and aggregated SONET/SDH interfaces as well as multiple equal-cost MPLS next hops. In addition, on the T Series, MX Series, M120, and M320 routers only, you can configure load balancing for IPv4 traffic over Layer 2 Ethernet pseudowires. You can also configure load balancing for Ethernet pseudowires based on IP information. The option to include IP information in the hash key provides support for Ethernet circuit cross-connect (CCC) connections.

To load-balance based on the MPLS label information, configure the family mpls statement:

You can include this statement at the following hierarchy levels:

  • [edit forwarding-options hash-key]

Table 1 provides detailed information about all of the possible MPLS LSP load-balancing options.

Table 1: MPLS LSP Load Balancing Options

Statement

Supported Platforms

MPLS LSP Load Balancing Options

all-labels

MX Series and PTX Series

Prior to Junos OS Release 19.1R1, up to eight MPLS labels were included in the hash key to identify the uniqueness of a flow in the Packet Forwarding Engine. On PTX Series routers, this value is set by default.

Starting in Junos OS Release 19.1R1, for MX Series routers with MPC and MIC interfaces, up to sixteen incoming MPLS labels are included in the hash key.

bottom-label-l

MX Series with DPC (I-Chip). Not supported on M10i, M7i, and M120.

Uses the bottom-most label for calculating the hash key, for example if the top labels do not provide sufficient variable for the required level of entropy.

bottom-label-2

MX Series with DPC (I-Chip). Not supported on M10i, M7i, and M120.

Uses the second label from the bottom for calculating the hash key, for example if the top labels do not provide sufficient variable for the required level of entropy.

bottom-label-3

MX Series with DPC (I-Chip). Not supported on M10i, M7i, and M120.

Uses the third label from the bottom for calculating the hash key, for example if the top labels do not provide sufficient variable for the required level of entropy.

label-l

M Series, MX Series, T Series

Include the first label in the hash key. Use this option for single label packets.

label-2

M Series, MX Series, T Series

Include the second label in the hash key. You must also configure the label-1 option. The entire first label and the first 16 bits of the second label are used in the hash key.

label-3

M Series, MX Series, T Series

Include the third label in the hash key. You must also configure the label-1 option and the label-2 option.

no-labels

All

Excludes MPLS labels from the hash key.

no-label-1-exp

M Series, MX Series, T Series

Excludes the EXP bit of the top label from the hash key. You must also configure the label-l option.

For Layer 2 VPNs, the router could encounter a packet reordering problem. When a burst of traffic pushes the customer traffic bandwidth to exceed its limits, the traffic might be affected in mid flow. Packets might be reordered as a result. By excluding the EXP bit from the hash key, you can avoid this reordering problem.

payload

All

Allows you to configure which parts of the IP packet payload to include in the hash key. For the PTX Series Packet Transport Router, this value is set by default.

disable

PTX Series

Exclude IP payload from the hash key.

ether-pseudowire

M120, M320, MX Series, T Series

Load-balance IPv4 traffic over Layer 2 Ethernet pseudowires.

ip

All

Include the IPv4 or IPv6 address in the hash key. You must also configure either label-l or no-labels.

layer-3-only

All

Include only the Layer 3 IP information in the hash key. Excludes all of the port-data bytes from the hash key.

port-data

M Series, MX Series, T Series

Include the source and destination port field information. By default, the most significant byte and least significant byte of the source and destination port fields are used in the hash key. To select specific bytes to use in the hash key, include one or more of the source-msb, source-lsb, destination-msb, and destination-lsb options at the [edit forwarding-options hash-key family mpls payload ip port-data] hierarchy level. To prevent all four bytes from being hashed, include the layer-3-only statement at the [edit forwarding-options hash-key family mpls payload ip] hierarchy level.

destination-lsb

M Series, MX Series, T Series

Include the least significant byte of the destination port in the hash key. Can be combined with any of the other port-data options.

destination-msb

M Series, MX Series, T Series

Include the most significant byte of the destination port in the hash key. Can be combined with any of the other port-data options.

source-lsb

M Series, MX Series, T Series

Include the least significant byte of the source port in the hash key. Can be combined with any of the other port-data options.

source-msb

M Series, MX Series, T Series

Include the most significant byte of the source port in the hash key. Can be combined with any of the other port-data options.

The following examples illustrate ways in which you can configure MPLS LSP load balancing:

  • To include the IP address as well as the first label in the hash key:

    • For M Series, MX Series, and T Series routers, configure the label-1 statement and the ip option for the payload statement at the [edit forwarding-options hash-key family mpls] hierarchy level:

    • For PTX Series Packet Transport Routers, the all-labels and ip payload options are configured by default, so no configuration is necessary.

  • (M320 and T Series routers only) To include the IP address as well as both the first and second labels in the hash key, configure the label-1 and label-2 options and the ip option for the payload statement at the [edit forwarding-options hash-key family mpls] hierarchy level:

    Note

    You can include this combination of statements on M320 and T Series routers only. If you include them on an M Series Multiservice Edge Router, only the first MPLS label and the IP payload are used in the hash key.

  • For T Series routers, ensure proper load balancing by including the label-1, label-2, and label-3 options at the [edit forwarding-options hash-key family mpls] hierarchy level:

  • (M Series, MX Series, and T Series routers only) For Layer 2 VPNs, the router could encounter a packet reordering problem. When a burst of traffic pushes the customer traffic bandwidth to exceed its limits, the traffic might be affected in mid flow. Packets might be reordered as a result. By excluding the EXP bit from the hash key, you can avoid this reordering problem. To exclude the EXP bit of the first label from the hash calculations, include the no-label-1-exp statement at the [edit forwarding-options hash-key family mpls] hierarchy level:

Release History Table
Release
Description
Starting in Junos OS Release 19.1R1, for MX Series routers with MPC and MIC interfaces, up to sixteen incoming MPLS labels are included in the hash key.