I'm writing a networked iOS game. When sending packets with GKMatchSendDataReliable
(which I assumed was UDP with their own packet reception code written) at 60 packets per second (so 16 ms between adjacent packets), average ping times rapidly get worse: I opened 7 GameCenter matches below (one after the other) and simply sent a "flood" of 100 packets (at a rate of 60 packets per second). I measured the average roundtrip time, and these are the results:
[ 21:16:39 ]: I saw an average roundtrip time of 52.342787 ms, he saw 54.496590 ms
[ 21:16:34 ]: I saw an average roundtrip time of 62.631942 ms, he saw 61.991655 ms
[ 21:16:45 ]: I saw an average roundtrip time of 88.394380 ms, he saw 83.619123 ms
[ 21:16:51 ]: I saw an average roundtrip time of 179.053118 ms, he saw 156.869141 ms
[ 21:16:57 ]: I saw an average roundtrip time of 75.025076 ms, he saw 75.419723 ms
[ 21:17:23 ]: I saw an average roundtrip time of 8832.082488 ms, he saw 7616.877558 ms
[ 21:19:33 ]: I saw an average roundtrip time of 25088.962344 ms, he saw 16833.064914 ms
After the last 2 tests the results are around 1000 ms.
It would seem that I'm being throttled, most likely by my ISP. Because this is an iOS game, people will use regular residential connections.
When I changed the packet send rate to being 10 times slower (so 1 packet every 160 ms), the tests take much longer, but roundtrip times remain consistently low.
[ 21:31:27 ]: I saw an average roundtrip time of 55.289109 ms, he saw 69.032727 ms
So it looks like to keep low latency on the connection (and not be "punished" by ISPs) I have to reduce the rate of packets that I send. Keep in mind these are very small packets, like 40 bytes maximum, yet I'm still being throttled.
I'm looking for guidelines on how many UDP packets I can send per second to avoid being throttled! Are there any general guidelines anywhere?