How to use Iperf?

Hi,

The Iperf tool is a very helpful utility to measure network QoS parameters. This tool is a Linux command line and it is available in any type of Linux operating system distribution that I know. The simplest way to use iperf is:

Server side: (IP: 192.168.1.2)

$ iperf -s

Client side: (IP: 192.168.1.1)

$ iperf -c 192.168.1.2

The default protocol is TCP and port 5001. This configuration will generate TCP flows from client side to server side in the network 192.168.1.x. However, more efficiently or complex configuration can be done by passing more parameters to iperf command. Like this:

For UDP configuration:

Server side:

$ iperf -s -p 8888 -u -f m -i 1

Client side:

$ iperf -c 192.168.1.2 -p 8011 -i 1 -f m -t 120 -u -b 25000

For TCP configuration:

Server side:

$ iperf -s -p 8899 -f m -i 1

Client side:

$ iperf -c 192.168.1.2 -i 1 -p 8010 -f m -t 120 

The meaning of each available parameters that can be used:

Client/Server:
  -f, --format    [kmKM]   format to report: Kbits, Mbits, KBytes, MBytes
  -i, --interval  #        seconds between periodic bandwidth reports
  -l, --len       #[KM]    length of buffer to read or write (default 8 KB)
  -m, --print_mss          print TCP maximum segment size (MTU - TCP/IP header)
  -o, --output     output the report or error message to this specified file
  -p, --port      #        server port to listen on/connect to
  -u, --udp                use UDP rather than TCP
  -w, --window    #[KM]    TCP window size (socket buffer size)
  -B, --bind         bind to , an interface or multicast address
  -C, --compatibility      for use with older versions does not sent extra msgs
  -M, --mss       #        set TCP maximum segment size (MTU - 40 bytes)
  -N, --nodelay            set TCP no delay, disabling Nagle's Algorithm
  -V, --IPv6Version        Set the domain to IPv6

Server specific:
  -s, --server             run in server mode
  -U, --single_udp         run in single threaded UDP mode
  -D, --daemon             run the server as a daemon

Client specific:
  -b, --bandwidth #[KM]    for UDP, bandwidth to send at in bits/sec
                           (default 1 Mbit/sec, implies -u)
  -c, --client       run in client mode, connecting to 
  -d, --dualtest           Do a bidirectional test simultaneously
  -n, --num       #[KM]    number of bytes to transmit (instead of -t)
  -r, --tradeoff           Do a bidirectional test individually
  -t, --time      #        time in seconds to transmit for (default 10 secs)
  -F, --fileinput    input the data to be transmitted from a file
  -I, --stdin              input the data to be transmitted from stdin
  -L, --listenport #       port to receive bidirectional tests back on
  -P, --parallel  #        number of parallel client threads to run
  -T, --ttl       #        time-to-live, for multicast (default 1)
  -Z, --linux-congestion   set TCP congestion control algorithm (Linux only)
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s