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

Joe Touch <touch@isi.edu> Fri, 29 July 2016 18:53 UTC

Return-Path: <touch@isi.edu>
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 D773812D74B for <tcpinc@ietfa.amsl.com>; Fri, 29 Jul 2016 11:53:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8.186
X-Spam-Level:
X-Spam-Status: No, score=-8.186 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-1.287] autolearn=unavailable autolearn_force=no
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 rbCm4LxCwYMn for <tcpinc@ietfa.amsl.com>; Fri, 29 Jul 2016 11:53:14 -0700 (PDT)
Received: from boreas.isi.edu (boreas.isi.edu [128.9.160.161]) (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 4AB4912D10D for <tcpinc@ietf.org>; Fri, 29 Jul 2016 11:46:39 -0700 (PDT)
Received: from [128.9.184.41] ([128.9.184.41]) (authenticated bits=0) by boreas.isi.edu (8.13.8/8.13.8) with ESMTP id u6TIk9RW028355 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 29 Jul 2016 11:46:10 -0700 (PDT)
To: Kyle Rose <krose@krose.org>
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>
From: Joe Touch <touch@isi.edu>
Message-ID: <579BA470.3000405@isi.edu>
Date: Fri, 29 Jul 2016 11:46:08 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2
MIME-Version: 1.0
In-Reply-To: <CAJU8_nXSxr7ykC1TwptBmyP8pNccz52ozq=hF7-EYiaMdDeLBQ@mail.gmail.com>
Content-Type: multipart/alternative; boundary="------------090709020105040203050309"
X-ISI-4-43-8-MailScanner: Found to be clean
X-MailScanner-From: touch@isi.edu
Archived-At: <https://mailarchive.ietf.org/arch/msg/tcpinc/MzTDJXa9FxW08aikZyAlFbLXfMk>
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 18:53:16 -0000


On 7/28/2016 3:31 PM, Kyle Rose wrote:
> On Thu, Jul 28, 2016 at 6:07 PM, Joe Touch <touch@isi.edu
> <mailto:touch@isi.edu>> wrote:
>
>     On 7/28/2016 3:01 PM, Kyle Rose wrote:
>     > I still don't have a good feel for what folks like Joe are
>     > recommending re: dealing with a B that doesn't understand ENO.
>     If B is
>     > suddenly not ENO-aware,
>     Not suddenly. During the SYN exchange.
>
>
> Sorry, by "suddenly" I mean that an IP that formerly negotiated ENO
> gets swapped out for one that doesn't understand ENO: this could for
> example be the result of a load balancer sending the request to a
> machine with an older kernel.

Or a different connection. For all you know, there are multiple stacks
within the kernel (e.g., FreeBSD supports this) or per-connection settings.

IMO, it isn't a good idea to build a protocol around the default
assumption that past connections predict future ones. It's OK to guess,
but that guess has to be "unrollable". Which leads me to the concern
below...
>
> Note that it must be the case that the stack in question doesn't
> understand ENO, not just that it is now unwilling to negotiate ENO. If
> it knows about ENO but just doesn't want to negotiate it, it knows
> enough to throw away the SYN data.

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.

...
To your point:

> I see four main options:
>
> (1) Don't ever send data in the SYN. This is easiest, but sacrifices
> ENO support for SYN data forever for the sake of full interoperability
> with legacy TCP stacks, even with hosts a user knows a priori support
> ENO. This is not my preference.
It is known safe, though.

> (2) Retain knowledge of ENO support for an IP and assume it on
> resumption attempts, throwing that state away if ENO is not
> negotiated. This case means accepting that we'll have to retry the
> connection in cases when a server supporting ENO and one knowing
> nothing about ENO share an IP.
This is safe only if you kill off the connection where you try ENO with
data and it fails.

> (3) Require signaling from the server on a previous connection. This
> case is a more explicit form of (2), and carries the same dangers, but
> puts the configuration burden on the server administrator to assert
> that, yes, all servers responding for this IP support ENO.

Dangerous. TCP shares state explicitly only within a single connection.
Across connections, you can share hints that you can undo (ala RFC2140),
but nothing that changes the semantics of TCP or can't be unrolled
completely.

> (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...

Joe