Skip to content

[snappi]:Change ipv4 to random-src-port udp traffic.#14029

Merged
yejianquan merged 6 commits intosonic-net:masterfrom
rraghav-cisco:ipv4_udp
Sep 8, 2024
Merged

[snappi]:Change ipv4 to random-src-port udp traffic.#14029
yejianquan merged 6 commits intosonic-net:masterfrom
rraghav-cisco:ipv4_udp

Conversation

@rraghav-cisco
Copy link
Contributor

This PR proposes to change the IPv4 traffic used in snappi_tests/multidut to UDP traffic with different src ports for every stream.

We need this change since this allows the traffic to be well load-balanced in the backplane ports of the Multi-ASIC architecture. This doesn't affect the other platforms, since they should continue to behave the same irrespective of IPv4 or UDP traffic.

@selldinesh , @kamalsahu0001 , @sdszhang : FYI.
This allows 9 extra tests passing in multi-dut.

@rraghav-cisco rraghav-cisco changed the title Change ipv4 to random-src-port udp traffic. [snappi]:Change ipv4 to random-src-port udp traffic. Aug 7, 2024
src_port = random.randint(5000, 6000)
udp.src_port.increment.start = src_port
udp.src_port.increment.step = 1
udp.src_port.increment.count = 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously: 400G port speed1 traffic stream at 100%
Now: 400G port speed 2 traffic streams at 50% each

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rraghav-cisco pls make it platform specific.

tx_port_name = testbed_config.ports[tx_port_id].name
rx_port_name = testbed_config.ports[rx_port_id].name
data_flow_rate_percent = int(100 / len(prio_list))
data_flow_rate_percent = int(99.98 / len(prio_list))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amitpawar12 @vmittal-msft : Cisco recommendation is not to use 100% based on their platforms. Is it is ok for VOQ platform or do we see any concern ? If any concern we can make it platform specific

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, the change should be platform specific.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rraghav-cisco pls make it platform specific.

src_port = random.randint(5000, 6000)
udp.src_port.increment.start = src_port
udp.src_port.increment.step = 1
udp.src_port.increment.count = 1
Copy link
Contributor

@sdszhang sdszhang Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the total count is 1, one flow will use only one UDP port. When test case has two test flows, there is still 50% chance that two flows may be sent on the same physical link.
maybe we should increase the total count to 2 or higher? better to define it as a common variable in case it needs to be changed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can leave this as it is for now. and monitor it for further improvements when needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If traffic on each queue <= 200G, we can remove random and set fixed udp port for each queue.
Something like src_port = 5000 + queue_id

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have a random int between let's say (5000,6000) and have (PRIO+1) as multiplier so that each priority stream would have different source-destination port ranges.
The count can be also of higher value, like let's say 100/500 ensuring variety of UDP streams.

data_flow.tx_rx.port.rx_name = rx_port_name

eth, ipv4 = data_flow.packet.ethernet().ipv4()
eth, ipv4, udp = data_flow.packet.ethernet().ipv4().udp()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems only packet-chassis will be affected by the backplane issue. Should we use an if..else.. to show it's platform specific behavior?

@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/snappi_tests/multidut/pfcwd/files/pfcwd_multidut_basic_helper.py:146:31: E251 unexpected spaces around keyword / parameter equals
tests/snappi_tests/multidut/pfcwd/files/pfcwd_multidut_basic_helper.py:146:33: E251 unexpected spaces around keyword / parameter equals
tests/snappi_tests/multidut/pfcwd/files/pfcwd_multidut_basic_helper.py:147:36: E251 unexpected spaces around keyword / parameter equals
tests/snappi_tests/multidut/pfcwd/files/pfcwd_multidut_basic_helper.py:147:38: E251 unexpected spaces around keyword / parameter equals

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

Copy link
Collaborator

@yejianquan yejianquan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yejianquan yejianquan merged commit b0c19a0 into sonic-net:master Sep 8, 2024
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Sep 8, 2024
This PR proposes to change the IPv4 traffic used in snappi_tests/multidut to UDP traffic with different src ports for every stream.

We need this change since this allows the traffic to be well load-balanced in the backplane ports of the Multi-ASIC architecture. This doesn't affect the other platforms, since they should continue to behave the same irrespective of IPv4 or UDP traffic.

This allows 9 extra tests passing in multi-dut.

co-authorized by: [email protected]
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #14470

mssonicbld pushed a commit that referenced this pull request Sep 9, 2024
This PR proposes to change the IPv4 traffic used in snappi_tests/multidut to UDP traffic with different src ports for every stream.

We need this change since this allows the traffic to be well load-balanced in the backplane ports of the Multi-ASIC architecture. This doesn't affect the other platforms, since they should continue to behave the same irrespective of IPv4 or UDP traffic.

This allows 9 extra tests passing in multi-dut.

co-authorized by: [email protected]
hdwhdw pushed a commit to hdwhdw/sonic-mgmt that referenced this pull request Sep 20, 2024
This PR proposes to change the IPv4 traffic used in snappi_tests/multidut to UDP traffic with different src ports for every stream.

We need this change since this allows the traffic to be well load-balanced in the backplane ports of the Multi-ASIC architecture. This doesn't affect the other platforms, since they should continue to behave the same irrespective of IPv4 or UDP traffic.

This allows 9 extra tests passing in multi-dut.

co-authorized by: [email protected]
arista-hpandya pushed a commit to arista-hpandya/sonic-mgmt that referenced this pull request Oct 2, 2024
This PR proposes to change the IPv4 traffic used in snappi_tests/multidut to UDP traffic with different src ports for every stream.

We need this change since this allows the traffic to be well load-balanced in the backplane ports of the Multi-ASIC architecture. This doesn't affect the other platforms, since they should continue to behave the same irrespective of IPv4 or UDP traffic.

This allows 9 extra tests passing in multi-dut.

co-authorized by: [email protected]
vikshaw-Nokia pushed a commit to vikshaw-Nokia/sonic-mgmt that referenced this pull request Oct 23, 2024
This PR proposes to change the IPv4 traffic used in snappi_tests/multidut to UDP traffic with different src ports for every stream.

We need this change since this allows the traffic to be well load-balanced in the backplane ports of the Multi-ASIC architecture. This doesn't affect the other platforms, since they should continue to behave the same irrespective of IPv4 or UDP traffic.

This allows 9 extra tests passing in multi-dut.

co-authorized by: [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants