简体   繁体   English

Android UDP数据包丢失

[英]Android UDP packet loss

So i'm writing an app that sends 5Kb packets out 15 times a second through UDP. 所以我正在写一个应用程序,它通过UDP每秒发送5Kb数据包15次。 I understand I will lose some packets but I seem to be losing all my packets after the first couple seconds. 我知道我会丢失一些数据包,但似乎在最初的几秒钟之后会丢失所有数据包。 Even if I slow it down to send the 5Kb packets out once every 10 seconds I will still lose them. 即使我放慢速度以每10秒发送5Kb数据包一次,我仍然会丢失它们。 What would cause this? 是什么原因造成的?

It's not surprising that they are all dropped. 它们都被丢弃并不奇怪。 A payload bigger than 512 bytes is unlikely to make it out of the network. 大于512字节的有效负载不太可能使其脱离网络。 It depends on the MTU of your router and how much bandwidth is allocated to UDP / internet traffic on the router. 这取决于路由器的MTU以及为路由器上的UDP / Internet通信分配多少带宽。

You'll be lucky to get any UDP datagram larger than about 1260 bytes at all. 您将很幸运获得所有大于约1260字节的UDP数据报。 The generally accepted limit for UDP through routers is 534 bytes, which derives somehow from the IPv4 non-fragmentation minimum of 576 bytes. 通过路由器的UDP的公认限制为534个字节,这是从576个字节的IPv4非分段最小值中得出的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM