From owner-freebsd-current@FreeBSD.ORG Mon Nov 26 02:29:43 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1BE216A41A; Mon, 26 Nov 2007 02:29:43 +0000 (UTC) (envelope-from jhealy@swin.edu.au) Received: from mailmonitor.cc.swin.edu.au (mailmonitor.cc.swin.edu.au [136.186.1.65]) by mx1.freebsd.org (Postfix) with ESMTP id 0B8F513C4E5; Mon, 26 Nov 2007 02:29:42 +0000 (UTC) (envelope-from jhealy@swin.edu.au) Received: from groupwise.swin.edu.au (Not Verified[136.186.3.197]) by mailmonitor.cc.swin.edu.au with MailMarshal (v6, 1, 4, 441) id ; Mon, 26 Nov 2007 13:09:07 +1100 Received: from [136.186.229.102] (jhealy.caia.swin.edu.au [136.186.229.102]) by groupwise.swin.edu.au with ESMTP; Mon, 26 Nov 2007 13:08:59 +1100 Message-ID: <474A2ABA.5020104@swin.edu.au> Date: Mon, 26 Nov 2007 13:08:58 +1100 From: James Healy User-Agent: Thunderbird 2.0.0.6 (X11/20071113) MIME-Version: 1.0 To: freebsd-net@freebsd.org X-Enigmail-Version: 0.95.0 Content-Type: multipart/mixed; boundary="------------020409040702050006030506" Cc: Lawrence Stewart , freebsd-current@freebsd.org, grenville armitage Subject: SACK broken in HEAD/RELENG_7 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2007 02:29:44 -0000 This is a multi-part message in MIME format. --------------020409040702050006030506 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 While monitoring a data transfer between two 7-beta3 hosts with tcpdump and SIFTR[1] last week, we noticed that SACK was not being negotiated as expected. The SACK option was sent in the SYN, but the option wasn't sent back in the SYNACK, despite SACK being enabled on both hosts. The problem seems to have been caused during some refactoring of tcp_syncache.c back in march (r1.105), and is fixed by the single line patch attached. While investigating the issue, the comments relating to TOF_SACKPERM and TOF_SACK in tcp_var.h made it a little harder to understand what was going on. We interpreted the comment for TOF_SACK to imply that it was used during the handshake. The attached patch only fixes the code, but it might be worth tweaking these comments as well. Maybe something like: #define TOF_SACKPERM 0x0004 /* SACK permitted */ #define TOF_SACK 0x0080 /* SACK hole data */ In our opinion, it might also be worth renaming SCF_SACK to SCF_SACKPERM in tcp_syncache.c to semantically align it with the TOF defines in tcp_var.h. James Healy and Lawrence Stewart http://caia.swin.edu.au [1] http://caia.swin.edu.au/urp/newtcp/tools.html -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHSiq64oawkrbYo/kRAsX0AKCybMhaBxPaYtmKNrYF0+kkh4s/DgCfQK0W +79c+IH5nzG3r+6Nn/ji8L4= =TD4L -----END PGP SIGNATURE----- Swinburne University of Technology CRICOS Provider Code: 00111D NOTICE This e-mail and any attachments are confidential and intended only for the use of the addressee. They may contain information that is privileged or protected by copyright. If you are not the intended recipient, any dissemination, distribution, printing, copying or use is strictly prohibited. The University does not warrant that this e-mail and any attachments are secure and there is also a risk that it may be corrupted in transmission. It is your responsibility to check any attachments for viruses or defects before opening them. If you have received this transmission in error, please contact us on +61 3 9214 8000 and delete it immediately from your system. We do not accept liability in connection with computer virus, data corruption, delay, interruption, unauthorised access or unauthorised amendment. Please consider the environment before printing this email. --------------020409040702050006030506 Content-Type: text/x-patch; name="freebsd7beta3_syncache_sack_fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="freebsd7beta3_syncache_sack_fix.patch" --- tcp_syncache.c.orig +++ tcp_syncache.c @@ -1184,7 +1184,7 @@ if (to->to_flags & TOF_SIGNATURE) sc->sc_flags |= SCF_SIGNATURE; #endif - if (to->to_flags & TOF_SACK) + if (to->to_flags & TOF_SACKPERM) sc->sc_flags |= SCF_SACK; if (to->to_flags & TOF_MSS) sc->sc_peer_mss = to->to_mss; /* peer mss may be zero */ --------------020409040702050006030506--