iperf3 INSTRUCTION

  1. wget https://iperf.fr/download/source/iperf-3.1.3-source.tar.gz

  2. tar xzvf iperf-3.1.3-source.tar.gz

  3. Set the compiler and prefix (default 8.2.1, other compilers need to specify here)

    ./configure --host=arm-linux-gnueabihf \
    CC=arm-linux-gnueabihf-gcc \
    CXX=arm-linux-gnueabihf-g++ \
    RANLIB=arm-linux-gnueabihf-ranlib\
    STRIP=arm-linux-gnueabihf-strip\
    ac_cv_func_malloc_0_nonnull=yes \
    CFLAGS=-static \
    CXXFLAGS=-static \
    --prefix=/Home/jackson.pan/opensource/iperf-3.1.3/out
    
  4. make && make install

  5. Copy the iperf3 in out to target board

Test example:

./iperf3 -s

Server listening on 5201

Result:

Accepted connection from 172.19.30.175, port 57290

[ 5] local 172.19.24.242 port 5201 connected to 172.19.30.175 port 50363

[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams

[ 5] 0.00-1.00 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/0 (0%)

[ 5] 1.00-2.00 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/0 (0%)

[ 5] 2.00-3.00 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/0 (0%)

[ 5] 3.00-4.00 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/0 (0%)

[ 5] 4.00-5.00 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/0 (0%)

[ 5] 5.00-6.00 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/0 (0%)

[ 5] 6.00-7.00 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/0 (0%)

[ 5] 7.00-8.00 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/0 (0%)

[ 5] 8.00-9.00 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/0 (0%)

[ 5] 9.00-10.00 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/0 (0%)


[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams

[ 5] 0.00-10.00 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/0 (0%)


Server listening on 5201


Far-end:

iperf3 -c 172.19.24.242 -u -i 1 -t 10

Connecting to host 172.19.24.242, port 5201

[ 4] local 172.19.30.175 port 50363 connected to 172.19.24.242 port 5201

[ ID] Interval Transfer Bandwidth Total Datagrams

[ 4] 0.00-1.00 sec 120 KBytes 983 Kbits/sec 15

[ 4] 1.00-2.00 sec 128 KBytes 1.05 Mbits/sec 16

[ 4] 2.00-3.00 sec 128 KBytes 1.05 Mbits/sec 16

[ 4] 3.00-4.00 sec 128 KBytes 1.05 Mbits/sec 16

[ 4] 4.00-5.00 sec 128 KBytes 1.05 Mbits/sec 16

[ 4] 5.00-6.00 sec 128 KBytes 1.05 Mbits/sec 16

[ 4] 6.00-7.00 sec 128 KBytes 1.05 Mbits/sec 16

[ 4] 7.00-8.00 sec 128 KBytes 1.05 Mbits/sec 16

[ 4] 8.00-9.00 sec 128 KBytes 1.05 Mbits/sec 16

[ 4] 9.00-10.00 sec 128 KBytes 1.05 Mbits/sec 16


[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams

[ 4] 0.00-10.00 sec 1.24 MBytes 1.04 Mbits/sec 0.000 ms 0/0 (-nan%)

[ 4] Sent 0 datagrams

iperf Done.

  • Parameters:

    -p, --port #,For monitoring in Server; Represent the connected port number in Client;
    
    -f, --format [kmgKMG], the data unit used in the report, Kbits, Mbits, KBytes, Mbytes;
    
    -i, --interval #,the interval of each report, unit: s(second);
    
    -F, --file name, name for testing file. Send file to test when used in Client, write data to the file when used in Server.
    
    -A, --affinity n/n,m, set CPU affinity;
    
    -B, --bind, band specify network adaptor port;
    
    -V, --verbose, output more details at runtime;
    
    -J, --json, output in JSON format at runtime;
    
    --logfile f, output to file;
    
    -d, --debug, output results in debug mode;
    
    -v, --version, display the version information and quit;
    
    -h, --help, display the version information and exit.
    
  • Parameters in Server

    -s, --server, running in Server mode;
    
    -D, --daemon, running as a daemon in the background;
    
    -I, --pidfile file, specify pid file;
    
    -1, --one-off, accept the test from Client once and then exit.
    
  • Parameters in Client

    -c, --client, running in Client mode, and specify the address for Server;
    
    -u, --udp, testing with UDP protocol;
    
    -b, --bandwidth #[KMG][/#], limit bandwidth test, UDP default: 1Mbit/s, TCP unlimited by default;
    
    -t, --time #, take time as the end condition for testing, the default is 10s;
    
    -n, --bytes #[KMG], take the data transmission size as the end condition fot testing;
    
    -k, --blockcount #[KMG], take the transmitted data package numbers as the end condition for testing;
    
    -l, --len #[KMG], length of read and write buffer, TCP defaults to 128K, UDP defaults to 8K;
    
    --cport, specify the client to use TCP or UDP port, the default is temporary port;
    
    -P, --parallel #, test the data stream and send the quantity;
    
    -R, --reverse, reverse mode running(Server sending, Client receiving);
    
    -w, --window #[KMG], set the socket buffer size, in TCP mode, the default is windows size;
    
    -C, --congestion, set TCP congestion control algorithm(only support Linux and FreeBSD);
    
    -M, --set-mss #, set the maximum segment length of TCP/SCTP (MSS, MTU minus 40 bytes);
    
    -N, --no-delay, set TCP/SCTP no delay, shield Nagle algorithm;
    
    -4, --version4, use IPv4 only;
    
    -6, --version6,Use IPv6 only;
    
    -S, --tos N, set IP service type (TOS, Type Of Service);
    
    -L, --flowlabel N, set IPv6 flow label(support Linux only);
    
    -Z, --zerocopy, use "zero copy" to send data;
    
    -O, --omit N, Ignore the first N seconds of testing;
    
    -T, --title str, set a title for each line of test results;
    
    --get-server-output, get the testing result from Server;
    
    --udp-counters-64bit, use 64-bit counter in UDP test packets (to prevent counter overflow).