Reputation: 83745
I am usually sending packets that range from 3 to 15 KB but from time to time I need to send a large packet which is about 0.8-0.9 MB. In that case the UDP socket will stop because there is probably some limit on a single packet size.
How can I increase this limit so I can send large packets?
Upvotes: 0
Views: 5401
Reputation: 4454
It is possible to use packets >64K, despite the size limitation of fields in the layer-4 headers. See IPv6 Jumbograms.
Upvotes: 2
Reputation: 355267
The length
field in the UDP packet header is only 16 bits in width; you can't have a single UDP packet larger than 65,535 bytes (that includes the header, too, so really the limit is 65,527 bytes; it's probably even lower still since IP has other restrictions).
Upvotes: 5
Reputation: 62631
note that UDP packets bigger than the MTU's (at every hope between your hosts) will be split by IP. If a single one of these parts is lost, the whole UDP packet will be discarded. There's no retransmission.
On a local LAN, with low traffic you might not note the difference, but in any not-so-ideal situation, it could be a huge performance hit.
I think it would be much better to either:
Upvotes: 4