6

I am unable to set the bandwidth on both sides using the Iperf tool.

When I use the command iperf -c 192.168.1.15 -b 10m -l 32k -w 128k I get this error:

--iperf: ignoring extra argument -- 10m

--Can't use packet-oriented mode with these settings.

Why am I getting this error?

Ryan Foley
  • 5,479
  • 4
  • 23
  • 43
sak
  • 69
  • 2
  • 2
  • 5
  • iperf 2.0.8+ supports -b for TCP using a token bucket. – rjmcmahon Jul 15 '16 at 18:01
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer. – Ron Maupin Jan 05 '21 at 18:21

4 Answers4

3

I'm inclined to believe that it is your caps/non-caps on the bandwidth designations (i.e. -b 10M -l 32K -w 128K). I can't test it because we don't know what version you're running. Iperf does make a distinction between bits and bytes:

-f, --format    [kmKM]   format to report: Kbits, Mbits, KBytes, MBytes

Though, the sections you were modifying were strictly K or M:

-b, --bandwidth #[KM]    for UDP, bandwidth to send at in bits/sec
                         (default 1 Mbit/sec, implies -u)
-l, --len       #[KM]    length of buffer to read or write (default 8 KB)
-w, --window    #[KM]    TCP window size (socket buffer size)

I can, however, tell you that getting your version up to current will render this issue obsolete. Iperf version 2.0.5 (08 Jul 2010) makes no distinction between the 2 different types in those fields.

Here is your exact cli syntax working for one of my private servers.

Server:

root@AFP001SRV01:~# iperf -s -u
------------------------------------------------------------
Server listening on UDP port 5001
Receiving 1470 byte datagrams
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 127.0.0.1 port 5001 connected with 127.0.0.1 port 40974
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3]  0.0-10.0 sec   550 KBytes   449 Kbits/sec   0.017 ms    0/  383 (0%)
^C
root@AFP001SRV01:~# 

Client:

root@AFP001SRV01:~# iperf -c 127.0.0.1  -b 10m -l 32k -w 128k
WARNING: option -b implies udp testing
------------------------------------------------------------
Client connecting to 127.0.0.1, UDP port 5001
Sending 32768 byte datagrams
UDP buffer size:  256 KByte (WARNING: requested  128 KByte)
------------------------------------------------------------
[  3] local 127.0.0.1 port 40542 connected with 127.0.0.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  12.0 MBytes  10.0 Mbits/sec
[  3] Sent 383 datagrams
[  3] Server Report:
[  3]  0.0-10.0 sec   550 KBytes   449 Kbits/sec   0.008 ms    0/  383 (0%)
root@AFP001SRV01:~# 
Ryan Foley
  • 5,479
  • 4
  • 23
  • 43
1

You need to specify -u UDP "datagram-oriented" mode if not using iperf3.

CLIENT SPECIFIC OPTIONS
   -b, --bandwidth n[KM]
          set  target  bandwidth to n bits/sec (default 1 Mbit/sec).  This
          setting requires UDP (-u).

http://manpages.ubuntu.com/manpages/precise/en/man1/iperf.1.html

1

You can use iperf3, or v2 only in UDP mode:

# iperf -v
iperf version 2.0.5 (08 Jul 2010) pthreads
# iperf -h
  -b, --bandwidth #[KM]    for UDP, bandwidth to send at in bits/sec
                           (default 1 Mbit/sec, implies -u)

V3

# iperf3 -h
  -b, --bandwidth #[KMG][/#] target bandwidth in bits/sec
                            (default 1 Mbit/sec for UDP, unlimited for TCP)
                            (optional slash and packet count for burst mode)
t3mp
  • 710
  • 6
  • 8
  • why this command:->#iperf -c 10.42.0.1 -u -n 100M give the error "Amount-oriented (-n) works only in non-packet-oriented mode." – sak Apr 11 '14 at 20:39
  • Have you tried 'iperf -u -c 10.42.0.1 -n 100M' and the server is well set to UDP ? – cgasp Jun 10 '14 at 21:13
0

You're getting the error because you're using 10m instead of 10M. Try:

iperf -c 192.168.1.15  -b 10M -l 32k -w 128k
Pedro Brito
  • 639
  • 3
  • 7