iperf icon indicating copy to clipboard operation
iperf copied to clipboard

feature request: make client report after specific number of bytes transferred

Open khimaros opened this issue 2 years ago • 2 comments

Context

  • Version of iperf3: 3.13

  • Hardware: x86

  • Operating system (and distribution, if any): Debian 12

Enhancement Request

  • Current behavior

it is currently possible to generate a report every number of seconds using -i flag, however, there is no way to report after a specific number of bytes are transferred.

  • Desired behavior

provide a new flag to report every number of bytes, for example:

$ iperf3 --interval-bytes=1M

would report after each 1MB was transferred regardless of how much time has elapsed.

it's fine if -i 0 also needs to be passed along to disable time based intervals

  • Implementation notes

i'm using this to generate a sound each time a number of bytes is successfully sent on my phone. this helps me search for reception while traveling in remote areas. more frequent sound means higher bandwidth.

i tried to do this using repeated invocations to iperf3, but the startup time (connecting initial server connection/handshake) ends up being the majority of the time and puts an upper bound on the frequency of notifications.

khimaros avatar Jul 03 '23 14:07 khimaros

if i am reading correctly, this could be done with only one or two new variables on the stack in iperf_run_client and no other api or data structure changes.

for client only implementation, it seems like the implementation of this could go somewhere near here: https://github.com/esnet/iperf/blob/master/src/iperf_client_api.c#L651

making use of test->bytes_sent and/or test->bytes_received and tracking them in the while loop with another variable which is reset each time the threshold is reached (rolling over the remaining bytes to the next iteration).

khimaros avatar Jul 03 '23 14:07 khimaros

created this tool to work around the limitation: https://github.com/khimaros/iperf3_watch

khimaros avatar Jul 03 '23 17:07 khimaros