Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Mar 2001 22:18:03 +0200
From:      Ruslan Ermilov <ru@FreeBSD.ORG>
To:        David Malone <dwmalone@maths.tcd.ie>
Cc:        freebsd-net@FreeBSD.ORG
Subject:   Re: UDP datagram max size.
Message-ID:  <20010314221803.A80894@sunbay.com>
In-Reply-To: <200103141703.aa78458@salmon.maths.tcd.ie>; from dwmalone@maths.tcd.ie on Wed, Mar 14, 2001 at 05:03:10PM %2B0000
References:  <200103141703.aa78458@salmon.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Mar 14, 2001 at 05:03:10PM +0000, David Malone wrote:
> I'm trying to figure out what #define I should use for the largest
> UDP datagram. The header files don't seem to define a constant for
> this. The correct size would seem to be 65535 'cos there are two
> bytes in the UDP header for the size.
> 
> IP_MAXPACKET and IPV6_MAXPACKET are available and have the right
> values, but these don't really seem to be the correct thing to use
> 'cos they don't take headers or the possibility Jumbo payload into
> account.
> 
> I wanted to commit something for:
> 
> 	http://www.FreeBSD.org/cgi/query-pr.cgi?pr=25050
> 
> but I'm not convinced that the patch is spot on. I could determine
> the data size and malloc memory dynamically I guess.
> 
The maximum size of IPv4 UDP datagram is 65535-28=65507:

	IP_MAXPACKET - sizeof(struct ip) - sizeof(struct udp)

provided that the send/receive buffers were set appropriately:

: tcpdump: listening on lo0
: 127.0.0.1.49431 > 127.0.0.1.1:  udp 65507 (frag 7691:16360@0+)
: 127.0.0.1 > 127.0.0.1: (frag 7691:16360@16360+)
: 127.0.0.1 > 127.0.0.1: (frag 7691:16360@32720+)
: 127.0.0.1 > 127.0.0.1: (frag 7691:16360@49080+)
: 127.0.0.1 > 127.0.0.1: (frag 7691:75@65440)



-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010314221803.A80894>