Subject: kern/12790: path MTU discovery broken (net.inet.ip.mtudisc)
To: None <gnats-bugs@gnats.netbsd.org>
From: Martin Husemann <martin@duskware.de>
List: netbsd-bugs
Date: 04/30/2001 09:37:43
>Number:         12790
>Category:       kern
>Synopsis:       path MTU discovery broken (net.inet.ip.mtudisc)
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 30 00:38:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Martin Husemann
>Release:        1.5U, cvs updated on April 28, 2001
>Organization:
	
>Environment:
	
System: NetBSD night-porter.duskware.de 1.5U NetBSD 1.5U (PORTER) #1: Sun Apr 29 11:55:20 MEST 2001 martin@night-porter.duskware.de:/usr/src/sys/arch/i386/compile/PORTER i386
Architecture: i386
Machine: i386
>Description:

Turning on path mtu discovery (sysctl -w net.inet.ip.mtudisc=1) breaks outgoing
connections if the path mut is less than the outgoing interfaces mtu (i.e. in
every case PMTU discovery makes sense at all).

See below for a tcpdump.

>How-To-Repeat:

I have an easy setup that triggers this bug reproduceably: my NAT/router 
machine (nightfall) uses a PPPoE connection to the internet with an MTU of
1494. When I try to transfer something with scp to an outside machine,
the transfer stalls after a short time and later times out.

Here is a tcpdump of such a transfer until it stalls (didn't wait for the
timeout here).

tcpdump: listening on ep0
09:23:35.862212 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: S 1558831500:1558831500(0) win 16384 <mss 1460,nop,wscale 0,nop,nop,timestamp 0 0> (DF)
09:23:36.084839 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: S 4289717678:4289717678(0) ack 1558831501 win 32768 <mss 1460,nop,wscale 0,nop,nop,timestamp 759700 0>
09:23:36.085137 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: . ack 1 win 17520 <nop,nop,timestamp 0 759700> (DF)
09:23:36.309145 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: P 1:53(52) ack 1 win 33580 <nop,nop,timestamp 759700 0>
09:23:36.312129 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: P 1:52(51) ack 53 win 17520 <nop,nop,timestamp 0 759700> (DF)
09:23:36.541785 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: P 53:377(324) ack 52 win 33580 <nop,nop,timestamp 759701 0>
09:23:36.602678 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: P 52:224(172) ack 377 win 17520 <nop,nop,timestamp 1 759701> (DF)
09:23:37.836362 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: P 52:224(172) ack 377 win 17520 <nop,nop,timestamp 3 759701> (DF)
09:23:37.948056 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: P 53:377(324) ack 52 win 33580 <nop,nop,timestamp 759703 0>
09:23:37.948481 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: . ack 377 win 17520 <nop,nop,timestamp 4 759701> (DF)
09:23:38.078822 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: . ack 224 win 33580 <nop,nop,timestamp 759704 1>
09:23:38.369818 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: P 377:389(12) ack 224 win 33580 <nop,nop,timestamp 759704 1>
09:23:38.370822 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: P 224:244(20) ack 389 win 17520 <nop,nop,timestamp 5 759704> (DF)
09:23:38.644848 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: . ack 244 win 33580 <nop,nop,timestamp 759705 5>
09:23:38.780611 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: P 389:401(12) ack 244 win 33580 <nop,nop,timestamp 759705 5>
09:23:38.782466 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: P 244:384(140) ack 401 win 17520 <nop,nop,timestamp 5 759705> (DF)
09:23:39.043818 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: . ack 384 win 33580 <nop,nop,timestamp 759706 5>
09:23:39.063681 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: P 401:541(140) ack 384 win 33580 <nop,nop,timestamp 759706 5>
09:23:39.135656 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: . ack 541 win 17520 <nop,nop,timestamp 6 759706> (DF)
09:23:39.235837 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: P 384:412(28) ack 541 win 17520 <nop,nop,timestamp 6 759706> (DF)
09:23:39.458161 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: P 541:585(44) ack 412 win 33580 <nop,nop,timestamp 759707 6>
09:23:39.536770 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: . ack 585 win 17520 <nop,nop,timestamp 7 759707> (DF)
09:23:39.756856 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: P 585:597(12) ack 412 win 33580 <nop,nop,timestamp 759707 6>
09:23:39.758008 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: P 412:440(28) ack 597 win 17520 <nop,nop,timestamp 7 759707> (DF) [tos 0x8]
09:23:40.044460 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: . ack 440 win 33580 <nop,nop,timestamp 759708 7> [tos 0x8]
09:23:40.214381 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: P 597:617(20) ack 440 win 33580 <nop,nop,timestamp 759708 7> [tos 0x8]
09:23:40.216371 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: P 440:484(44) ack 617 win 17520 <nop,nop,timestamp 8 759708> (DF) [tos 0x8]
09:23:40.444599 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: . ack 484 win 33580 <nop,nop,timestamp 759709 8> [tos 0x8]
09:23:40.504336 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: P 617:637(20) ack 484 win 33580 <nop,nop,timestamp 759709 8> [tos 0x8]
09:23:40.515641 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: . 484:1932(1448) ack 637 win 17520 <nop,nop,timestamp 9 759709> (DF) [tos 0x8]
09:23:40.516149 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: . 1932:3380(1448) ack 637 win 17520 <nop,nop,timestamp 9 759709> (DF) [tos 0x8]
09:23:40.516945 nightfall.duskware.de > setting-sun.duskware.de: icmp: ftp.netbsd.org unreachable - need to frag (mtu 1494)
09:23:40.517548 nightfall.duskware.de > setting-sun.duskware.de: icmp: ftp.netbsd.org unreachable - need to frag (mtu 1494)
09:23:40.518090 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: . 484:1926(1442) ack 637 win 17520 <nop,nop,timestamp 9 759709> (DF) [tos 0x8]
09:23:40.518590 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: . 484:1926(1442) ack 637 win 17520 <nop,nop,timestamp 9 759709> (DF) [tos 0x8]
09:23:40.518816 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: . 1926:1978(52) ack 637 win 17520 <nop,nop,timestamp 9 759709> (DF) [tos 0x8]
09:23:40.744466 ftp.netbsd.org.ssh > setting-sun.duskware.de.65530: . ack 484 win 33580 <nop,nop,timestamp 759709 8> [tos 0x8]
09:23:41.835021 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: . 484:1926(1442) ack 637 win 17520 <nop,nop,timestamp 11 759709> (DF) [tos 0x8]
09:23:43.834062 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: . 484:1926(1442) ack 637 win 17520 <nop,nop,timestamp 15 759709> (DF) [tos 0x8]
09:23:47.832156 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: . 484:1926(1442) ack 637 win 17520 <nop,nop,timestamp 23 759709> (DF) [tos 0x8]
09:23:55.828357 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: . 484:1926(1442) ack 637 win 17520 <nop,nop,timestamp 39 759709> (DF) [tos 0x8]
09:24:11.820729 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: . 484:1932(1448) ack 637 win 17520 <nop,nop,timestamp 71 759709> (DF) [tos 0x8]
09:24:11.821475 nightfall.duskware.de > setting-sun.duskware.de: icmp: ftp.netbsd.org unreachable - need to frag (mtu 1494)
09:24:11.822431 setting-sun.duskware.de.65530 > ftp.netbsd.org.ssh: . 484:1926(1442) ack 637 win 17520 <nop,nop,timestamp 72 759709> (DF) [tos 0x8]

>Fix:
Only a workaround:
Leaving net.inet.ip.mtudisc at it's default value (0) prevents the problem.
>Release-Note:
>Audit-Trail:
>Unformatted: