梓悦生活

  • 🍟首页
  • 🍪免费资源
  • 🍓Wordpress
  • 🍋琐碎生活
  • 🍘关于
关注周围的人或事,体验人生历程
  1. 首页
  2. 免费资源
  3. 正文

iperf3 网络性能测试

2024/05/20 4714点热度 0人点赞 0条评论

1、iperf3简介
iperf3是一个主动测试网络带宽的工具,可以测试iTCP、UDP、SCTP等网络带宽;可以通过参数修改网络协议、缓冲区、测试时间、数据大小等,每个测试结果会得出吞吐量、带宽、重传数、丢包数等测试结果

2、参数详解

通用参数:

-v, --version,显示版本信息并退出;
-p, --port #,Server 端监听、Client 端连接的端口号;
-f, --format [kmgKMG],报告中所用的数据单位,Kbits, Mbits, KBytes, Mbytes;
-i, --interval #,每次报告的间隔,单位为秒;
-F, --file name,测试所用文件的文件名。如果使用在 Client 端,发送该文件用作测试;如果使用在 Server 端,则是将数据写入该文件,而不是丢弃;
-A, --affinity n/n,m,设置 CPU 亲和力;
-B, --bind ,绑定指定的网卡接口;
-V, --verbose,运行时输出更多细节;
-J, --json,运行时以 JSON 格式输出结果;
–logfile f,输出到文件;
-d, --debug,以 debug 模式输出结果;
-h, --help,显示帮助信息并退出。

Server 端参数:

-s, --server,以 Server 模式运行;
-D, --daemon,在后台以守护进程运行;
-I, --pidfile file,指定 pid 文件;
-1, --one-off,只接受 1 次来自 Client 端的测试,然后退出。

Client 端参数:

-c, --client ,以 Client 模式运行,并指定 Server 端的地址;
-u, --udp,以 UDP 协议进行测试;
-b, --bandwidth #[KMG][/#],限制测试带宽。UDP 默认为 1Mbit/秒,TCP 默认无限制;
-t, --time #,以时间为测试结束条件进行测试,默认为 10 秒;
-n, --bytes #[KMG],以数据传输大小为测试结束条件进行测试;
-k, --blockcount #[KMG],以传输数据包数量为测试结束条件进行测试;
-l, --len #[KMG],读写缓冲区的长度,TCP 默认为 128K,UDP 默认为 8K;
–cport ,指定 Client 端运行所使用的 TCP 或 UDP 端口,默认为临时端口;
-P, --parallel #,测试数据流并发数量;多线程
-R, --reverse,反向模式运行(Server 端发送,Client 端接收);
-w, --window #[KMG],设置套接字缓冲区大小,TCP 模式下为窗口大小;
-C, --congestion ,设置 TCP 拥塞控制算法(仅支持 Linux 和 FreeBSD );
-M, --set-mss #,设置 TCP/SCTP 最大分段长度(MSS,MTU 减 40 字节);
-N, --no-delay,设置 TCP/SCTP no delay,屏蔽 Nagle 算法;
-4, --version4,仅使用 IPv4;
-6, --version6,仅使用 IPv6;
-S, --tos N,设置 IP 服务类型(TOS,Type Of Service);
-L, --flowlabel N,设置 IPv6 流标签(仅支持 Linux);
-Z, --zerocopy,使用 “zero copy”(零拷贝)方法发送数据;
-O, --omit N,忽略前 n 秒的测试;
-T, --title str,设置每行测试结果的前缀;
–get-server-output,从 Server 端获取测试结果;
–udp-counters-64bit,在 UDP 测试包中使用 64 位计数器(防止计数器溢出)。

3、安装使用
#在线使用下面指令可以安装iperf3工具

ccc@ccc:~$sudo apt-get install iperf3

测试用例

服务端

robot@robot:~$ iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.4.110, port 50512
[ 5] local 192.168.4.77 port 5201 connected to 192.168.4.110 port 50518
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-1.00 sec 573 KBytes 4.69 Mbits/sec
[ 5] 1.00-2.00 sec 498 KBytes 4.08 Mbits/sec
[ 5] 2.00-3.00 sec 433 KBytes 3.54 Mbits/sec
[ 5] 3.00-4.00 sec 519 KBytes 4.25 Mbits/sec
[ 5] 4.00-5.00 sec 592 KBytes 4.85 Mbits/sec
[ 5] 5.00-6.00 sec 568 KBytes 4.66 Mbits/sec
[ 5] 6.00-7.00 sec 632 KBytes 5.18 Mbits/sec
[ 5] 7.00-8.00 sec 559 KBytes 4.58 Mbits/sec
[ 5] 8.00-9.00 sec 583 KBytes 4.77 Mbits/sec
[ 5] 9.00-10.00 sec 684 KBytes 5.61 Mbits/sec
[ 5] 10.00-10.09 sec 80.6 KBytes 7.11 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 5] 0.00-10.09 sec 6.10 MBytes 5.07 Mbits/sec 6 sender
[ 5] 0.00-10.09 sec 5.59 MBytes 4.64 Mbits/sec receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

客户端

tcp网络协议测试

ccc@ccc:~$ iperf3 -c 192.168.4.77
Connecting to host 192.168.4.77, port 5201
[ 4] local 172.17.145.18 port 43830 connected to 192.168.4.77 port 5201
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 954 KBytes 7.82 Mbits/sec 0 62.2 KBytes
[ 4] 1.00-2.00 sec 608 KBytes 4.98 Mbits/sec 0 87.7 KBytes
[ 4] 2.00-3.00 sec 547 KBytes 4.48 Mbits/sec 1 72.1 KBytes
[ 4] 3.00-4.00 sec 486 KBytes 3.98 Mbits/sec 0 87.7 KBytes
[ 4] 4.00-5.00 sec 608 KBytes 4.98 Mbits/sec 0 96.2 KBytes
[ 4] 5.00-6.00 sec 547 KBytes 4.48 Mbits/sec 3 49.5 KBytes
[ 4] 6.00-7.00 sec 669 KBytes 5.48 Mbits/sec 0 58.0 KBytes
[ 4] 7.00-8.00 sec 547 KBytes 4.48 Mbits/sec 2 46.7 KBytes
[ 4] 8.00-9.00 sec 547 KBytes 4.48 Mbits/sec 0 58.0 KBytes
[ 4] 9.00-10.00 sec 730 KBytes 5.98 Mbits/sec 0 62.2 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-10.00 sec 6.10 MBytes 5.12 Mbits/sec 6 sender
[ 4] 0.00-10.00 sec 5.59 MBytes 4.69 Mbits/sec receiver

iperf Done.

[ ID]:这是测试会话的唯一标识符,此处为数字4,表示这是第四个测试会话。
Interval:测试的时间区间,从0.00秒开始,持续到10.00秒结束。
Transfer:在指定时间范围内传输的数据总量。发送端传输了大约6.10 MBytes(兆字节)的数据,接收端接收了大约5.59 MBytes的数据。
Bandwidth:数据传输的带宽,即每秒传输的数据量。发送端的带宽为5.12 Mbits/sec(兆比特每秒),接收端的带宽为4.69 Mbits/sec。
Retr:重传次数,出现在发送端的信息中,此处为6,表示在测试期间发送端有6次数据包需要重传。
在这次10秒的网络性能测试中,发送端以大约5.12兆比特每秒的带宽传输数据,共传输了6.10兆字节,期间发生了6次数据包重传。接收端则以大约4.69兆比特每秒的带宽接收了5.59兆字节的数据。这表明网络连接存在一定的丢包和带宽波动,需要进一步排查网络质量或设备性能问题。

udp网络协议测试

ccc@ccc:~$ iperf3 -u -b 50M -c 192.168.4.77
Connecting to host 192.168.4.77, port 5201
[ 4] local 172.17.145.18 port 2307 connected to 192.168.4.77 port 5201
[ ID] Interval Transfer Bandwidth Total Datagrams
[ 4] 0.00-1.00 sec 5.41 MBytes 45.4 Mbits/sec 693
[ 4] 1.00-2.00 sec 5.96 MBytes 50.0 Mbits/sec 763
[ 4] 2.00-3.00 sec 5.97 MBytes 50.1 Mbits/sec 764
[ 4] 3.00-4.00 sec 5.96 MBytes 50.0 Mbits/sec 763
[ 4] 4.00-5.00 sec 5.95 MBytes 49.9 Mbits/sec 761
[ 4] 5.00-6.00 sec 5.97 MBytes 50.1 Mbits/sec 764
[ 4] 6.00-7.00 sec 5.95 MBytes 49.9 Mbits/sec 761
[ 4] 7.00-8.00 sec 5.98 MBytes 50.1 Mbits/sec 765
[ 4] 8.00-9.00 sec 5.95 MBytes 49.9 Mbits/sec 761
[ 4] 9.00-10.00 sec 5.95 MBytes 49.9 Mbits/sec 762
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 4] 0.00-10.00 sec 59.0 MBytes 49.5 Mbits/sec 0.000 ms 0/0 (0%)
[ 4] Sent 0 datagrams

iperf Done.

Jitter:表示数据包传输延迟的变化情况,数值为0.000毫秒,表示数据包之间的延迟非常稳定;
Lost/Total Datagrams:表示丢失率,为0%,即所有发送的数据包都成功到达了目的地
————————————————

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

原文链接:https://blog.csdn.net/xiaofeilongyu/article/details/137627592

标签: iperf3
最后更新:2024/05/20

Meteor

关注周围的人或事,体验人生历程!

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

最新 热点 随机
最新 热点 随机
哪吒探针V0版本控制面板的安装和windows安装V0.20.5的agent方法 Realm转发脚本:一键安装、规则启停、定时备份、FTP/SFTP 备份、Web面板 Realm 一键转发脚本 [测评]喵云绍兴BGP-NAT云主机测评 docker容器部分命令收藏 BillionMail:一个开源的邮件服务器
docker容器部分命令收藏[测评]喵云绍兴BGP-NAT云主机测评Realm 一键转发脚本Realm转发脚本:一键安装、规则启停、定时备份、FTP/SFTP 备份、Web面板哪吒探针V0版本控制面板的安装和windows安装V0.20.5的agent方法
CentOS手工安装LAMP环境 Realm转发脚本:一键安装、规则启停、定时备份、FTP/SFTP 备份、Web面板 Inavit免费PHP和Asp.net空间数据库MSSQL 2008和MysqL空间250MB 5G/20G/PHP/MYSQL/CP/绑米/5gbfree免费空间 iperf3 网络性能测试 利用Fikker自建CDN 给网站提供自定义加速节点
最近评论
过客 发布于 10 个月前(11月20日) SSL证书掉了
b2b系统 发布于 3 年前(12月29日) 感谢分享
Meteor 发布于 3 年前(10月20日) 哈哈,友链一直都在,后来换了主题后忘记修改显示数量了,现在恢复好了。
弋牧 发布于 3 年前(10月12日) 这里已经看不到我的友连了吗?
彩鸽 发布于 3 年前(10月04日) 写的不错
标签聚合
虚拟主机 域名解析 Linux VPS wordpress 技巧 活动 Linux技巧
友情链接
  • Anders Norén
  • Appurse
  • CSS参考手册
  • DeeTeam-迪提姆
  • Fatesinger
  • FreeSSL
  • gandi
  • Internetbs
  • LogoMaker
  • Meteor's Blog
  • PM唐杰
  • SSL For Free
  • WPEX-Themes
  • 优品PPT
  • 免费顶级域名
  • 博客大全
  • 印记
  • 弋牧
  • 挖站否
  • 闫宝龙博客

COPYRIGHT © 2023 梓悦生活. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang