iperf、linux 调度报告的丢失的 UDP 数据包数量可变?

iperf、linux 调度报告的丢失的 UDP 数据包数量可变?

我正在测试与在 Bananpi M2+ 单板计算机(Debian,5.1.1-BPI-Kernel #1 SM)上运行的 iperf 服务器(iperf 版本 2.0.13(2019 年 1 月 21 日)pthreads)的连接。对于不同的目标带宽,我观察到不同的数据包丢失率。对于非常低和非常高的目标带宽设置(低于 1%),丢失的数据包数量很少。然而,对于中等值,丢失的数据包数量非常高(例如,在 400 Mbps 时丢失了 29% 的数据包)。什么可能导致这种行为?(详细结果见下文)。这是测试网络中发生的唯一通信(因此丢失必须发生在目标端)。

我已经尝试调整 UDP 套接字的大小,但并没有改善结果。

------------------------------------------------------------
Server listening on UDP port 5001
Receiving 1470 byte datagrams
UDP buffer size: 3.81 MByte (WARNING: requested 1.91 MByte)
------------------------------------------------------------
[  3] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 37950
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3]  0.0-10.0 sec  11.9 MBytes  10.0 Mbits/sec   0.195 ms    0/ 8504 (0%)
[  4] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 32833
[  4]  0.0-10.0 sec   118 MBytes  98.9 Mbits/sec   0.306 ms  571/85034 (0.67%)
[  3] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 56833
[  3]  0.0-10.0 sec   344 MBytes   288 Mbits/sec   0.053 ms 9951/255103 (3.9%)
[  4] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 51751
[  4]  0.0-10.0 sec   337 MBytes   283 Mbits/sec   0.026 ms 99684/340136 (29%)
[  3] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 53331
[  3]  0.0-10.0 sec   512 MBytes   429 Mbits/sec   0.018 ms 60157/425171 (14%)
[  4] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 35110
[  4]  0.0-10.0 sec   832 MBytes   698 Mbits/sec   0.014 ms 1860/595239 (0.31%)
[  3] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 52002
[  3]  0.0-10.0 sec  1.04 GBytes   897 Mbits/sec   0.013 ms 2895/765308 (0.38%)

更新 对于 400 Mbps,当我以默认优先级运行 iperf 作为进程时,我得到以下结果:

pi@bpi2:~$ iperf -s -u 
------------------------------------------------------------
Server listening on UDP port 5001
Receiving 1470 byte datagrams
UDP buffer size: 25.0 MByte (default)
------------------------------------------------------------
[  3] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 44269
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3]  0.0-10.0 sec   379 MBytes   318 Mbits/sec   0.030 ms 69509/340136 (20%)
[  4] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 53115
[  4]  0.0-10.0 sec   463 MBytes   389 Mbits/sec   0.022 ms 9715/340137 (2.9%)
[  3] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 39077
[  3]  0.0-10.0 sec   431 MBytes   362 Mbits/sec   0.031 ms 32537/340136 (9.6%)
[  4] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 47676
[  4]  0.0-10.0 sec   363 MBytes   305 Mbits/sec   0.029 ms 81019/340136 (24%)
[  3] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 52106
[  3]  0.0-10.0 sec   407 MBytes   341 Mbits/sec   0.030 ms 49872/340136 (15%)

当我设置最高优先级时:

pi@bpi2:~$ sudo ionice -c 1 -n 0 nice -n -20 iperf -s -u       
------------------------------------------------------------
Server listening on UDP port 5001
Receiving 1470 byte datagrams
UDP buffer size: 25.0 MByte (default)
------------------------------------------------------------
[  3] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 59056
[ ID] Interval       Transfer     Bandwidth        Jitter   Lost/Total Datagrams
[  3]  0.0-10.0 sec   460 MBytes   386 Mbits/sec   0.022 ms 11665/340137 (3.4%)
[  4] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 54558
[  4]  0.0-10.0 sec   450 MBytes   378 Mbits/sec   0.039 ms 18941/340137 (5.6%)
[  3] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 34361
[  3]  0.0-10.0 sec   437 MBytes   366 Mbits/sec   0.029 ms 28662/340137 (8.4%)
[  4] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 47201
[  4]  0.0-10.0 sec   474 MBytes   398 Mbits/sec   0.033 ms 1953/340136 (0.57%)
[  3] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 34809
[  3]  0.0-10.0 sec   442 MBytes   371 Mbits/sec   0.030 ms 24886/340136 (7.3%)
[  4] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 54412
[  4]  0.0-10.0 sec   429 MBytes   360 Mbits/sec   0.037 ms 34388/340138 (10%)
[  3] local 192.168.1.11 port 5001 connected with 192.168.1.201 port 55946
[  3]  0.0-10.0 sec   446 MBytes   374 Mbits/sec   0.034 ms 22341/340136 (6.6%)

答案1

与此同时,我自己也找到了解决方案。iperf 出现这种奇怪行为的原因不是应用程序本身,而是 NIC 驱动程序出现故障(很可能是 GbE 延迟设置不正确导致的)。

有帮助的是完全重新安装操作系统并切换到具有正确驱动程序集的 Armbian 4.19。我设法在 armbian 论坛中找到了解决方案,它为任何对全志 h3 SoC 感兴趣的人提供了非常广泛的信息(就像我在 BananaPi M2+ 中使用的一样,还有许多其他产品)。

相关内容