当前位置: 首页 > news >正文

网络性能测试工具:iperf3介绍

文章目录

  • 前言
  • 一、iperf3 的安装和使用
    • 下载和安装
    • 参数说明
  • 二、iperf3 测试
    • 服务端启动
    • 客户端启动
    • 服务端输出
    • 反向测试
      • 客户端
      • 服务端


前言

新接触的网络环境如何评估网络带宽和吞吐量呢,有的项目没有对业务流量进行合理规划,服务或者中间件出口带宽经常有被打满的情况。所以提前预测网络带宽的瓶颈还是非常有必要的。

ipef3工具,是一个用于测试网络带宽的开源工具,用于评估网络的性能和吞吐量,他是iperf工具的第三个版本。


一、iperf3 的安装和使用

下载和安装

官网链接: https://iperf.fr/
iperf3支持Windows和Linux版本,Windows是直接编译好的exe文件,Linux一般是rpm包,可以通过yum源安装。
windows 下载连接: https://files.budman.pw/ 下载后解压,在cmd或者gitbash窗口可以启动。
Linux 通过 yum install iperf3 直接安装。

参数说明

  1. -c, --client <server_hostname>:指定客户端模式,连接到指定的服务器。

  2. -s, --server:指定服务器模式,启动 iPerf3 服务器。

  3. -p, --port :指定服务器监听的端口号,默认为 5201。

  4. -t, --time

  5. -i, --interval :设置报告输出的间隔时间,单位为秒,默认为 1 秒。

  6. -w, --window <window_size>:设置 TCP 窗口大小,单位为字节,默认为 128KB。

  7. -b, --bandwidth :限制带宽,单位为比特每秒(bps)。

  8. -u, --udp:使用 UDP 协议进行测试,默认TCP协议。

  9. -l, --len :设置 UDP 数据包的长度,单位为字节,默认为 1460 字节。

  10. -n, --bytes :设置要发送的字节数,可以与 -t 参数一起使用。

  11. -P, --parallel :指定并发连接数,可以同时进行多个连接。

  12. -R, --reverse:反向测试,客户端变为服务器,服务器变为客户端。

  13. -V, --IPv6:使用 IPv6 地址。

  14. -h, --help:显示帮助信息。

二、iperf3 测试

现在我们分别在Windows端和Linux端安装了iperf3软件。
Windows主机 (192.168.37.1) 客户端
Linux主机(192.168.37.100) 服务端

服务端启动

[root@work ~]# iperf3 -s -p 5222
-----------------------------------------------------------
Server listening on 5222
-----------------------------------------------------------

-s 表示服务器端 -p 指定服务端监听端口

客户端启动

$ ./iperf3.exe -c 192.168.37.100 -p 5222  -t 10 -i 1
Connecting to host 192.168.37.100, port 5222
[  4] local 192.168.37.1 port 13957 connected to 192.168.37.100 port 5222
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec   315 MBytes  2.64 Gbits/sec
[  4]   1.00-2.00   sec   349 MBytes  2.93 Gbits/sec
[  4]   2.00-3.00   sec   304 MBytes  2.55 Gbits/sec
[  4]   3.00-4.00   sec   332 MBytes  2.78 Gbits/sec
[  4]   4.00-5.00   sec   335 MBytes  2.81 Gbits/sec
[  4]   5.00-6.00   sec   352 MBytes  2.95 Gbits/sec
[  4]   6.00-7.00   sec   367 MBytes  3.07 Gbits/sec
[  4]   7.00-8.00   sec   367 MBytes  3.08 Gbits/sec
[  4]   8.00-9.00   sec   339 MBytes  2.84 Gbits/sec
[  4]   9.00-10.00  sec   318 MBytes  2.67 Gbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-10.00  sec  3.30 GBytes  2.83 Gbits/sec                  sender
[  4]   0.00-10.00  sec  3.30 GBytes  2.83 Gbits/sec                  receiveriperf Done.

-c 表示客户端
-p 5222 指定服务端口
-t 10 测试持续时间
-i 1 设置报告输出的间隔时间。

服务端输出

[root@work ~]# iperf3 -s -p 5222
-----------------------------------------------------------
Server listening on 5222
-----------------------------------------------------------
Accepted connection from 192.168.37.1, port 13956
[  5] local 192.168.37.100 port 5222 connected to 192.168.37.1 port 13957
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-1.00   sec   301 MBytes  2.52 Gbits/sec                  
[  5]   1.00-2.00   sec   348 MBytes  2.92 Gbits/sec                  
[  5]   2.00-3.00   sec   304 MBytes  2.55 Gbits/sec                  
[  5]   3.00-4.00   sec   333 MBytes  2.79 Gbits/sec                  
[  5]   4.00-5.00   sec   338 MBytes  2.83 Gbits/sec                  
[  5]   5.00-6.00   sec   349 MBytes  2.93 Gbits/sec                  
[  5]   6.00-7.00   sec   366 MBytes  3.07 Gbits/sec                  
[  5]   7.00-8.00   sec   366 MBytes  3.07 Gbits/sec                  
[  5]   8.00-9.00   sec   344 MBytes  2.89 Gbits/sec                  
[  5]   9.00-10.00  sec   317 MBytes  2.66 Gbits/sec                  
[  5]  10.00-10.04  sec  11.4 MBytes  2.42 Gbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  5]   0.00-10.04  sec  0.00 Bytes  0.00 bits/sec                  sender
[  5]   0.00-10.04  sec  3.30 GBytes  2.82 Gbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5222
-----------------------------------------------------------

结果查看,主要是看 receiver Bindwidth达到的的值。

反向测试

服务端启动方式不变,客户端在原来启动命令基础上,增加-R 参数就是客户端和服务器将对调过来。

客户端

$ ./iperf3.exe -c 192.168.37.100 -p 5222  -t 10 -i 1 -R
Connecting to host 192.168.37.100, port 5222
Reverse mode, remote host 192.168.37.100 is sending
[  4] local 192.168.37.1 port 9562 connected to 192.168.37.100 port 5222
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec   106 MBytes   892 Mbits/sec
[  4]   1.00-2.00   sec   106 MBytes   886 Mbits/sec
[  4]   2.00-3.00   sec   105 MBytes   877 Mbits/sec
[  4]   3.00-4.00   sec  97.9 MBytes   822 Mbits/sec
[  4]   4.00-5.00   sec  89.4 MBytes   750 Mbits/sec
[  4]   5.00-6.00   sec  74.6 MBytes   625 Mbits/sec
[  4]   6.00-7.00   sec  71.9 MBytes   603 Mbits/sec
[  4]   7.00-8.00   sec  68.0 MBytes   571 Mbits/sec
[  4]   8.00-9.00   sec  69.1 MBytes   580 Mbits/sec
[  4]   9.00-10.00  sec  69.4 MBytes   582 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   857 MBytes   719 Mbits/sec    0             sender
[  4]   0.00-10.00  sec   857 MBytes   719 Mbits/sec                  receiveriperf Done.

服务端

[root@work ~]# iperf3 -s -p 5222
-----------------------------------------------------------
Server listening on 5222
-----------------------------------------------------------
Accepted connection from 192.168.37.1, port 9561
[  5] local 192.168.37.100 port 5222 connected to 192.168.37.1 port 9562
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  5]   0.00-1.02   sec   105 MBytes   863 Mbits/sec    0    218 KBytes       
[  5]   1.02-2.01   sec   105 MBytes   884 Mbits/sec    0    218 KBytes       
[  5]   2.01-3.01   sec   105 MBytes   878 Mbits/sec    0    218 KBytes       
[  5]   3.01-4.02   sec  98.2 MBytes   820 Mbits/sec    0    218 KBytes       
[  5]   4.02-5.02   sec  89.5 MBytes   753 Mbits/sec    0    218 KBytes       
[  5]   5.02-6.02   sec  75.0 MBytes   628 Mbits/sec    0    218 KBytes       
[  5]   6.02-7.03   sec  73.0 MBytes   603 Mbits/sec    0    218 KBytes       
[  5]   7.03-8.03   sec  67.5 MBytes   571 Mbits/sec    0    218 KBytes       
[  5]   8.03-9.03   sec  69.5 MBytes   579 Mbits/sec    0    218 KBytes       
[  5]   9.03-10.02  sec  68.8 MBytes   582 Mbits/sec    0    218 KBytes       
[  5]  10.02-10.04  sec  1.25 MBytes   562 Mbits/sec    0    218 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  5]   0.00-10.04  sec   857 MBytes   716 Mbits/sec    0             sender
[  5]   0.00-10.04  sec  0.00 Bytes  0.00 bits/sec                  receiver
-----------------------------------------------------------
Server listening on 5222
-----------------------------------------------------------

这里,服务端结果,看sender 这一行,这次服务端是发送端。带宽716Mbits/sec


http://www.lryc.cn/news/359192.html

相关文章:

  • scp:Linux系统本地与远程文件传输命令
  • python基础(习题、资料)
  • shell脚本免交互
  • WPF学习笔记:给文字添加线性渐变效果
  • Fully Convolutional Networks for Semantic Segmentation--论文笔记
  • Camworks编程怎么样:深度解析其四大特点、五大应用领域、六大优势与七大挑战
  • 【Linux】操作系统之冯诺依曼体系
  • c++ QT 实现QMediaPlayer播放音频显示音频级别指示器
  • 失之毫厘差之千里之load和loads
  • element ui在移动端的适配问题
  • 堆排序详细理解
  • RK3588+FPGA+AI高性能边缘计算盒子,应用于视频分析、图像视觉等
  • 07-操作元素(键盘和鼠标事件)
  • 3389,为了保障3389端口的安全,我们可以采取的措施
  • Java集合【超详细】2 -- Map、可变参数、Collections类
  • 最佳 Mac 数据恢复:恢复 Mac 上已删除的文件
  • 芋道系统,springboot+vue3+mysql实现地址的存储与显示
  • 【C++】C++11新特性:列表初始化、声明、新容器、右值引用、万能引用和完美转发
  • 【IB Protocal Serial--WQE】
  • C++ 混合运算的类型转换
  • 线性时间选择
  • 【对算法期中卷子的解析和反思】
  • sudo apt update sudo: apt: command not found
  • ios:文本框默认的copy、past改成中文复制粘贴
  • Qt moc系统的黑魔法?
  • MyBatis开发中常用总结
  • Git基本使用教程(学习记录)
  • 【Linux-RTC】
  • 机器学习目录
  • React开发环境配置详细讲解-04