IPERF 网络性能测试
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 网络测试
- iperf -s 命令启动server:
[root@xiesshavip002 ~]# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001 # 默认端口为5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
- 向IP为192.168.130.20的主机发出TCP测试,,测试时间为20秒,并每2秒返回一次测试结果
[root@xiesshavip001 ~]# iperf -c 192.168.130.20 -i 2 -t 20
- 测试双向传输
[root@xiesshavip001 ~]# iperf -c 192.168.130.20 -i 2 -t 20 -d
- 指定传输字节数
[root@xiesshavip001 ~]# iperf -c 192.168.130.20 -i 2 -t 20 -d -n 10240
- 设置TCP传输窗口
[root@xiesshavip001 ~]# iperf -c 192.168.130.20 -i 2 -t 20 -d -n 10240 -w 300k
# 注:窗口大小不能超过默认的TCP window size: 416 KByte。并且服务端要与客户端的传输窗口大小一致
- 指定端口传输
[root@xiesshavip001 ~]# iperf -c 192.168.130.20 -i 2 -t 20 -d -p 12345
- 使用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 网络性能测试的更多相关文章
- iperf——网络性能测试工具
一.前言 工作中遇到需要测试Linux服务器网卡占用率的场景,查阅资料后,发现iperf是一款合适的网络测速工具. 下面讲解一下如何使用iperf做网络性能测试. 二.基础知识 先补充一些基础知识: ...
- 移植 iperf 网络性能测试工具到 Android-P
. . . . . 新开发板使用了 Android-P 的方案,WiFi 刚刚调通,为了测试 WiFi 稳定性,需要使用 iperf 工具.但 Android 并没有提供这个工具,只能自己移植一份了. ...
- 网络性能测试工具iperf详细使用图文教程
Iperf是一个网络性能测试工具.Iperf可以测试TCP和UDP带宽质量.Iperf可以测量最大TCP带宽,具有多种参数和UDP特性. Iperf可以报告带宽,延迟抖动和数据包丢失.利用Iper ...
- 网络性能测试工具iperf详细使用图文教程【转载】
原文:http://blog.163.com/hlz_2599/blog/static/142378474201341341339314/ 参考:http://man.linuxde.net/iper ...
- 网络性能测试工具Iperf/Jperf解读
Iperf 是一个网络性能测试工具.Iperf 可以测试TCP 和UDP 带宽质量.Iperf 可以测量最大TCP 带宽,具有多种参数和UDP 特性. Iperf 可以报告带宽,延时抖动和数据包丢失. ...
- 网络性能测试工具-Iperf
一.简单介绍 Iperf是一个网络性能测试工具,Iperf可以测试TCP和UDP带宽质量,Iperf可以测量最大TCP带宽,具有多种参数和UDP特性.Iperf可以报告带宽,延迟抖动和数据包丢失.利用 ...
- Iperf是一个网络性能测试工具
http://blog.163.com/hlz_2599/blog/static/142378474201341341339314/ Iperf是一个网络性能测试工具.Iperf可以测试TCP和UDP ...
- 网络性能测试工具iperf详细使用图文教程(转)
Iperf是一个网络性能测试工具.Iperf可以测试TCP和UDP带宽质量.Iperf可以测量最大TCP带宽,具有多种参数和UDP特性.Iperf可以报告带宽,延迟抖动和数据包丢失.利用Iperf这一 ...
- iperf点对点网络性能测试工具
什么是Iperf?Iperf 是一个网络性能测试工具.Iperf可以测试TCP和UDP带宽质量.Iperf可以测量最大TCP带宽,具有多种参数和UDP特性.Iperf可以报告带宽,延迟抖动和数据包丢失 ...
随机推荐
- CentOS7下Docker的安装与使用
前言 简介 Docker 是一个开源的应用容器引擎,基于 Go 语言,并遵从 Apache2.0 协议开源. Docker 可以让开发者打包他们的应用以及依赖包到一个轻量级.可移植的容器中,然后发布到 ...
- Python基础-编码与解码
一.什么是编码 编码是指信息从一种形式或格式转换为另一种形式或格式的过程. 在计算机中,编码,简而言之,就是将人能够读懂的信息(通常称为明文)转换为计算机能够读懂的信息.众所周知,计算机能够读懂的 ...
- [vue]vue路由篇vue-router
spa单页开发及vue-router基础: https://www.cnblogs.com/iiiiiher/p/9034496.html url两种传参方式 query: $route.query ...
- vue弹窗组件
文件结构 component.vue <template> <div class="_vuedals" v-show="show"> & ...
- (转载)Spring定时任务的几种实现
spring框架定时任务 一.分类 从实现的技术上来分类,目前主要有三种技术(或者说有三种产品): Java自带的java.util.Timer类,这个类允许你调度一个java.util.TimerT ...
- Mac下安装m2crypto 解决找不到openssl头文件的错误
直接复制整段到终端运行 sudo env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --pref ...
- python更新zip文件中文件
#更新zip文件中某一个文件import os import shutil import tempfile import zipfile from rat_tool.pack import * too ...
- 从零开始一起学习SLAM | 学习SLAM到底需要学什么?
SLAM涉及的知识面很广,我简单总结了 “SLAM知识树” 如下所示: (公众号菜单栏回复 “树” 可获得清晰版) 可以看到涉及的知识面还是比较广的.这里放出一张SLAM圈子里喜闻乐见的表达悲喜交加心 ...
- unity3d连接Sqlite并打包发布Android
连接Sqlite首先要把dll程序集导入到unity3d工程里面.安装好的unity中可以找到
- 在屏幕拖拽3D物体移动
3D物体的拖拽不同于2D的.因为3D物体有x,y,z当然.实际拖拽还是在XZ平面.只是多了几个转换 using UnityEngine; using System.Collections; publi ...