Skip to content

examples/networking/misc/lwiperf: add application#22286

Open
basilfx wants to merge 7 commits into
RIOT-OS:masterfrom
basilfx:feature/lwiperf_example
Open

examples/networking/misc/lwiperf: add application#22286
basilfx wants to merge 7 commits into
RIOT-OS:masterfrom
basilfx:feature/lwiperf_example

Conversation

@basilfx
Copy link
Copy Markdown
Member

@basilfx basilfx commented May 12, 2026

Contribution description

This is lwIP's built-in iPerf2 'app', provided as an example application for RIOT-OS. I came across this functionality, researching possibilities to test (to be PR'd) ethernet drivers.

I am aware of benchmark_udp. Given that the code for the built-in iPerf2 'app' is already distributed with lwIP, I think this is a nice addition to test TCP throughput, and have another utility to stress test an ethernet driver.

Testing procedure

This can be easily tested on native.

$ make -C examples/networking/misc/lwiperf
$ examples/networking/misc/lwiperf/bin/native64/lwiperf.elf tap0

On the host, start an iPerf server (-V is for IPv6):

$ iperf -V -s

Run the client on the node, connecting to the host:

> client fe80::804:9bff:feb4:23de
TCP client connecting to fe80::804:9bff:feb4:23de port 5001

The node will connect to the server and print a report afterwards:

--- Results ---
Status      : TCP client done
Remote      : FE80::804:9BFF:FEB4:23DE:5001
Transferred : 309149816 bytes
Duration    : 10000 ms
Bandwidth   : 247312 kbit/s
--------------

The host output will look as follows:

------------------------------------------------------------
Server listening on TCP port 5001
TCP window size:  128 KByte (default)
------------------------------------------------------------
[  1] local fe80::804:9bff:feb4:23de port 5001 connected with fe80::d016:6cff:fe09:7835 port 49153
[ ID] Interval       Transfer     Bandwidth
[  1] 0.0000-9.9988 sec   295 MBytes   247 Mbits/sec

Issues/PRs references

None

Declaration of AI-Tools / LLMs usage:

AI-Tools / LLMs that were used are:

  • Claude Code for the final review of the three commits

@basilfx basilfx requested review from jia200x and miri64 as code owners May 12, 2026 15:18
@github-actions github-actions Bot added Area: network Area: Networking Area: doc Area: Documentation Area: pkg Area: External package ports Area: examples Area: Example Applications labels May 12, 2026
@basilfx basilfx force-pushed the feature/lwiperf_example branch from 8b82639 to 12e674f Compare May 12, 2026 15:19
@crasbe crasbe added Type: new feature The issue requests / The PR implemements a new feature for RIOT CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels May 12, 2026
Comment thread examples/networking/misc/lwiperf/main.c Outdated
Comment thread examples/networking/misc/lwiperf/Makefile Outdated
@riot-ci
Copy link
Copy Markdown

riot-ci commented May 12, 2026

Murdock results

✔️ PASSED

b747126 fixup! examples/networking/misc/lwiperf: add application

Success Failures Total Runtime
11124 0 11124 12m:35s

Artifacts

@basilfx basilfx force-pushed the feature/lwiperf_example branch 2 times, most recently from ed2a543 to 9ddc7ae Compare May 14, 2026 13:47
basilfx added 5 commits May 18, 2026 16:17
This is a lwIP app that provides an iPerf2 compatible client and server.
It can be useful for benchmarking an ethernet driver.
This is an application that encapsulates lwIP's built-in iPerf
client/server. It provides a shell to connect to a server, or to host a
server.
@basilfx basilfx force-pushed the feature/lwiperf_example branch from 9ddc7ae to f2a435f Compare May 18, 2026 18:39
@basilfx basilfx force-pushed the feature/lwiperf_example branch from f2a435f to 7d6ec33 Compare May 18, 2026 19:30
@basilfx
Copy link
Copy Markdown
Member Author

basilfx commented May 18, 2026

Gave this another review myself:

  • Guarded _session a bit more with locks.
  • Documented an issue where a server on both IPv4 and IPv6 will only listen on IPv4. Not sure why, and not something I want to dig into too much. I exactly use it as documented.
  • Moved dependency on lwip_tcp and lwip_arp (for IPv4) to pkg/lwip/Makefile.dep

@basilfx basilfx force-pushed the feature/lwiperf_example branch from 1e76108 to b747126 Compare May 18, 2026 19:38
@basilfx
Copy link
Copy Markdown
Member Author

basilfx commented May 18, 2026

Screenshot of this application running on actual hardware (Seeeduino Arch Pro):

Scherm­afbeelding 2026-05-18 om 22 21 29

(don't mind the sudo thingy: has to do with macOS and local network access)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: doc Area: Documentation Area: examples Area: Example Applications Area: network Area: Networking Area: pkg Area: External package ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR 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.

3 participants