RE: UDP practical limits

"Nicolas Romantzoff" <[email protected]>
Newsgroups gmane.games.devel.general
Message-ID <[email protected]>
> (1) What size limit on UDP packets is imposed by the
>     UDP specification?

IP Packet maximal size is 65535. When removing IP/UDP headers (28
bytes), you get a max data size of 65507 bytes.

> 
> (2) What size limit on UDP packets is imposed by the 
>     operating system (Windows, Linux, ...), and how
>     can I query the OS for these limits?

Don't know any OS "adding" limits on UDP packets. Wouldn't be compliant
with standards.
Some socket options do contain the max size for a given socket.

> 
> (3) What is the practical limit of UDP packets going across the
>     wild Internet, through dozens of routers with various 
>     policies?

Strictly speaking of UDP packets, nothing else.

Note however that when a packet size is greater than a given value
(MTU), it might be fragmented into several packets and recombined later
when possible. This can happen several time on each router. Usually that
MTU is around 1500 bytes. 

It is strongly encouraged when communicating with another host to
discover the MTU on the path. Though the path may change (and therefode
MTU) it is unlikely to happen very often. Using MTU max size for packets
will avoid adding extra IP/UDP headers during communication.


> 
>   (I know UDP is "unreliable", but I'd like to push UDP
>   packet size as high as possible without significantly
>   increasing the risk of UDP packets being quietly
>   dropped along the route to their destinations.)
> 

Simple: If your packet is fragmented into 'n' smaller ones, the final
packet will be lost 'n' times more often ! :)
So basically, the chance to loose a packet is around (Size/MTU) bigger.

Nicolas

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.656 / Virus Database: 421 - Release Date: 09/04/2004
 



-------------------------------------------------------
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.