[Twisted-Python] UDP with multiple connections

glyph at divmod.com glyph at divmod.com
Thu Oct 11 12:30:01 EDT 2007


On 03:20 pm, sipickles at hotmail.com wrote:
>UDP is often used in online gaming, where other methods are employed to 
>compensate for its weaknesses, in return for its speed.

"Speed" is an oversimplified way of explaining this usage.

Some games use a TCP control channel for most logical messages and UDP 
for updates to a small set of values where only the _most current_ value 
ever matters.  This is most often the position, orientation, and 
velocity of an object in the game world.  This can improve the apparent 
performance of twitchy games over lossy links.

Some games, having heard secondhand about this previous strategy, use 
UDP for everything because their implementors mistakenly believe that 
it's faster than TCP.  Often, these games eventually switch to TCP later 
in the development cycle when networking bugs and profiling indicate 
that the features of TCP are actually required or the performance 
"gains" are actually losses.  For example, routers on the public 
internet can and often do cheat in a variety of ways to use the 
additional information that TCP provides to make it go faster.  UDP 
can't take advantage of that and its overall throughput is often slower 
(especially on congested networks).




More information about the Twisted-Python mailing list