Re: draft-kinnear-httpbis-http2-transport questions

Eric Kinnear <ekinnear@apple.com> Sun, 24 March 2019 00:56 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0B380130ECD for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 23 Mar 2019 17:56:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.698
X-Spam-Level:
X-Spam-Status: No, score=-2.698 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=fail (2048-bit key) reason="fail (body has been altered)" header.d=apple.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 xg6RbEiB8yLK for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 23 Mar 2019 17:56:41 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [IPv6:2603:400a:ffff:804:801e:34:0:38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id ACBB4130EC8 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sat, 23 Mar 2019 17:56:41 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.89) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1h7rQA-0007t9-VL for ietf-http-wg-dist@listhub.w3.org; Sun, 24 Mar 2019 00:55:30 +0000
Resent-Date: Sun, 24 Mar 2019 00:55:30 +0000
Resent-Message-Id: <E1h7rQA-0007t9-VL@frink.w3.org>
Received: from uranus.w3.org ([128.30.52.58]) by frink.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <ekinnear@apple.com>) id 1h7rQ0-0007qc-78 for ietf-http-wg@listhub.w3.org; Sun, 24 Mar 2019 00:55:20 +0000
Received: from www-data by uranus.w3.org with local (Exim 4.89) (envelope-from <ekinnear@apple.com>) id 1h7rQ0-0001Tf-2D for ietf-http-wg@listhub.w3.org; Sun, 24 Mar 2019 00:55:20 +0000
Received: from titan.w3.org ([2603:400a:ffff:804:801e:34:0:4c]) by frink.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <ekinnear@apple.com>) id 1h7SUv-0000qz-54 for ietf-http-wg@listhub.w3.org; Fri, 22 Mar 2019 22:18:45 +0000
Received: from ma1-aaemail-dr-lapp01.apple.com ([17.171.2.60]) by titan.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <ekinnear@apple.com>) id 1h7SUs-0000L8-RT for ietf-http-wg@w3.org; Fri, 22 Mar 2019 22:18:44 +0000
Received: from pps.filterd (ma1-aaemail-dr-lapp01.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp01.apple.com (8.16.0.27/8.16.0.27) with SMTP id x2MMGrZ7065121; Fri, 22 Mar 2019 15:18:20 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=mime-version : content-type : sender : from : message-id : subject : date : in-reply-to : cc : to : references; s=20180706; bh=Jv/Vs+JTehT0AKXtcQt+G3N0W2QXKlgPuCz2UlCCz7E=; b=JQThRq6REKyKo8dkZoQujiPFcz7hdTonzcMQ9qRJ/GaWwP7B2/WJzovNEJhvrZFx8erB b/QdkzbFUkHOtbMxP9DtMc9f/9E9nzXBMln4CuCMJi5gikr34fJysKMA0vQzjTSAnDTe m6+WWxKiUSA9zKloCYcLVUmbtT/raI6oR9qaFtaoPbg+IcYSDh0jNLIsYqKuNkEAv9bY FGaoTdkIwnnD4oZrajCCngrLb5lP78Izc1cwklp4H2qIAm0MuWBCAqDe5iwinSXPtA2u zlhJPdgq1RgonfY9SVPQL2RUxMl3QcR7NpEIpIdMHCj1IEphvRHjN1ccGSkRIlYPASkC Vg==
Received: from crk-mtap-sz03.euro.apple.com (crk-mtap-sz03.euro.apple.com [17.66.12.163]) by ma1-aaemail-dr-lapp01.apple.com with ESMTP id 2rbn3vk3e4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Fri, 22 Mar 2019 15:18:20 -0700
MIME-version: 1.0
Content-type: multipart/alternative; boundary="Boundary_(ID_cErko9wSpCL41pVO/55RgQ)"
Received: from crk-mmpp-sz04.euro.apple.com (crk-mmpp-sz04.euro.apple.com [17.66.12.168]) by crk-mtap-sz03.euro.apple.com (Oracle Communications Messaging Server 8.0.2.3.20181024 64bit (built Oct 24 2018)) with ESMTPS id <0POS00AAWGMINN00@crk-mtap-sz03.euro.apple.com>; Fri, 22 Mar 2019 22:18:18 +0000 (GMT)
Received: from process_milters-daemon.crk-mmpp-sz04.euro.apple.com by crk-mmpp-sz04.euro.apple.com (Oracle Communications Messaging Server 8.0.2.3.20181024 64bit (built Oct 24 2018)) id <0POS00000G06WH00@crk-mmpp-sz04.euro.apple.com>; Fri, 22 Mar 2019 22:18:18 +0000 (GMT)
X-Va-A:
X-Va-T-CD: c23d783ab285e2e2724c3baee78f3ad6
X-Va-E-CD: 0e8927e9d98800650d37deaa590d93e3
X-Va-R-CD: 5c7f8fa88d8f049c3410ba954a01c718
X-Va-CD: 0
X-Va-ID: 4e240d69-eb47-47fc-a6bf-6d993b120fea
X-V-A:
X-V-T-CD: 01a37c4388be431533d60b3d58eeb299
X-V-E-CD: 0e8927e9d98800650d37deaa590d93e3
X-V-R-CD: 5c7f8fa88d8f049c3410ba954a01c718
X-V-CD: 0
X-V-ID: 449a1a03-a453-4c14-a5ac-e10223c08c5b
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-22_13:,, signatures=0
Received: from [17.235.221.157] (unknown [17.235.221.157]) by crk-mmpp-sz04.euro.apple.com (Oracle Communications Messaging Server 8.0.2.3.20181024 64bit (built Oct 24 2018)) with ESMTPSA id <0POS00KANGMBXV60@crk-mmpp-sz04.euro.apple.com>; Fri, 22 Mar 2019 22:18:16 +0000 (GMT)
Sender: ekinnear@apple.com
From: Eric Kinnear <ekinnear@apple.com>
Message-id: <D82DBE62-CE65-41FF-958C-4592D509DCFA@apple.com>
Date: Fri, 22 Mar 2019 23:18:10 +0100
In-reply-to: <9f7a6f56-13d8-4c91-b7be-7939c08c98e2@www.fastmail.com>
Cc: ietf-http-wg@w3.org
To: Martin Thomson <mt@lowentropy.net>
References: <9f7a6f56-13d8-4c91-b7be-7939c08c98e2@www.fastmail.com>
X-Mailer: Apple Mail (2.3445.104.2)
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-22_13:, , signatures=0
X-W3C-Hub-Spam-Status: No, score=-4.1
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1h7SUs-0000L8-RT 751f3c914c4970c3709a7f18ac6ab843
X-caa-id: 2ee8caf3de
X-Original-To: ietf-http-wg@w3.org
Subject: Re: draft-kinnear-httpbis-http2-transport questions
Archived-At: <https://www.w3.org/mid/D82DBE62-CE65-41FF-958C-4592D509DCFA@apple.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/36475
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <https://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Hi Martin, 

Thanks for the read through and for the comments! 

You’ve managed to hit upon most of the open questions remaining for this approach, which I expect will be discussed in Prague in tsvwg and httpbis. 
My intent here is to have this document present (alongside its -00) to help discuss those questions, at which point we can rev the draft and start a more detailed discussion on the list with a more concrete proposal. 

> On Mar 20, 2019, at 3:05 AM, Martin Thomson <mt@lowentropy.net> wrote:
> 
> Lots to think about here.  Thanks for sharing.
> 
> I have a few fairly basic questions about the goals of the draft.
> 
> Why do you need to use both :protocol and a setting?  Isn't SETTINGS_ENABLE_CONNECT_PROTOCOL plus the new values for :protocol enough?

Short answer: Yes, just doing a new :protocol value with the existing setting would be fine. There’s a big caveat around the “bidirectional” part, and I left the setting as covering both, when it probably should be only the second part. 

Long answer: 
So this brings me to some of the “where do we want this to go” questions. Right now, there are a few potentially competing goals, and I’ve left the setting to cover everything to ensure that any endpoint supporting this supports all of it. I expect that’s not what we really want long term, and that this can be split into two parts.  

A brief summary of those goals (this will be covered in a presentation in tsvwg this week): 

- Ability to establish transport of arbitrary bytes over a single stream on a multiplexed H/2 connection. At the API layer, we present this as if it were a TCP/TLS stream, with all the associated state machinery plumbed, but underneath we’re sharing a single H/2 connection. 

- Ability to share that H/2 connection with other streams, potentially also transporting arbitrary bytes, or maybe they’re performing standard H/2 requests/responses by sending HTTP messages. 

- Ability for the server to establish streams that transport arbitrary bytes (note that the client can reject these incoming requests for streams, just like any other H/2 stream). 
	This one is where it starts to get tricky, since we want everything to be bidirectional. This is the main reason to have a SETTING, since it’s a much larger leap than just adding a new :protocol value, and I’m not convinced that it’s currently allowed/even reasonable with CONNECT or any HTTP message. This is covered in -00 rather well by STREAM frames which are just defined as a new, bidirectional concept, but I’m not clear that -01 adequately solves this. (And ideas on the best way to accomplish this are most welcome!) 


In terms of use cases, we’re really looking at the intersection of a few things, and it may eventually be better to split this into two documents. 

1. Arbitrary transport of bytes (and potentially a framing layer that suffices for datagrams, see comments below) is useful for tunneling things over an H/2 connection while getting all the benefits of the shared underlying transport. 
	This could enable nice types of proxies, like for UDP, using existing CONNECT (not to the other endpoint), etc. 
	This is great to enable talking directly to the other endpoint if you wanted to bundle everything to that host together (of course, HoL blocking is still a thing)
	There are a several more that are written up across some of the HiNT (https://tools.ietf.org/html/draft-pardue-httpbis-http-network-tunnelling-01 <https://tools.ietf.org/html/draft-pardue-httpbis-http-network-tunnelling-01>) and HELIUM (https://tools.ietf.org/html/draft-schwartz-httpbis-helium-00 <https://tools.ietf.org/html/draft-schwartz-httpbis-helium-00>) drafts, which have lots of really great ideas and discussion.
	Having headers available in the HTTP message (as opposed to the -00 with STREAM frames) is useful for these types of use cases. 

	This starts to cover some of the “enhance CONNECT a little more and define ways to send the missing pieces over it/negotiate how to have both ends agree on what’s happening” strategy. 
	

2. Bidirectional establishment of arbitrary transport of bytes is another very useful concept
	I’d like to have both ends of a connection be able to establish a new stream that carries bytes — once you’re connected to someone, both sides should be able to initiate contact with the other. I use this today for making just a single link between devices and then having different services run on top of that shared link. 
	This is something that’s offered by QUIC Transport (i.e. not H/3) and there are lots of use cases for this - however we likely need to fall back to TLS/TCP for some percentage of connections. HTTP/3 falls back to HTTP/2 over TLS/TCP and is happy. QUIC Transport needs something to fall back to, and HTTP/2 Transport could be that thing.

For QUIC Transport falling back to TLS/TCP, some frame types aren’t necessary (ACK) since TLS/TCP provides reliability, etc. 
At that point, pretty much every frame maps to H/2, with the exception of being able to open new streams (and from either endpoint) without HTTP headers. I’m thinking that something along the lines of the -00 for this document works a bit more cleanly for this purpose, but that’s the main point of the discussion to be had. A QUIC STREAM frame would map pretty much directly to the STREAM frame in -00 and we can decide to use DATA for application data or keep it in the STREAM frame like QUIC. 


In terms of future direction, I’m thinking that this may need to be two documents, one for “how to run QUIC transport over TLS/TCP using H/2 framing / H/2” and one for “adding new :protocols to the extended CONNECT handshake”. The current document clubs beginnings of both together rather harshly and I’m not sure that’s helpful or useful. 


> 
> How does a :protocol of bytestream differ from a plan CONNECT?

My take on this is that RFC8441 specifies a way to use CONNECT to establish a stream terminated by the other endpoint of the H/2 connection, whereas plain CONNECT establishes a new connection to (potentially) a different host entirely and then tunnels traffic through to that other host.
Because of that, you want many of the same things that WebSocket over H/2 needed, like ways to match up listening applications to these incoming streams.

> What is the point of a :protocol of datagram?  Is the idea to use UDP?  The string "UDP" appears nowhere in the draft, so I've concluded that that isn't the case, except that using UDP would be the only way in which this would be different (and therefore marginally useful, modulo the obvious head-of-line stuff).

I debated dropping “datagram” out as a potential :protocol value, but left it in for now, since one of the things that would be nice to have is the ability to encapsulate datagrams. 
The idea here was to support sending delineated messages, but if you really want to do that you should probably be adding some framing (or even WebSockets) if you’re coalescing DATA frames, etc. At that point, we really need some framing in here (which isn’t in -01) or to remove it entirely.

Just to make sure, by “use UDP” do you mean this would be H/2 over TLS encapsulating datagrams on a given stream, or using UDP/DTLS underneath and sending the H/2 frames over that?

> 
> FWIW, the datagram thing might work, but DATA frames aren't really designed to work that way.  In order to use a datagram tunnel effectively you would have to change the complete stack for DATA to avoid coalescing of frames, buffering, splitting and all those sorts of things that are natural for something with an underlying assumption of streaming semantics.  It might be better to define a new frame type for this purpose.

This is a really good point, since DATA frames aren’t guaranteed to get to the other side in the same shape that you tried to send them. If we’re going that far, then yes, additional frames may be easier to specify rather than changing the rules based upon the presence of an extension. 
Alternately, we go with yet-another-framing-layer and stick with that approach. 

> If the point is to enable UDP, then there are a few features I might want to request.  For instance, the ability to setup a listener.  The ability to know what the IP and port of that listener are.  The ability to set rules about what remote addresses can send to that listener (other than a fixed, CONNECTed peer).  That might get closer to being useful for something like WebRTC.  I would want all of that for QUIC, for instance, where head-of-line is less of a concern.  But that gets dangerously close to TURN, so we'd have to have the NIH discussion in light of that.

Would you communicate to the other endpoint about the listener or is that more of an API consideration? (All valid here, just curious)

Thanks again for the thoughtful review, and I’d love any ideas on how to get this where it needs to go! 

Thanks,
Eric


> 
> Cheers,
> Martin
>