문제

How do I find the path MTU between connection? I need this to define the packet size of my UDP connection. Is there things like Path MTU Discovery in .Net?

도움이 되었습니까?

해결책

Taken from here:

winsock doesn't support reporting the discovered MTU, even though other TCP/IP stacks do (e.g. AIX through a socket option IP_GETPMTU). As winsock cannot report that, .NET can't provide an API (which would have to be on top of winsock).

다른 팁

i have found a way(workaround) to find the path mtu for udp on c#. just try send udp packet with udpclient.dontfragment set to true. if it throws an exception, reduce the packet size until no exception is thrown. if anybody would like to see some sample, just ask.

Have you tried using libpcap with C#? There is a library called SharpPCap that you can use to find the PMTU.

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