Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tapsetup: add --loss & --delay option #18885

Merged
merged 2 commits into from
Nov 11, 2022
Merged

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Nov 11, 2022

Contribution description

This adds an option to simulate loss links with netdev_tap

Testing procedure

Create lossy TAP interfaces

sudo dist/tools/tapsetup/tapsetup --loss 20% --delay 10ms

Start two native instances

> ping -c 100 -i 10 fe80::58b0:8ff:fe67:ad82   
12 bytes from fe80::58b0:8ff:fe67:ad82%5: icmp_seq=1 ttl=64 time=20.407 ms
12 bytes from fe80::58b0:8ff:fe67:ad82%5: icmp_seq=5 ttl=64 time=20.355 ms
12 bytes from fe80::58b0:8ff:fe67:ad82%5: icmp_seq=6 ttl=64 time=20.357 ms
…
12 bytes from fe80::58b0:8ff:fe67:ad82%5: icmp_seq=98 ttl=64 time=20.383 ms

--- fe80::58b0:8ff:fe67:ad82 PING statistics ---
100 packets transmitted, 67 packets received, 33% packet loss
round-trip min/avg/max = 20.233/20.373/20.509 ms

Note that ping measures round-trip-time, so two packets: 10 ms + 10 ms -> 20ms, 80% * 80% -> 64% success

Issues/PRs references

@github-actions github-actions bot added the Area: tools Area: Supplementary tools label Nov 11, 2022
@benpicco benpicco changed the title tapsetup: add --loss option tapsetup: add --loss & --delay option Nov 11, 2022
@benpicco benpicco added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Type: new feature The issue requests / The PR implemements a new feature for RIOT and removed Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation labels Nov 11, 2022
Copy link
Contributor

@kfessel kfessel left a comment

Choose a reason for hiding this comment

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

fits the tool, fits the style and in a simple test with examples/gnrc_networking it did the thing it is supposed to do

@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs labels Nov 11, 2022
@riot-ci
Copy link

riot-ci commented Nov 11, 2022

Murdock results

✔️ PASSED

4511f3f tapsetup: add --delay option

Success Failures Total Runtime
1 0 1 01m:18s

Artifacts

This only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now.

@benpicco benpicco enabled auto-merge November 11, 2022 16:45
@benpicco benpicco merged commit edf30e0 into RIOT-OS:master Nov 11, 2022
@kaspar030 kaspar030 added this to the Release 2023.01 milestone Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants