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
Thầy giáo làng viết thêm: Không được đăng những thứ này, hãy xóa đi ngay, nếu không, tôi sẽ xóa bài viết này
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 by here. Open a command prompt (Start > Run > cmd). Go to folder which exe file is in.
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: iperf -s
- To use iPerf as client, use: iperf -c IPaddress
iPerf as server
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: iperf --help
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 as iPerf client. Thus Computer1 sends packets to Computer2. It means Computer1 uploads these packets.
Testing download speed for Computer1
Write these commands for the test:
- On Computer 1: iperf -s
- On Computer 2: iperf -c IPaddress -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. This screenshot is from iPerf client (Computer 2)
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
Write these commands for the test:
- On Computer 1: iperf -c IPaddress -i 1 -t 20 -w384K
- On Computer 2: 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)
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 server
iPerf on Linux
To install iPerf on Linux, use these commands:
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 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
Jperf: 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
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:
iperf -c IPaddress -i 1 -t 20 -w384K > c:\output.txt