What is iperf?
Iperf is a network performance testing tool. Iperf can test the bandwidth quality of TCP and UDP. Iperf can measure the maximum TCP bandwidth and has multiple parameters and UDP features. Iperf can report bandwidth, latency jitter, and packet loss.
Compilation and Installation
Iperf2.0.2 currently only provides download of source code packages. After downloading the iperf source code package, you need to decompress the source code package on Unix-like systems and use the decompressed command gzip or tar. After decompression, a new folder "Iperf-2.0.2" is generated ". Iperf2.0.2 can be well compiled in the following operating systems: Linux, sgi irix, HP-UX, Solaris, Aix, and Cray unicos. Use the "make" command to compile the iperf source code. The complete compilation command is as follows:
Tar xvf iperf-2.0.2.tar.gz
CD iperf-2.0.2
./Configure
Make
After the compilation is successful, run the following command to install iperf:
Make install
To recompile iperf, run the following command:
Make distclean
./Configure
Make
Features
TCP
Measure network bandwidth
Report the size and observations of MSS/MTU values
Supports TCP Window value buffering through socket
Multithreading is supported when P or Win32 threads are available. The client and server support multiple connections at the same time
UDP
The client can create a UDP stream with the specified bandwidth.
Measurement packet loss
Measurement Delay
Support Multicast
Multithreading is supported when P threads are available. The client and server support multiple connections at the same time (windows is not supported)
Where appropriate, K (kilo-) and M (mega-) can be used in the options -). For example, 131072 bytes can be replaced by kb.
You can specify the total running time or even set the total amount of transmitted data.
Select the most appropriate unit for data in the report.
The server supports multiple connections instead of waiting for a Single-thread test.
The network bandwidth, fluctuations, and packet loss are repeatedly displayed at the specified interval.
The server can be run as a background program.
The server can run as a Windows service.
Use typical data streams to test the effect of link layer compression on available bandwidth.
Command:
For UDP sending:
Iperf-C [IP-ADDR]-I 1-P [port]-u-t 10000-B 2 m
========================================================== ================
For UDP grouping ing:
Iperf-s-I 1-u-p [port]
==========================================================
Iperf-C 10.0.5.5-I 1-P 6015-u- t 10000-B 128 K
Iperf-s-I 1-u-p 6005
Iperf-C 10.18.61.66-I 1-P 6006-u- t 99999-B 128 K
Iperf-s-I 1-u-p 6006-T 999999
The running result is on the clinet side:
C: \> iperf-C 10.0.5.235-I 1-P 6005-u-t 60-B 128 K
------------------------------------------------------------
Client connection to 10.0.5.235, UDP port 6005
Sending 1470 byte datagrams
UDP buffer size: 8.00 Kbyte (default)
------------------------------------------------------------
[ID] interval transfer bandwidth
[1868] 0.0-60.2 sec 940 Kbytes 128 kbits/sec
[2, 1868] Server Report:
[1868] 0.0-60.8 sec 940 Kbytes 127 kbits/sec 13.838 MS 0/655 (0%)
[1868] sent 655 extends rams
Cross-Compilation Method
Ubuntu10.04 is very intelligent and can be used directly by users who can access the Internet.
Sudo apt-Get install iperf
This command can successfully install iperf
If you want to download the source code for installation, you can use the most common method.
Tar xvf iperf-2.0.2.tar.gz
CD iperf-2.0.2
./Configure
Make
After the compilation is successful, run the following command to install iperf:
Make install
The installation is successful.
Next we will introduce how to cross-compile our iperf source code:
For convenience, we wrote a. Sh configuration file.
The specific content is as follows:
Vim buildarm. Sh
#! /Bin/sh
Echo "ac_cv_func_malloc_0_nonnull = yes"> arm-linux.cache
./Configure -- Host = arm-Linux cc = arm-none-linux-gnueabi-gcc-4.3.2-Cache-file = arm-linux.cache
Make
(Configure the environment variables of the Cross Compiler)
After the configuration file is written, you need to change its permissions so that it can execute
Chmod + x buildarm. Sh
Then you can run the following command:
./Buildarm. Sh
After the successful execution, an iperf file will be generated in the SRC folder of your iperf directory. You can place the binary executable file to the file system of your board, let's test it now.