From owner-freebsd-net@FreeBSD.ORG Tue Jan 7 22:40:10 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 139B6E83 for ; Tue, 7 Jan 2014 22:40:10 +0000 (UTC) Received: from mail-gg0-x233.google.com (mail-gg0-x233.google.com [IPv6:2607:f8b0:4002:c02::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA49916AF for ; Tue, 7 Jan 2014 22:40:09 +0000 (UTC) Received: by mail-gg0-f179.google.com with SMTP id l4so143971ggi.24 for ; Tue, 07 Jan 2014 14:40:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=message-id:date:from:organization:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=MwJsFVu6uDbHcX8GSkvuGSEEKKRr8F/lNz2YDnjti74=; b=YeWbGovMPT6GOC2FWy8i/Hi/Lg3FYXgSdyYw5CD8lIQdfKBHdPViJQoxPXxTOUE5Ku IYI5rLbLQ3D6lyaf4pUHsuQnDtHzUVJUK+WOw/LaGimxLbZcCSR1sGzvjk5FTIb/QvLd 4EkUgFs7Fy9xruhxP05og8FJUhwjlKGPwmWec= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:organization:user-agent :mime-version:to:subject:references:in-reply-to:content-type; bh=MwJsFVu6uDbHcX8GSkvuGSEEKKRr8F/lNz2YDnjti74=; b=gnrEAK17Vjtk95/jZscf5QYgouBpY0sYxeZ/HHiIfD55AAm0VKZcAhtdFZ8Th3tPE6 4FuJ9NcJesGihpA3HrHznE+qrrgeTXI7eUHvjEbcKBhelGkgq6CmSGL9cGW5iAzuy12Q L9RtykyRc/NbtqlwwfyUxkuRTP0gz2HWubyMn/QgfMjN9kCHhor0YfQPIq4Eht5lX/AZ FHxlSQhb6zQQDrYKvnvZTevV47jNpYwxW7To5nKu62b6Nl6reh38OKEjAtmfvV0Tage0 0qkJDufdzIp0InE+bxwg3meaWrxdTzSwgrkRNYOvNToDZYHiC5yFH2T0YQdnCXPG/o+G mNHA== X-Gm-Message-State: ALoCoQliJnuRfNsc94svvl5zFb8lecuRKA+QYGw5/4k6t98lNVTjYtWEAdgis/lI9+YKUBr8Kvwq X-Received: by 10.236.147.107 with SMTP id s71mr14185703yhj.45.1389134408824; Tue, 07 Jan 2014 14:40:08 -0800 (PST) Received: from hackintosh.wemm.org ([2601:9:e80:770:69a1:2b30:eab6:4149]) by mx.google.com with ESMTPSA id m68sm25963808yhj.22.2014.01.07.14.40.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 Jan 2014 14:40:07 -0800 (PST) Message-ID: <52CC8246.7080609@wemm.org> Date: Tue, 07 Jan 2014 14:40:06 -0800 From: Peter Wemm Organization: World Domination in progress. User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: Re: TCP question: Is this simultaneous close handling broken? References: <52CB3AE9.3030107@wemm.org> <52CC5F2E.5030201@wemm.org> In-Reply-To: <52CC5F2E.5030201@wemm.org> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="THfFN3Oi0mROUh9xOcrEIPcW0LnguJ57W" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2014 22:40:10 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --THfFN3Oi0mROUh9xOcrEIPcW0LnguJ57W Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 1/7/14, 12:10 PM, Peter Wemm wrote: > On 1/6/14, 3:23 PM, Peter Wemm wrote: >> We've hit a weird problem at work when dealing with simultaneous close= s. >> In this particular case, it's a FreeBSD-7.4 machine talking some rando= m >> Linux host. >> >> There is a client/server protocol in use, and both ends are doing a cl= ose >> at the same time. It might be a shutdown, I haven't seen all the code= yet. > [..] >> A packet capture, with relative timestamps: >> >> 000050 freebsd.28411 > linux.14001: F 6486:6486(0) ack 232 >> 000031 linux.14001 > freebsd.28411: F 232:232(0) ack 6486 >> 000333 linux.14001 > freebsd.28411: . ack 6487 >> [200ms retransmit timer fires on linux] >> 200490 linux.14001 > freebsd.28411: F 232:232(0) ack 6487 >> 000011 freebsd.28411 > linux.14001: . ack 233 > [..] >> What am I looking at? Who's at fault? It looks like we're failing to= >> recognize the ack for our fin. >=20 > It definitely looks like FreeBSD at fault. We've simply not acked thei= r FIN > until they retransmitted it. >=20 > I've looked at the commit logs and I don't see anything obvious that st= ands > out to me for a fix for this. Most of the changes seem to be lock stru= cture > changes than protocol fixes. I see things like ECN and other protocol > features being added as well. >=20 > Where should I look in the code? It turns out it's fixed in HEAD. ------------------------------------------------------------------------ r258821 | eadler | 2013-12-01 19:11:25 -0800 (Sun, 01 Dec 2013) | 14 line= s In a situation where: - The remote host sends a FIN - in an ACK for a sequence number for which an ACK has already been received - There is still unacked data on route to the remote host - The packet does not contain a window update The packet may be dropped without processing the FIN flag. PR: kern/99188 Submitted by: Staffan Ulfberg Discussed with: andre MFC after: never ------------------------------------------------------------------------ The bug in question is from Date: Mon, 19 Jun 2006 23:45:05 +0200 (CEST) This is the exact situation we hit. --=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6F= JV UTF-8: for when a ' just won\342\200\231t do. --THfFN3Oi0mROUh9xOcrEIPcW0LnguJ57W Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlLMgkYACgkQFRKuUnJ3cX/KuQCfV6gHtCN58vr6A+fpUsVPJ7YL jWIAn0itVXvDRhEGCH+zrsX5XO9rJNq/ =aWiN -----END PGP SIGNATURE----- --THfFN3Oi0mROUh9xOcrEIPcW0LnguJ57W--