iperf icon indicating copy to clipboard operation
iperf copied to clipboard

iperf3: use incompressible data for streaming test

Open rscheff opened this issue 8 months ago • 2 comments

Various access technologies, as well as transparent WAN accellerators, TCP proxies, VPNs and Encryption protocols willl try to compress (gz) the data stream and/or the packets. This is particularly notable by sending zeroed data payload, or when the data buffer which is used to send, is relatively small (few kB) - this can lead to results of throuhgput which are not attainable with normally compressible data, or incompressible data (e.g. media streaming data).

iperf3 should optionally have the capability to allocate a larger chunk of main memory, and fill this with random data or pre-compressed data (alternatively, consume a file / stdin with user-provided data to send, which is sent repeatedly when the data runs out before the test is over).

rscheff avatar Apr 04 '25 09:04 rscheff

Per iprf3 code, the iperf3 packets data is already randomized using "/dev/urandom". However, each message (packet) includes the same contents. I wrote the data into a file using iperf3 -F option and then compressed in using zip. The compression results:

  1. One packet (1KB / 31KB, 32KB 128KB): 0% compression.
  2. 4,000 packets of 1KB or 31KB: about 99% compression.
  3. 4,000 packets of of 32KB: 0% compression.

I am not familiar of the zip compression algorithm but from the above results it seems that it is effective for repeated random values only up to length of 32KB. Do you know what is that length for the network components you mentioned? I.e. what should be the size of the iperf3 "larger chunk of main memory"?

davidBar-On avatar Apr 05 '25 10:04 davidBar-On

Submitted PR #1907 with proposed solution - allow to send blocks with different randomized data in each (up to certain limit and then repeating the blocks).

davidBar-On avatar Jul 12 '25 19:07 davidBar-On