iperf installation and use

The iperf command is a network performance testing tool that can test TCP and UDP bandwidth quality. At the same time, you can also report network packet loss rate or packet sending performance through UDP test, which is a very practical tool.

1.windwos installation

You can directly download the corresponding system version from the official website for installation (https://iperf.fr/iperf-download.php)
. For the Windows version of iPerf, directly copy the decompressed iperf.exe and cygwin1.dll to the %systemroot% directory. That’s it

ubuntu installation

  1. Get the installation package
    and clone it directly on ubuntu:
git clone https://github.com/esnet/iperf.git 

Or download and copy it under windows:
https://github.com/esnet/iperf
Insert image description here

After downloading, copy it to ubuntu, unzip it, get the folder 'iperf-master, rename it: iperf
Then run the following code:

$ cd iperf
$ ./configure
$ sudo ldconfig /usr/local/lib
$ make
$ make install

Test:
Start the server:

inper3 -s

Insert image description here

Basic use

-s,--server:iperf服务器模式,默认启动的监听端口为5201,eg:iperf -s

-c,--client host:iperf客户端模式,host是server端地址,eg:iperf -c 222.35.11.23

-i,--interval:指定每次报告之间的时间间隔,单位为秒,eg:iperf3 -c 192.168.12.168 -i 2

-p,--port:指定服务器端监听的端口或客户端所连接的端口,默认是5001端口。

-u,--udp:表示采用UDP协议发送报文,不带该参数表示采用TCP协议。

-l,--len:设置读写缓冲区的长度,单位为 Byte。TCP方式默认为8KB,UDP方式默认为1470字节。通常测试 PPS 的时候该值为16,测试BPS时该值为1400。

-b,--bandwidth [K|M|G]:指定UDP模式使用的带宽,单位bits/sec,默认值是1 Mbit/sec。

-t,--time:指定数据传输的总时间,即在指定的时间内,重复发送指定长度的数据包。默认10秒。

-A:CPU亲和性,可以将具体的iperf3进程绑定对应编号的逻辑CPU,避免iperf进程在不同的CPU间调度

Server:

iperf -s -i 1 -p 4101

Client:

iperf -c 192.168.84.1 -p 4101 -i 1

Example

The server listens to the specified ip: 192.168.84.1and port number:, 4101uses tcp, and uses -ithe interval report to print out the delay data in each interval.

iperf -s -i -B 192.168.84.1 -p 4101

Client sends, packet size 160000, interval 100ms, total sending time30s

iperf -c 192.168.84.1 -p 4101 -i 0.1 -t 300

Guess you like

Origin blog.csdn.net/qq_41224270/article/details/132110388