Test Plan for inner packet hashing in ECMP
Rev 1.1
Table of Contents
- Revision
- Overview
- Test information
Revision
Rev | Date | Author | Change Description |
---|---|---|---|
0.1 | 03/12/2021 | Anish Narsian | Initial version |
1.0 | 04/01/2021 | Anish Narsian | Incorporate review comments |
1.1 | 07/28/2021 | Anton Hryshchuk | Test configs by dynamic PBH |
Overview
The purpose of this test plan is to describe inner packet hashing tests for ECMP nexthops. The test methodology will be similar to the current hash_test in SONiC. The test sends encapsulated packets and validates hashing is performed per the inner packet's 5 tuple(src ip, dst ip, src port, dst port, ip proto).
Test information
Supported topology
The test will be supported on the T0 toplogy(add and verify others), it may be enhanced in the future for other topologies.
Test configuration
The inner hashing configuration to the DUT done by dynamic Policy Base Hashing feature.
Beyond hash configuration, base DUT route table configurations are sufficient to perform the test.
PBH cli coverage
- config pbh table add
- config pbh table delete
- config pbh hash-field add
- config pbh hash-field delete
- config pbh hash add
- config pbh hash delete
- config pbh rule add
- config pbh rule delete
PBH table configuration
Create PBH table with vlan ptf ports as members. It will be a list of all ports in t0 topology, which in Up state and not in LAG.
PBH hash field configuration
Hash native field:
NAME FIELD MASK SEQUENCE SYMMETRIC
----------------- ----------------- --------------- ---------- -----------
inner_ip_proto INNER_IP_PROTOCOL N/A 1 No
inner_l4_dst_port INNER_L4_DST_PORT N/A 2 Yes
inner_l4_src_port INNER_L4_SRC_PORT N/A 2 Yes
inner_dst_ipv4 INNER_DST_IPV4 255.255.255.255 3 Yes
inner_src_ipv4 INNER_SRC_IPV4 255.255.255.255 3 Yes
inner_dst_ipv6 INNER_DST_IPV6 ::ffff:ffff 4 Yes
inner_src_ipv6 INNER_SRC_IPV6 ::ffff:ffff 4 Yes
PBH hash configuration
Define hash with field list:
- inner_ip_proto
- inner_l4_dst_port
- inner_l4_src_port
- inner_dst_ipv4
- inner_src_ipv4
- inner_dst_ipv6
- inner_src_ipv6
PBH rule configuration
Created rules:
TABLE RULE PRIORITY MATCH HASH ACTION COUNTER
--------- --------------- ---------- ------------------------- ---------- ------------- ---------
pbh_table nvgre_ipv4_ipv4 2 ether_type: 0x0800 inner_hash SET_ECMP_HASH ENABLED
ip_protocol: 0x2f
inner_ether_type: 0x0800
pbh_table nvgre_ipv4_ipv6 2 ether_type: 0x0800 inner_hash SET_ECMP_HASH ENABLED
ip_protocol: 0x2f
inner_ether_type: 0x86dd
pbh_table nvgre_ipv6_ipv4 2 ether_type: 0x86dd inner_hash SET_ECMP_HASH ENABLED
ipv6_next_header: 0x2f
inner_ether_type: 0x0800
pbh_table nvgre_ipv6_ipv6 2 ether_type: 0x86dd inner_hash SET_ECMP_HASH ENABLED
ipv6_next_header: 0x2f
inner_ether_type: 0x86dd
pbh_table vxlan_ipv4_ipv4 1 ether_type: 0x0800 inner_hash SET_ECMP_HASH ENABLED
ip_protocol: 0x11
l4_dst_port: 0x3412
inner_ether_type: 0x0800
pbh_table vxlan_ipv4_ipv6 1 ether_type: 0x0800 inner_hash SET_ECMP_HASH ENABLED
ip_protocol: 0x11
l4_dst_port: 0x3412
inner_ether_type: 0x86dd
pbh_table vxlan_ipv6_ipv4 1 ether_type: 0x86dd inner_hash SET_ECMP_HASH ENABLED
ipv6_next_header: 0x11
l4_dst_port: 0x3412
inner_ether_type: 0x0800
pbh_table vxlan_ipv6_ipv6 1 ether_type: 0x86dd inner_hash SET_ECMP_HASH ENABLED
ipv6_next_header: 0x11
l4_dst_port: 0x3412
inner_ether_type: 0x86dd
High level test details
- Send packets to a destination prefix which is pointing to multiple ecmp nexthops. For the T0 topology test we will send it to a dest prefix which is pointing to the T1s.
- Vary some tuple of the packet so that the packets hash to different nexthops. The total packets sent in a test is calcualted as follows: 1000 packets sent per ECMP next hop. This translates to 4000 packets in a T0 topology with 4 T1s(ECMP nexthops). All 4000 packets will have varied tuples to get a good distribution of packets to ports.
- Identify set of ports on which the packet would have ecmp'd
- Check which port received the packet and record received packet count per port
- Calculate the expected number of packets per port
- Validate if received packet count per port is within a 25% deviation of expected number of packets on the port
Different outer encapsulation formats tested with various inner packets
The test will send inner packets and validate that varying any single 5-tuple of the inner packet results in hash variation, it will be sent with various outer encapsulation formats listed below
- IPv4 Vxlan
- IPv6 Vxlan
- IPv4 NVGRE
- IPv6 NVGRE
Different inner encapsulated formats tested with various outer packets
- IPv4
- IPv6
Inner packet tuples varied for hash validation
Validate hashing with different inner packet tuples
- Src IPv4
- Dst IPv4
- Src IPv6
- Dst IPv6
- Src Port
- Dst Port
- IP Protocol
Ensure that outer packets are not contributing to the hashing
Send the inner packets with identical inner tuples, then vary each of the outer packet tuples as 1000s of packets are sent. All packets should be received on a single next-hop ONLY, because of a lack in variation of the inner packet tuples. This way we ensure that only the inner packet tuples are contributing to the hash and that the outer packet tuples are not.
Symmetric hashing
As an optional mode, the test will also validate symmetric packet hashing: 2 directions of a flow land on the same ecmp nexthop. This will be tested by sending one direction of the packet, recording the received port, sending the reverse direction of the packet and validate that it is received on the very same port.
Warm boot testing
Run inner packet hashing traffic while warm boot is ongoing and ensure that it works just as in the standard non-warm boot case. Different packets tested with various inner encapsulated and outer encapsulation formats
- IPv4 IPv4 Vxlan
- IPv4 IPv6 Vxlan
- IPv6 IPv4 Vxlan
- IPv6 IPv6 Vxlan
- IPv4 IPv4 NVGRE
- IPv4 IPv6 NVGRE
- IPv6 IPv4 NVGRE
- IPv6 IPv6 NVGRE