Subject: Re: tun(4) minimum mtu is 576, can I safely make this smaller?
To: None <itojun@iijlab.net>
From: Tad Hunt <tad@entrisphere.com>
List: tech-kern
Date: 10/09/2002 11:51:11
So, I adjusted the minimum mtu in tun_ioctl() down to 256, and
gave it a try. Everything seems to work fine. NetBSD fragments
the packets, and they make it to the far end and are reassembled
correctly.
However, while testing this, I noticed some strange behavior.
when I run "ifconfig tun0 mtu NNN", it doesn't change the MTU for
any existing routes using the specified interface. (viewable via
"netstat -r"). In fact, after adjusting the mtu and adding a new
route (with "route add"), the old MTU is still reflected in the
new route entry:
# ifconfig tun2
tun2: flags=2<BROADCAST> mtu 1500
# ifconfig tun2 192.168.3.1
# ifconfig tun2
tun2: flags=43<UP,BROADCAST,RUNNING> mtu 1500
inet 192.168.3.1 netmask 0xffffff00 broadcast 192.168.3.255
# netstat -nr
...
Destination Gateway Flags Refs Use Mtu Interface
...
192.168.3 192.168.3.1 U 0 0 1500 tun2
Everything is as expected so far, however adding a route after
changing the MTU adds the route with the original MTU... I would
have expected the new route to have the new MTU. In fact, I would
have expected the MTU on all of the existing routes pointing to
this interface to get the new MTU.
# ifconfig tun2 mtu 1024
# ifconfig tun2
tun2: flags=43<UP,BROADCAST,RUNNING> mtu 1024
inet 192.168.3.1 netmask 0xffffff00 broadcast 192.168.3.255
# route add -net 192.168.100.0 192.168.3.1
add net 192.168.100.0: gateway 192.168.3.1
# netstat -nr
...
192.168.100 192.168.3.1 UGS 0 0 1500 tun2
...
This is NetBSD-1.5, if it makes a difference.
I'm not a networking expert, so if this is the expected/desired behavior,
sorry for wasting time.
-Tad
In message <20021009063459.8FD3A4B24@coconut.itojun.org>, you said:
;>An MTU of less than 576 violates the IPv4 standard, and will cause
;>all kinds of obscure (and some not-so-obscure!) problems, even in
;>the presence of Path MTU discovery.
;
; incorrect, 576 is the minimum supported size for the packet
; size after reassembly. minimum MTU requirement is 68 octets.
;
;RFC791:
;>> impractical for most hosts and networks. All hosts must be prepared
;>> to accept datagrams of up to 576 octets (whether they arrive whole
;>> or in fragments). It is recommended that hosts only send datagrams
;>> larger than 576 octets if they have assurance that the destination
;>> is prepared to accept the larger datagrams.
;
;>> Every internet module must be able to forward a datagram of 68
;>> octets without further fragmentation. This is because an internet
;>> header may be up to 60 octets, and the minimum fragment is 8 octets.
;
;itojun