网络测试工具—— iperf2详细使用方法

这篇具有很好参考价值的文章主要介绍了网络测试工具—— iperf2详细使用方法。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

简介

很多公司都在将自己的无线网络升级到802.11n,以实现更大的吞吐量、更广的覆盖范围和更高的可靠性,然而保证无线LAN(WLAN)的性能对于确保足够的网络容量和覆盖率尤为重要。下面,我们将探讨如何通过iPerf来测定网络性能,这是一个简单易用测量TCP/UDP的吞吐量、损耗和延迟的工具。

软件安装

# ubuntu系统
sudo apt install iperf

说明:不同的系统安装方式不同,这里只介绍ubuntu系统

使用介绍

案例一:工具检验测试

启动一个串口,输入指令

iperf -s       
# 开启iperf服务端

效果如下:
网络测试工具—— iperf2详细使用方法

启动另一个窗口,输入指令

iperf -c 127.0.0.1 
# 作为客户端运行,测试10s回环通信数据

测试结果如下:
  网络测试工具—— iperf2详细使用方法

上面的例子只是简单测试了回环通信的吞吐量,如果显示正常,说明iperf安装和运行均正常。

案例二:TCP通信测试

先关闭上面的测试窗口,或结束上面的服务程序,我们这里还是以127.0.0.1作回环测试,时间应用场景中只需要把IP地址替换为对应服务端的IP地址即可

启动服务端,输入指令

iperf -s -b 7M -i 5
# 作为服务端运行,带宽7M,报告回显间隔时间5s

效果如下
网络测试工具—— iperf2详细使用方法

打开新的terminal,启动客户端,输入指令

iperf -c 127.0.0.1 -b 7M -i 5 -t 30
#作为客户端,连接服务端ip地址127.0.0.1,带宽7M,与服务端保持一致,报告回显间隔5s,测试时间30s

测试效果如下:
网络测试工具—— iperf2详细使用方法

我们这里测试吞吐量的结果为7.34M左右,是因为我们限制了测试数据的带宽就是7M,我们做的回环测试,实际回环的吞吐量应该是G为单位,测试过程中,如果发现测试的带宽与限制带宽接近,说明限制设置的太小了,需要适当调整-b参数,或者参考硬件厂家给的指标测试。

案例三:UDP测试

先关闭上面的测试窗口,或结束上面的服务程序,我们这里还是以127.0.0.1作回环测试,时间应用场景中只需要把IP地址替换为对应服务端的IP地址即可

启动服务端,输入指令

iperf -s -u -b 7M -i 5
# 作为UDP服务端启动iperf,限制带宽7M,报告回显时间间隔5s

效果如下:
网络测试工具—— iperf2详细使用方法

启动客户端,输入指令

iperf -u -c 127.0.0.1 -b 7M -i 5 -t 30

测试效果如下:
网络测试工具—— iperf2详细使用方法

我们这里测试吞吐量的结果为7.34M左右,是因为我们限制了测试数据的带宽就是7M,我们做的回环测试,实际回环的吞吐量应该是G为单位,测试过程中,如果发现测试的带宽与限制带宽接近,说明限制设置的太小了,需要适当调整-b参数,或者参考硬件厂家给的指标测试。

此时服务端显示内容如下:
网络测试工具—— iperf2详细使用方法

我们可以看到服务端还可以显示通信延时Jitter(在连续传输中的平滑平均值差)和丢包率:Lost/Total Data

详细解读

我们可以直接参考系统自带的帮助文档,如下:

iperf -h                                                   
Usage: iperf [-s|-c host] [options]                           
iperf [-h|--help] [-v|--version]                    
Client/Server:                                                                                                                                                          
    -b, --bandwidth #[kmgKMG | pps]  bandwidth to send at in bits/sec or packets per second   
    -e, --enhancedreports    use enhanced reporting giving more tcp/udp and traffic information  
    -f, --format    [kmgKMG]   format to report: Kbits, Mbits, KBytes, MBytes                   
    -i, --interval  #        seconds between periodic bandwidth reports                       
    -l, --len       #[kmKM]    length of buffer in bytes to read or write (Defaults: TCP=128K, v4 UDP=1470, v6 UDP=1450)                                                   
    -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           
    --udp-counters-64bit use 64 bit sequence numbers with UDP    
    -w, --window    #[KM]    TCP window size (socket buffer size)   
    -z, --realtime           request realtime scheduler           
    -B, --bind <host>[:<port>][%<dev>] bind to <host>, ip addr (including multicast address) and optional port and device                                                
    -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        
    -S, --tos       #        set the socket's IP_TOS (byte) field               
Server specific:                                                             
    -s, --server             run in server mode                          
    -t, --time      #        time in seconds to listen for new connections as well as to receive traffic (default not set)                                              
    --udp-histogram #,#  enable UDP latency histogram(s) with bin width and count, e.g. 1,1000=1(ms),1000(bins)  
    -B, --bind <ip>[%<dev>]  bind to multicast address and optional device           
    -H, --ssm-host <ip>      set the SSM source, use with -B for (S,G)                 
    -U, --single_udp         run in single threaded UDP mode               
    -D, --daemon             run the server as a daemon               
    -V, --ipv6_domain        Enable IPv6 reception by setting the domain and socket to AF_INET6 (Can receive on both IPv4 and IPv6)                              
Client specific:                              
    -c, --client    <host>   run in client mode, connecting to <host>   
    -d, --dualtest           Do a bidirectional test simultaneously   
    --ipg                set the the interpacket gap (milliseconds) for packets within an isochronous frame   
    --isochronous <frames-per-second>:<mean>,<stddev> send traffic in bursts (frames - emulate video traffic) 
    -n, --num       #[kmgKMG]    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 ip (and optional port) from which to source 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    
    -R, --reverse            reverse the test (client receives, server sends)  
    -T, --ttl       #        time-to-live, for multicast (default 1)     
    -V, --ipv6_domain        Set the domain to IPv6 (send packets over IPv6)   
    -X, --peer-detect        perform server version detection and version exchange 
    -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    
	
[kmgKMG] Indicates options that support a k,m,g,K,M or G suffix   
Lowercase format characters are 10^3 based and uppercase are 2^n based   
(e.g. 1k = 1000, 1K = 1024, 1m = 1,000,000 and 1M = 1,048,576)         

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>

我们抽取我在测试过程中用到的一些参数做一些翻译和解读

Client/Server: # 客户端和服务端公有的参数
带宽参数,单位:字节每秒:kmg或者KMG,小写为10的3次方,大写为2的n次方,比如1k=1000,1K=1024,;单位包数量每秒:pps(packets per second) 
    -b, --bandwidth #[kmgKMG | pps]  bandwidth to send at in bits/sec or packets per second 
回显报告的间隔时间                       
    -i, --interval  #        seconds between periodic bandwidth reports      
指定端口号,默认为5001             
    -p, --port      #        server port to listen on/connect to   
udp模式,不带-u默认为tcp模式
    -u, --udp                use UDP rather than TCP       
tcp窗口大小,默认无上限,可以不设此参数,作为udp模式测试时也不需要此参数 ,单位:KM,1K=1024     
    -w, --window    #[KM]    TCP window size (socket buffer size)   
                
Server specific:  #服务端私有参数
指定以服务端运行                                                            
    -s, --server             run in server mode   
指定测试时间,服务端一般一直开着,不设此参数                       
    -t, --time      #        time in seconds to listen for new connections as well as to receive traffic (default not set)                                              
        
Client specific:  #客户端私有参数
指定以客户端运行,后面要带服务端的IP地址                            
    -c, --client    <host>   run in client mode, connecting to <host>   
指定测试时间,不带参数默认测试10s        
    -t, --time      #        time in seconds to transmit for (default 10 secs)  
翻转测试,iperf2并不支持此功能,无法使用,可以推荐使用iperf3   
    -R, --reverse            reverse the test (client receives, server sends)  

Miscellaneous:   #混合参数,指既不是服务端也不是客户端的时候使用                              
显示帮助菜单  
    -h, --help               print this message and quit   
显示版本
    -v, --version            print version information and quit    

·
·
·

欢迎各位老铁一键三连,本号后续会不断更新树莓派、人工智能、STM32、ROS小车相关文章和知识。

大家对感兴趣的知识点可以在文章下面留言,我可以优先帮大家讲解哦

欢迎大家光临我的淘宝小店【玩转智能机器人】,会定期推出教程中使用的物美价优的硬件,你的光临就是对我的支持

原创不易,转载请说明出处。文章来源地址https://www.toymoban.com/news/detail-460148.html

到了这里,关于网络测试工具—— iperf2详细使用方法的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 网络性能测试工具:iperf3

    iperf3 是一个网络性能测试工具(iperf3下载地址)。iperf可以测试TCP和UDP带宽质量。iperf可以测量最大TCP带宽,具有多种参数和UDP特性。iperf可以报告带宽,延迟抖动和数据包丢失。 iperf3是一种用于主动测量IP网络上可实现的 最大带宽 的工具。 它支持调整与时序、缓冲区和协议(

    2024年02月16日
    浏览(34)
  • 网络性能测试工具 iperf3

    iperf3软件下载地址:https://liyouchen.lanzoul.com/iZmaI0otb1de 下载到电脑到,并解压后,会得到两个文件:cygwin1.dll 和 iperf3.exe,这两个文件拷贝到 c:windows 目录下 最后打开 cmd,执行 iperf3 --version ,若安装成功,会打印出版本信息 最后要在使用前,关闭防火墙 iperf3 有客户端 和 服务

    2024年02月12日
    浏览(70)
  • iperf3 网络带宽测试工具

    iperf3 是一个 TCP, UDP, 和 SCTP (传输层协议)网络带宽测量工具. iperf 是一个用于主动测量 IP 网络上最大可用带宽的工具. 它支持与时间、协议和缓冲区相关的各种参数的调优. 对于每个测试,它报告测量的吞吐量/比特率(带宽), 丢包率和其他参数. 这个版本,有时被称为 iperf3, 是

    2024年02月05日
    浏览(31)
  • Linux环境安装iperf3(网络性能测试工具)

    iperf官网地址: iPerf - The TCP, UDP and SCTP network bandwidth measurement tool   iperf特性: 测量带宽 报告MSS/MTU大小和观察到的读数大小。 通过套接字缓冲区支持TCP窗口大小。 UDP 客户端可以创建指定带宽的UDP流。 测量数据包丢失 测量延迟抖动 支持多播 跨平台:Windows、Linux、Android、

    2024年02月03日
    浏览(32)
  • Linuxc centos下的网络性能测试命令iperf、iperf2、iperf3(常用于网络测速)

    目                录 一、网络性能测试命令介绍 (一)Iperf (二)iperf2 (三)iperf3 (四)几个命令的比较 二、使用场景 三、iperf命令详解 (一)安装 (二)命令 (三)启动和停止 1、启动服务端 2、启动客户端 3、停止命令 (四)应用 1、测试网络连接的带宽和吞吐量

    2024年01月21日
    浏览(33)
  • 网络丢包带宽测试工具 iperf3 简单认知

    iperf3  是一种网络性能测试工具 工作中用到,这里简单介绍 理解不足小伙伴帮忙指正 对每个人而言,真正的职责只有一个:找到自我。然后在心中坚守其一生,全心全意,永不停息。所有其它的路都是不完整的,是人的逃避方式,是对大众理想的懦弱回归,是随波逐流,是

    2024年02月05日
    浏览(33)
  • iperf3网络带宽性能测试工具 局域网网络最大带宽高阶教程

            iperf3 是一个 TCP, UDP, 和 SCTP (传输层协议)网络带宽测量工具,iperf 是一个用于主动测量 IP 网络上最大可用带宽的工具. 它支持与时间、协议和缓冲区相关的各种参数的调优. 对于每个测试,它报告测量的吞吐量/比特率(带宽), 丢包率和其他参数, iperf的版本不向下兼

    2024年02月20日
    浏览(25)
  • 带宽测试工具 iperf3

    带宽测试工具-iperf3 iperf3是一款带宽测试工具,它支持调节各种参数,比如通信协议,数据包个数,发送持续时间,测试完会报告网络带宽,丢包率和其他参数。 操作系统:centos7.0 软件下载网址:https://iperf.fr/iperf-download.php(选择对应的发行版) 软件名称:iperf3-3.1.3-1.fc24.

    2023年04月09日
    浏览(25)
  • 服务器带宽测试工具:iPerf的安装与使用

    Linux 环境安装及相关使用命令: 一、安装 iperf3 1、 yum 安装 2、其他操作系统可以下载官网的软件包 下载完成后可以通 rpm -ivh 进行安装。 官网地址: https://iperf.fr/iperf-download.php 二、服务端启动命令 1、开启 ipert3 服务器端 2、客户端测速命令 举个例子: Windows 环境安装及相关

    2024年02月07日
    浏览(47)
  • 【十年网络安全工程师整理】—100渗透测试工具使用方法介绍

     渗透测试是指渗透人员在不同的位置(比如从内网、从外网等位置)利用各种手段对 某个特定网络进行测试,以期发现和挖掘系统中存在的漏洞,然后输出渗透测试报告, 并提交给网络所有者。网络所有者根据渗透人员提供的渗透测试报告, 可以清晰知晓系统中存在的安

    2024年02月02日
    浏览(38)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包