How to Measure Network Throughput Using JPerf
JPerf is a graphical front end for the popular network testing tool Iperf. Using JPerf you can quickly test a WAN or LAN connection to determine the maximum network throughput. The test results are automatically graphed and presented in a format that is easy to read. JPerf can also be used to detect packet loss, delay, jitter, and other common network problems.
JPerf provides many benefits over Iperf which is a command line only application. Besides being reliable and easy to use JPerf is completely free. The utility is fully open source and runs on both Windows or Linux systems.
Whether you're trying to diagnose a problem in your home network or troubleshoot the performance of a WAN link JPerf can handle the task.
Installing JPerf on Windows
JPerf requires that Java version 1.5 or newer is installed before it will run. You can visit Java.com to download the latest version or verify if it is correctly installed on your computer.
To get JPerf running you will need to download the jperf-2.0.2.zip file from the JPerf Google code page.
There isn't an installer so simply extract the contents of the zip file to a location on your computer such as C:\JPerf.
To launch the JPerf utility run jperf.bat.
Installing JPerf on Linux
On Linux the Java executable must be in your system path, to verify this type java -version in a shell. You should see output similar to what's below.
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) 64-Bit Server VM (build 16.0-b13, mixed mode)
If you don't see this make sure Java is installed and is within your path.
Next download the JPerf zip file, the same archive is used for Windows or Linux. The folder can be extracted to any location, for example /usr/bin/jperf.
Within the jperf directory you downloaded is a script called jperf.sh. This script must be made executable by running chmod u+x jperf.sh from within the JPerf directory.
Finally, to launch the application run ./jperf.sh.
Setting up a JPerf Server
JPerf is designed to run as a client/server application. To run a test you will need to set up a JPerf server on your network. Then you can run a JPerf client from another location on the network which will connect to the remote server.
To start the JPerf server select the radio button labeled server then click Run IPerf. By default JPerf runs in TCP mode and listens on port 5001.
Connecting a client to the server
To connect to the JPerf server to run a test you'll need to first select the client radio button. In the server address field type in the IP address of the computer running the JPerf server. To begin the test click on run iPerf in the upper right hand corner of the app.
By default JPerf will run a 10 second TCP test using 1 stream. While the test is running the graph will update in real time to reflect the results.
There are several options that can be adjusted to modify the parameters of the test.
Application layer options
- Transmit - Run the test for a specified number of seconds, or until a certain amount of bytes have been transferred.
- Output Format - Test results can be changed to display bits, bytes, kbytes, etc.
- Report Interval - This adjusts how often the graph results are updated.
Transport layer options
There are several TCP options that can be modified such as buffer length, window size, and MSS. JPerf can also function in UDP mode, although the server must be operating in UDP mode in order for this test to work.
JPerf Tips and Tricks
Below are a few useful tips for improving your JPerf results.
- Use Parallel streams - The bandwidth of a single TCP session is limited by several factors. By using parallel streams you can easily saturate a very high bandwidth connection. In the JPerf client settings you can specify the number of streams to use. I've found 10 to be a good number.
- Run a Bi-Directional Test - By default JPerf transmits data from the client to the server. By selecting the dual testing mode under application layer options JPerf will send data in both directions at the same time.
- Use a representative file - JPerf has a cool ability that allows you to select a file to be transmitted to the server during the test. This function allows you to simulate a real world data transfer across your network in a controlled manner.
- Use JPerf to create iPerf commands - Since JPerf uses iPerf as a back end to run all of the tests you can use JPerf to help you build useful iPerf commands. Select the test options you want using the GUI and then copy the command it created from the box at the top of the application.
Expanding Your Knowledge
Now that you are familiar with JPerf I would recommend learning more about iPerf and how to run it from the command line. IPerf is designed for Linux but you can compile IPerf for Windows as well.
JPerf and Iperf tests can be run cross platform, eg: Linux to Windows or vice versa which makes it a highly useful tool for network testing. I've found both of these tools to be indispensable for diagnosing and troubleshooting network problems.