UDP max datagram size

Heiko Wundram me+python at modelnine.org
Wed Apr 12 05:01:04 EDT 2006


Am Mittwoch 12 April 2006 10:26 schrieb Iain King:
> Hi.  I've been looking everywhere for this and can't find it, apologies
> if I'm being obtuse:  How do I set the max datagram packet size?  I'm
> using the socket module.  It seem like it's hardcoded at 255, but I
> need it to be larger.

The minimal size any IP-stack has to be able to handle is 512 bytes. Normally, 
modern IP stacks will handle packets up to 4096 bytes and possibly larger 
packets (with correct fragmentation and rejoining). But this depends on the 
IP stack that's used to send and to receive the packet.

Anyway, a maximum size of 255 bytes is certainly not true for UDP packets.

--- Heiko.



More information about the Python-list mailing list