[英]When does the Linux network stack drop received RTP packets?
I am debugging a packet loss issue with my C++ program receiving RTP.我正在调试接收 RTP 的 C++ 程序的丢包问题。 After my program ran for quite a long time receiving lots of RTP data, it starts to loose packets.
在我的程序运行很长时间接收大量 RTP 数据后,它开始丢失数据包。
Tracing with Wireshark shows the missing packets, but my application never receives them.使用 Wireshark 进行跟踪显示丢失的数据包,但我的应用程序从未收到它们。 It seems the network stack drops them before delivering them to the application.
网络堆栈似乎在将它们交付给应用程序之前丢弃它们。 After restarting my application all goes back to normal.
重新启动我的应用程序后,一切都恢复正常。
To produce the error condition, I overload the machine with RTP and at that time packet loss happens and for good reason.为了产生错误条件,我使用 RTP 使机器过载,并且当时发生了数据包丢失并且有充分的理由。 But even after I stop the overload and start sending at a moderate rate, packet loss still occurs and I have to restart my application to receive all data again.
但即使在我停止过载并开始以中等速率发送后,数据包丢失仍然发生,我必须重新启动我的应用程序以再次接收所有数据。
Is this an issue with Linux receive buffer handling?这是 Linux 接收缓冲区处理的问题吗? What Linux stats could I check to see where those missing packets go?
我可以检查哪些 Linux 统计信息来查看丢失的数据包去哪儿了?
You are not consuming your UDP input fast enough.您使用 UDP 输入的速度不够快。 Here are some usual steps to take to mitigate that:
以下是一些通常可以采取的措施来缓解这种情况:
recvmmsg(2)
if your kernel supports it to reduce system call overhead,recvmmsg(2)
,setsockopt(2)
),setsockopt(2)
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.