Re: UDP max packet size
Re: UDP max packet size
- Subject: Re: UDP max packet size
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Tue, 16 Nov 2010 09:22:18 +0000
On 15 Nov 2010, at 19:16, Jonathon Kuo wrote:
> I have a dedicated ad hoc network between two OSX devices, and I use UDP packets between them to transfer status messages, and this all works fine. The standard "max" size of a UPD packet is generally taken to be 512 bytes over the internet, but does this hold strictly true between two end points on a dedicated (local) network? Just wondering about the OSX UDP implementation, if it allows a SO_MAX_MSG_SIZE up to 64k bytes like Windows does?
You're mixing up the UDP maximum packet size with the UDP maximum packet size without fragmentation. The former is just under 64 KB (the IP max packet size minus the IP and UDP header overhead). The latter is determined by the link layers between you and your peer. The historical 512 byte limit is probably too low these days (smells like LocalTalk to me). Virtually all commonly-used link layers support a maximum packet size of 1500 bytes, or just under that (curse you PPPoE and your 1492 byte MTU!). So I'd expect that you could double your maximum UDP size to 1024 without running into major problems, even on the wider Internet. However, given that you have a dedicated network, you should be able to set your packet size based on knowledge of that network. If it's a standard Wi-Fi network, it uses 1500 byte Ethernet packets, from which you can subtract the IP and UDP header sizes to get your maximum UDP packet size.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden