iperf/iperf3网络测试工具的安装与使用
1.官网及下载路径:
iperf3 homepage at: http://software.es.net/iperf/
Report bugs to: https://github.com/esnet/iperf
2.iperf3命令选项
[ubuntu @meta]$ iperf3
iperf3: parameter error - must either be a client (-c) or server (-s) 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
-A, --affinity n/n,m set CPU affinity
-B, --bind <host> bind to a specific interface
-V, --verbose more detailed output
-J, --json output in JSON format
-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
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 ( for unlimited)
(default Mbit/sec for UDP, unlimited for TCP)
(optional slash and packet count for burst mode)
-t, --time # time in seconds to transmit for (default 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 KB for TCP, KB for UDP)
-P, --parallel # number of parallel client streams to run
-R, --reverse run in reverse mode (server sends, client receives)
-w, --window #[KMG] TCP window size (socket buffer size)
-C, --linux-congestion <algo> set TCP congestion control algorithm (Linux only)
-M, --set-mss # set TCP maximum segment size (MTU - bytes)
-N, --nodelay set TCP no delay, disabling Nagle's Algorithm
-, --version4 only use IPv4
-, --version6 only use IPv6
-S, --tos N set the IP 'type of service'
-L, --flowlabel N set the IPv6 flow label (only supported on Linux)
-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 [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
3.iperf3的测试例子
测试1:
一台电脑本地回环测试
打开两个终端t1和t2,在t1中输入命令:iperf3 -s 在t2中输入命令: iperf3 -c 127.0.0.1 -t
本例中t2向t1发送5秒中的数据包
测试2:
一台电脑的实际网卡:
打开两个终端t1和t2,在t1中输入命令:iperf3 -s 在t2中输入命令: iperf3 -c 10.219.119.21
测试3:
两台电脑之间发包测试,在电脑A中打开终端t1,在电脑B中打开终端t2,确保两台电脑在同一个局域网中并假设t1的IP地址为192.168.1.,t2的IP地址为192.168.1.
在t1中输入命令: iperf3 -s 在t2中输入命令: iperf3 -c 192.168.1.123 -t
如果出现错误iperf3: error - unable to connect to server: No route to host,请修改电脑A的防火墙规则。 防火墙规则修改方法:
防火墙会阻止两台电脑之间的通信。centos7.0自带的防火墙为firewalld,可以先把firewalld删除,再安装iptalbes。
在t1中输入以下两条的命令来停用firewalld:
.删除firewalld的命令如下
sudo systemctl stop firewalld //关闭
sudo systemctl disable firewalld //禁止开机启动
.安装iptables的命令如下
sudo yum install -y iptables-services.x86_64 iptables-devel.x86_64
重新测试iperf3,在t1中输入命令:
sudo iptables -I INPUT -s 192.168.1.124 -j ACCEPT
sudo service iptables save
iperf3 -s
在t2中输入命令:
iperf3 -c 192.168.1.123 -t
. Apple手机测试
开发板host,ip:172.27.0.25,App手机做client:
测试UDP:
开发板:# iperf -V -s -u
手机:iperf -p -l -w -i 1.0 -u -c 172.27.0.25 -t 10.0 -b 100m
测试TCP:
开发板:# iperf -V -s
手机:iperf -p -l -w -i 1.0 -c 172.27.0.25 -t 10.0 开发板client,App手机做service,ip:172.27.0.165
测试TCP:
开发板:# iperf -c 172.27.0.165 -w 128k -t 10.0 -i 1.0 -p
手机:# iperf -p -l -w -i 1.0 -s
测试UDP:
开发板:# iperf -c 172.27.0.165 -w 128k -t 10.0 -i 1.0 -p -l -u -b 50m
手机:# iperf -p -l -w -i 1.0 -u -s
4.iperf3卸载
查看所有已经安装的软件:
sudo yum list installed
删除iperf3:
sudo yum -y remove iperf3.x86_64
5.软件包中的test_command.sh
#!/bin/sh
#
# This is a set of commands to run and verify they work before doing a new release.
# Eventually they should also use the -J flag to generate JSON output, and a program should
# be written to check the output.
# Be sure to test both client and server on Linux, BSD, and OSX
# if [ $# -ne ]
then
echo "Usage: `basename $0` hostname"
exit $E_BADARGS
fi set -x host=$ # basic testing
./src/iperf3 -c $host -V -t -T "test1"
./src/iperf3 -c $host -u -V -t
# omit mode
./src/iperf3 -c $host -i . -O -t
# JSON mode
./src/iperf3 -c $host -i -J -t
# force V4
./src/iperf3 -c $host - -t
./src/iperf3 -c $host - -u -t
# force V6
./src/iperf3 -c $host - -t
./src/iperf3 -c $host - -u -t
# parallel streams
./src/iperf3 -c $host -P -t
./src/iperf3 -c $host -u -P -t
# reverse mode
./src/iperf3 -c $host -P -t -R
./src/iperf3 -c $host -u -P -t -R
# zero copy
./src/iperf3 -c $host -Z -t
./src/iperf3 -c $host -Z -t -R
# window size
./src/iperf3 -c $host -t -w 8M
# -n flag
./src/iperf3 -c $host -n 5M
./src/iperf3 -c $host -n 5M -u -b1G
# conflicting -n -t flags
./src/iperf3 -c $host -n 5M -t
# -k mode
./src/iperf3 -c $host -k 1K
./src/iperf3 -c $host -k 1K -u -b1G
# CPU affinity
./src/iperf3 -c $host -A /
./src/iperf3 -c $host -A / -u -b1G
# Burst mode
./src/iperf3 -c $host -u -b1G/
# change MSS
./src/iperf3 -c $host -M -V
# test congestion control option (linux only)
./src/iperf3 -c $host -C reno -V
6. 若网络媒体出现卡顿可以是用iperf测试卡顿时网络的带宽,以定位是否是底层问题。
iperf/iperf3网络测试工具的安装与使用的更多相关文章
- iperf3网络测试工具
一.简介: iperf3是一个网络速度测试工具,支持IPv4与IPv6,支持TCP.UDP.SCTP传输协议,可在Windows.Mac OS X.Linux.FreeBSD等各种平台使用,是一个简单 ...
- iperf3 网络测试工具
Iperf3 是一个网络性能测试工具.Iperf可以测试最大TCP和UDP带宽性能,具有多种参数和UDP特性,可以根据需要调整,可以报告带宽.延迟抖动和数据包丢失.对于每个测试,它都会报告带宽,丢包和 ...
- IPerf——网络测试工具介绍与源码解析(4)
上篇随笔讲到了TCP模式下的客户端,接下来会讲一下TCP模式普通场景下的服务端,说普通场景则是暂时不考虑双向测试的可能,毕竟了解一项东西还是先从简单的情况下入手会快些. 对于服务端,并不是我们认为的直 ...
- 网络测试工具--Iperf、Netperf 、MZ
网络性能测量的五项指标 可用性(availability) 响应时间(response time) 网络利用率(network utilization) 网络吞吐量(network throughpu ...
- 网络测试工具netperf(转)
http://pangyi.github.io/blog/20141210/wang-luo-ce-shi-gong-ju-netperf/ 网络测试工具netperf 2014年12月10日 一般我 ...
- TCP/UDP网络性能测试工具 - Netperf (zz) ..网络测试工具
在构建或管理一个网络系统时,我们更多的是关心网络的可用性,即网络是否连通,而对于其整体的性能往往考虑不多. 除了netperf以外. 还有很多其它的网络性能测试工具. 如db, ...
- 微软源代码管理工具TFS2013安装与使用详细图文教程(Vs2013)
这篇文章联合软件小编主要介绍了微软源代码管理工具TFS2013安装与使用图文教程,本文详细的给出了TFS2013的安装配置过程.使用教程,需要的朋友可以参考下 最近公司新开发一个项目要用微软的TFS2 ...
- [转] 微软源代码管理工具TFS2013安装与使用详细图文教程(Vs2013)
这篇文章联合软件小编主要介绍了微软源代码管理工具TFS2013安装与使用图文教程,本文详细的给出了TFS2013的安装配置过程.使用教程,需要的朋友可以参考下 最近公司新开发一个项目要用微软的TFS2 ...
- nmon工具的安装及简单使用
1.工具的安装 下载rpm包安装即可http://mirror.ghettoforge.org/distributions/gf/el/6/gf/x86_64/nmon-14i-1.gf.el6.x8 ...
随机推荐
- vgg_face人脸识别
最近参考http://blog.csdn.net/hlx371240/article/details/51388022一文,用LFW数据集对vgg_face.caffemodel进行fine-tune ...
- python webdriver grid多节点运行webdriver程序
grid整理: 机制 Hub机器和节点机器上要装jdk和jar包 A机器:hub 中控:用来监控所有节点机的状态 启动命令: java -jar selenium-server-standalone ...
- 20145221 《Java程序设计》实验报告一:Java开发环境的熟悉(Windows+IDEA)
20145221 <Java程序设计>实验报告一:Java开发环境的熟悉(Windows+IDEA) 实验要求 使用JDK编译.运行简单的Java程序: 使用IDEA 编辑.编译.运行.调 ...
- 20145326《Java程序设计》实验二Java面向对象程序设计实验报告
20145326<Java程序设计>实验二Java面向对象程序设计实验报告 实验内容 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装.继承.多态 初步掌握UML建模 熟悉S.O. ...
- STRIDE 和 DREAD
目录 STRIDE 和 DREAD 背景 STRIDE DREAD 注释 STRIDE 和 DREAD 背景 STRIDE 和 DREAD 是最常用也是最好用的安全模型 STRIDE 主要负责对安全风 ...
- Vim提示E325(锁机制)
背景 用vim命令处理一些超大文件时,有时会遇到卡死现象,不得不强制退出.但是,再次用vim命令访问这个文件时,会出现“E325:ATTENTION”提示.如果不做处理,以后每次都会出现. 分析 经过 ...
- spring boot2 基于百度云apiface实现人脸检测与认证1
原理介绍: 基于百度云的人脸资料库(用户上传),调用本地摄像头抓拍的图像,与百度云的用户图像做比对,实现人脸认证. 主要步骤如下: 1. 创建百度去账号 2. 在百度云控制台中创建人脸识别的应用,并记 ...
- Cloud Native 环境
当今软件行业正发生着巨变.自上世纪50年代计算机诞生以来,软件从最初的手工作坊式的交付方式,逐渐演变成为了职业化开发.团队化开发,进而定制了软件件行业的相关规范,形成了软件产业. 今天,无论是大型企业 ...
- 利用JS将页面中包含“一个”字段值的元素改为红色
document.body.innerHTML = document.body.innerHTML.replace(/一个/ig,"<span style='color: red;'& ...
- C# 使用Dictionary、linq实现根据集合里面的字符串进行分组
//对下面集合里面的字符串按照“_”进行分组. List<string> list = new List<string>() { "1_32", " ...