How can i detect if a received UDP got fragmented from userland?

Sten Daniel Sørsdal lists at wm-access.no
Thu Mar 23 22:56:32 UTC 2006


Andre Oppermann wrote:
> Sten Daniel Sørsdal wrote:
>> I am currently working on a udp multicast application written in C for
>> FreeBSD (6.x)
>>
>> For our test cases in many different network types we found that
>> fragmentation poses as a significant problem for quality and reliability.
>> Packets that get fragmented are more likely to get dropped than
>> packets that do not get fragmented and since our application needs high
>> bulk performance without retransmissions we believe our application and
>> the network would benefit from this.
>> Our first assumption was that adding DF to UDP would solve it, and it
>> does in our small tests, but it has a noticable negative effect on the
>> network.
>> Are there any way i can read whether a message's packet was fragmented
>> into smaller pieces and preferably how large the largest fragment was?
>> Are there any feasible way to do this?
> 
> No.  There is no way to know from userland if a packet was fragmented.
> In theory you can infere this from the size of the rcvmsg() you do.  If
> it is larger than your local MTU it must have been fragemented.  This
> doesn't allow you to find out if the path from source to receiver has
> a lower MTU somewhere however.  There you can only do path MTU discovery.
> 

I have a hard time figuring out how to do path mtu discovery from server 
side. Could i have your opinions about an implementation idea?

I considered adding a socket flag for UDP to indicate i want to monitor 
this socket for incoming fragments. Then send a message on the routing 
socket indicating the largest fragment size and the host address that 
caused the fragments - whenever a successful defragmented packet is 
passed to higher levels?

-- 
Sten Daniel Sørsdal

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20060323/2cb83a45/signature.pgp


More information about the freebsd-net mailing list