平均 UDP 数据包丢失和数据包重新排序
我想向 SO'ers 伙伴们学习有关 UDP 数据包丢失(或丢失)问题的经验。
最初我的理解是,考虑到网卡通过交叉电缆连接的直接点对点连接和网卡上充足的缓冲区以及对所述缓冲区的及时处理,“应该”不存在数据包丢失或数据包排序问题。我相信,考虑到在这两点之间有一个良好/高端的切换,情况也是如此。
排除上述情况,LAN 上预期的平均 UDP 数据包丢失是多少
哪些情况会导致 UDP 数据包排序问题?
I'd like to garner fellow SO'ers experience with regards to the issue of UDP packet loss (or drop-out).
Initially my understanding is that given direct point to point connections where the NICs are connected via a crossover cable and ample buffer on the NICs and timely processing of said buffers, that there 'should' be no packet loss or packet ordering issues. I believe this is also the case given one good/high-end switch in between the points.
Excluding the above scenario, what is the expected average UDP packet loss over a LAN
What scenarios cause UDP packet ordering issues?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在我的基本千兆位交换 LAN 上,使用 FreeBSD、Solaris 或 Linux,即使每秒 50,000 个数据包,也能实现零数据包丢失。
然而 Windows 是相当特殊的,我很容易在完全相同的硬件上以低速(例如每秒 10,000 个)看到数据包丢失。这主要是由于 WinSock 和 NIC 之间的缓冲区溢出造成的,如果您驱动数据包的速度更快,则会丢失更多的数据包,如果您将数据包间隔开,则丢失的数据包会更少。
没有神奇的数字,我的情况可能更糟,因为 Broadcom 的 Windows 驱动程序很糟糕。
您可以轻松地看到数据包排序问题,但几乎总是只有最后两个数据包被交换。这是开关功能的产物。
有趣的是,您在 Wi-Fi 中没有提到的是,无线电信号很容易受到干扰和环境条件的影响。
On my basic gigabit switched LAN I get zero packet loss at even 50,000 packets per second, with FreeBSD, Solaris or Linux.
However Windows is something quite special, I easily see packet loss on exactly the same hardware at low speeds such as 10,000 per second. This is mainly due to buffer overflow between WinSock and the NIC, if you drive the packets faster you lose more, if you space out the packets you drop less.
There is no magical number, my situation is probably worse due to Broadcom having terrible Windows drivers.
You can easily see packet ordering issues, however it is almost always only the last two packets switched. This is an artifact of how switches function.
Interestingly what you haven't mentioned in Wi-Fi, radio signals are highly subject to interference and environmental conditions.
我也在寻找预期的平均值。我发现直接链路(PC 到 PC)丢包的情况很少发生,尽管确实会发生。 1 kB 数据包 @ 50 Hz 时的可用性约为 99.9%。
我见过仅通过在同一网络接口上发送和接收来重新排序。
我得出的结论是,发生这种情况是因为每个数据包都是异步处理的,因此有可能在新收到的数据包之前收到的数据包之前先处理新到达的数据包。
I too am looking for an expected average. I found that from a direct link (PC to PC) packet loss occurs very rarely, although it definitely occurs. Availability was something like 99.9% at 1 kB packets @ 50 Hz.
I have seen reordering just by sending and receiving on the same network interface.
I concluded that this occurs because each packet is handled asynchronously so that there is a chance of a newly arrived packet being processed before packets received prior to the newly received one.
不知道平均 LAN 上的 UDP 数据包丢失情况。我认为现代交换网络的负载相当低,否则您的 LAN 或端点负载过高。 :)
当路由向上和向下时,重新排序可能是最容易实现的;比如说,您组织中的一台交换机承受了足够的负载,因此重新组织树是有意义的,并且流量通过不同的交换机发送。更有可能的是,您的 ISP 的对等点来来往往,或者达到流量限制,并且通过它们的数据包的优先级发生变化 - 旧数据包在重负载网络上传输,新数据包在轻负载网络上传输,并且他们到达时没有按顺序。
No idea on the UDP packetloss on average LANs. I assume reasonably low on modern switched networks, otherwise your LAN or endpoints are too highly loaded. :)
The re-ordering is probably easiest to achieve when routes are brought up and down; say, one of the switches in your organization is under enough load that re-organizing the tree makes sense and traffic is sent through different switches. More likely is your ISP's peers coming and going, or reaching traffic limits, and the priority of packets through them changes -- old packets were in flight on the heavy-loaded network, new packets are in flight on the lighter-loaded network, and they arrive out of order.