Archived

This topic is now archived and is closed to further replies.

fragmented UDP packets?

This topic is 5367 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

All packets can be fragmented by routers on the net, although the OS kernel of your machine makes the reassembly transparent to the application developper. Your application won''t know any difference and the total packet size that was sent will be correct on the receiving end. If possible, make your UDP packets shorter than 1400 bytes for better performance; some routers just hate large (>16K) packets and delay some of the sub-packets on purpose.

-cb

Share this post


Link to post
Share on other sites
quote:
Original post by BeanDog
Note: Under WinSock2, a UDP packet of size greater than 512 bytes may fragment. Keep ''em small!



That''s not true at all. winsock doesn''t define the standard - it''s just an API. RFC 768 defines the UDP protocol, not Winsock - UPD always, no matter which API you''re using, gaurantees that if a packet arrives to the client, it will arrive whole.

A packet may be fragmented by a router, but is always reassembled by the networking layer before being returned to the application.

If I had my way, I''d have all of you shot!


codeka.com - Just click it.

Share this post


Link to post
Share on other sites
From MSDN:
iMaxUdpDg
The size in bytes of the largest User Datagram Protocol (UDP) datagram that can be sent or received by a Windows Sockets application. If the implementation imposes no limit, iMaxUdpDg is zero. In many implementations of Berkeley sockets, there is an implicit limit of 8192 bytes on UDP datagrams (which are fragmented if necessary). A Windows Sockets implementation can impose a limit based, for instance, on the allocation of fragment reassembly buffers. The minimum value of iMaxUdpDg for a compliant Windows Sockets implementation is 512.

I suppose you are right. But you still don''t want to send over 512 bytes at a time, since Winsock allows the send command to fail if the datagram is bigger than 512 bytes on some implementations.



~BenDilts( void );

Share this post


Link to post
Share on other sites