From owner-freebsd-net@FreeBSD.ORG Wed Mar 12 02:48:40 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 299D71065671 for ; Wed, 12 Mar 2008 02:48:40 +0000 (UTC) (envelope-from coda.trigger@gmail.com) Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.236]) by mx1.freebsd.org (Postfix) with ESMTP id BC7588FC1E for ; Wed, 12 Mar 2008 02:48:39 +0000 (UTC) (envelope-from coda.trigger@gmail.com) Received: by qb-out-0506.google.com with SMTP id a10so2465856qbd.7 for ; Tue, 11 Mar 2008 19:48:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=iC+1dFjhIhqYrQoo4akApCkIXpLS+On4Um9XbXZU8ME=; b=UwhAHmOtoIsdVIdfheAXbuXXyLxvaGXf6zKG720l1mGvJNbJsibopIMErLf1jEIDg4HN3YLqBHM/N/HaKlgEL+bCMSMRHal728M+Po5qfA5i1bOu87WCETq4OPhr5qrxCpkb3No/mAXFQKP4c5euH8tsoc6ScBzbc8mAFoMa56w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=vdimFkLmIawyMrXwG8js2DQhGtzk1TXclLwSZkyLGD8t07YtYN2sqj533wrznzYu7c9luyoB1U91xnOw5ZJDk4PLLQQ1aX8RPO2ZLPvDoJ8Ulun0ayz1g6aRkt+PthAY7MVbHz65Gu4zk6Rn7C5D7pemmvcCQkAXCSg3GAElcUw= Received: by 10.114.156.1 with SMTP id d1mr6008752wae.120.1205290118198; Tue, 11 Mar 2008 19:48:38 -0700 (PDT) Received: by 10.115.15.12 with HTTP; Tue, 11 Mar 2008 19:48:38 -0700 (PDT) Message-ID: Date: Tue, 11 Mar 2008 22:48:38 -0400 From: "d.s. al coda" To: "Kip Macy" In-Reply-To: MIME-Version: 1.0 References: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-net@freebsd.org Subject: Re: TCP options order changed in FreeBSD 7, incompatible with some routers 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: Wed, 12 Mar 2008 02:48:40 -0000 On 3/11/08, Kip Macy wrote: > Are you running 7.0-RELEASE? What I believe was this issue was a > showstopper for it, so I'm surprised to hear of it now. > > -Kip Yes, we are running 7.0-RELEASE. -coda On Tue, Mar 11, 2008 at 5:56 PM, d.s. al coda > wrote: > > Hi, > > We recently upgraded one of our webservers to FreeBSD 7, and we started > > receiving complaints from some users not able to connect to that server > > anymore. On top of that, users were saying that the problem only > occurred on > > Windows (at least, the ones who had more than on OS to try it out). > > > > After managing to get a user who had the problem running windump, > running > > tcpdump on the new server, and comparing that to the windump & tcpdump > > output for a "control" user (me) that could connect, we managed to > figure > > out the following: > > - For the user with this problem, ping works fine, but all TCP > connections > > to the server fail. > > - The user, trying to connect, sends out a SYN packet, receives no > response, > > and retries a few times until timing out. > > - The server sees a bunch of SYN packets and responds with SYN-ACK each > > time. > > - The issue only seems to arise if the sender has RFC1323 disabled. > > > > So, the SYN-ACK is getting lost somewhere. > > > > - For the control user (who can connect via TCP just fine), we set the > TCP > > window size and RFC1323 options the same as the user with the problem. > > - The control user sees the SYN-ACK packet. > > - We send a connection attempt to one of our other servers, running > FreeBSD > > 5.5, and one to the server running FreeBSD 7. > > - There is only one notable difference between the responses: the order > of > > the options. > > - FreeBSD 5.5 has > > - FreeBSD 7 has (there is of course an aligning > nop > > after the eol, which tcpdump skips) > > - These options don't appear in this exact configuration when using > RFC1323 > > options. > > > > I get a hunch that the users with the problem have a router that > erroneously > > thinks that these options are invalid, or thinks that the some part of > byte > > sequence (e.g. 0204 05b4 0101 0402) is an attack. > > > > Just to try it out, I patched tcp_output.c so that the SACK permitted > option > > was aligned on a 4-byte boundary, preventing the "sackOK, eol" pattern > from > > ever occuring. Looking through previous versions, I found where the > tcp > > option code had changed, and there used to be a comment about putting > SACK > > permitted last, but I can't tell if it's relevant. > > > http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netinet/tcp_output.c.diff?r1=1.125;r2=1.126 > > > > The one-line patch to tcp_output.c is attached. > > > > Sure enough, it fixed the problem. Afterwards, we collected some > information > > about the routers the users who had the problem were using, and while > they > > didn't all have the same manufacturer, several mentioned that their > router > > had a built-in firewall, which, when they disabled it, allowed them to > > access the server. > > > > Does all of this sound reasonable? And if so, would it be worth > submitting > > this patch? I don't know if this particular change in options order was > > intentional, or just a side-effect of the new code, but it certainly > works > > around an extremely hard-to-diagnose problem. > > > > -coda > > > > _______________________________________________ > > freebsd-net@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-net > > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > > >