在测试网络吞吐量时,我们常见的方式都是通过远程拷贝一个文件来大致验证网络吞吐量,但是这种方式可能会受到磁盘自身吞吐量影响,所以我们采取 iperf 命令行工具可以避开受到其他因素影响。该工具可以在Linux 和 Windows 下通用。

一、iPerf 工具下载

  • CentOS 安装
# CentOS默认 yum 源没有iperf,epel yum 源库中存在
yum install epel-release
yum update
yum install iperf
  • Windows 安装 (直接在官方网站下载即可)
https://iperf.fr/iperf-download.php

二、iPerf 工具使用

iPerf 需要两台机器,一台充当客户端,一台充当服务端。客户端连接上服务测试。

1、TCP 服务端客户端测试
  • 在第一台机器上以服务端模式启动
# iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
  • 在第二台机器上以客户端方式连接测试
# iperf3 -c 192.168.6.160
Connecting to host 192.168.6.160, port 5201
[  4] local 192.168.1.192 port 20886 connected to 192.168.6.160 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  7.63 MBytes  64.0 Mbits/sec   56   32.5 KBytes
[  4]   1.00-2.00   sec  8.26 MBytes  69.3 Mbits/sec   22   39.6 KBytes
[  4]   2.00-3.00   sec  7.52 MBytes  63.1 Mbits/sec   35   29.7 KBytes       ......
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec  71.6 MBytes  60.0 Mbits/sec  430             sender
[  4]   0.00-10.00  sec  71.3 MBytes  59.8 Mbits/sec                  receiveriperf Done.
2、UDP 服务端客户端测试
  • 服务端依旧加 -s 启动,客户端加上 -u 参数代表使用udp协议,可以测试使用 udp 连接能实现的最大吞吐量
# 加上 -u 参数可以
# iperf3 -c 192.168.6.160 -u
Connecting to host 192.168.6.160, port 5201
[  4] local 192.168.1.192 port 38898 connected to 192.168.6.160 port 5201
[ ID] Interval           Transfer     Bandwidth       Total Datagrams
[  4]   0.00-1.00   sec   116 KBytes   950 Kbits/sec  82
[  4]   1.00-2.00   sec   129 KBytes  1.05 Mbits/sec  91
[  4]   2.00-3.00   sec   127 KBytes  1.04 Mbits/sec  90
......
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  4]   0.00-10.00  sec  1.24 MBytes  1.04 Mbits/sec  0.289 ms  1/897 (0.11%)
[  4] Sent 897 datagramsiperf Done.

1.05Mbits/sec远低于TCP测试中观察到的值,这是因为默认情况下,iperf 对UDP带宽限制为每秒1 Mbits/sec。如果需要测试UDP网络速度,可以加 -b 参数设置带宽,将数字设置为双方硬件设置端口的最大带宽限制。

# iperf3 -c 192.168.6.160 -u -b 100m
Connecting to host 192.168.6.160, port 5201
[  4] local 192.168.1.192 port 63338 connected to 192.168.6.160 port 5201
[ ID] Interval           Transfer     Bandwidth       Total Datagrams
[  4]   0.00-1.00   sec  10.3 MBytes  86.6 Mbits/sec  7479
[  4]   1.00-2.00   sec  11.4 MBytes  95.6 Mbits/sec  8253
[  4]   2.00-3.00   sec  11.4 MBytes  95.6 Mbits/sec  8254
......
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Jitter    Lost/Total Datagrams
[  4]   0.00-10.00  sec   113 MBytes  94.6 Mbits/sec  0.016 ms  1346/81703 (1.6%)
[  4] Sent 81703 datagramsiperf Done.
3、Windows 使用

Windows 也是基于命令行使用,可以跟Linux混合测试,使用方式一致。从官网下载好的文件解压放进 C:\Windows 即可。

三、iPerf 参数选项

Usage: iperf [-s|-c host] [options]iperf [-h|--help] [-v|--version]Server or Client:-p, --port      #         server port to listen on/connect to-f, --format    [kmgKMG]  format to report: Kbits, Mbits, KBytes, MBytes-i, --interval  #         seconds between periodic bandwidth reports-F, --file name           xmit/recv the specified file-B, --bind      <host>    bind to a specific interface-V, --verbose             more detailed output-J, --json                output in JSON format--logfile f               send output to a log file-d, --debug               emit debugging output-v, --version             show version information and quit-h, --help                show this message and quit
Server specific:-s, --server              run in server mode-D, --daemon              run the server as a daemon-I, --pidfile file        write PID file-1, --one-off             handle one client connection then exit
Client specific:-c, --client    <host>    run in client mode, connecting to <host>-u, --udp                 use UDP rather than TCP-b, --bandwidth #[KMG][/#] target bandwidth in bits/sec (0 for unlimited)(default 1 Mbit/sec for UDP, unlimited for TCP)(optional slash and packet count for burst mode)-t, --time      #         time in seconds to transmit for (default 10 secs)-n, --bytes     #[KMG]    number of bytes to transmit (instead of -t)-k, --blockcount #[KMG]   number of blocks (packets) to transmit (instead of -t or -n)-l, --len       #[KMG]    length of buffer to read or write(default 128 KB for TCP, 8 KB for UDP)--cport         <port>    bind to a specific client port (TCP and UDP, default: ephemeral port)-P, --parallel  #         number of parallel client streams to run-R, --reverse             run in reverse mode (server sends, client receives)-w, --window    #[KMG]    set window size / socket buffer size-M, --set-mss   #         set TCP/SCTP maximum segment size (MTU - 40 bytes)-N, --no-delay            set TCP/SCTP no delay, disabling Nagle's Algorithm-4, --version4            only use IPv4-6, --version6            only use IPv6-S, --tos N               set the IP 'type of service'-Z, --zerocopy            use a 'zero copy' method of sending data-O, --omit N              omit the first n seconds-T, --title str           prefix every output line with this string--get-server-output       get results from server--udp-counters-64bit      use 64-bit counters in UDP test packets[KMG] indicates options that support a K/M/G suffix for kilo-, mega-, or giga-iperf3 homepage at: http://software.es.net/iperf/
Report bugs to:     https://github.com/esnet/iperf

使用iPerf测试网络吞吐量相关推荐

  1. Android 使用iperf测试wifi吞吐量

    Android使用iperf测试wifi吞吐量 大体上分为三个步骤 编译生成android端的可执行文件iperf 把该文件拷贝到/data/data/包名/iperf目录下 根据iperf命令执行该 ...

  2. Linux网络性能评估工具iperf 、CHARIOT测试网络吞吐量

    目录 一. Iperf能做什么 1.TCP方面 2.UDP方面 二. Iperf的安装与使用 1.安装iperf 2.iperf参数介绍 三. Iperf应用实例 1.测试TCP吞吐量 2 . 测试U ...

  3. 【测试】使用iPerf进行网络吞吐量测试

    即看即用 1.安装ipref3: wget wget https://iperf.fr/download/fedora/iperf3-3.1.3-1.fc24.x86_64.rpm rpm -ivh  ...

  4. 使用iPerf进行网络吞吐量测试

    iperf是一种命令行工具,用于通过测量服务器可以处理的最大网络吞吐量来诊断网络速度问题.它在遇到网络速度问题时特别有用,通过该工具可以确定哪个服务器无法达到最大吞吐量. 资源准备 需要root权限具 ...

  5. 使用iperf测试网络性能

    iperf 是一个 TCP/IP 和 UDP/IP 的性能测量工具,能够提供网络吞吐率信息,以及震动.丢包率.最大段和最大传输单元大小等统计信息:从而能够帮助我们测试网络性能,定位网络瓶颈.iperf ...

  6. iperf测试WiFi吞吐量

    0前言 借助工具iperf去测试WiFi吞吐量 1硬件 PC一台(使用的是台式Ubuntu16.04),测试板子,路由器,网线 2硬件连接 能够联网的网线插在WLAN口,然后PC端网线口和路由器LAN ...

  7. ITE平台开发 chapter5之jperf测试网络吞吐量

    1.关于Jperf的介绍 使用JPerf程序能简化了复杂命令行参数的构造,而且它还保存测试结果,同时实时图形化显示结果.JPerf可以测试TCP和UDP带宽质量.JPerf可以测量最大TCP带宽,具有 ...

  8. iperf 测试网络试用

    出现终端用户使用浏览器登录应用系统出现卡顿,加载时间较长,先进行网络排查,测试网络带宽.使用iperf工具来测试. 一.客户端 win7 旗舰版: 官网下载安装包iperf-3.1.3-win64,解 ...

  9. Android 移植iperf3.13 测试网络

    iperf,测试网络性能的,不同于 webrtc里面的gcc 算法预估网络带宽,iperf是实际占用网络来传输数据测量实际的网络性能. 官网:https://iperf.fr/ 官方就有 androi ...

最新文章

  1. mysql集群数据引擎_MySQL数据引擎
  2. CentOS 6.8 安装FTP及添加用户
  3. 腾讯-视频打标签算法探讨
  4. 如何用PPT编制方案 (2)PPT内容的逻辑表达
  5. Web测试中容易被忽略的Charset问题
  6. 批量导入时间oracle excel,读取Excel数据、批量导入到Oracle数据库
  7. 虎牙、斗鱼正式达成合并协议;​中国广电正式成立,或催生5G发展新格局;Linux 5.9 释出|极客头条
  8. AJAX ControlToolkit学习日志-AnimationExtender控件(3)
  9. 三菱控制器 梯形图 c语言 转换,三菱plc程序设计控制器系列软件功能简介
  10. 基于java的小型旅游网站设计(含源文件)
  11. wince之浅谈无线漫游
  12. autocad2014 菜单栏 闪退_AutoCAD2014闪退解决办法
  13. cocoscreator的游戏背景适配方案
  14. 干货 | 呆滞库存(Slow moving)产生原因分析和预防措施
  15. verilog练习:hdlbits网站上的做题笔记(5)
  16. centos7.4安装
  17. java反射获取所有接口实现类
  18. ultraiso软碟通注册码
  19. 西门子300PLC连接组态王KingSCADA实现ModbusTCP通信
  20. 使用yocto搭建 i.MX8QXP Linux 4.14.98_ga 板级开发包编译环境

热门文章

  1. 安卓手机来电防火墙_斗鱼直播伴侣教程之手机投屏介绍
  2. BWT(Burrows-Wheelter Transform)算法
  3. 北京航空航天大学王田苗教授:人工智能与机器人前沿科技发展与投资布局
  4. css3clip-path绘制正八边形
  5. maven指定配置文件打包
  6. 一成首付网络购车平台谁会走的更远?
  7. encode编码解码
  8. 牛人用 Rust 重写了 Apache Spark,并把它开源了
  9. Day2 Transparency and Trust in Human-AI-InteractionThe Role of Model-Agnostic Explanations in CV DSS
  10. 厦门大学计算机专业考研真题,厦门大学2002年考研真题-计算机数据结构