views:

59

answers:

2

I'm working on a network-related project and I am using DTLS (TLS/UDP) to secure communications.

Reading the specifications for DTLS, I've noted that DTLS requires the DF flag (Don't Fragment) to be set.

On my local network if I try to send a message bigger than 1500 bytes, nothing is sent. That makes perfect sense. On Windows the sendto() reports a success but nothing is sent.

I obviously cannot unset the DF flag manually since it is mandatory for DTLS and i'm not sure whether the 1500 bytes limit (MTU ?) could change in some situations. I guess it can.

So, my question is : "Is there a way to discover this limit ?" using APIs ?

If not, what would be the lowest possible value ?

My software runs under UNIX (Linux/MAC OSX) and Windows OSes so different solutions for each OS are welcome ;)

Many thanks.

A: 

you probably need to 'auto tune' it by sending a range of packet sizes to the target, and see which arrive. think binary_search ...

steelbytes
Thanks, but I wish there was some "standard" way to do this. I don't really feel like reinventing MTU Path Discovery.
ereOn
+3  A: 

There is a minimum MTU that must be supported - 576 bytes, including IP headers. So if you keep your packets below that, you don't have to worry about PMTU-D (that's what DNS does).

caf
I wasn't aware of the minimal frame size.I guess I have no choice but to fragment my frames in 576 bytes parts.Thank you for that !
ereOn
caf