From owner-freebsd-net@FreeBSD.ORG Mon Jan 6 23:23:24 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 25C2C491 for ; Mon, 6 Jan 2014 23:23:24 +0000 (UTC) Received: from mail-pd0-x232.google.com (mail-pd0-x232.google.com [IPv6:2607:f8b0:400e:c02::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E852415E0 for ; Mon, 6 Jan 2014 23:23:23 +0000 (UTC) Received: by mail-pd0-f178.google.com with SMTP id y10so18684231pdj.23 for ; Mon, 06 Jan 2014 15:23:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=2ax5x2Bojv+1eeK7dGoDy0pYiEP75WJvNXtDKzJPDh0=; b=mM+s32oPcW44TXfNMet58nPesGvl2OpP6SW5FfOx2f4GEOc7DFM43kJNv8L3QNnyCL vAFzNvfxhmTmNfMYu21AtLG8gzbKdoha64cHjREptTkoCrCrmMHPyEDUl10cLFL5eh4r kjOF5kKDkFh1oyXSDWcgBGh3BPAizaOG0Xe14= 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:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=2ax5x2Bojv+1eeK7dGoDy0pYiEP75WJvNXtDKzJPDh0=; b=aS0NsFi6fY/FVgXrvP+wf3oYVPeDLEYkzDMJcLYFWJXFCIGJZn61SoooF9kvDHyKwk ayK+em2Ab8xdVDSwhvnqxKrotrb1If9PYUv8Ibk8J+mJ+QfjySben90BSS08L6saK3Q5 D790Pw5uoRdlLFCaiNCUzimNRv/pbrWlJcgbTSkZeWxHtW72QvVDiZyUJ7Ftql2j2ecc i9+wHvWoXROFPKw5qMRAkknCG3YbeGBI7NDuf5B01fy0qQ1sjHSW4LaUuo469a+29BPo djBw0yqcYcu80QFQK9r6mQxsJqrpgrurTnZjSoez7ja1GmlrTqSphCs8UwfgbXsdkaAc FyaA== X-Gm-Message-State: ALoCoQk/CLMsz48fpu6uZsS6A5XR3h92quer6X1auvumWXlYcgqGBowOCvgNrpKP0ywj3mMeHKwv X-Received: by 10.67.14.162 with SMTP id fh2mr1215560pad.120.1389050603567; Mon, 06 Jan 2014 15:23:23 -0800 (PST) Received: from hater-dm.corp.yahoo.com (nat-dip4.cfw-a-gci.corp.yahoo.com. [209.131.62.113]) by mx.google.com with ESMTPSA id vn10sm131362464pbc.21.2014.01.06.15.23.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 Jan 2014 15:23:22 -0800 (PST) Message-ID: <52CB3AE9.3030107@wemm.org> Date: Mon, 06 Jan 2014 15:23:21 -0800 From: Peter Wemm 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: TCP question: Is this simultaneous close handling broken? X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: Mon, 06 Jan 2014 23:23:24 -0000 We've hit a weird problem at work when dealing with simultaneous closes. In this particular case, it's a FreeBSD-7.4 machine talking some random Linux host. There is a client/server protocol in use, and both ends are doing a close at the same time. It might be a shutdown, I haven't seen all the code yet. A convenient summary of how a simultaneous close is performed: "A simultaneous CLOSE by users at both ends of a connection causes FIN segments to be exchanged. When all segments preceding the FINs have been processed and acknowledged, each TCP can ACK the FIN it has received." 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 I am not familar with the finer details of edge cases of TCP/IP like this, but this looks a bit odd to me. What am I looking at? Who's at fault? It looks like we're failing to recognize the ack for our fin. The quote above from some google search result: http://www.freesoft.org/CIE/Course/Section4/11.htm Insight would be greatly appreciated... -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV UTF-8: for when a ' just won\342\200\231t do.