Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Understanding the Algorithm Used to Hash LAG Bundle and Egress Next-Hop ECMP Traffic (QFX 10002 and QFX 10008 Switches)

 

Juniper Networks QFX 10002 and QFX 10008 switches use a hashing algorithm to determine how to forward traffic over a link aggregation group (LAG) bundle or to the next-hop device when equal-cost multipath (ECMP) is enabled.

The hashing algorithm makes hashing decisions based on values in various packet fields. You can configure some of the fields that are used by the hashing algorithm.

This topic contains the following sections:

Understanding the Hashing Algorithm

The hashing algorithm is used to make traffic-forwarding decisions for traffic exiting a switch when ECMP is enabled.

For LAG bundles, the hashing algorithm determines how traffic entering a LAG bundle is placed onto the bundle’s member links to manage bandwidth by evenly load-balancing traffic across the the outgoing links

For ECMP, the hashing algorithm determines how incoming traffic is forwarded to the next-hop device.

The hashing algorithm makes hashing decisions based on values in various packet fields, as well as on the hash seed value. The packet fields used by the hashing algorithm varies by the packet’s EtherType and, in some instances, by the configuration on the switch. The hashing algorithm recognizes the following EtherTypes:

  • IP (IPv4 and IPv6)

  • MPLS

  • MAC-in-MAC

You can configure some fields that are used by the hashing algorithm to make traffic forwarding decisions. You cannot, however, configure how certain values within a header are used by the hashing algorithm.

Note the following points regarding the hashing algorithm:

  • The fields selected for hashing are based on the packet type only. The fields are not based on any other parameters, including forwarding decision (bridged or routed) or egress LAG bundle configuration (Layer 2 or Layer 3).

  • The same fields are used for hashing unicast and multicast packets. Unicast and multicast packets are, however, hashed differently.

  • The same fields are used by the hashing algorithm to hash ECMP and LAG traffic. The hashing ensures that traffic is not polarized when a LAG bundle is part of the ECMP next-hop path.

The fields used for hashing by each EtherType as well as the fields used by the Layer 2 header are discussed in the following sections.

IP (IPv4 and IPv6)

Payload fields in IPv4 and IPv6 packets are used by the hashing algorithm when IPv4 or IPv6 packets need to be placed onto a member link in a LAG bundle or sent to the next-hop device when ECMP is enabled.

The table below displays the IPv4 and IPv6 payload fields that are used by the hashing algorithm, by default. All fields are configurable.

  • ✓—Field is used by the hashing algorithm, by default.

  • Χ—Field is not used by the hashing algorithm, by default.

  • (configurable)—Field can be configured to be used or not used by the hashing algorithm.

Table 1: IPv4 and IPv6 Hashing Fields for the QFX10002 Switch and QFX 10008 Switch

Fields

QFX10002 Switch and QFX 10008 Switch

 

LAG

ECMP

Source MAC (0:47)

Χ

Χ

Destination MAC (0:47)

Χ

Χ

EtherType (0:15)

VLAN ID (0:11)

Source IP [1](0:31)

Destination IP (0:31)

Incoming Port

Protocol (for IPv4 packets)(0:7)

Χ

Χ

Next header (for IPv6 packets)(0:7)

Χ

Χ

Layer 4 Source Port (0:15)

Layer 4 Destination Port (0:15)

IPv6 Flow label (0:19)

MPLS

The hashing algorithm hashes MPLS packets using the source IP, destination IP, MPLS label 0, MPLS label 1, and MPLS label 2 fields.

The table below displays the MPLS payload fields that are used by the hashing algorithm, by default:

  • ✓—Field is used by the hashing algorithm, by default.

  • Χ—Field is not used by the hashing algorithm, by default.

The fields used by the hashing algorithm for MPLS packet hashing are not user-configurable.

The source IP and destination IP fields are not always used for hashing. For non-terminated MPLS packets, the payload is checked if the bottom of stack (BoS) flag is seen in the packet. If the payload is IPv4 or IPv6, then the IP source address and IP destination address fields are used for hashing along with the MPLS labels. If the BoS flag is not seen in the packet, only the MPLS labels are used for hashing.

Table 2: MPLS Hashing Fields for the QFX10002 Switch and QFX 10008 Switch

Fields

QFX10002 Switch

 

LAG

ECMP

Source MAC (0:47)

Χ

Χ

Destination MAC (0:47)

Χ

Χ

EtherType (0:15)

VLAN ID (0:11)

Source IP [1](0:31)

Destination IP (0:31)

Incoming Port

Protocol (for IPv4 packets)(0:7)

Χ

Χ

Next header (for IPv6 packets)(0:7)

Χ

Χ

Layer 4 Source Port (0:15)

Layer 4 Destination Port (0:15)

IPv6 Flow label (0:19)

MPLS label 0 (0:19)

MPLS label 1 (0:19)

MPLS label 2 (0:19)

Layer 2 Header Hashing on the QFX10002 and QFX 10008 Switches

Layer 2 header fields are used by the hashing algorithm when a packet’s EtherType is not recognized as IP (IPv4 or IPv6), MPLS, or MAC-in-MAC. The Layer 2 header fields are also used for hashing IPv4, IPv6, and MPLS traffic instead of the payload fields when the hash mode is set to Layer 2 header.

  • ✓—Field is used by the hashing algorithm, by default.

  • Χ—Field is not used by the hashing algorithm, by default.

Table 3: Layer 2 Header Hashing Fields for the QFX10002 Switch

Fields

QFX10002 and QFX 10008 Switches

 

LAG

ECMP

Source MAC (0:47)

Χ

Χ

Destination MAC (0:47)

Χ

Χ

EtherType (0:15)

Inner VLAN ID

Χ

Χ

VLAN ID (0:11)

Source IP [1] (0:31)

Χ

Χ

Destination IP (0:31)

Χ

Χ