Tuesday, April 26, 2016

What is iperf, jperf and xjperf? How can you use them to test network performance?

Iperf is a very helpful tool written in C++ to measure network bandwidth and quality. It can be used to analyze both TCP and UDP traffic.
Jperf or Xjperf (both of them are the same thing. Don’t confuse about the difference) equip Iperf with graphical interface. If you don’t like to spend your time by command line, use Jperf.
I am going to give you some information about Iperf and Jperf. First of all, the project links of these tools are here:

Quick Iperf Example:

Iperf is an “exe” file (I am talking about Windows of course. If you are wonder about Iperf on Linux, see last section of this article). Download this exe file byhere or here. Open a command prompt (Start > Run > cmd). Go to folder which exe file is in.
We are beginning to study Iperf
We are beginning to study Iperf
It can be used as server or client. I mean the same exe file can be server or client.
  • To use Iperf as server, use:
    1
    iperf -s
  • To use Iperf as client, use:
    1
    iperf -c IPaddress
Iperf as a server
Iperf as server
Iperf as a client
Iperf as client
As you see above, average bandwidth is 13.0 Mbits/sec in this example. To find out that, Iperf has sent 15.5 MBytes in 10 seconds.

We are going deep in Iperf:

Indeed, Iperf is not easy as It seems. There are almost 30 commands for Iperf. To see all commands, use this command:
1
iperf --help
Iperf commands
Iperf commands
In this case, we want to test our download and upload speed for TCP by specific windows size, interval and time.
Testing download speed:
Here is the environment:
  • Computer1 (main computer in the office that we want to test download/upload speed in)
  • Laptop2 (remote computer in another office)
  • Windows size: 384 KB
  • Interval: 1 second
  • Time: 20 seconds
The key point is client sends packets to server (Client generates network traffic). So:
  • If you want to see download speed for Computer1, you should configure it as Iperf server. Thus Computer2 sends packets to Computer1. Computer1 receives/downloads these packets.
  • If you want to see upload speed for Computer1, you should configure it asIperf client. Thus Computer1 sends packets to Computer2. It means Computer1 uploads these packets.
Testing download speed for Computer1
Testing download speed for Computer1
Write these commands for the test:
  • On Computer 1:
    1
    iperf -s
  • On Computer 2:
    1
    iperf -c <em>IPaddress</em> -i 1 -t 20 -w384K
Do not forget to write your IP address instead of IPaddress!
After that, command lines are going to be like that:
After TCP download test for Computer 1
After TCP download test for Computer 1. This screenshot is from Iperf client (Computer 2)
After TCP download test for Computer 1. This screenshot is from Iperf server (Computer 1)
After TCP download test for Computer 1. This screenshot is from Iperf server (Computer 1)
As you see, totally 29.2 MB has been sent in 10 seconds. Average speed is 24.3 Mbits/sec.
Testing upload speed:
The environment is going to be the same with “testing download speed” section but iperf server and client computers should change.
Testing upload speed for Computer1
Testing upload speed for Computer1
Write these commands for the test:
  • On Computer 1:
    1
    iperf -c IPaddress -i 1 -t 20 -w384K
  • On Computer 2:
    1
    iperf -s
Do not forget to write your IP address instead of IPaddress!
After that, command lines are going to be like that:
After TCP upload test for Computer 1. This screenshot is from Iperf server (Computer 2)
After TCP upload test for Computer 1. This screenshot is from Iperf client (Computer 1)
After TCP upload test for Computer 1. This screenshot is from Iperf client (Computer 1)
As you see, totally 12.6 MB has been sent in 10 seconds. Average speed is 10.4 Mbits/sec.

UDP Test:

You need to “-u” parameter for UDP test. You can see jitter (delay correlation) and data gram. Here is a quick example.
UDP test result of Iperf client
UDP test result of Iperf client
UDP test result of Iperf server
UDP test result of Iperf server

Iperf on Linux:

To install Iperf on Linux, use these commands:
1
2
3
4
5
6
wget http://78.40.227.80/~depo/iperf-2.0.5.tar.gz
tar xvfz iperf-2.0.5.tar.gz
cd iperf-2.0.5
./configure
make
&amp;&amp; make install
Commands are the same as commands on Iperf Windows version. Just be aware of default windows packet size (It is 85.3 KB).
Iperf on Linux
Iperf on Linux

Jperf:

Jperf installation is as easy as regular program installation on Windows. Just you need to JDK or JRE first of all.
  • Download Jperf for Windows by here. Extract it.
  • Download JRE or JDK by here.
  • Click to “jperf.bat” in Jperf folder.
Jperf UI
Jperf UI

Notes:

  • Use “-P” parameter for paralel test.
  • If you want to save Iperf output, add this command at the end of line: “> c:\output.txt”. For example:
1
iperf -c IPaddress -i 1 -t 20 -w384K &gt; c:\output.txt
.

No comments:

Post a Comment