From owner-freebsd-net@FreeBSD.ORG Sun Apr 1 06:27:44 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4ECAC1065670 for ; Sun, 1 Apr 2012 06:27:44 +0000 (UTC) (envelope-from darernr@freebsd.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 14D9B8FC1E for ; Sun, 1 Apr 2012 06:27:43 +0000 (UTC) Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id CFC3B20A96 for ; Sun, 1 Apr 2012 02:27:36 -0400 (EDT) Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute1.internal (MEProxy); Sun, 01 Apr 2012 02:27:36 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=6lXox6atFQfI5QQIUW1bJS YstPU=; b=fMfEKjj5Gott2Q67ealUZ/S+O8MA/xm563h3U0tTzfPHo057Gyj9n0 Lo2Pl6TJvbiWG1Gn+sgvWqQCOiZwNRii2hBQC+B3YwiHB60Y9mhyJJ9s8fv5Fq/U cfwcLzbVzvyrLX+mSe8OaxX1oi1mgT7ltC/cqxfh1z1OowGyuFNzQ= X-Sasl-enc: oRSj6xR2pEzAGbTebsiyVwMc8yj8ZXFPYRv/MfmE74nr 1333261656 Received: from [192.168.1.23] (dsl-202-45-110-141-static.VIC.netspace.net.au [202.45.110.141]) by mail.messagingengine.com (Postfix) with ESMTPSA id 14C12482491; Sun, 1 Apr 2012 02:27:34 -0400 (EDT) Message-ID: <4F780373.6030107@freebsd.org> Date: Sun, 01 Apr 2012 17:27:47 +1000 From: Darren Reed User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Andre Oppermann References: <4F75C1A3.4030401@freebsd.org> <4F75D9ED.7080707@freebsd.org> In-Reply-To: <4F75D9ED.7080707@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: darrenr@freebsd.org, freebsd-net@freebsd.org Subject: Re: FreeBSD TCP ignores zero window size X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Apr 2012 06:27:44 -0000 Andre, Your changes bring it closer to working correctly with a small change: rather than "tiwin > tp->snd_wnd", it should be "tiwin != tp->snd_wnd". In this trace, the remote end has set a window scale factor of 5 during connection establishment. The same change should be made in the if() a few lines down. The problem here is that it only tracks the window size as it grows, not as it shrinks. Thus the remote end setting its window size to 0 is ignored. But having made that change, there appears to be still one problem that still lingers. As can be seen below, freebsd 8.2 fails to properly ack the data that the remote end is trying to send, ultimately causing the connection to be dropped. Darren 16:06:50.207927 IP remote.ssh > freebsd82.62922: . 6268613:6270053(1440) ack 367219 win 128 16:06:50.208736 IP freebsd82.62922 > remote.ssh: . ack 6270053 win 8100 16:06:50.210902 IP remote.ssh > freebsd82.62922: . 6270053:6271493(1440) ack 367219 win 128 16:06:50.211752 IP freebsd82.62922 > remote.ssh: . ack 6271493 win 8280 16:06:50.229987 IP remote.ssh > freebsd82.62922: . ack 370099 win 38 16:06:50.419926 IP remote.ssh > freebsd82.62922: . ack 371315 win 0 16:06:50.422858 IP remote.ssh > freebsd82.62922: . ack 371315 win 0 16:06:51.207172 IP freebsd82.62922 > remote.ssh: . ack 6271493 win 8280 16:06:51.419263 IP remote.ssh > freebsd82.62922: . ack 371315 win 0 16:06:53.203547 IP remote.ssh > freebsd82.62922: . 6267173:6268613(1440) ack 371315 win 0 16:06:53.204320 IP freebsd82.62922 > remote.ssh: . ack 6271493 win 8280 16:06:53.415648 IP remote.ssh > freebsd82.62922: . ack 371315 win 0 16:06:59.207766 IP remote.ssh > freebsd82.62922: . 6267173:6268613(1440) ack 371315 win 0 16:06:59.208469 IP freebsd82.62922 > remote.ssh: . ack 6271493 win 8280 16:06:59.419342 IP remote.ssh > freebsd82.62922: . ack 371315 win 0 16:07:11.212606 IP remote.ssh > freebsd82.62922: . 6267173:6267697(524) ack 371315 win 0 16:07:11.213158 IP freebsd82.62922 > remote.ssh: . ack 6271493 win 8280 16:07:11.424414 IP remote.ssh > freebsd82.62922: . ack 371315 win 0 16:07:35.227356 IP remote.ssh > freebsd82.62922: . 6267173:6267697(524) ack 371315 win 0 16:07:35.227954 IP freebsd82.62922 > remote.ssh: . ack 6271493 win 8280 16:07:35.440105 IP remote.ssh > freebsd82.62922: . ack 371315 win 0 16:08:23.257747 IP remote.ssh > freebsd82.62922: . 6267173:6267697(524) ack 371315 win 0 16:08:23.258471 IP freebsd82.62922 > remote.ssh: . ack 6271493 win 8280 16:08:23.469790 IP remote.ssh > freebsd82.62922: . ack 371315 win 0 16:09:27.299037 IP remote.ssh > freebsd82.62922: . 6267173:6267697(524) ack 371315 win 0 16:09:27.299734 IP freebsd82.62922 > remote.ssh: . ack 6271493 win 8280 16:09:27.510740 IP remote.ssh > freebsd82.62922: . ack 371315 win 0 16:10:31.340328 IP remote.ssh > freebsd82.62922: . 6267173:6267697(524) ack 371315 win 0 16:10:31.340996 IP freebsd82.62922 > remote.ssh: . ack 6271493 win 8280 16:10:31.552639 IP remote.ssh > freebsd82.62922: . ack 371315 win 0 16:11:35.380906 IP remote.ssh > freebsd82.62922: . 6267173:6267697(524) ack 371315 win 0 16:11:35.381519 IP freebsd82.62922 > remote.ssh: . ack 6271493 win 8280 16:11:35.592948 IP remote.ssh > freebsd82.62922: . ack 371315 win 0 16:12:39.421327 IP remote.ssh > freebsd82.62922: . 6267173:6267697(524) ack 371315 win 0 16:12:39.421957 IP freebsd82.62922 > remote.ssh: . ack 6271493 win 8280 16:12:39.633531 IP remote.ssh > freebsd82.62922: . ack 371315 win 0 16:13:43.462137 IP remote.ssh > freebsd82.62922: . 6267173:6267697(524) ack 371315 win 0 16:13:43.462625 IP freebsd82.62922 > remote.ssh: . ack 6271493 win 8280 16:13:43.674110 IP remote.ssh > freebsd82.62922: . ack 371315 win 0 16:14:47.502951 IP remote.ssh > freebsd82.62922: . 6267173:6267697(524) ack 371315 win 0 16:14:47.503637 IP freebsd82.62922 > remote.ssh: . ack 6271493 win 8280 16:14:47.715729 IP remote.ssh > freebsd82.62922: . ack 371315 win 0 16:15:51.542134 IP remote.ssh > freebsd82.62922: . 6267173:6267697(524) ack 371315 win 0 16:15:51.542794 IP freebsd82.62922 > remote.ssh: . ack 6271493 win 8280 16:16:55.581199 IP remote.ssh > freebsd82.62922: R 6271493:6271493(0) ack 371315 win 0