dellemc.enterprise_sonic.sonic_ecmp_load_share module – IP ECMP load share mode configuration handling for SONiC.

Note

This module is part of the dellemc.enterprise_sonic collection (version 3.2.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install dellemc.enterprise_sonic.

To use it in a playbook, specify: dellemc.enterprise_sonic.sonic_ecmp_load_share.

New in dellemc.enterprise_sonic 3.1.0

Synopsis

  • This module provides configuration management for IP ECMP load share mode on

  • devices running SONiC.

Parameters

Parameter

Comments

config

dictionary

IP ECMP load share mode configuration.

hash_algorithm

string

Load share hash algorithm.

Choices:

  • "CRC"

  • "XOR"

  • "CRC_32LO"

  • "CRC_32HI"

  • "CRC_CCITT"

  • "CRC_XOR"

  • "JENKINS_HASH_LO"

  • "JENKINS_HASH_HI"

hash_ingress_port

boolean

Include the ingress port in the load share hash calculation.

Choices:

  • false

  • true

hash_offset

dictionary

Load share hash offset.

flow_based

boolean

Enable flow-based IP ECMP hashing.

If this option is set to true, the configured ‘offset’ value is ignored.

Choices:

  • false

  • true

offset

integer

IP ECMP hash offset value.

The range of values is from 0 to 15.

hash_roce_qpn

boolean

Include the ROCE Queue-Pair Number in the load share hash calculation.

Choices:

  • false

  • true

hash_seed

integer

IP ECMP hash seed value.

The range of values is from 0 to 16777215.

ipv4

dictionary

IPv4 ECMP Load share hash parameters.

ipv4_dst_ip

boolean

Include the IPv4 destination IP address in the load share hash calculation.

Choices:

  • false

  • true

ipv4_ip_proto

boolean

Include the IPv4 protocol value in the load share hash calculation.

Choices:

  • false

  • true

ipv4_l4_dst_port

boolean

Include the IPv4 L4 source port in the load share hash calculation.

Choices:

  • false

  • true

ipv4_l4_src_port

boolean

IPv4 L4 source port.

Choices:

  • false

  • true

ipv4_src_ip

boolean

Include the IPv4 source IP address in the load share hash calculation.

Choices:

  • false

  • true

ipv4_symmetric

boolean

IPv4 symmetric hash mode.

Choices:

  • false

  • true

ipv6

dictionary

IPv6 ECMP Load share hash parameters.

ipv6_dst_ip

boolean

Include the IPv6 destination IP address in the load share hash calculation.

Choices:

  • false

  • true

ipv6_l4_dst_port

boolean

Include the IPv6 L4 destination port in the load share hash calculation.

Choices:

  • false

  • true

ipv6_l4_src_port

boolean

Include the IPv6 L4 source port in the load share hash calculation.

Choices:

  • false

  • true

ipv6_next_hdr

boolean

Include the IPv6 “next header” value (usually the Transport Layer protocol type) in the

load share hash calculation.

Choices:

  • false

  • true

ipv6_src_ip

boolean

Include the IPv6 source IP address in the load share hash calculation.

Choices:

  • false

  • true

ipv6_symmetric

boolean

IPv6 symmetric hash mode.

Choices:

  • false

  • true

state

string

The state of the configuration after module completion.

Choices:

  • "merged" ← (default)

  • "deleted"

  • "replaced"

  • "overridden"

Notes

Note

  • Tested against Enterprise SONiC Distribution by Dell Technologies.

  • Supports check_mode.

Examples

# Using "deleted" state
#
# Before state:
# -------------
#
# sonic# show running-configuration | grep load-share
# ip load-share hash offset flow-based
# ip load-share hash seed 8888
# ip load-share hash ipv4 ipv4-dst-ip
# ip load-share hash ipv4 ipv4-src-ip
# ip load-share hash ipv4 ipv4-ip-proto
# ip load-share hash ipv4 ipv4-l4-src-port
# ip load-share hash ipv4 ipv4-l4-dst-port
# ip load-share hash algorithm CRC
# ip load-share hash ingress-port
# ip load-share hash roce qpn

- name: Delete some configuration
  sonic_ecmp_load_share:
    config:
      hash_algorithm: CRC
      hash_offset:
        flow_based: true
      hash_roce_qpn: true
      hash_seed: 8888
      ipv4:
        ipv4_l4_dst_port: true
        ipv4_l4_src_port: true
    state: deleted

# After state:
# ------------
#
# sonic# show running-configuration | grep load-share
# ip load-share hash ipv4 ipv4-dst-ip
# ip load-share hash ipv4 ipv4-src-ip
# ip load-share hash ipv4 ipv4-ip-proto
# ip load-share hash ingress-port


# Using "merged" state
#
# Before state:
# -------------
#
# sonic# show running-configuration | grep load-share
# ip load-share hash seed 8888
# ip load-share hash ipv4 ipv4-dst-ip
# ip load-share hash algorithm CRC

- name: Merge some configuration
  sonic_ecmp_load_share:
    config:
      hash_algorithm: CRC_32LO
      hash_ingress_port: true
      hash_offset:
        offset: 12
        flow_based: true
      hash_roce_qpn: true
      hash_seed: 9999
      ipv4:
        ipv4_src_ip: true
        ipv4_ip_proto: true
        ipv4_l4_dst_port: true
        ipv4_l4_src_port: true
    state: merged

# After state:
# ------------
#
# sonic# show running-configuration | grep load-share
# ip load-share hash seed 9999
# ip load-share hash ipv4 ipv4-dst-ip
# ip load-share hash ipv4 ipv4-src-ip
# ip load-share hash ipv4 ipv4-ip-proto
# ip load-share hash ipv4 ipv4-l4-src-port
# ip load-share hash ipv4 ipv4-l4-dst-port
# ip load-share hash algorithm CRC_32LO
# ip load-share hash ingress-port


# Using "replaced" state
#
# Before state:
# -------------
#
# sonic# show running-configuration | grep load-share
# ip load-share hash offset flow-based
# ip load-share hash seed 8888
# ip load-share hash ipv4 ipv4-dst-ip
# ip load-share hash ipv4 ipv4-src-ip
# ip load-share hash algorithm CRC
# ip load-share hash ingress-port

- name: Replace some configuration
  sonic_ecmp_load_share:
    config:
      hash_algorithm: XOR
      hash_ingress_port: true
      hash_offset:
        flow_based: true
      hash_seed: 7777
      ipv4:
        ipv4_src_ip: true
    state: replaced

# After state:
# ------------
#
# sonic# show running-configuration | grep load-share
# ip load-share hash offset flow-based
# ip load-share hash seed 7777
# ip load-share hash ipv4 ipv4-src-ip
# ip load-share hash algorithm XOR
# ip load-share hash ingress-port


# Using overridden
#
# Before state:
# -------------
#
# sonic# show running-configuration | grep load-share
# ip load-share hash offset flow-based
# ip load-share hash seed 9999
# ip load-share hash ipv4 ipv4-src-ip
# ip load-share hash ipv4 ipv4-ip-proto
# ip load-share hash ipv4 ipv4-l4-src-port
# ip load-share hash ipv4 ipv4-l4-dst-port
# ip load-share hash algorithm XOR
# ip load-share hash ingress-port

- name: Override some configuration
  sonic_ecmp_load_share:
    config:
      hash_algorithm: CRC_32LO
      hash_ingress_port: true
      hash_offset:
        flow_based: true
      hash_seed: 1234
      ipv4:
        ipv4_l4_dst_port: true
        ipv4_l4_src_port: true
    state: overridden

# After state:
# ------------
#
# sonic# show running-configuration | grep load-share
# ip load-share hash offset flow-based
# ip load-share hash seed 1234
# ip load-share hash ipv4 ipv4-l4-src-port
# ip load-share hash ipv4 ipv4-l4-dst-port
# ip load-share hash algorithm CRC_32LO
# ip load-share hash ingress-port

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

after

dictionary

The configuration resulting from module invocation.

Returned: when changed

after(generated)

dictionary

The configuration that would result from non-check-mode module invocation.

Returned: when check_mode

before

dictionary

The configuration prior to the module invocation.

Returned: always

commands

list / elements=string

The set of commands pushed to the remote device. In check_mode the needed commands are displayed, but not pushed to the device.

Returned: always

Sample: ["command 1", "command 2", "command 3"]

Authors

    1. Zhang (@mingjunzhang2019)