User-agent: Mozilla Thunderbird 1.0.6 (Macintosh/20050716)
>From TCP/IP Illustrated (W Richard Stevens):
"Theoretically, the maximum size of an IP datagram is 65536 bytes,
imposed by the 16-bit total length field in the IP header. With an IP
header of 20 bytes and a UDP header of 8 bytes this leaves a maximum of
65507 bytes of user data in a UDP datagram. Most implementations
however provide less than this maximum."
He goes on to explain that there can be kernel limits or bugs that limit
the size of the datagram which is possible in this case but Stevens also
talks about API level restrictions:
"Most systems provide a default of just over 8192 bytes for the maximum
size of a UDP datagram that can be read or written."
This default is controlled by the default buffer sizes which are set via
DatagramSocket.setReceiveBufferSize() and
DatagramSocket.setSendBufferSize(). There are also get equivalents.
I'd suggest that you modify your program to invoke the get methods and
see what the values are. If the values are less than your preferred
packet size, try invoking the set methods and see if that makes the
difference.
Hope that helps,
Dan.
Jamie Curmi wrote:
>
> On 27/07/2005, at 5:04 PM, Moises Lejter wrote:
>
>> Jamie Curmi wrote:
>>
>>
>>> On Panther, you could send UDP packets > 16356 bytes from Java, and
>>> receive them without issue.
>>> On Tiger, any UDP packets > 16356 bytes are dropped. You just
>>> never receive them.
>>>
>>
>> I thought the max UDP packet size was limited to something like 8K
>> (system buffer size)... A google search found a reference to a page
>> in the MS Windows 2003 doc that claims that a UDP packet *must* be
>> less than 16384, and another discussion that suggests that whatever
>> the max size is has to include header info, so your actual payload
>> will be about 20 bytes less... Elsewhere someone says that the max
>> UDP packet size might have to be smaller than the smallest MTU on any
>> devices along the way, or the packet might not make it through...
>>
>> Bottom line, it seems to have to be small... :-)
>
>
> Have tested the code on Linux and Windows XP. Both can go all the way
> up to close to 64k.
>
> That is quite a difference between Panther and Tiger. Panther acts the
> same as all other platforms - but Tiger has an 8k limit. And no
> apparent way to change it.
>
> :-(
>
> Jamie
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Java-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/java-dev/email@hidden
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden