PDA

View Full Version : UDP IP layer limit



mhoover
30th July 2009, 21:53
So I've been trying to send some long UDP datagrams, as in like 3000 bytes.

(You can probably tell where this is going).

They seem to get broken up into blocks of 1024 bytes.

I've heard from a couple folks the specification states UDP should be able to send 65000 bytes without breaking it up. In actual practice it happens much sooner.

The Qt docs mention (on the QUdpSocket page) that anything larger than 512 bytes is likely to get broken up by the IP layer. How can the specification say it is so large while it is so low in actual practice?

Does anyone know of a workaround that doesn't involve adding headers and checking?

paF4uko
1st August 2009, 16:13
It's most probably because of your network interface's MTU (Maximum Transmit Unit). For instance, on my Linux machine the standard MTU for ethernet interfaces is 1500 bytes and 16436 bytes for the loopback interface. I guess you read the protocol specifications wich does not take into account the lower layers. However, there are ways of changing the MTU value, but even if you do so for the source machine the packets will be cut further on the network by the other equipments.