Re: UDP practical limits

"Colin Fahey" <[email protected]>
Newsgroups gmane.games.devel.general
Message-ID <1b2401c420f0$862925e0$0301a8c0@pc350>
2004 April 12th
Monday

  Well, I'll roughly summarize what I encountered while doing
Google searching for answers, but perhaps people can add 
experiences or other hard facts to this thread.

  The limit for UDP data size is theoretically 65535 bytes,
just based on the unsigned 16-bit UDP Message Length field
in a UDP datagram.

  Then this is reduced by 28 bytes due to the fact that IP
packets also must be a maximum of 65535 bytes, and require
their own fields (headers and final CRC) -- reducing the
theoretical UDP data size to 65507 bytes (a number quoted
in various sources one can find via Google).

  However, according to one source, many OSes put an upper
limit of 8192 bytes on the UDP receive buffer, which puts
further limit on individual UDP packet sizes.  (I assume
this is after any packet re-assembly after potential 
fragmentation, since the receive buffer is "session layer"?)

  Other sources say that the 1526 byte-max Ethernet
frame size (Ethernet's "Maximum Transmission Unit" (MTU)
size) puts another de facto limit on UDP packet size --
since data larger than the 1500-byte payload limit for
a single Ethernet frame is necessarily fragmented, and
apparently some routing policies often don't call for
working very hard to handle fragmented UDP packets.

  One source said that really the only way to be confident
was to go all the way down to the minimum guaranteed UDP
packet size handled by hosts complying with specs: 512 bytes.

  One source said the following (as a "moral"):
"Avoid UDP if you really require reliable transmission of
large messages, otherwise you end up reinventing TCP protocol".

  Clearly UDP is great for many purposes, and TCP is great
for many other purposes.  Assuming UDP is the right choice
for a given purpose, it is interesting to consider the 
actual constraints imposed by the wild Internet.

--- Colin

[email protected]





-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Gamedevlists-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-general
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=557
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.