6

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.

user674907
  • 73
  • 1
  • 1
  • 4

1 Answers1

10

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
JFL
  • 19,884
  • 1
  • 36
  • 68