Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Queue-Pair Hashing for RDMA Flows

date_range 27-Feb-25

Overview

Load balancing algorithms use hashing mechanisms to select the best outgoing interface from a link aggregation group (LAG) or ECMP bundle. Most load balancing algorithms hash (that is, divide the traffic load among links) based on 5-tuple information. The 5-tuple information covers Layer 2 (L2), which includes the source and destination MAC addresses; Layer 3 (L3), which includes the source and destination IP addresses; and Layer 4 (L4), which includes the TCP/UDP ports. However, in AI-ML training networks, most traffic uses Remote Direct Memory Access (RDMA) over Converged Ethernet version 2 (RoCEv2) for transport. ROCEv2 traffic might not have variance on L4 ports. This leads to less entropy and could result in less efficient load balancing.

In a network that uses RoCEv2 for application traffic transport, an RDMA connection sends traffic on a send queue and receives traffic on a receive queue. These queues form the RDMA connection. Together, the send queue and receive queue are referred to as a queue pair. Each queue pair has an identifiable prefix. ROCEv2 uses the destination queue pair as the flow identification field.

You can enhance load balancing on your AI-ML training network by including the destination queue pair in the hash calculation. This is called queue-pair hashing. Adding the destination queue pair to the hash calculation increases the entropy of the system and improves the overall load balancing efficiency. On devices and releases that support this feature, queue-pair hashing is enabled by default for all ROCEv2 traffic.

Note:

When you enable dynamic load balancing (DLB) on your device, queue-pair hashing is automatically disabled on link aggregation group (LAG) interfaces.

Configuration

Verify Queue-Pair Hashing

By default, the load balancing algorithm includes the RDMA queue pair as part of the hash calculation for RDMA traffic (both IPv4 and IPv6). No configuration is required.

To confirm the feature is enabled, use the following command and confirm that the “RDMA Queue Pair” field in the output is marked “yes”:

content_copy zoom_out_map
user@device> show forwarding-options enhanced-hash-key

Current RTAG7 Settings
-------------------------
   Hash-Mode                 :layer2-payload
   Hash-Seed                 :108202401
inet  RTAG7 settings:
----------------------
inet packet fields
  protocol                  :yes
  Destination IPv4 Addr     :yes
  Source IPv4 Addr          :yes
  destination L4 Port       :yes
  Source L4 Port            :yes
  Vlan id                   :no
  RDMA Queue Pair           :yes
inet non-packet fields
  incoming device           :yes
  incoming port             :yes
inet6  RTAG7 settings:
----------------------
inet6 packet fields
  next-header               :yes
  Destination IPv6 Addr     :yes
  Source IPv6 Addr          :yes
  destination L4 Port       :yes
  Source L4 Port            :yes
  Vlan id                   :no
  RDMA Queue Pair           :yes
inet6 non-packet fields
  incoming device           :yes
  incoming port             :yes
Hash-Parameter Settings for ECMP:
------------------------------------
  Hash Function   = CRC16_BISYNC
  Hash offset base = 16
  Hash offset     = 4294967280
  Hash preprocess = 0
Hash-Parameter Settings for LAG:
------------------------------------
  Hash Function   = CRC16_CCITT
  Hash offset base = 0
  Hash offset     = 0
  Hash preprocess = 0
Ecmp Resilient Hash   = Disabled
ECMP DLB Load Balancing Options:
---------------------------------------------------
  Load Balancing Method              : Disabled
  Inactivity Interval                : 0 (us)
  Flowset Table size                 : 0 (entries per ECMP)
  Reassignment Probability Threshold : 0
  Reassignment Quality Delta         : 0
  Egress Port Load Weight            : 0
  EgressBytes Min Threshold          : 1
  EgressBytes Max Threshold          : 100
  Sampling Rate                      : 62500
  Ether Type                         : All

Disable Queue-Pair Hashing

To exclude the queue pair from the load balancing hash calculation, configure the following:

  1. Check the hash mode configured on your device using the show forwarding-options enhanced-hash-key command.
    In this example, the hash mode is the default layer2-payload. The output has been shortened for clarity.
    content_copy zoom_out_map
    user@device> show forwarding-options enhanced-hash-key      
    
    SENT: Ukern command: show forwarding-options enhanced-hash-key
    Current RTAG7 Settings
    -------------------------
       Hash-Mode                 :layer2-payload
    [...] 
    
  2. Configure the hash mode using the hash-mode statement.
    content_copy zoom_out_map
    user@device# set forwarding-options enhanced-hash-key hash-mode hash-mode

    Even though the device already recognizes layer2-payload as the hash mode in this example as shown in the previous step, you must still configure it in the CLI. Otherwise, the commit fails.

    content_copy zoom_out_map
    user@device# set forwarding-options enhanced-hash-key hash-mode layer2-payload
  3. Configure the no-queue-pair option for either IPv4 or IPv6.
    content_copy zoom_out_map
    user@device# set forwarding-options enhanced-hash-key (inet | inet6) no-queue-pair
  4. Commit the configuration.
    content_copy zoom_out_map
    user@device# commit

Platform Support

See Feature Explorer for platform and release support.

footer-navigation