Measure Network Bandwidth with iperf

Running iperf

Start iperf in SERVER mode:

iperf -s

Start iperf in CLIENT mode:

iperf -c server-ip -i2

Start iperf in CLIENT in synchronous mode

iperf -c server.ip -d

EXAMPLE

on MYSERVER

iperf -s

on MYCLIENT

host MYSERVER
   MYSERVER has address 172.16.1.119

iperf -c 172.16.1.119 -i2

  ------------------------------------------------------------
  Client connecting to 172.16.1.119, TCP port 5001
  TCP window size: 16.0 KByte (default)
  ------------------------------------------------------------
  [  3] local 172.16.10.82 port 53883 connected with 172.16.1.119 port 5001
  [ ID] Interval       Transfer     Bandwidth
  [  3]  0.0- 2.0 sec  22.6 MBytes  94.9 Mbits/sec
  [ ID] Interval       Transfer     Bandwidth
  [  3]  2.0- 4.0 sec  22.4 MBytes  94.1 Mbits/sec
  [ ID] Interval       Transfer     Bandwidth
  [  3]  4.0- 6.0 sec  22.4 MBytes  94.1 Mbits/sec
  [ ID] Interval       Transfer     Bandwidth
  [  3]  6.0- 8.0 sec  22.4 MBytes  94.0 Mbits/sec
  [ ID] Interval       Transfer     Bandwidth
  [  3]  8.0-10.0 sec  22.4 MBytes  94.0 Mbits/sec
  [ ID] Interval       Transfer     Bandwidth
  [  3]  0.0-10.0 sec    112 MBytes  94.2 Mbits/sec
  • We can see that the client’s connection to the server is around 100mbit.

Network is slow in one area

  • This is a gigabit Linksys switch with gigabit fiber back to a Cisco Catalyst 4001.

WORKSTATION1

./iperf -c 172.16.1.119 -i2
 ------------------------------------------------------------ 
 Client connecting to 172.16.1.119, TCP port 5001
 TCP window size: 65.0 KByte (default)
 ------------------------------------------------------------
 [  3] local 172.16.11.26 port 50068 connected with 172.16.1.119 port 5001
 [ ID] Interval       Transfer     Bandwidth
 [  3]  0.0- 2.0 sec   320 KBytes  1.31 Mbits/sec
 [  3]  2.0- 4.0 sec  8.00 KBytes  32.8 Kbits/sec
 [  3]  4.0- 6.0 sec   312 KBytes  1.28 Mbits/sec
 [  3]  6.0- 8.0 sec   344 KBytes  1.41 Mbits/sec
 [  3]  8.0-10.0 sec   120 KBytes   492 Kbits/sec
 [  3]  0.0-11.7 sec  1.09 MBytes   777 Kbits/sec
  • This machine is barely working at 1-2 mbit

WORKSTATION1 after replacing the Linksys Switch

./iperf -c 172.16.1.119 -i2
 ------------------------------------------------------------
 Client connecting to 172.16.1.119, TCP port 5001
 TCP window size: 65.0 KByte (default)
 ------------------------------------------------------------
 [  3] local 172.16.10.246 port 49269 connected with 172.16.1.119 port 5001
 [ ID] Interval       Transfer     Bandwidth
 [  3]  0.0- 2.0 sec   127 MBytes   532 Mbits/sec
 [  3]  2.0- 4.0 sec   104 MBytes   436 Mbits/sec
 [  3]  4.0- 6.0 sec   160 MBytes   673 Mbits/sec
 [  3]  6.0- 8.0 sec   172 MBytes   723 Mbits/sec
 [  3]  8.0-10.0 sec   166 MBytes   697 Mbits/sec
 [  3]  0.0-10.0 sec   730 MBytes   611 Mbits/sec
  • This machine is now hitting a solid 0.5-1 gigabit.
categories: networking | iperf | commandline | bandwidth |