Skip to content
Ask AI

ECMP

Table 1 Load Balance Hash Key

CommandPurpose
hash mode {ipv4|ipv6|non_ip|ipv4-rdma|ipv6-rdma} hash_keySet load-balance mode and hash key.

hash mode {ipv4|ipv6|non_ip|ipv4-rdma|ipv6-rdma} hash_key

Section titled “hash mode {ipv4|ipv6|non_ip|ipv4-rdma|ipv6-rdma} hash_key”

[Command]

hash mode {ipv4|ipv6|non-ip|ipv4-rdma|ipv6-rdma} hash_key

[Purpose]

Set load-balance and hash key.

[Parameters]

ParameterDescription
hash_keyThe configurable hash key varys in different modes. Keys vlan_id/ip-protocol/src-ip/dst-ip/l4-src-port/l4-dst-port/in-port are supported for type IPv4.Keys vlan-id/src-ipv6/dst-ipv6/l4-src-port/l4-dst-port/in-port/nextheader/flow-label are supported for type IPv6.Keys src-mac/dst-mac/ethertype/vlan-id/in-port are supported for NON-IP type.Keys vlan_id/ip-protocol/src-ip/dst-ip/l4-src-port/l4-dst-port/in-port/bth-dest-qp supported for ipv4-rdma type.Keys vlan-id/src-ipv6/dst-ipv6/l4-src-port/l4-dst-port/in-port/nextheader/ flow-label/bth-dest-qp supported for ipv6-rdma type.

[View]

Global Configuration View

[Notes]

Set this parameter to modify the LAG and ECMP hash key. CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2 devices currently do not support configuring flow label fields for ipv6 types, which is enabled by default. Only CX864E-N device currently supports ipv4-rdma and ipv6-rdma type. Run command no hash mode {ipv4|ipv6|non-ip|ipv4-rdma|ipv6-rdma} to delete the configured custom load balancing and restore it to the default configuration.

[Use Cases]

sonic# configure terminal
sonic(config)# hash mode ipv4 src-ip dst-ip
sonic(config)# hash mode ipv6 src-ipv6 nextheader in-port
sonic(config)# hash mode non-ip src-mac dst-mac vlan-id

Table 2 Hash Configuration

CommandPurpose
hash seed valueSet hash seed.
hash enhancementEnable Hash Enhancement
hash outer-fields gre enableEnable hash based on the outer fields of GRE packets.

[Command]

hash seed value

[Purpose]

Set hash seed.

[Parameters]

ParameterDescription
valueThe range is 0~4294967295.

[View]

Global Configuration View

[Notes]

Configure this parameter to modify the LAG and ECMP hash seed. Run command no hash seed to restore to default value 10.

[Use Cases]

sonic# configure terminal
sonic(config)# hash seed 1000

[Command]

hash enhancement

[Purpose]

Enable Hash Enhancements.

[View]

Global Configuration View

[Notes]

Configure this parameter to automatically modify the hash Seed of LAG and ECMP, eliminating ECMP polarization phenomenon. Run command hash enhancement to disable hash enhancement.

[Use Cases]

sonic# configure terminal
sonic(config)# hash enhancement

[Command]

hash outer-fields gre enable

[Purpose]

Enable hash based on the outer fields of GRE messages.

[View]

Global Configuration View

[Notes]

By default, the switch performs hashing based on the inner field of GRE packets. After this configuration, the switch will hash based on the outer field of GRE packets instead of the inner field. Run command no hash outer-fields gre enable to disable the outer field hash function of GRE messages.

[Use Cases]

sonic# configure terminal
sonic(config)# hash outer-fields gre enable