网速测试利器-iperf3

使用工具


 

简介

iperf3是一个网络速度测试工具,支持IPv4与IPv6,支持TCP、UDP、SCTP传输协议,可在Windows、Mac OS X、Linux、FreeBSD等各种平台使用,是一个简单又实用的小工具。 本文介绍安装、使用iperf3 网速测试工具。

 

安装

 

Ubuntu安装

 
  1. sudo apt-get install iperf3
 

CentOS安装

 
  1. yum install iperf3
 

MAC OS X安装

 
  1. brew install iperf3
 

网络带宽测试

在使用iperf3测试时,要同时在server端与client端都各执行一个程序,让它们互相传送报文进行测试。

首先在服务端(48.77.234.178)启动server端的程序:

 
  1. iperf3 -s

接着在client端执行:

 
  1. iperf3 -c 48.77.234.178
 

测试结果

从打印的内容看,缺省参数下,Client将连接Server端的5201端口,持续向Server端发送数据,并统计出每秒传输的字节数、带宽、出现报文重传的次数、拥塞窗口(Congestion Window)大小,整个测试将持续10秒钟;最后将汇总10秒的平均数据,并给出发送和接收端的统计。

Client端

 
  1. [ ID] Interval Transfer Bitrate Total Datagrams
  2. [ 5] 0.00-1.01 sec 129 KBytes 1.05 Mbits/sec 95
  3. [ 5] 1.01-2.01 sec 125 KBytes 1.02 Mbits/sec 92
  4. [ 5] 2.01-3.00 sec 131 KBytes 1.09 Mbits/sec 97
  5. [ 5] 3.00-4.00 sec 127 KBytes 1.04 Mbits/sec 94
  6. [ 5] 4.00-5.00 sec 129 KBytes 1.05 Mbits/sec 95
  7. [ 5] 5.00-6.00 sec 127 KBytes 1.04 Mbits/sec 94
  8. [ 5] 6.00-7.00 sec 127 KBytes 1.04 Mbits/sec 94
  9. [ 5] 7.00-8.00 sec 129 KBytes 1.06 Mbits/sec 95
  10. [ 5] 8.00-9.00 sec 127 KBytes 1.04 Mbits/sec 94
  11. [ 5] 9.00-10.00 sec 126 KBytes 1.03 Mbits/sec 93
  12. - - - - - - - - - - - - - - - - - - - - - - - - -
  13. [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
  14. [ 5] 0.00-10.00 sec 1.25 MBytes 1.05 Mbits/sec 0.000 ms 0/943 (0%) sender
  15. [ 5] 0.00-10.30 sec 1.24 MBytes 1.01 Mbits/sec 9.435 ms 8/942 (0.85%) receiver
  16. iperf Done.

server端

 
  1. [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
  2. [ 5] 0.00-1.00 sec 71.8 KBytes 588 Kbits/sec 3431041313.248 ms 0/53 (0%)
  3. [ 5] 1.00-2.00 sec 146 KBytes 1.20 Mbits/sec 3223480.936 ms 0/108 (0%)
  4. [ 5] 2.00-3.00 sec 123 KBytes 1.01 Mbits/sec 9083.840 ms 2/93 (2.2%)
  5. [ 5] 3.00-4.00 sec 130 KBytes 1.07 Mbits/sec 26.471 ms 0/96 (0%)
  6. [ 5] 4.00-5.00 sec 117 KBytes 955 Kbits/sec 6.871 ms 4/90 (4.4%)
  7. [ 5] 5.00-6.00 sec 134 KBytes 1.10 Mbits/sec 11.419 ms 0/99 (0%)
  8. [ 5] 6.00-7.00 sec 126 KBytes 1.03 Mbits/sec 9.642 ms 0/93 (0%)
  9. [ 5] 7.00-8.00 sec 108 KBytes 888 Kbits/sec 7.776 ms 0/80 (0%)
  10. [ 5] 8.00-9.00 sec 145 KBytes 1.19 Mbits/sec 9.401 ms 1/108 (0.93%)
  11. [ 5] 9.00-10.00 sec 129 KBytes 1.05 Mbits/sec 9.824 ms 1/96 (1%)
  12. [ 5] 10.00-10.30 sec 35.2 KBytes 979 Kbits/sec 9.435 ms 0/26 (0%)
  13. - - - - - - - - - - - - - - - - - - - - - - - - -
  14. [ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
  15. [ 5] 0.00-10.30 sec 1.24 MBytes 1.01 Mbits/sec 9.435 ms 8/942 (0.85%) receiver
 

使用命令

 
  1. Server or Client:
  2. -p, --port # server port to listen on/connect to 端口
  3. -f, --format [kmgKMG] format to report: Kbits, Mbits, KBytes, MBytes 格式化带宽数输出
  4. -i, --interval # seconds between periodic bandwidth reports 设置每次报告之间的时间间隔,单位为秒。如果设置为非零值,就会按照此时间间隔输出测试报告。默认值为零。
  5. -F, --file name xmit/recv the specified file
  6. -A, --affinity n/n,m set CPU affinity
  7. -B, --bind <host> bind to a specific interface 主机绑定指定接口
  8. -V, --verbose more detailed output 更详细的输出
  9. -J, --json output in JSON format 输出JSON格式
  10. --logfile f send output to a log file 将输出发送到日志文件
  11. -d, --debug emit debugging output 发出调试输出
  12. -v, --version show version information and quit 显示版本信息并退出
  13. -h, --help show this message and quit 显示帮助信息并退出
  14. Server specific:
  15. -s, --server run in server mode 运行服务器模式
  16. -D, --daemon run the server as a daemon 将服务器作为守护进程运行
  17. -I, --pidfile file write PID file 写PID文件
  18. -1, --one-off handle one client connection then exit 处理一个客户端连接,然后退出
  19. Client specific:
  20. -c, --client <host> run in client mode, connecting to <host> 在客户端模式下运行,连接到主机
  21. -u, --udp use UDP rather than TCP 使用UDP而不是TCP
  22. -b, --bandwidth #[KMG][/#] target bandwidth in bits/sec (0 for unlimited) 目标带宽(比特/秒)
  23. (default 1 Mbit/sec for UDP, unlimited for TCP) UDP默认为1 Mbit/秒,TCP没有限制
  24. (optional slash and packet count for burst mode)
  25. -t, --time # time in seconds to transmit for (default 10 secs) 传输时间(默认为10秒)
  26. -n, --bytes #[KMG] number of bytes to transmit (instead of -t) 要传输的字节数(而不是-t)
  27. -k, --blockcount #[KMG] number of blocks (packets) to transmit (instead of -t or -n) 要传输的块(包)数量(而不是-t或-n)
  28. -l, --len #[KMG] length of buffer to read or write 读取或写入缓冲区的长度
  29. (default 128 KB for TCP, 8 KB for UDP) TCP默认为128 KB, UDP默认为8 KB
  30. --cport <port> bind to a specific client port (TCP and UDP, default: ephemeral port) 绑定到特定的客户端端口(TCP和UDP,默认:临时端口)
  31. -P, --parallel # number of parallel client streams to run 要运行的并行客户端流的数量
  32. -R, --reverse run in reverse mode (server sends, client receives) 以反向模式运行(服务器发送,客户端接收)
  33. -w, --window #[KMG] set window size / socket buffer size 设置窗口大小/套接字缓冲区大小
  34. -C, --congestion <algo> set TCP congestion control algorithm (Linux and FreeBSD only) 设置TCP拥塞控制算法(只支持Linux和FreeBSD)
  35. -M, --set-mss # set TCP/SCTP maximum segment size (MTU - 40 bytes) 设置TCP/SCTP最大段大小(MTU - 40字节)
  36. -N, --no-delay set TCP/SCTP no delay, disabling Nagle's Algorithm 设置TCP/SCTP没有延迟,禁用Nagle的算法
  37. -4, --version4 only use IPv4
  38. -6, --version6 only use IPv6
  39. -S, --tos N set the IP 'type of service' 设置IP“服务类型”
  40. -L, --flowlabel N set the IPv6 flow label (only supported on Linux) 设置IPv6流标签(只支持Linux)
  41. -Z, --zerocopy use a 'zero copy' method of sending data 使用“零拷贝”方法发送数据
  42. -O, --omit N omit the first n seconds 省略前N秒
  43. -T, --title str prefix every output line with this string 在每个输出行前面加上这个字符串
  44. --get-server-output get results from server 从服务器获取结果
  45. --udp-counters-64bit use 64-bit counters in UDP test packets 在UDP测试包中使用64位计数器
  46. --no-fq-socket-pacing disable fair-queuing based socket pacing

网速测试利器-iperf3的更多相关文章

  1. 【Android 应用开发】Android 平台 HTTP网速测试 案例 API 分析

    作者 : 万境绝尘 转载请注明出处 : http://blog.csdn.net/shulianghan/article/details/25996817 工信部规定的网速测试标准 : 除普通网页测速 ...

  2. Android 平台 HTTP网速测试 案例 API 分析

    作者 : 万境绝尘 转载请注明出处 : http://blog.csdn.net/shulianghan/article/details/25996817 工信部规定的网速测试标准 : 除普通网页测速 ...

  3. NetLimiter网速测试小坑

    在涉及到网络下载或者上传时,需要对各种不同的网络环境进行模拟验证,这时就需要一种可以随意限制指定进程网速的软件,经过同事推荐,发现NetLimiter这款软件很不错,界面直观,可任意设置上传下载速度, ...

  4. linux网络监控_网速测试

    Linux下查看网络即时网速 1.sar命令(一般般) sar -n DEV 1 100 1代表一秒统计并显示一次 100代表统计一百次 sar在sysstat包 2.使用ntop图形工具(没详细用过 ...

  5. 英雄联盟测试静态IP(固态IP)和动态IP的网速测试

    在自己家里测试的,平时用迅雷下载大约600KB/S.同时,设置成动态IP的话,英雄联盟的延迟大约在100ms左右,如果设置成静态IP的话,大约是50ms左右,不过也有可能和DNS服务器的设置成静态有关 ...

  6. 网速测试脚本speedtest_cli的安装与使用

    speedtest_cli的安装与使用 1.下载 wget https://raw.github.com/sivel/speedtest-cli/master/speedtest.py 图 1 2.授 ...

  7. Linux 使用 Speedtest 测试网速

    Speedtest的linux客户端是用python写的一个安装包 安装python包管理器pip yum -y install python-pip 如果提示No package python-pi ...

  8. [无线路由] “免费”斐讯K2路由器刷OpenWRT(实战MWAN多宽带网速叠加)

    (阿财首发于什么值得买)斐讯K2可以算是一个非常另类的跨界数码产品,其产品完全的醉翁之意不在酒.最多值99元的 MT7260硬件架构和用料,售价399元,金额激活K码后自动转入合作理财P2P平台,等待 ...

  9. AC+AP组网无线WiFi网速超慢延迟卡顿问题解决

    AP是什么? AP是Access Point的简称,即无线接入点,其作用是把局域网里通过双绞线传输的有线信号(即电信号)经过编译,转换成无线电信号传递给电脑.手机等无线终端,与此同时,又把这些无线终端 ...

随机推荐

  1. SpringBoot-11 扩展功能

    SpringBoot-11 扩展功能 异步 同步就是一个任务的完成需要依赖另外一个任务时,只有等待被依赖的任务完成后,依赖的任务才能算完成,这是一种可靠的任务序列.要么成功都成功,失败都失败,两个任务 ...

  2. 《环形队列》游戏高《TPS》模式下减少cpu线程切换

    序言 什么高TPS?QPS,其实很多人都知道,还有人说大数据,大流量这些关键词夜以继日的出现在我们眼前: 针对高TPS,QPS这些词汇还有一个次可能比较陌生那就是CCU,tps,qps接受满天飞,CC ...

  3. C. 【例题3】畜栏预定

    C . [ 例 题 3 ] 畜 栏 预 定 C. [例题3]畜栏预定 C.[例题3]畜栏预定 题解 考虑贪心 Code #include <bits/stdc++.h> using nam ...

  4. 【CTF】XCTF 我们的秘密是绿色的 writeup

    题目来源:SSCTF-2017 题目链接:https://adworld.xctf.org.cn/task/answer?type=misc&number=1&grade=1& ...

  5. Go-25-文件管理

    FileInfo接口 package main import ( "fmt" "os" ) // FileInfo 接口文件的信息包括文件名.文件大小.修改权限 ...

  6. 5. VUE 生命周期

    VUE 生命周期 帮助文档: https://cn.vuejs.org/v2/api/#%E9%80%89%E9%A1%B9-%E6%95%B0%E6%8D%AE https://cn.vuejs.o ...

  7. Day01_07_Java关键字和字面值

    关键字 https://www.cnblogs.com/chenglc/p/6922834.html 字面值(所见即所得的数据) 10 100 3.14 'a' "abc" tur ...

  8. 3- MySQL数据类型

    MySQL表字段类型 MySQL数据表的表示一个二维表,由一个或多个数据列构成. 每个数据列都有它的特定类型,该类型决定了MySQL如何看待该列数据,并且约束列存放相应类型的数据. MySQL中的列表 ...

  9. 批处理打造MySQLCleaner

    #批处理打造MySQLCleaner ###1. 简介 在我们卸载MySQL数据库的时候,往往除了需要卸载软件,还需要删除各种注册表信息,隐藏文件,卸载服务,否则当我们再次安装MySQL时就会出现一些 ...

  10. Windows本地安全策略

    目录 本地安全策略 密码策略 账户策略 审核策略 用户权限分配 安全选项 本地安全策略 安全策略是影响计算机安全性的安全设置的组合.可以利用本地安全策略来编辑本地计算机上的帐户 系统安全策略包括下面的 ...