Network performance testing tool: iperf3

1. Introduction to iperf3

iperf3It is a network performance testing tool ( iperf3 download address ). iperf can test TCP and UDP bandwidth quality. iperf can measure the maximum TCP bandwidth, with various parameters and UDP characteristics. iperf can report bandwidth, latency jitter and packet loss.

iperf3 is a 最大带宽tool for actively measuring achievable performance on IP networks.

It supports tuning of various parameters related to timing, buffers and protocols (TCP, UDP, SCTP with IPv4 and IPv6). For each test, it reports bandwidth, loss, and other parameters  . This is a new implementation which does not share code with the original iperf nor is it backwards compatible.

Test Methods:

  1. Server side hang  iperf3 -s service

  2. client test command iperf3 -c 服务器IP地址

  3. Analyze network bandwidth, network delay, and judge overall network performance

Two, iperf3 speed measurement

  • CentOS7 server command: iperf3 -s

  • Windows10 client: iperf3.exe -c server IP address -P 10  //The client sends TCP packets to the server in parallel in 10 ways;

    As can be seen from the above figure: the bandwidth is 942Mbps, that is, the current network is: Gigabit network

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

    It can be seen from the figure above: the bandwidth is 95Mbps, the delay is 0.677ms, and the packet loss is 0%.

Three, 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值

Author: caojun97

Source: https://www.cnblogs.com/caojun97/p/16388475.html

Guess you like

Origin blog.csdn.net/lingshengxiyou/article/details/130232731