How to send fragmented UDP packets
Posted: Fri May 21, 2010 1:25 am
Hello,
I have problems sending UDP packets that have to be fragmented since the payload extends the MTU. Currently I am using the UDP socket API, but it would be OK to switch to the UDP class.
sendto() uses internally an UDPPacket. It sets the port numbers, adds the data, and sends the packet before returning the "written" bytes. The problem is, that UDPPacket::AddData() does not support fragmentation as far as I discovered and silently ignores bytes exceeding the MAX_UDPDATA (1458) boundary. sendto() thus reports a wrong number of written bytes.
The UDP_FRAGMENTS define is just for receiving fragmented UDP packets, am I right?
So how can I send UDP packets with a larger payload than 1458 bytes?
Thanks,
Stephan
I have problems sending UDP packets that have to be fragmented since the payload extends the MTU. Currently I am using the UDP socket API, but it would be OK to switch to the UDP class.
sendto() uses internally an UDPPacket. It sets the port numbers, adds the data, and sends the packet before returning the "written" bytes. The problem is, that UDPPacket::AddData() does not support fragmentation as far as I discovered and silently ignores bytes exceeding the MAX_UDPDATA (1458) boundary. sendto() thus reports a wrong number of written bytes.
The UDP_FRAGMENTS define is just for receiving fragmented UDP packets, am I right?
So how can I send UDP packets with a larger payload than 1458 bytes?
Thanks,
Stephan