如何调试丢包? [英] How to debug packet loss?

查看:161
本文介绍了如何调试丢包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个C ++应用程序(在Linux上运行),它提供大约400 kbps的RTP流。对大多数目的地这工作正常,但一些目的地经验包丢失。有问题的目的地似乎有一个较慢的连接共同,但它应该足够快足够快的流我发送。

I wrote a C++ application (running on Linux) that serves an RTP stream of about 400 kbps. To most destinations this works fine, but some destinations expericence packet loss. The problematic destinations seem to have a slower connection in common, but it should be plenty fast enough for the stream I'm sending.

由于这些目的地能够接收类似

Since these destinations are able to receive similar RTP streams for other applications without packet loss, my application might be at fault.

我已经验证了一些东西:
- 在tcpdump中,我看到所有在发送机上发送的RTP数据包
- 有一个UDP发送缓冲区(我尝试大小在64KB和300KB之间)
- RTP数据包大多留在1400字节以下以避免碎片

I already verified a few things: - in a tcpdump, I see all RTP packets going out on the sending machine - there is a UDP send buffer in place (I tried sizes between 64KB and 300KB) - the RTP packets mostly stay below 1400 bytes to avoid fragmentation

发送应用程序可以做什么来最小化数据包丢失的可能性,以及什么是调试这种情况的最佳方法?

What can a sending application do to minimize the possibility of packet loss and what would be the best way to debug such a situation ?

推荐答案

不要以大的突发块发送数据包。

Don't send out packets in big bursty chunks.

数据包丢失通常是由于路由器速度较慢而带有有限的数据包缓冲区大小造成的。慢速路由器可能能够处理1 Mbps就好了,如果有时间发出说,10个数据包在接收另一个10,但是如果100 Mbps发送器端发送它一个大块50个数据包,它别无选择,其中的40个。

The packet loss is usually caused by slow routers with limited packet buffer sizes. The slow router might be able to handle 1 Mbps just fine if it has time to send out say, 10 packets before receiving another 10, but if the 100 Mbps sender side sends it a big chunk of 50 packets it has no choice but to drop 40 of them.

尝试分发发送,以便您只写每个时间段所需的内容。如果你必须每五分之一秒写一个数据包,这样做,而不是每秒写5个数据包。

Try spreading out the sending so that you write only what is necessary to write in each time period. If you have to write one packet every fifth of a second, do it that way instead of writing 5 packets per second.

这篇关于如何调试丢包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆