iperf 测试网络带宽
100BASE-TX
iPerf - The ultimate speed test tool for TCP, UDP and SCTP
- Test the limits of your network + Internet neutrality test
编译安装 iperf
windows 端直接下载二进制文件
- iPerf 3.1.3 (8 jun 2016 - 1.3 MiB for Windows Vista 64bits to Windows 10 64bits)
嵌入式平台需要从源码[[交叉编译]]安装
- iPerf C++ source | iPerf 3.1.3 |8 jun 2016|537 KiB|
交叉编译安装
export PATH="/code/gcc-linaro-7.5.0-2019.12-x86_64_armlinux-gnueabihf/bin":$PATH
export CROSS_COMPILE=arm-linux-gnueabihf-
mkdir build_out; cd build_out
../configure --prefix=/code/glibc-2.35/build_out \
--host=arm-linux-gnueabihf
make
make install
测试
嵌入式客户端
root@nxp:/# iperf3 -c 192.168.3.229 -i 10 -t 60 -u -b 1000M -A 2
Connecting to host 192.168.3.229, port 5201
[ 4] local 192.168.3.250 port 42474 connected to 192.168.3.229 port 5201
[ ID] Interval Transfer Bandwidth Total Datagrams
[ 4] 0.00-10.00 sec 1.12 GBytes 958 Mbits/sec 146184
[ 4] 10.00-20.00 sec 1.12 GBytes 958 Mbits/sec 146232
[ 4] 20.00-30.00 sec 1.12 GBytes 958 Mbits/sec 146205
[ 4] 30.00-40.00 sec 1.12 GBytes 958 Mbits/sec 146232
[ 4] 40.00-50.00 sec 1.12 GBytes 958 Mbits/sec 146232
[ 4] 50.00-60.00 sec 1.12 GBytes 958 Mbits/sec 146235
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 4] 0.00-60.00 sec 6.69 GBytes 958 Mbits/sec 637732049.574 ms 389951/389962 (1e+02%)
[ 4] Sent 389962 datagrams
iperf Done.
测试概要:
- 测试工具: iperf3
- 测试时间: 60 秒
- 客户端 IP: 192.168.3.250
- 服务器 IP: 192.168.3.229
带宽测试结果:
- 传输量(Transfer): 在测试期间共传输了 6.69 GBytes 的数据。
- 带宽(Bandwidth): 平均带宽约为 958 Mbits/秒。
- 抖动(Jitter): 抖动非常高,平均达到了 637,732,049.574 毫秒。
- 丢包率(Lost/Total Datagrams): 共丢失了 389,951 个数据包中的 389,951 个(丢包率达到了 100%)。
测试详细信息:
- 带宽测试开始后,平均带宽稳定在约 958 Mbits/秒。
- 抖动(Jitter)非常高,每个测试间隔都显示非常大的抖动值,可能表明网络连接不稳定。
- 丢包率达到了 100%,所有的数据包都丢失了,这也是网络连接不稳定的表现。
结论:
根据测试结果,可以得出以下结论:
- 测试中的带宽表现良好,平均带宽约为 958 Mbits/秒,这表示在某些方面网络连接是高速的。
- 高抖动值表明网络连接不稳定,导致数据包传输的不一致性。
- 丢包率达到了 100%,所有的数据包都丢失了,这也是网络连接不稳定的表现。
建议进一步分析和排除网络问题,以改善网络性能和稳定性。网络连接的高带宽潜力可能受到抖动和丢包的影响,因此优化网络连接以减少这些问题可能会提高性能。在执行网络性能测试时,低抖动和低丢包率通常是期望的结果,可以提供更稳定和高速的网络连接。
windows server
PS C:\Users\vc++6.0\Downloads\iperf-3.1.3-win64\iperf-3.1.3-win64> .\iperf3.exe -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.3.250, port 60790
[ 5] local 192.168.3.229 port 5201 connected to 192.168.3.250 port 55010
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 5] 0.00-1.01 sec 184 KBytes 1.49 Mbits/sec 301187251.198 ms 0/23 (0%)
[ 5] 1.01-2.01 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 2.01-3.01 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 3.01-4.00 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 4.00-5.01 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 5.01-6.00 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 6.00-7.00 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 7.00-8.00 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 8.00-9.00 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 9.00-10.01 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 10.01-11.01 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 11.01-12.00 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 12.00-13.00 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 13.00-14.00 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 14.00-15.00 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 15.00-16.00 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 16.00-17.01 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 17.01-18.00 sec 0.00 Bytes 0.00 bits/sec 301187251.198 ms 0/0 (0%)
[ 5] 18.00-19.00 sec 120 KBytes 986 Kbits/sec 114394655.053 ms 274384/274399 (1e+02%)
[ 5] 19.00-20.00 sec 0.00 Bytes 0.00 bits/sec 114394655.053 ms 0/0 (0%)
[ 5] 20.00-21.00 sec 0.00 Bytes 0.00 bits/sec 114394655.053 ms 0/0 (0%)
[ 5] 21.00-22.00 sec 0.00 Bytes 0.00 bits/sec 114394655.053 ms 0/0 (0%)
[ 5] 22.00-23.01 sec 0.00 Bytes 0.00 bits/sec 114394655.053 ms 0/0 (0%)
[ 5] 23.01-24.01 sec 0.00 Bytes 0.00 bits/sec 114394655.053 ms 0/0 (0%)
[ 5] 24.01-25.00 sec 0.00 Bytes 0.00 bits/sec 114394655.053 ms 0/0 (0%)
[ 5] 25.00-26.01 sec 0.00 Bytes 0.00 bits/sec 114394655.053 ms 0/0 (0%)
[ 5] 26.01-27.01 sec 0.00 Bytes 0.00 bits/sec 114394655.053 ms 0/0 (0%)
[ 5] 27.01-28.01 sec 0.00 Bytes 0.00 bits/sec 114394655.053 ms 0/0 (0%)
[ 5] 28.01-29.01 sec 128 KBytes 1.05 Mbits/sec 40732978.068 ms 146944/146960 (1e+02%)
[ 5] 29.01-30.01 sec 0.00 Bytes 0.00 bits/sec 40732978.068 ms 0/0 (0%)
[ 5] 30.01-31.01 sec 0.00 Bytes 0.00 bits/sec 40732978.068 ms 0/0 (0%)
[ 5] 31.01-32.00 sec 0.00 Bytes 0.00 bits/sec 40732978.068 ms 0/0 (0%)
[ 5] 32.00-33.00 sec 0.00 Bytes 0.00 bits/sec 40732978.068 ms 0/0 (0%)
[ 5] 33.00-34.00 sec 0.00 Bytes 0.00 bits/sec 40732978.068 ms 0/0 (0%)
[ 5] 33.00-34.00 sec 0.00 Bytes 0.00 bits/sec 40732978.068 ms 0/0 (0%)
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 5] 0.00-34.00 sec 0.00 Bytes 0.00 bits/sec 40732978.068 ms 421328/421382 (1e+02%)
测试概要:
- 测试工具: iperf3
- 测试时间: 34 秒
- 服务器 IP: 192.168.3.229
- 客户端 IP: 192.168.3.250
带宽测试结果:
- 传输量(Transfer): 在测试期间共传输了 184 KBytes 的数据。
- 带宽(Bandwidth): 平均带宽约为 1.49 Mbits/秒。
- 抖动(Jitter): 抖动非常高,平均达到了 301,187,251.198 毫秒。
- 丢包率(Lost/Total Datagrams): 共丢失了 421,328 个数据包中的 421,328 个(丢包率达到了 100%)。
测试详细信息:
- 测试开始后,带宽在测试的前几秒内表现得非常低,平均带宽只有 1.49 Mbits/秒。
- 抖动(Jitter)非常高,每个测试间隔都显示非常大的抖动值,可能表明网络连接不稳定。
- 在测试的中间阶段,带宽测试结果显示了一些数据包的传输,但仍然非常低。
- 在测试的最后,带宽略有增加,但仍然很低,且丢包率高达 100%。
结论:
根据测试结果,可以得出以下结论:
- 测试中的带宽非常低,平均值约为 1.49 Mbits/秒,这可能表明存在网络性能问题。
- 高抖动值表明网络连接不稳定,导致数据包传输的不一致性。
- 丢包率达到了 100%,所有的数据包都丢失了,这也是网络连接不稳定的表现。
建议进一步分析和排除网络问题,以改善网络性能和稳定性。这可以包括检查网络硬件、减少网络拥塞、优化网络配置等措施。在执行网络性能测试时,低抖动和低丢包率通常是期望的结果,可以提供更稳定和高速的网络连接。