Re: Proposal: Run QUIC over DTLS

Kazuho Oku <kazuhooku@gmail.com> Tue, 06 March 2018 09:29 UTC

Return-Path: <kazuhooku@gmail.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 333A0124D37 for <quic@ietfa.amsl.com>; Tue, 6 Mar 2018 01:29:33 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.989
X-Spam-Level:
X-Spam-Status: No, score=-1.989 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_REMOTE_IMAGE=0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 p_58sV6djHrj for <quic@ietfa.amsl.com>; Tue, 6 Mar 2018 01:29:30 -0800 (PST)
Received: from mail-pl0-x22b.google.com (mail-pl0-x22b.google.com [IPv6:2607:f8b0:400e:c01::22b]) (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 E0979126DFB for <quic@ietf.org>; Tue, 6 Mar 2018 01:29:29 -0800 (PST)
Received: by mail-pl0-x22b.google.com with SMTP id m22-v6so8011692pls.5 for <quic@ietf.org>; Tue, 06 Mar 2018 01:29:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yZXXF+IPjVDUXLkgiTh6m/9xZudozR+TQ+rAkSOwUho=; b=lE2gjcp6AGUXYkHGWq7sniW0BVP5d69d1moIZ0cjLBTTt/dwZBKRQ22yLx2rZ8jz35 DbAc2hpK5G7epkK6MYXPYzkBveoMeVZY1BhEx44LJlzvmBC4poCeXRAZSopf2jmh/eT0 zBIr8hRTZtT2sikFR/hmMfeL84RQ6WWhZRCkSxkMsGZyDgDGXWXpmAzT2NyJCGNGo9nb ulR17XyeWocvPhpYn+7PWptPoKXY7gNXDn0ijJK10BZqN95JhbvFyfhiULvki0S0RYyp VNWztI91nCWUgJXHluDgqFDA0W0YpnIjFgkpxx2ATuq/dby0GpEGORpyKqHb0J+oinxU XFUA==
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=yZXXF+IPjVDUXLkgiTh6m/9xZudozR+TQ+rAkSOwUho=; b=qcxNp3JsqR6/iDV8EkNskr3rOaQ6gUy3rwKWcyYPvWA107TOZSrHjdL5b0buPPjSju 8pQdzUkoIXuf66wY8qblO8/7EA9RP4eiK8044d9bN5cq0cW0icRuweGyBCSdtxBjF5G/ qZCdmayDLHnl3rr581iitlvGzwm+gNbWXq3JuwMjN7e8ZZ8KCn4sNNBDN9Plg1TDKB16 eNKrOMrQyrexgmrJACG/Mx0ISyNQSY1DmCMf6Sqpfgb6+RyQJJBpxud+wNHeBL9tZK7t h7cm3sDL7GDpt8TOEzyimuo4LeJdghy6709QN3iaUta1N6PuuLvsClCcL2VSXW7IDMIr pM8g==
X-Gm-Message-State: APf1xPC5XHAc4AFq9LmlEQyJabDTlsuuHROS780PwLYpv7R/ahYaOFoX WNg2UnNFux4W8J8bxBpyR+m717RXXV04TKgU1wc=
X-Google-Smtp-Source: AG47ELvn2NdCJ4mjHwNLsZ/1HxXUJsPGIvlVil7ZoLhPwupJ3ry1vKb+icjZAmXL8q2nMQK+etHvhn3aULwqtY7YCVQ=
X-Received: by 2002:a17:902:2de4:: with SMTP id p91-v6mr16309747plb.405.1520328569435; Tue, 06 Mar 2018 01:29:29 -0800 (PST)
MIME-Version: 1.0
Received: by 10.100.154.23 with HTTP; Tue, 6 Mar 2018 01:29:28 -0800 (PST)
In-Reply-To: <MWHPR15MB182183BE8E6E0C3A97795315B6D90@MWHPR15MB1821.namprd15.prod.outlook.com>
References: <CABcZeBO9g5vnPK2aGYEUOYOkT-898Gc0-d4T=kDvxuE2Yg6kMQ@mail.gmail.com> <CANatvzyevZrZciO3fTWFspp9utjKv9Z+PQ5F=yHKNBabssEsNw@mail.gmail.com> <MWHPR15MB182183BE8E6E0C3A97795315B6D90@MWHPR15MB1821.namprd15.prod.outlook.com>
From: Kazuho Oku <kazuhooku@gmail.com>
Date: Tue, 6 Mar 2018 18:29:28 +0900
Message-ID: <CANatvzzARjNdr6Rms0r0yVn41JwtU6p9uNueq_ZROVzU19-1+A@mail.gmail.com>
Subject: Re: Proposal: Run QUIC over DTLS
To: Subodh Iyengar <subodh@fb.com>
Cc: Eric Rescorla <ekr@rtfm.com>, IETF QUIC WG <quic@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000052bbcf0566bb1407"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/LdxgdeqUbrMlE9k31c2yXmARcec>
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, 06 Mar 2018 09:29:33 -0000

2018-03-06 15:39 GMT+09:00 Subodh Iyengar <subodh@fb.com>;:

> While using DTLS is not unworkable, the WG has put a lot of work put into
> the current header and packet format which shows that controlling the
> header format has several advantages for the transport to accomplish its
> goals. That being said, I think the spirit of ekr's proposal has several
> salient ideas which we could incorporate into the existing QUIC drafts
> irrespective of deciding to adopt this draft.
>
> One of the salient ideas is a more clear layering structure. I believe it
> is possible to implement even QUIC as currently specified with a layered
> API, even if the current drafts make no assumptions about layering of the
> protocol.
>
>
> Even though our implementation, mvfst, is not layered, I can imagine an
> implementation creating a layering structure to be like
>
>
> [ QUIC transport layer]
>
> [ QUIC encryption and "record" layer ]
>
> [ UDP ]
>
>
> The roles of these layers are well defined (note that I have not
> implemented this yet).
>
>
> The transport layer
>
> --------------------------
>
> It maintains the transport state and gets signals from the encryption
> layer on what type of data is appropriate to write, i.e. no data, 0rtt
> data, or 1rtt data.
>
>
> Record layer
>
> -------------------
> The record layer would decide to encrypt the bytes with the appropriate
> keys.
>
>
> The record layer would also send packets for handshake data. Since the
> transport and the record layer would share the same packet number space it
> would be appropriate to give ownership of packet number counting to the
> record layer. Before the transport layer constructs a packet it would ask
> the record layer to assign it a packet number to use for its state
> accounting.
>
> Receiving a packet
>
> ---------------------------
> The handshake layer decrypts the packet and hands the transport layer a
> packet number and the decrypted frame data. If the handshake layer has any
> handshake packets outstanding it would go into a mode where it would read
> all acks from all packets to make a decision on whether its handshake data
> needs to be retransmitted. The handshake layer would only be responsible
> for transmission of stream 0 data.
>
>
> This allows acks for non handshake data to be used to re-transmit
> handshake data even though they are in different "layers". If the transport
> layer assumes that any gaps of data were transmitted by the handshake
> layer, it would also allow acks for handshake packets to be used for loss
> recovery of data packets as well by the transport layer.
>
> I could see the current draft adopt a more layered editorial structure, or
> it might be simpler to have a separate draft that describes the layering
> design of QUIC. I would be happy to work with ekr on this if this needs a
> separate draft. The spec could incorporate some features to address the
> issues ekr brought up. 3 changes that might bring us closer are:
>
>
>
>    - We could move crypto out of stream 0 and giving it it's own frame
>    type. This separates the "channel" of communication of crypto data
>    from "streams" which the transport has to maintain state for. In
>    several implementations, including ours, crypto streams are treated special
>    for everything anyway. The only resemblance to a stream is in the state
>    needed.
>    - Multiple QUIC packets in 1 UDP packet. There is already an open
>    issue for this.
>    - Getting rid of regular packet gaps so that multiple layers can use
>    gaps to decide which layer handled the data. I believe we are on a path to
>    doing this anyway.
>
>
> I'm not sure how to resolve the issue on version negotiation though.
>

Honestly speaking, I do not understand why people are interested in doing
QUIC v2 soon.

If we want to extend QUIC v1, we can add new extensions to TLS to negotiate
additional features.

Regarding preventing ossification, I think that can be (and should be)
achieved through greasing and obfuscation.

If my assumptions listed here are correct, requiring additional round-trip
is a non-issue. Assuming that a non-compatible change will come only once a
decade, we can just do happy eyeballs with QUIC version N and version N+1.


>
>
> Subodh
>
>
>
> ------------------------------
> *IFrom:* QUIC <quic-bounces@ietf.org>; on behalf of Kazuho Oku <
> kazuhooku@gmail.com>;
> *Sent:* Monday, March 5, 2018 8:32:28 PM
> *To:* Eric Rescorla
> *Cc:* IETF QUIC WG
> *Subject:* Re: Proposal: Run QUIC over DTLS
>
> 2018-03-06 8:05 GMT+09:00 Eric Rescorla <ekr@rtfm.com>;:
> > Hi folks,
> >
> > Sorry to be the one randomizing things again, but the asymmetric
> > conn-id thing went well, so here goes....
> >
> > TL;DR.
> > I'd like to discuss refactoring things to run QUIC over DTLS.
>
> EKR, Thank you for writing this. This is a very interesting proposal!
>
> I can see the point that the QUIC specification will become more
> straightforward if we adopt the DTLS-based approach, while, as an
> implementor of TLS 1.3 and QUIC, I do not think that the total cost of
> maintaining crypto and transport would change a lot.
>
> One thing that I like about the proposed approach in particular is the
> negotiation. As your draft points out, current approach has the
> overhead of requiring additional round-trip when the server's
> preferred version differs from that of the client.
>
> It makes sense to negotiate the QUIC version using the negotiation
> scheme available in (D)TLS.
>
> That said, I feel uneasy about building QUIC **on top of** DTLS.
>
> My understanding is that the intent of the working group is to build a
> transport. We have spent maybe about a half of our time discussing
> things that need to be implemented below the crypto (e.g., connection
> ID, stateless reset, path migration, etc.), while the other half being
> above the crypto (e.g., streams and multiplexing).
>
> I think that that reflects the nature of what transport is, and that
> the two need to be discussed together. In other words, I am afraid
> that moving half of the design to TLSWG while retaining the other half
> in QUICWG is likely to lead to the need for much more discussion
> (would we holding interims for two workgroups?) as well as making the
> decision process more complex.
>
> In my view, that increases the risk of QUIC standardization process
> being either delayed or ultimately failing.
>
> Therefore, I am sorry to say that I am negative to the proposal. I
> would feel safer if the proposal is adjusted to retain the sandboxing
> approach (i.e. define the layers below and above the crypto layers in
> QUIC WG while switching to DTLS).
>
> However, I also believe that the issues of the current approach that
> have been pointed out by the proposal can be adjusted without
> switching to DTLS, and I would prefer doing so unless we unanimously
> agree to switch to DTLS.
>
> PS. If we decide to adopt the proposal, I am happy to implement DTLS
> in picotls. It would not take a lot of time to do so.
>
> >
> > DETAILS
> > When we originally designed the interaction between TLS and QUIC,
> > there seemed like a lot of advantages to embedding the crypto
> > handshake on stream 0, in particular the ability to share a common
> > reliability and congestion mechanism. However, as we've gotten further
> > along in design and implementation, it's also become clear that it's
> > archictecturally kind of crufty and this creates a bunch of problems,
> > including:
> >
> >   * Stream 0 is unencrypted at the beginning of the connection, but
> >     encrypted after the handshake completes, and you still need
> >     to service it.
> >
> >   * Retransmission of stream 0 frames from lost packets needs special
> >     handling to avoid accidentally encrypting them.
> >
> >   * Stream 0 is not subject to flow control; it can exceed limits and
> >     goes into negative credit after the handshake completes.
> >
> >   * There are complicated rules about which packets can ACK other
> >     packets, as both cleartext and ciphertext ACKs are possible.
> >
> >   * Very tight coupling between the crypto stack and the transport
> >     stack, especially in terms of knowing where you are in the
> >     crypto state machine.
> >
> > I've been looking at an alternative design in which we instead adopt a
> > more natural layering of putting QUIC on top of DTLS. The basic
> > intuition is that you do a DTLS handshake and just put QUIC frames
> > directly in DTLS records (rather than QUIC packets). This
> > significantly reduces the degree of entanglement between the two
> > components and removes the corner cases above, as well as just
> > generally being a more conventional architecture. Of course, no design
> > is perfect, but on balance, I think this is a cleaner structure.
> >
> > I have a draft for this at:
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__
> datatracker.ietf.org_doc_draft-2Drescorla-2Dquic-
> 2Dover-2Ddtls_&d=DwIBaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=
> h3Ju9EBS7mHtwg-wAyN7fQ&m=wmlFadUY1Jjjb0308-LqYpvNMl8SR01vRZd6V_CwVVA&s=
> jI8gErodUXMcWnUPIRvyAO-NCsnN779ZOxJukgJzqXg&e=
> draft-rescorla-quic-over-dtls-00 - QUIC over DTLS
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__datatracker.ietf.org_doc_draft-2Drescorla-2Dquic-2Dover-2Ddtls_&d=DwIBaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=h3Ju9EBS7mHtwg-wAyN7fQ&m=wmlFadUY1Jjjb0308-LqYpvNMl8SR01vRZd6V_CwVVA&s=jI8gErodUXMcWnUPIRvyAO-NCsnN779ZOxJukgJzqXg&e=>
> urldefense.proofpoint.com
> QUIC over DTLS (Internet-Draft, 2018)
>
> >
> > And a partial implementation of it in Minq at:
> >
> > Mint: https://github.com/ekr/mint/tree/dtls_for_quic
> <https://github.com/ekr/mint/tree/dtls_for_quic>
> ekr/mint <https://github.com/ekr/mint/tree/dtls_for_quic>
> github.com
> mint - A Minimal TLS 1.3 Implementation in Go
>
> > Minq: https://github.com/ekr/minq/tree/quic_over_dtls
> >
> >
> > I can't speak for anyone else's implementation, but at least in my
> > case, the result was considerable simplification.
> >
> > It's natural at this point to say that this is coming late in the
> > process after we have a lot invested in the current design, as well as
> > to worry that it will delay the process. That's not my intention, and
> > as I say in the draft, many of the issues we have struggled over
> > (headers especially) can be directly ported into this architecture (or
> > perhaps just reused with QUIC-over-DTLS while letting ordinary DTLS do
> > its thing) and this change would allow us to sidestep issued we are
> > still fighting with, so on balance I believe we can keep the schedule
> > impact contained.
> >
> > We are designing a protocol that will be used long into the future, so
> > having the right architecture is especially important. Our goal has
> > always been to guide this effort by implementation experience and we
> > are learning about the deficiencies of the Stream 0 design as we go
> > down our current path. If the primary concern to this proposal is
> > schedule we should have an explicit discussion about those relative
> > priorities in the context of the pros and cons of the proposal.
> >
> > The hackathon would be a good opportunity to have a face to face chat
> > about this in addition to on-list discussion.
> >
> > Thanks in advance for taking a look,
> > -Ekr
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>
> --
> Kazuho Oku
>
>


-- 
Kazuho Oku