1

I wanted to test some different test cases. I wanted to transmit 1MB, 10MB, 100MB, ..., 1GB, ... and measure bandwith with iperf.

In the manual stands that I can use a combination of -l and -n parameter.

So now I want to send for example 1 MB. I use a -l 8K (8 KByte(?)) and -n 125 to send 1 MByte. Or -n 125*1000 to send 1 GB.

If I try this it's to fast! (10 GB needs 8 seconds...) My calculation has to be wrong. But I don't see what I'm doing wrong.

  • Thanks a lot @JFL ! I was confused because of this page: "The number of buffers to transmit. Normally, iPerf sends for 10 seconds. The -n option overrides this and sends an array of len bytes num times, no matter how long that takes. See also the -l and -t options." iperf.fr/iperf-doc.php – user674907 Nov 29 '17 at 12:56
  • yes "The number of buffers to transmit. " is misleading, it should be "The number of bytes". In doubt, always check the man page ;) – JFL Nov 29 '17 at 13:21
7

The -l option is for the buffer and doesn't influence the amount of data transferred.

You have to specify the desired amount of data with the client-only option -n in KByte or MByte.

So for 10GB, use -n 10240M

Example:

With the defaut buffer size of 8KB:

iperf -c 10.1.1.1 -n 10240M
------------------------------------------------------------
Client connecting to 10.1.1.1, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  3] local 10.1.1.2 port 56565 connected with 10.1.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.5 sec  10.0 GBytes  8.20 Gbits/sec

Wit the the same value for the -n option but with -l 32K

iperf -c 10.1.1.1 -n 10240M -l 32K
------------------------------------------------------------
Client connecting to 10.12.1.1, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  3] local 10.1.1.2 port 56568 connected with 10.1.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.5 sec  10.0 GBytes  8.17 Gbits/sec
  • Also works with GByte -n 10GB – Tobias Mar 16 '19 at 23:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.