Saturday 7 February 2015

IPERF to measure throughput

Iperf is a handy tool to measure the bandwidth and the quality of a network link. It is a commonly used network testing tool that can create Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) data streams and measure the throughput of a network that is carrying them.

Iperf allows the users to vary various parameters that can be used for testing the network, or alternatively for optimizing and tuning a network. Iperf has a client and server functionality, and can measure the throughput between the two ends, either unidirectionally or bi-directionally.

Iperf can be installed very easily on any Linux or Microsoft Windows system, where one host can be configured as a client, the other one as server.


















Setup required for running the iperf test:

1. Download the iperf setup, you can download it from: https://iperf.fr/
2. Copy the setup file on the two hosts you would be using to perform the test.
3. Set one host in the server mode and the other in the client mode with the following syntax:


To set the host in server mode use the command : iperf -s

C:\IOS Images\iperf-2.0.5-2-win32>iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 64.0 KByte (default)
------------------------------------------------------------


To set the client in client mode use the command : iperf -c <server ip address>

C:\IOS Images\iperf-2.0.5-2-win32>iperf -c 192.168.1.5      // Where 192.168.1.5 is server ip address.



The other parameters available in iperf are:


C:\IOS Images\iperf-2.0.5-2-win32>iperf --help
Usage: iperf [-s|-c host] [options]
       iperf [-h|--help] [-v|--version]

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    <filename> 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      <host>   bind to <host>, 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    <host>   run in client mode, connecting to <host>
  -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 <name>   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 <algo>  set TCP congestion control algorithm (Linux only)

Miscellaneous:
  -x, --reportexclude [CDMSV]   exclude C(connection) D(data) M(multicast) S(settings) V(server) reports
  -y, --reportstyle C      report as a Comma-Separated Values
  -h, --help               print this message and quit
  -v, --version            print version information and quit

[KM] Indicates options that support a K or M suffix for kilo- or mega-

The TCP window size option can be set by the environment variable
TCP_WINDOW_SIZE. Most other options can be set by an environment variable
IPERF_<long option name>, such as IPERF_BANDWIDTH.

Report bugs to <iperf-users@lists.sourceforge.net>

C:\IOS Images\iperf-2.0.5-2-win32>




























Server side:
=========
#iperf -s
------------------------------------------------------------ 
Server listening on TCP port 5001 
TCP window size: 8.00 KByte (default) 
------------------------------------------------------------ 
[852] local 10.1.1.1 port 5001 connected with 10.6.2.5 port 33453 
[ ID]   Interval          Transfer       Bandwidth 
[852]   0.0-10.6 sec   1.26 MBytes   1.03 Mbits/sec 



Client side:
=========
#iperf -c 10.1.1.1
------------------------------------------------------------ 
Client connecting to 10.1.1.1, TCP port 5001 
TCP window size: 16384 Byte (default) 
------------------------------------------------------------ 
[ 3] local 10.6.2.5 port 33453 connected with 10.1.1.1 port 5001 
[ 3]   0.0-10.2 sec   1.26 MBytes   1.05 Mbits/sec 



Another example:


Use the syntax with some additional parameters " iperf.exe – c  <IP address of the server>   -P 10  -w 1000k " (  -P refers to the number of parallel TCP streams and –w referes to the TCP window size  )
























Hope this was helpful.








Labels: ,

5 Comments:

At 8 February 2015 at 11:26 , Blogger Unknown said...

Very useful info! Thanks for sharing!

 
At 8 February 2015 at 11:27 , Blogger Unknown said...

Very useful info! Thanks for sharing!

 
At 13 November 2015 at 22:15 , Anonymous Wassim said...

Thanks for sharing. We use Iperf and Jperf a lot at work.

 
At 22 June 2016 at 10:02 , Blogger Unknown said...

Thanks Wassim.

 
At 24 February 2020 at 00:25 , Blogger Email-Helpline-Number-UK said...

To provide easy resolution for Gmail loading failure error it is advisable to get all the cache and cookies cleared from the browser. If needed then for further information the user should get connected with the certified Gmail technicians. Lines are open for help and support all the time there is no such issue that cannot be resolved by the Gmail technical team.

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home