Re: Proposal: Run QUIC over DTLS

Eric Rescorla <> Tue, 06 March 2018 15:13 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 3C2F61270AB for <>; Tue, 6 Mar 2018 07:13:25 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -0.6
X-Spam-Status: No, score=-0.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, HTTPS_HTTP_MISMATCH=1.989, RCVD_IN_DNSWL_LOW=-0.7, T_REMOTE_IMAGE=0.01] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id l3z96AarYDRl for <>; Tue, 6 Mar 2018 07:13:21 -0800 (PST)
Received: from ( [IPv6:2607:f8b0:400d:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 1207D124235 for <>; Tue, 6 Mar 2018 07:13:21 -0800 (PST)
Received: by with SMTP id j4so25194362qke.10 for <>; Tue, 06 Mar 2018 07:13:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=EHvXevB5wB6OouVLjpqr+77NhonNQaU/M5Z0Y+T3HL0=; b=lvGGEtgPGlfPSIaa8pKwjB+MkQfhgn5a/Wc/HX4hy8F29t3w+j8cJ2gmapPINKxTiM 1rNXgunkhuN0e4BDezha+Z4/QKU4Hv/3MhLfEd4QtgmTQ/6Hv4jfRfeyPTuAIluF8LBL 6UmYdcH2DeOYtMjkTHa53W34GZVp5LeF1mq5C+uw74FK3IeXTMtAjsKX/ZkvAZaejaYI OEvoETK19ldPSIrbxPuX4CkERUSHiUMy3EtlB3pOrAMeyZfboSch1zxhMGQ8CbTD/Adb p4VI2OjKTPGN8XH3+IURirjTwJIBQZMD6gfuk/D14pZcuosnEU75kMsvnpDS7Isj9rXp WGqA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EHvXevB5wB6OouVLjpqr+77NhonNQaU/M5Z0Y+T3HL0=; b=MlM1Nkc1AlEpHOzVZAxWuV1CIP9L63mmnBQDIQMi0f+EE2BBWa01KioBENAX/r/bTE ZLoerXLBe+zw5q4g4NbtaxSkU11rPnl22r5oOzFWt2+FPYyUtcCqQ5W93RXF+1rBs+20 PqJz4xFow5wOkjEmGUBHMDTtiuXuESMn/zSC3hfPcnDVJbx4niKXNV7REadn/zuCvIkt Q5H2Qgt77xlaIFXH8D9YS5oxQmncbU+SMp5ZVwaIswZG+OzTCkcxdrOd0fP6i/CiIrkL BwjX5HaNrRyADsMcS2KKrFa2Z8IN8vi5olubHcsa9G/tA9qkmnR7H6JwN33Xrn4N0rb+ YqvQ==
X-Gm-Message-State: AElRT7GGBlr1FEiLpFnwFqBCmx1Pw7tJEAGs9BO7sf2FKQCEQkIK83zz GZ6t0T+SZx8lNDpJs8EUsYWjRvmz3G4a1bBlV4H6CA==
X-Google-Smtp-Source: AG47ELvKUFUiYmt0nrEmTU7yUi+Qmbv1ZelPQ16Uvtx/UgshHggZc7NS3UWrDJzJD4i9qiuq9De5b4z1O+hnZc7w1+0=
X-Received: by with SMTP id r89mr28145872qkr.152.1520349200027; Tue, 06 Mar 2018 07:13:20 -0800 (PST)
MIME-Version: 1.0
Received: by with HTTP; Tue, 6 Mar 2018 07:12:39 -0800 (PST)
In-Reply-To: <>
References: <> <> <> <> <>
From: Eric Rescorla <>
Date: Tue, 6 Mar 2018 07:12:39 -0800
Message-ID: <>
Subject: Re: Proposal: Run QUIC over DTLS
To: "Lubashev, Igor" <>
Cc: "" <>, "" <>, "" <>
Content-Type: multipart/alternative; boundary="001a1149442c00a69e0566bfe202"
Archived-At: <>
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 06 Mar 2018 15:13:25 -0000

FWIW it is possible to move the style of version negotiation from my draft
directly into the current draft if we so wanted. It's just that it's
necessary if QUIC is at the bottom of the stack and so is a nice extra win.

Specifically, we would have the version in the long header In Initial refer
not to the QUIC version we want to negotiate but rather to the version
whose obfuscation method we are using (probably the client's minimum). The
CH would then have an extension which contained the QUIC versions we
support (as in TLS.supported_versions) and then the SH would contain both
selected versions. We could have the remaining obfuscated long header
packets could use *either* obfuscation version. The encrypted long header
packets would of course use the negotiated versions.

A few notes:

- The CH always comes in one packet so that you don't have to worry about
it being immediately available to the server
- The SH may be broken up but as noted above, the obfuscation version isn't
part of the negotiation.

As with my draft, this would give you 1-RTT negotiation if the client
obfuscated with a version the server knew and 2-RTT if the client
obfuscated with a version the server didn't know, as opposed to always
having 2-RTT

If people think they like this idea, I'd be happy to write it up a separate


On Tue, Mar 6, 2018 at 4:54 AM, Lubashev, Igor <> wrote:

> If it requires an extra rtt to do version negotiation, it is likely that
> extensions will be created by other means. If we improve version
> negotiation to look more like one in Ekr's draft (no extra rtt), standard
> extensions are more likely to come in via new versions.
> - Igor
> -----Original Message-----
> *From:* Kazuho Oku []
> *Received:* Tuesday, 06 Mar 2018, 4:29AM
> *To:* Subodh Iyengar []
> *CC:* Eric Rescorla []; IETF QUIC WG []
> *Subject:* Re: Proposal: Run QUIC over DTLS
> 2018-03-06 15:39 GMT+09:00 Subodh Iyengar <>om>:
>> 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 <> on behalf of Kazuho Oku <
>> *Sent:* Monday, March 5, 2018 8:32:28 PM
>> *To:* Eric Rescorla
>> *Subject:* Re: Proposal: Run QUIC over DTLS
>> 2018-03-06 8:05 GMT+09:00 Eric Rescorla <>om>:
>> > 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.
>> >
>> > 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:
>> >
>> cker.ietf.org_doc_draft-2Drescorla-2Dquic-2Dover-2Ddtls_&d=
>> DwIBaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=h3Ju9EBS7mHtwg-wAyN7fQ&m=
>> wmlFadUY1Jjjb0308-LqYpvNMl8SR01vRZd6V_CwVVA&s=jI8gErodUXMcWn
>> UPIRvyAO-NCsnN779ZOxJukgJzqXg&e=
>> draft-rescorla-quic-over-dtls-00 - QUIC over DTLS
>> <>
>> QUIC over DTLS (Internet-Draft, 2018)
>> >
>> > And a partial implementation of it in Minq at:
>> >
>> > Mint:
>> <>
>> <>
>> ekr/mint
>> <>
>> <>
>> mint - A Minimal TLS 1.3 Implementation in Go
>> > Minq:
>> <>
>> >
>> >
>> > 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