문제

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.

도움이 되었습니까?

해결책

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).

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top