Skip to content Skip to sidebar Skip to footer

Udp Hole Punching Not Possible With Mobile Provider

actually iam coding an android app that receives the pictures of a webcam that it connected to a pc. To gain more fps i use the udp protocol instead of tcp. The idea is, that the

Solution 1:

There are several issues to keep in mind with UDP, which are magnified on mobile networks:

  • As you probably know, once you send a UDP datagram, there is absolutely no guarantee that it will get through and no sure way to know what happened if it didn't.

  • Payloads larger than roughly 1400 bytes are likely to be broken up into IP fragments. The receiving operating system may reassemble those into a whole packet, but only if every fragment arrives. Some routers drop fragments arbitrarily, some firewalls drop fragments if they contain particular byte patterns, and some limit the rate at which fragments may be sent. Its best to always keep your datagrams small and handle reassembly and repeats of missing pieces yourself.

  • There is no flow-control: if any router's buffer is full, everything after that is dropped. Some routers will begin randomly dropping a percentage of packets if their buffers are growing but not yet full. Some firewalls will blacklist a UDP source if it goes faster than some arbitrary threshold.

In general, device and firewall makers tend to treat UDP like crap so as a UDP developer you have to be an extra good citizen to not get dumped on: regulate your flow, remember that dropped packets mean you might be going too fast, and keep the packets small. There is a lot you can get away with in a controlled environment, but if the application will be deployed "in the wild" it will take a lot of careful programming to avoid problems.

Post a Comment for "Udp Hole Punching Not Possible With Mobile Provider"