How to send fragmented UDP packets

Discussion to talk about software related topics only.
Post Reply
stephan
Posts: 10
Joined: Fri Feb 26, 2010 1:58 am
Location: Germany

How to send fragmented UDP packets

Post by stephan »

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
User avatar
pbreed
Posts: 1081
Joined: Thu Apr 24, 2008 3:58 pm

Re: How to send fragmented UDP packets

Post by pbreed »

int SendFragmentedUdpPacket(IPADDR to, WORD source_port, WORD dest_port, PBYTE data, int length);


This function will send larger than MTU udp packets.

Paul
Post Reply