Iperf 是一个网络性能测试工具。Iperf可以测试最大TCP和UDP带宽性能。Iperf具有多种参数和UDP特性,可以根据需要调整。Iperf可以报告带宽,延迟抖动和数据包丢失。

Iperf 参数选项

#介绍参考链接:https://iperf.fr/iperf-doc.php

iperf服务器端选项

-s 以server模式启动 eg:*iperf –s* 。Server端为数据的接收端。
-D 以服务方式运行ipserf
-R 停止iperf服务,针对-D
-o <filename> 重定向输出报告或错误信息到指定文件。
-c <hostname/IP> 如果Iperf运行为服务器模式,则可利用-c参数指定一个客户端,本机将接受指定客户端的连接,但不支持UDP协议。
-P,--parallel # 设置Iperf服务模式下的最大连接数,默认值为0,表示不限制连接数量。

iperf客户端选项

-b,--bandwidth 指定客户端通过UDP协议发送信息的带宽,默认值为1Mbit/s
-c,--client <hostname/IP> 指定Iperf服务器的主机名和IP地址
-d,--dualtest 同时进行双向传输测试
-n,--num 指定传输的字节数
-r,--tradeoff 单独进行双向传输测试
-t,--time 指定Iperf测试时间,默认10秒
-L,--listenport 指定一个端口,服务器将利用这个端口与客户机连接
-P, --parallel 设置Iperf客户端至Iperf服务器的连接数,默认值为1
-S, --tos 设置发出包的类型,具体类型请参阅man文档
-F 指定需要传输的文件
-T 指定ttl值

通用参数

-f [kmKM] 分别表示以Kbits, Mbits, KBytes, MBytes显示报告,默认以Mbits为单位
-i sec 以秒为单位显示报告间隔
-l 缓冲区大小,默认是8KB
-m 显示tcp最大mtu
-o 将报告和错误信息输出到文件
-p 指定服务器端使用的端口或客户端所连接的端口
-u 使用udp协议
-w 指定TCP窗口大小,默认是8KB
-B 绑定一个主机地址或接口(当主机有多个地址或接口时使用该参数)
-C 兼容旧版本(当server端和client端版本不一样时使用)
-M 设定TCP数据包的最大mtu值
-N 设定TCP不延时
-V 传输ipv6数据包

软件安装

[root@xiesshavip001 ~]# yum install https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm -y
[root@xiesshavip001 ~]# yum install iperf -y # 注:yum安装的iperf是2版本,如果需要安装3版本,可以到官网下载源包安装

Iperf 网络测试

  1. iperf -s 命令启动server:
[root@xiesshavip002 ~]# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001 # 默认端口为5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
  1. 向IP为192.168.130.20的主机发出TCP测试,,测试时间为20秒,并每2秒返回一次测试结果
[root@xiesshavip001 ~]# iperf -c 192.168.130.20 -i 2 -t 20
  1. 测试双向传输
[root@xiesshavip001 ~]# iperf -c 192.168.130.20 -i 2 -t 20 -d
  1. 指定传输字节数
[root@xiesshavip001 ~]# iperf -c 192.168.130.20 -i 2 -t 20 -d -n 10240
  1. 设置TCP传输窗口
[root@xiesshavip001 ~]# iperf -c 192.168.130.20 -i 2 -t 20 -d -n 10240 -w 300k
# 注:窗口大小不能超过默认的TCP window size: 416 KByte。并且服务端要与客户端的传输窗口大小一致
  1. 指定端口传输
[root@xiesshavip001 ~]# iperf -c 192.168.130.20 -i 2 -t 20 -d -p 12345
  1. 使用UDP测试
[root@xiesshavip001 ~]# iperf -c 192.168.130.20 -i 2 -t 20 -d -u

iperf --help

[root@xiesshavip001 ~]# iperf --help
Usage: iperf [-s|-c host] [options]
iperf [-h|--help] [-v|--version] Client/Server:
-b, --bandwidth #[KMG | pps] bandwidth to send at in bits/sec or packets per second
-f, --format [kmKM] format to report: Kbits, Mbits, KBytes, MBytes
-i, --interval # seconds between periodic bandwidth reports
-l, --len #[KM] length of buffer to read or write (default 8 KB)
-m, --print_mss print TCP maximum segment size (MTU - TCP/IP header)
-o, --output <filename> output the report or error message to this specified file
-p, --port # server port to listen on/connect to
-u, --udp use UDP rather than TCP
-w, --window #[KM] TCP window size (socket buffer size)
-z, --realtime request realtime scheduler
-B, --bind <host> bind to <host>, an interface or multicast address
-C, --compatibility for use with older versions does not sent extra msgs
-M, --mss # set TCP maximum segment size (MTU - 40 bytes)
-N, --nodelay set TCP no delay, disabling Nagle's Algorithm
-V, --IPv6Version Set the domain to IPv6 Server specific:
-s, --server run in server mode
-U, --single_udp run in single threaded UDP mode
-D, --daemon run the server as a daemon Client specific:
-c, --client <host> run in client mode, connecting to <host>
-d, --dualtest Do a bidirectional test simultaneously
-n, --num #[KM] number of bytes to transmit (instead of -t)
-r, --tradeoff Do a bidirectional test individually
-t, --time # time in seconds to transmit for (default 10 secs)
-B, --bind [<ip> | <ip:port>] bind src addr(s) from which to originate traffic
-F, --fileinput <name> input the data to be transmitted from a file
-I, --stdin input the data to be transmitted from stdin
-L, --listenport # port to receive bidirectional tests back on
-P, --parallel # number of parallel client threads to run
-T, --ttl # time-to-live, for multicast (default 1)
-Z, --linux-congestion <algo> set TCP congestion control algorithm (Linux only) Miscellaneous:
-x, --reportexclude [CDMSV] exclude C(connection) D(data) M(multicast) S(settings) V(server) reports
-y, --reportstyle C report as a Comma-Separated Values
-h, --help print this message and quit
-v, --version print version information and quit [KM] Indicates options that support a K or M suffix for kilo- or mega- The TCP window size option can be set by the environment variable
TCP_WINDOW_SIZE. Most other options can be set by an environment variable
IPERF_<long option name>, such as IPERF_BANDWIDTH. Source at <http://sourceforge.net/projects/iperf2/>
Report bugs to <iperf-users@lists.sourceforge.net>
[root@xiesshavip001 ~]#

IPERF 网络性能测试的更多相关文章

  1. iperf——网络性能测试工具

    一.前言 工作中遇到需要测试Linux服务器网卡占用率的场景,查阅资料后,发现iperf是一款合适的网络测速工具. 下面讲解一下如何使用iperf做网络性能测试. 二.基础知识 先补充一些基础知识: ...

  2. 移植 iperf 网络性能测试工具到 Android-P

    . . . . . 新开发板使用了 Android-P 的方案,WiFi 刚刚调通,为了测试 WiFi 稳定性,需要使用 iperf 工具.但 Android 并没有提供这个工具,只能自己移植一份了. ...

  3. 网络性能测试工具iperf详细使用图文教程

      Iperf是一个网络性能测试工具.Iperf可以测试TCP和UDP带宽质量.Iperf可以测量最大TCP带宽,具有多种参数和UDP特性. Iperf可以报告带宽,延迟抖动和数据包丢失.利用Iper ...

  4. 网络性能测试工具iperf详细使用图文教程【转载】

    原文:http://blog.163.com/hlz_2599/blog/static/142378474201341341339314/ 参考:http://man.linuxde.net/iper ...

  5. 网络性能测试工具Iperf/Jperf解读

    Iperf 是一个网络性能测试工具.Iperf 可以测试TCP 和UDP 带宽质量.Iperf 可以测量最大TCP 带宽,具有多种参数和UDP 特性. Iperf 可以报告带宽,延时抖动和数据包丢失. ...

  6. 网络性能测试工具-Iperf

    一.简单介绍 Iperf是一个网络性能测试工具,Iperf可以测试TCP和UDP带宽质量,Iperf可以测量最大TCP带宽,具有多种参数和UDP特性.Iperf可以报告带宽,延迟抖动和数据包丢失.利用 ...

  7. Iperf是一个网络性能测试工具

    http://blog.163.com/hlz_2599/blog/static/142378474201341341339314/ Iperf是一个网络性能测试工具.Iperf可以测试TCP和UDP ...

  8. 网络性能测试工具iperf详细使用图文教程(转)

    Iperf是一个网络性能测试工具.Iperf可以测试TCP和UDP带宽质量.Iperf可以测量最大TCP带宽,具有多种参数和UDP特性.Iperf可以报告带宽,延迟抖动和数据包丢失.利用Iperf这一 ...

  9. iperf点对点网络性能测试工具

    什么是Iperf?Iperf 是一个网络性能测试工具.Iperf可以测试TCP和UDP带宽质量.Iperf可以测量最大TCP带宽,具有多种参数和UDP特性.Iperf可以报告带宽,延迟抖动和数据包丢失 ...

随机推荐

  1. jenkins+maven+gitlab触发构建

    1.安装插件 安装gitlab插件 回到项目配置在“构建触发器”那里有一个Build when a change is pushed to GitLab. GitLab webhook选项复制选项里的 ...

  2. 003-linux命令-文件和目录、查看文件内容-文本处理

    文本处理 cat file1|command(sed,grep,awk,) > result.txt 合并一个文件的详细说明文本,并将简介写入一个新文件中 cat file1|command(s ...

  3. 主成分分析(PCA)原理详解

    一.PCA简介 1. 相关背景 在许多领域的研究与应用中,往往需要对反映事物的多个变量进行大量的观测,收集大量数据以便进行分析寻找规律.多变量大样本无疑会为研究和应用提供了丰富的信息,但也在一定程度上 ...

  4. Gradle全局变量定义及引用

    在Project的build.gradle脚本中定义一些全局变量 ext { compileSdkVersion = 21 buildToolsVersion = "24.0.1" ...

  5. (转)以太坊(Ethereum)创世揭秘 以太坊(Ethereum)创世揭秘

    什么是以太坊(Ethereum) 以太坊(Ethereum)是一个基于区块链技术,允许任何人构建和使用去中心化应用的区块链平台.像比特币一样,以太坊是开源的,并由来自全世界的支持者们共同维护.与比特币 ...

  6. DL中train\dev\test集

    转自:https://blog.csdn.net/l8947943/article/details/80328721 training set:训练集是用来训练模型的.遵循训练集大,开发,测试集小的特 ...

  7. linux iscsi挂载与卸载

    iscsiadm -m discovery -t sendtargets -p 192.168.4.245:3260 #扫描ISCSI Target 列出所有LUN iscsiadm -m node ...

  8. 2019年UI和UX设计趋势:大概是最全的汇总了!

    朋友们,很快,2018就要跟我们说

  9. 数据分析与挖掘 - R语言:贝叶斯分类算法(案例三)

    案例三比较简单,不需要自己写公式算法,使用了R自带的naiveBayes函数. 代码如下: > library(e1071)> classifier<-naiveBayes(iris ...

  10. ssh生成私钥

    指定证书类型为rsa ssh-keygen.exe  -t rsa https://www.cnblogs.com/pixy/p/4722381.html