How to use the iperf3 network performance testing tool under windows

It can test the bandwidth quality of TCP and UDP, which is simply to measure the speed of the network.

Preparation: two devices

  1. Download the tool according to your own device (both must be downloaded): https://iperf.fr/iperf-download.php

  1. Open the downloaded compressed package

  • 1. If you do not use this tool frequently, you can choose a folder to decompress, find the file after decompression, enter "cmd" in the file location and press Enter, and a command prompt window will pop up, as shown in the figure:

  • 2. If you use it frequently, directly copy the decompressed iperf.exe and cygwin1.dll to the %systemroot% directory

It is the window that is opened directly after running "cmd", and the displayed path is as shown in the figure:

  • 3. If it is used frequently, it can also be added to the environment variable.

  1. Verify whether the download is successful, enter "iperf3.exe -v" in the opened window, and the installed version will appear, indicating that the installation is successful

  1. start testing.

During the test, one device is used as the server and the other as the client.

Enter "iperf3 -s" on the server, and if server listening on 5201 appears, it means that the server is running

Client input: "iperf3.exe -c server IP address -P 10"//indicates that the client sends TCP packets to the server in parallel in 10 ways;

As can be seen from the above figure: the bandwidth is about 90Mbps, that is, the current network is: 100M network

Client input: "iperf3.exe -u -c server IP address -b 1g" //The client sends udp data packets to the server, the maximum bandwidth is 1g

It can be seen from the figure above: the bandwidth is 149Mbps, the delay is 1.217ms, and the packet loss is 55%.

  1. iperf3 flag parameters

Common parameter description

-f [k|m|K|M] 分别表示以Kbits, Mbits, KBytes, MBytes显示报告,默认以Mbits为单位,eg:iperf -c 222.35.11.23 -f K
-i sec 以秒为单位显示报告间隔,eg:iperf -c 222.35.11.23 -i 2
-l 缓冲区大小,默认是8KB,eg:iperf -c 222.35.11.23 -l 16
-m 显示tcp最大mtu值
-o 将报告和错误信息输出到文件eg:iperf -c 222.35.11.23 -o c:\iperflog.txt
-p 指定服务器端使用的端口或客户端所连接的端口eg:iperf -s -p 9999;iperf -c 222.35.11.23 -p 9999
-u 使用udp协议
-w 指定TCP窗口大小,默认是8KB
-B 绑定一个主机地址或接口(当主机有多个地址或接口时使用该参数)
-C 兼容旧版本(当server端和client端版本不一样时使用)
-M 设定TCP数据包的最大mtu值
-N 设定TCP不延时
-V 传输ipv6数据包

Server parameter description

-D 以服务方式运行ipserf,eg:iperf -s -D
-R 停止iperf服务,针对-D,eg:iperf -s -R

Client parameter description

-c //在客户端模式下运行
-u //使用UDP而不是TCP
--sctp //使用 SCTP 而不是 TCP(Linux、FreeBSD 和 Solaris)
-b //UDP模式使用的带宽,单位bits/sec。此选项与-u选项相关。默认值是1 Mbit/sec
-t //设置传输的总时间。Iperf在指定的时间内,重复的发送指定长度的数据包。默认是10秒钟。
-n //要传输的字节数,通常情况,Iperf按照10秒钟发送数据。-n参数跨越此限制,按照指定次数发送指定长度的数据,而不论该操作耗费多少时间。
-k //要传输的块(数据包)数
-i //要读取或写入的缓冲区的长度。TCP 的默认值为 128 KB,UDP 的默认值为 8 KB
-r //分别进行双向测试
-P //大写字母P,要运行的并行客户端流的数量
-d //同时进行双向传输测试
-n //指定传输的字节数,eg:iperf -c 222.35.11.23 -n 100000
-r //单独进行双向传输测试
-t //测试时间,默认10秒,eg:iperf -c 222.35.11.23 -t 5
-F //指定需要传输的文件
-T //指定ttl值

Guess you like

Origin blog.csdn.net/m0_60027682/article/details/129031342