Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Enjoy members-only rewards and discounts
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

如何使用“iperf”测试可用网络带宽

Summary: 本文提供有关如何测试可用网络带宽的信息。

This article may have been automatically translated. If you have any feedback regarding its quality, please let us know using the form at the bottom of this page.

Article Content


Symptoms

如何测试可用网络带宽

1.下载 iperf 实用程序。  可在 iperf.fr 找到拷贝
2.在将接收数据的服务器上,打开提升的命令窗口并运行以下命令:“iperf.exe –s –w 2m”。
    3.在将发送数据的服务器上,打开提升的命令窗口并运行以下命令:“iperf –c x.x.x.x –w 2m –t 30s –i 1s”。  将 x.x.x.x 替换为步骤 2 中服务器的 IP 地址。
    4.查看从步骤 3 返回到服务器上的数据。  输出应类似于以下文本:

 
C:\Users\some_user\Downloads>iperf -c xx.xx.xx.xx -w 2m -t 30s -i 1s
------------------------------------------------------------
Client connecting to xx.xx.xx.xx, TCP port 5001
TCP window size:2.00 MByte
------------------------------------------------------------
[156] local xx.xx.xx.xx port 53724 connected with xx.xx.xx.xx port 5001
[ ID] Interval       Transfer     Bandwidth
[156]  0.0- 1.0 sec  113 MBytes  945 Mbits/sec
[156]  1.0- 2.0 sec  112 MBytes  944 Mbits/sec
[156]  2.0- 3.0 sec  113 MBytes  945 Mbits/sec
.
.
.
[156] 28.0-29.0 sec  113 MBytes  945 Mbits/sec
[156] 29.0-30.0 sec  112 MBytes  944 Mbits/sec
[156]  0.0-30.3 sec   3.30 GBytes  945 Mbits/sec

 
其他信息:

Iperf 是常用的网络测试工具,可以创建 TCP 和 UDP 数据流并测量承载它们的网络的吞吐量。

Iperf 允许用户设置可用于测试网络,或者用于优化或调整网络的各种参数。Iperf 具有客户端和服务器功能,可以单向或双向测量两端之间的吞吐量。它是开源软件,可在 Linux、Unix 和 Windows 等各种平台上运行。

上面的示例命令运行缓冲区大小为 2 MB 的单向测试。  测试运行 30 秒,每秒显示一次结果。  有关更高级的测试,请参阅下面的完整语法。
 

常规选项:  


-f, --format
[kmKM] 报告格式:Kbits、Mbits、KBytes、MBytes

-h, --help
打印帮助大纲

-i, --interval n
在定期带宽报告之间暂停 n 秒

-l, --len n[KM]
将读/写缓冲区长度设置为 n(默认为 8 KB)

-m, --print_mss
打印 TCP 最大数据段长度(MTU - TCP/IP 标头)

-o, --output <filename>
将报告或错误消息输出到此指定文件

-p, --port n
将要侦听/连接的服务器端口设置为 n(默认为 5001)

-u, --udp
使用 UDP 而不是 TCP

-w, --window n[KM]
TCP 窗口大小(套接字缓冲区大小)

-B, --bind <host>
绑定到<host>,接口或多播地址

-C, --compatibility
用于较低版本,不发送额外消息

-M, --mss n
设置 TCP 最大数据段长度(MTU - 40 字节)

-N, --nodelay
设置 TCP no delay,禁用 Nagle 算法

-v, --version
打印版本信息并退出

-V, --IPv6Version
将域设置为 IPv6

-x, --reportexclude
[CDMSV] 排除 C(connection) D(data) M(multicast) S(settings)
V(server) 报告

-y, --reportstyle C|c
是否设置 C 或 c 报告结果为 CSV(逗号分隔值)

特定于服务器的选项:  

-s, --server
在服务器模式下运行

-U, --single_udp
在单线程 UDP 模式下运行

-D, --daemon
将服务器作为守护程序运行

特定于客户端的选项:

-b, --bandwidth n[KM]
将目标带宽设置为 n 位/秒(默认为 1 Mbit/秒)。此
设置需要 UDP (-u)。

-c, --client<host>
在客户端模式下运行,连接到<host>

-d, --dualtest
同时执行双向测试

-n, --num n[KM]
要传输的字节数(而不是 -t)

-r, --tradeoff
单独执行双向测试

-t, --time n
传输时间,以秒为单位(默认为 10 秒)

-F, --fileinput <name>
从文件输入要传输的数据

-I, --stdin
从 stdin 输入要传输的数据

-L, --listenport n
接收回双向测试的端口

-P, --parallel n
要并行运行的客户端线程数

-T, --ttl n
多播的存活时间(默认为 1)

-Z, --linux-congestion <algo>
设置 TCP 拥塞控制算法(仅限 Linux)


来源:WikipediaManpagez

 

Cause

Resolution

Article Properties


Affected Product

Desktops & All-in-Ones, Laptops, Servers, PowerEdge

Last Published Date

06 Oct 2021

Version

4

Article Type

Solution