[erlang-questions] Getting the MTU of an IPv4 UDP socket?

Ivan Ostres iostres@REDACTED
Tue Mar 22 22:18:09 CET 2011


On 22/3/11 10:04 PM, Jesper Louis Andersen wrote:
> What is the easiest way to query MTUs for UDP sockets on Linux and
> Windows (One is ok, I can hack it for Windows). I know that you should
> probably carry out some PMTU discovery phase, but I am somewhat
> interested if you can query this state of a socket and how supported
> it is.
>
> Meanwhile, I'll cheat and assume the MTU is 1000 bytes :P

Hello Jesper,

MTU is defined on data-link layer, not on transport. If you don't want 
to do it with PMTU discovery, simplest way is to run "ifconfig" in 
shell, it shows MTU on OSX and it should do the same on Linux:

en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

I hope this helps.

BR,
Ivan Ostres


More information about the erlang-questions mailing list