Re: Proposed changes to cleartext packets

Jana Iyengar <jri@google.com> Tue, 09 May 2017 02:04 UTC

Return-Path: <jri@google.com>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3E9B31293F5 for <quic@ietfa.amsl.com>; Mon, 8 May 2017 19:04:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.001
X-Spam-Level:
X-Spam-Status: No, score=-2.001 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_NONE=-0.0001, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.com
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 NKPToqCbYo4J for <quic@ietfa.amsl.com>; Mon, 8 May 2017 19:04:17 -0700 (PDT)
Received: from mail-pg0-x22e.google.com (mail-pg0-x22e.google.com [IPv6:2607:f8b0:400e:c05::22e]) (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 9BD06126C83 for <quic@ietf.org>; Mon, 8 May 2017 19:04:17 -0700 (PDT)
Received: by mail-pg0-x22e.google.com with SMTP id u28so32177840pgn.1 for <quic@ietf.org>; Mon, 08 May 2017 19:04:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1NbTaJv0cmDw2bmCl0cZrpBYvTXqZHf3/zgWQAadimg=; b=kYBZvI8QQIOLZG+xhwOJ2ox2AzoRVBt4Yin/MMPv/SObdUTSxrypNXFhlkPCSZc8Qw hiSvbKvXpF73LJz1uYg/OqaI7FNp5HGoFqdKauJzKQYQbgT/d7r5+W0nS+e9ga9luTp+ PAUFlftv1COi/fy08It8tOge3Q+jNomTF35GA5YJ6pN9priZp0rngPJQYg341+9Skwg1 pLDsO30UOcKLuYQfipnW1P+3hqmO/D1IQYu7OezY2Xb9ryPWDqC//ryDInu3NcAjH9he heIKFC20BWnh7+yd3+iamkjqxN8Ntljy+48QpdTQ0V1XTM4JNZgiMdWlA6DEZkj5SWgR eaDw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1NbTaJv0cmDw2bmCl0cZrpBYvTXqZHf3/zgWQAadimg=; b=dD7e4vdPmmPHBoyvPdIhYkVvafRXv6gakHt9rL38XAPcNioCwekCK8bovt8egWkaFe elIgcq4DIUhdKIVIPmGk434XovzghuZuzTg+WozTDPcxRd3uQyItNo6GFEoHUXEztlwA VGhp6IzP0w9OzT0i3rWNGJ2eTVIIVX8/KnjIFMYzhgEBXKEckoJxZxnt4xhgixnQFkHD e+yvVkTt2+j7lKG3A+fOERuBFd5xuFgz+TiC8i0r2+vzxPVYTAa1EvK57jtlTAxWvW99 zyRCBkMNj+WX4ABjquknTglZY1GzWcqI9SEjUFPYDg9x5KtcSPswPr7d2qYbtOWpFIHD eOFw==
X-Gm-Message-State: AN3rC/55fVdw6riGtXj5AfOaA7Lh73jiIoH/o+js7pZ3QXNKlrwJEQ3c nkTzJZRhSrB6Zx0uziSKAlo0gnSvfWrYXf86gQ==
X-Received: by 10.84.178.101 with SMTP id y92mr26206689plb.60.1494295456853; Mon, 08 May 2017 19:04:16 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.100.181.165 with HTTP; Mon, 8 May 2017 19:04:16 -0700 (PDT)
In-Reply-To: <CABkgnnU4s3T89tvJi8-Bqf6tEHBsk6vsUMb4qowSpo8_16NqBw@mail.gmail.com>
References: <CABkgnnWafP++wsy4nUHJU_QG=qcTE72x1Q21dCeUOEhoaEND-Q@mail.gmail.com> <CAGD1bZaRZ_V2myZK1yVyU2VnUAZCy-xDgrxf4N3oG2HseKfrsA@mail.gmail.com> <CA+9kkMBh9K5=bSJRNnLAnMwWeLFYKGQ6SJoMnb4ZoihFbvTq=Q@mail.gmail.com> <CAGD1bZY1-29EXUEmz2PgwkpjuwSSS4ZPydzVjnD4aF=KmmbLoQ@mail.gmail.com> <CABkgnnVvn4k5Q6RCo5tNrP0y2JC1ZKtYptXTVwddNkSTefki3g@mail.gmail.com> <CAGD1bZYxdNz1MnFOrQsCt1UESba+rHwSqzU_AOQLXNr0NQp_7Q@mail.gmail.com> <CABkgnnU4s3T89tvJi8-Bqf6tEHBsk6vsUMb4qowSpo8_16NqBw@mail.gmail.com>
From: Jana Iyengar <jri@google.com>
Date: Mon, 08 May 2017 19:04:16 -0700
Message-ID: <CAGD1bZY_nEUkct+ANbYZw=rReuZEZsnc=OjHJnwefsNx69HM4Q@mail.gmail.com>
Subject: Re: Proposed changes to cleartext packets
To: Martin Thomson <martin.thomson@gmail.com>
Cc: Ted Hardie <ted.ietf@gmail.com>, QUIC WG <quic@ietf.org>
Content-Type: multipart/alternative; boundary="94eb2c11ac62e57e5e054f0dc56b"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/9b-oR1fzCZKD-EkvTYSXQgTaE6s>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 09 May 2017 02:04:20 -0000

There are two issues that are I brought up; for clarity's sake, I'll limit
this discussion to the immediate one. I'm summarizing the two proposals,
because it helped clarify my thinking, so I hope it helps others as well.
Please correct / add anything you think is incorrect / missing. I'm back in
favor of the newer proposal, FWIW, see below.

*Proposal #1 (first proposal):*
Client sends Client Initial
Server sends ServerHello/Stateless Retry/Version Negotiation with new
connection ID

If server sends SHLO:
Client continues with connection, uses server-supplied connection ID
Server continues using same connection ID

If server sends SR / VN:
Client resets connection
Client sends Client Cleartext with server-supplied connection ID
Server continues using same connection ID.

Load balancer rules: Complicated; 0-RTT packets from client following
Client Initial carry client-chosen connection ID and those following the
Client Cleartext carry server-chosen connection ID.

Issues:
- no rules specified for the server to verify that the client is indeed
using the server's supplied connection ID.
- no rules specified for client to verify that the server saw its Client
Initial before sending SR/VN. (I see now that the packet number is echoed,
but we should turn this into a requirement for the client to verify. This
is what I meant by a "correlator" for the client to use to tie the
client-chosen ID to the server-chosen one.)

*Proposal #2 (newer proposal):*
Client sends Client Initial
Server sends ServerHello/Stateless Retry/Version Negotiation with new
connection ID

If server sends SHLO:
Client continues with connection, uses server-supplied connection ID
Server continues using same connection ID

If server sends SR / VN:
Client resets connection
Client sends Client Initial with server-supplied connection ID #1 (SCID1)
Server sends SHLO with new server-chosen connection ID #2 (SCID2).
Client continues sending Client Cleartext and 0-RTT packets with SCID1
When SHLO is fully received, client switches to 1-RTT packets and SCID2

Load balancer rules: Simple; 1-RTT packets use server-chosen connection
IDs, everything else uses client-chosen IDs (from the load-balancer's point
of view, even though SCID1 is actually server-chosen.)

Issue (repeating for clarity):
- no rules specified for client to verify that the server saw its Client
Initial before sending SR/VN. (I see now that the packet number is echoed,
but we should turn this into a requirement for the client to verify. This
is what I meant by a "correlator" for the client to use to tie the
client-chosen ID to the server-chosen one.)

Proposal #2 additionally has the value that no rules are required for the
server to verify that the client is indeed using the server's supplied
connection ID, since the load balancer treats SCID1 as client-chosen
anyways.

If my understanding is correct, I am back in favor of Proposal #2, because
I cannot resolve the load balancer question of 0-RTT packets with Proposal
#1. Laying it out like this makes it clearer, and I wonder if some of it
can make it into the draft. Currently, the draft does not really specify
how a server might use this degree of freedom of specifying server-chosen
connection ID in SR packets (especially with load balancing rules the way
they are intended to be), and I think it may be valuable to lay out what a
server might want to do. Should this go in the applicability draft perhaps?

- jana



On Sun, May 7, 2017 at 4:31 PM, Martin Thomson <martin.thomson@gmail.com>
wrote:

> On 6 May 2017 at 11:06, Jana Iyengar <jri@google.com> wrote:
> > I don't think we should add complexity to optimize an RTT for super rare
> > cases. If we could do it for no cost, that's fine.
>
> I guess that it's a matter of perspective. I consider the less complex
> case to be where the server's connection ID is always correct and the
> server can respond with a new connection ID if the client sends Client
> Initial.  That means that having Version Negotiation contain a
> server-selected connection ID is the cheap option.
>
> >> I'm not sure that I understand the advantages that this design has.
> >> You claim that it reduces the number of mechanisms to two, but I think
> >> that you end up with three because you need to use a transport
> >> parameter.  (FWIW, the current writeup essentially only has two
> >> mechanisms: NEW_CONNECTION_ID and server handshake packets, though
> >> I'll concede that there might be three of those).  It has essentially
> >> the same properties as what I've written up, but it's more complicated
> >> in several ways.
> >>
> >>
> >>
> >> The NEW_CONNECTION_ID frame implies a packet number gap.  With client
> >> authentication, the server might receive encrypted packets before the
> >> handshake completes.  If we take ekr's pull request for
> >> NEW_CONNECTION_ID, the server can't know what the gap is without
> >> receiving the handshake packets.
> >
> >
> > That's a single bit of information we can add to the frame.
>
> Yep, more complexity.
>
> >> You would instead have us switch the test to packet[0] & 0x80 == 0x80>>
> and packet[0] != 0x87 and packet[0] != 0x88, that is every long form
> >> packet except the 1-RTT ones.  I don't see any advantage there.
> >
> >
> > That's not right. Your logical expression reduces to:
> > if packet[0] != 0x87 and packet[0] != 0x88:
> >   routing = client_selected
> > else:
> >   routing = server_selected
>
> Read it again, it's not the same.  It says everything with long form
> except those two.  Though the point was poorly made: the logic isn't
> particularly relevant.
>
> > ... which is the same complexity, but it isn't the correct filter
> anyways.
> > There's a related problem that I realized with this most recent scheme:
> > Connection ID in 0-RTT packets are ambiguous. If they follow a Client
> > Initial, they're client-chosen, but if they follow a Client Cleartext,
> > they're server-chosen. I think this is a problem in your earlier version
> > too. So that's a bummer.
> >
> > You say you see no advantages. I wrote out the advantages in my previous
> > email, but perhaps you didn't see them?
> >
> > 1. Explicitly indicating the new connection ID gives the client an
> explicit
> > correlator from the client's ID to the new server one, which is better
> than
> > assuming that the 4-tuple will only carry packets for this connection.
> > Currently, the client will receive the first server packet with an
> unknown
> > Connection ID and the only correlator is the fact that it was received on
> > the same 4-tuple that the Client Initial was sent on. If you have
> multiple
> > connections on the same 4-tuple, there's no explicit correlator.
>
> OK, that didn't seem like a real advantage to me, just a rearrangement
> of the furniture.  Packets reach the client based on port/IP pairs.
>
> > 2. This mechanism (and the previous one in the current spec) have both
> the
> > server and the client changing connection IDs -- the server does it
> during
> > handshake and the client does it after it receives one or more
> > NEW_CONNECTION_ID frames. I think we can make this simpler (both in
> protocol
> > and impl) with only the client initiating this change by sending a packet
> > with a server-chosen connection ID first. If the client were the only one
> > initiating the change, this would allow the server to not care about
> doing
> > any changes mid-connection, and it could simply use the connection ID in
> the
> > largest received packet as the outgoing one.
>
> Yes, my assertion was that this isn't in fact simpler due to the need
> for special rules during the handshake.
>
> If you wanted to talk about how we might, for example, use a different
> connection ID in each direction, then I might concede that there are
> advantages in using the frame type.
>