iperf2 Porting and User Guide
1. Porting¶
iperf is an open source network performance testing tool, mainly used to measure parameters such as network bandwidth, latency and throughput. It can help developers evaluate and optimize network performance. It can be tested between clients and servers, supports TCP and UDP protocols, and provides a variety of options and parameters for testing.
1.1. Source code download¶
Click here to download iperf2.0.9 directly
Download link for Windows version 2.0.9: https://iperf.fr/iperf-download.php#windows
1.2. Cross-compiling¶
The corresponding compiler is specified here:
tar -zxvf iperf-2.0.9.tar.gz cd iperf-2.0.9/ export PATH=/tools/toolchain/gcc-10.2.1-20210303-sigmastar-glibc-x86_64_aarch64-linux-gnu/bin:$PATH ; export ARCH=arm64 ; export CROSS_COMPILE=aarch64-linux-gnu- ./configure --prefix=$PWD/install --host=arm CXX=${CROSS_COMPILE}g++ CC=${CROSS_COMPILE}gcc make clean -j8 make -j8 make install
Note that the export command in the above example steps specifies the compilation chain address. In actual operation, please declare it according to the actual compilation chain path. After executing the above steps, you will find the generated iperf program in the path iperf-2.0.9/install/bin.
The original generated program size is large and can be trimmed using the aarch64-linux-gnu-strip iperf --strip-unneeded command.
2. Environment Setup¶
2.1. Copy Files¶
Copy the iperf file to the directory project/release/chip/pcupid/dispcam/common/glibc/10.2.1/release/bin/debug and add executable permissions using the chmod +x command.

2.2. Package image¶
Executing make image_install under project will package iperf to project/image/output/customer, which is the /customer directory actually running on the board.

3. Test verification¶
Taking PC Windows and Linux board as an example, first you need to ensure that both are in the same IP network segment. The iperf related parameters can be obtained through iperf -h.
3.1. Throughput test¶
Test throughput based on TCP protocol: PC Windows side acts as the server and runs .\iperf.exe -s; Linux board acts as the client and runs /customer/iperf -c xx.xx.xx.xx -i 1 -t 10.
Example:

3.2. Packet loss test¶
Test packet loss rate based on UDP protocol: Linux board as the server, run /customer/iperf -s -u; PC Windows as the client, run .\iperf.exe -c xx.xx.xx.xx -i 1 -t 10 -u
Example:
