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. linux下修改/etc/profile文件

    inux下修改/etc/profile文件 2017年01月06日 14:30:12 白昙 阅读数:8540 标签: linux 更多 个人分类: linux   通常情况下,/etc/profile ...

  2. 爬虫请求库——selenium

    selenium模块 selenium最初是一个自动化测试工具,而爬虫中使用它主要是为了解决requests无法直接执行JavaScript代码的问题.selenium的缺点是效率会变得很慢. sel ...

  3. 001-RESTful服务最佳实践-RestFul准则、HTTP动词表示含义、合理的资源命名、响应格式XML和JSON

    一.概述 因为REST是一种架构风格而不是严格的标准,所以它可以灵活地实现.由于这种灵活性和结构自由度,对设计最佳实践也有很大的差异. API的方向是从应用程序开发人员的角度考虑设计选择. 幂等性 不 ...

  4. wx 文件编辑框

    # -*- coding: utf- -*- import wx import os class my_frame(wx.Frame): """This is a sim ...

  5. js或jsp 获取项目路径常用方法

    可以引入一个jsp,这个jsp的内容如下: <%@page pageEncoding="UTF-8" contentType="text/javascript; c ...

  6. protocol error, got 'n' as reply type byte + redis如何后台启动

    其它机子的PHP访问redis爆“protocol error, got 'n' as reply type byte ”错误 解决办法: 在redis配置文件redis.conf中注释掉bind配置 ...

  7. golang gui library 库

    andlabs/ui已经重写,稳定性增强,但是组件很少,只提供了几种基础的控件,慎用.gxui死了,别用.linuxdeepin转QT了,所以…… windows系统最好的选择是walk. 首先,写w ...

  8. Request实例

    Request常用方法        getRequestURL方法返回客户端发出请求时的完整URL. getRequestURI方法返回请求行中的资源名部分. getQueryString 方法返回 ...

  9. [LeetCode] 106. Construct Binary Tree from Postorder and Inorder Traversal_Medium tag: Tree Traversal

    Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that ...

  10. js使用的一些实用技巧

    1.jquery中页面定时调用ajax方法 function SetContinueSend(param1,param2, func){ func.call(null,param1,param2) } ...