问题
So i'm writing an app that sends 5Kb packets out 15 times a second through UDP. 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. What would cause this?
回答1:
It's not surprising that they are all dropped. A payload bigger than 512 bytes is unlikely to make it out of the network. It depends on the MTU of your router and how much bandwidth is allocated to UDP / internet traffic on the router.
回答2:
You'll be lucky to get any UDP datagram larger than about 1260 bytes at all. The generally accepted limit for UDP through routers is 534 bytes, which derives somehow from the IPv4 non-fragmentation minimum of 576 bytes.
来源:https://stackoverflow.com/questions/15825298/android-udp-packet-loss