Re: [tcpinc] TCP's treatment of data in SYN packets

Kyle Rose <krose@krose.org> Fri, 29 July 2016 19:41 UTC

Return-Path: <krose@krose.org>
X-Original-To: tcpinc@ietfa.amsl.com
Delivered-To: tcpinc@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0277812D0A8 for <tcpinc@ietfa.amsl.com>; Fri, 29 Jul 2016 12:41:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=krose.org
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iXcwfFSqcDOL for <tcpinc@ietfa.amsl.com>; Fri, 29 Jul 2016 12:41:35 -0700 (PDT)
Received: from mail-qk0-x235.google.com (mail-qk0-x235.google.com [IPv6:2607:f8b0:400d:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C45C312B042 for <tcpinc@ietf.org>; Fri, 29 Jul 2016 12:41:34 -0700 (PDT)
Received: by mail-qk0-x235.google.com with SMTP id o67so100074788qke.1 for <tcpinc@ietf.org>; Fri, 29 Jul 2016 12:41:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=krose.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=BJWsX6OFyL5Tvi1bYdy7TGStg869BoNhYmhxPy1gouA=; b=PtP5BOvoR9qpcBXNBL5S2wyZ+mFWHtfi2YYeMLpaDpM378U6av+dExKZ9v4hQURjgs W0EqtOpc1YLwwpoZCvIW9CfekHY5wlkBGsrkXVSvs7OfAEPa4B374e1U3Ds5n0c4n/sV QLg3xa+uY/ZL8Hkw3TmxuahqZCxcOn1xBq2ss=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=BJWsX6OFyL5Tvi1bYdy7TGStg869BoNhYmhxPy1gouA=; b=bwVWwhryBmSyV5dkY1p46zhPN/wsF0nF+9muFH/ritfS79pm5rtSak0eqWtgbOPoXz /x30LWuQgdJK2uA8tN7XIeIea4EUM6K5wk8cZ3cDM+NsQueJ9gm3FghPncJyT1qqIyB0 iYMx3ripOaW5TcNWJW9twYOiQm4GdnLJ5Z1pbVVy8YnXAARnzVoiFw3pPTGhZO3llVHu 3j4GiHTVympOQoiwXA1HwheS+g2bB+1Eqw/37KsGP8bNpV/kevLTZ68HxiLzGnABzff0 pmdMY2Sbk/ugXOHA5DUPGLuiteb1H0sbgWz1hdSnJFyOnOoYmMFfUpriPROh33MyCaCZ iErg==
X-Gm-Message-State: AEkoouvedI+gK43wlGMyts3G4xXSqaAIjxfIcibezlJmCgZ1zWQhgevpSsvVJL5NwwdqFSP48CS0PI5sFFxI3g==
X-Received: by 10.55.137.70 with SMTP id l67mr52843848qkd.17.1469821293910; Fri, 29 Jul 2016 12:41:33 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.55.94.70 with HTTP; Fri, 29 Jul 2016 12:41:33 -0700 (PDT)
X-Originating-IP: [2001:4878:8000:50:8177:dae3:6e7d:d228]
In-Reply-To: <579BA470.3000405@isi.edu>
References: <CAJU8_nU1WzQNFFUn_2o1cACutB01iyQ_hC29PHoutr8TRDKGnA@mail.gmail.com> <579A4669.7030600@isi.edu> <87lh0lselg.fsf@ta.scs.stanford.edu> <CAJU8_nUPrm9JJMrrMbL5+FpP-9CKC6EkidCry9UuZA5ZfyJtoA@mail.gmail.com> <579A8223.8050308@isi.edu> <CAJU8_nXSxr7ykC1TwptBmyP8pNccz52ozq=hF7-EYiaMdDeLBQ@mail.gmail.com> <579BA470.3000405@isi.edu>
From: Kyle Rose <krose@krose.org>
Date: Fri, 29 Jul 2016 15:41:33 -0400
Message-ID: <CAJU8_nXjhHH1eEXPA3hvhJ3YXsP_v2djGX=X2p9+wyn767Hm5A@mail.gmail.com>
To: Joe Touch <touch@isi.edu>
Content-Type: multipart/alternative; boundary="94eb2c0731e61b979a0538cb7064"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tcpinc/cYUJfkowKDPjnZcZ2Ardq1PVhXw>
Cc: "Mirja Kuehlewind (IETF)" <ietf@kuehlewind.net>, tcpinc <tcpinc@ietf.org>, David Mazieres expires 2016-10-26 PDT <mazieres-p7v7bih3ykqpkxv5e74y9er6ts@temporary-address.scs.stanford.edu>
Subject: Re: [tcpinc] TCP's treatment of data in SYN packets
X-BeenThere: tcpinc@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "Discussion list for adding encryption to TCP." <tcpinc.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tcpinc>, <mailto:tcpinc-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tcpinc/>
List-Post: <mailto:tcpinc@ietf.org>
List-Help: <mailto:tcpinc-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tcpinc>, <mailto:tcpinc-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jul 2016 19:41:37 -0000

On Fri, Jul 29, 2016 at 2:46 PM, Joe Touch <touch@isi.edu> wrote:

>
> The thing about TCP is that it doesn't say what to do with data that is
> retransmitted.
>
> E.g., let's say you send SYN-abc, and I ACK only the SYN (not the data
> "abc").
>
> Then you send "def". I ACK the data *at the position of 3*. There's
> nothing that indicates which "position of 3" data I'm ACKing. For all you
> know, I cached the data in the SYN but did not ACK It, but when the new
> data came in I didn't overwrite it.
>
> Although I know this is unusual behavior, I'm not entirely positive it's
> prohibited by the spec. TCP doesn't say what happens to data that is sent
> more than once at a given position - there's no rule that it MUST be the
> variant seen in the most recently received segment.
>
> So I can easily imagine compliant implementations that might end up doing
> something you didn't want.
>
> That's why, IMO, if you send ENO, you need to make sure the SENDER doesn't
> put anything in the SYN data that has to be *changed*. Re-sent is fine. But
> CHANGED is not.
>

Right, I get that for interoperability with ENO-unaware stacks there is no
way to change data presented in the SYN. In the case where both ends
understand ENO but the server is not negotiating it, we can define TCP SYN
payload semantics differently: essentially, when there is an ENO option in
the SYN, an ENO-aware server will do one of two things:

(1) If it is negotiating ENO, it will hand the data off to the chosen TEP,
which will then indicate back to ENO whether to ACK the data or not.

(2) If it is not negotiating ENO, it will not ACK the data, and will in
fact throw it away and explicitly permit transmission of *different* data
for the same sequence number range.

This seems fine to me: since we're defining it in this case, we get to
choose the behavior. The problem is with interoperability with servers that
don't understand ENO, because they can't make an informed decision here,
and don't all throw away SYN data.

(4) Require signaling from the client application. This allows a client to
decide whether to support SYN data based on a priori knowledge of the
server's support for ENO.

I'm not sure what you mean here...

Allow the client to assume that a particular server supports ENO, and so
choose to send SYN data knowing a priori that the server will be able to
make the choice I outlined above. If you run a service on a particular
version of Linux that supports ENO, and distribute a phone app that
contacts only that service, it seems perfectly fine to tell your app to
assume the server knows ENO.

I'm not so sure about this case, as a middlebox unaware of ENO might be
breaking the connection: without SYN data, the connection simply wouldn't
negotiate ENO; with SYN data, the connection wouldn't negotiate ENO, and
the server might receive garbage data from the middlebox. Basically, cases
2-4 from my last email all carry similar potential for interoperability
problems.

Kyle