Re: [hybi] New Version Notification for draft-mcmanus-httpbis-h2-websockets-00.txt

Andy Green <andy@warmcat.com> Mon, 16 October 2017 02:39 UTC

Return-Path: <andy@warmcat.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 957FC132332 for <hybi@ietfa.amsl.com>; Sun, 15 Oct 2017 19:39:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham 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 gFltXS5iNvU4 for <hybi@ietfa.amsl.com>; Sun, 15 Oct 2017 19:39:47 -0700 (PDT)
Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2C4B51320DC for <hybi@ietf.org>; Sun, 15 Oct 2017 19:39:47 -0700 (PDT)
To: Patrick McManus <pmcmanus@mozilla.com>
Cc: hybi <hybi@ietf.org>, Cory Benfield <cory@lukasa.co.uk>, Patrick McManus <mcmanus@ducksong.com>, HTTP Working Group <ietf-http-wg@w3.org>
References: <150807649389.12130.9191022211105955718.idtracker@ietfa.amsl.com> <CAOdDvNqhaTJmLcEk3CwBBaAbdOroc4U46z+nJzC7+chd1ErSDA@mail.gmail.com> <FEBB57D4-E841-4F45-9B62-81FFC653FF70@lukasa.co.uk> <0F93FB58-579D-4F52-8F22-5FEAFBC99165@warmcat.com> <CAOdDvNpCVxsaKEzoW3EWsK1hmWSBPOP+GHnK-DcP4QO4om_khQ@mail.gmail.com>
From: Andy Green <andy@warmcat.com>
Message-ID: <f4bb6b5c-b12e-dc59-6faa-15588b692574@warmcat.com>
Date: Mon, 16 Oct 2017 10:38:56 +0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0
In-Reply-To: <CAOdDvNpCVxsaKEzoW3EWsK1hmWSBPOP+GHnK-DcP4QO4om_khQ@mail.gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/hybi/0sRBIs8baJ6Ltxc41q36MMW00x4>
Subject: Re: [hybi] New Version Notification for draft-mcmanus-httpbis-h2-websockets-00.txt
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/hybi/>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Oct 2017 02:39:53 -0000


On 10/16/2017 04:38 AM, Patrick McManus wrote:
> Hey Andy - it sounds like my 2 mails on this thread mght not have been 
> posted to hybi? I'll try here with @mozilla.com <http://mozilla.com> 
> addr. Thanks for the note.

> thanks. I'll rephrase
> 
>     4) The draft should spell out it carries ws payload unchanged in h2
>     frames. 
> 
> 
>     Streams that have been successfully established as protocol tunnels
>     proceed to establish and utilize the WebSocket Protocol using the
>     procedure defined by [RFC6455 <https://tools.ietf.org/html/rfc6455>] treating the stream as if were the
>     connection in that specification.
> 
> Obviously there are approaches that could do far more significant things 
> to the protocol. This is a shim for bootstrapping 6455, otherwise 6455 
> remains in tact.

Yes... it should probably spell that out for DATA though, something like:

"Once upgraded, the h2 stream is used to transport the ws frames by 
enclosing them in h2 DATA frames.  There is no specific relationship 
between h2 DATA fragment sizes carrying the ws frames and the ws frame 
sizes; the h2 frames may refragment the original ws frames arbitrarily, 
eg to meet mux latency goals across multiple streams.

Although the DATA frames used for encapsulation are not distinguishable 
from DATA frames used for h2 http transport, note unlike DATA frames 
used for http they are not restricted in either direction by 
content-length and they may appear in either direction continuously, 
until END_STREAM appears.".

>     5) Hybi originally did the ws handshake key dance with hashes to
>     ensure there were no inadvertant ws handshakes
> 
> 
> see 4.

Not suggesting to change that...

>     6) If you make the ws key dance roundtrip optional, something to
>     keep h1 clients happy who don't know they're on h2, then you can
>     PUSH_PROMISE a ws upgrade on a specific subprotocol unilaterally,
>     eliminating roundtrips.  If you are serving html with a 
> 
> you can only push safe methods. connect is not safe. Again, I agree you 
> could remove an rtt (or probably 2) with a different approach at a cost 
> of higher complexity and changes. That's not the target here.

Well, it looks like you don't want to do it.  This thing would be an 
optional optimization it doesn't affect what you have at the moment.

PUSH_PROMISE has some restrictions as defined in RFC7450 8.2, like 
"Promised requests MUST be cacheable" which would need working around. 
It's also slightly different in that ws is bidirectional, normal 
PUSH_PROMISE the server manages delivering the promise or not, and the 
client can accept stuff to cache at any time or RST him.

But with ws PUSH_PROMISE content, there'd be a race between the script 
trying to instantiate the ws connection after the HTML was received so 
it has a context to use the ws link, and the server deciding to try send 
something.  It can be handled by defining the initial tx window to be 0 
for ws PUSH_PROMISE streams and the client must explicitly allow it to send.

Here's what I think it means for RTT... first the default as it is

Client				Server

  - SETTINGS                      - SETTINGS
  - GET /index.html
				 - 200 HEADERS + DATA

  - :method CONNECT
  				 - 200 HEADERS

  - DATA ws handshake
				 - DATA ws handshake final

  - DATA ...			 - DATA...

So after the h2 link is up, he needs 3 x roundtrips to send some ws 
data.  With an optional PUSH_PROMISE that the client feels he can use...

  - SETTINGS                      - SETTINGS
  - GET /index.html
				 - 200 HEADERS + DATA
				 - PUSH_PROMISE ws contains
				   ws handshake final

  - WINDOW_UPDATE (see below)
  - DATA ...
				 - DATA...

It's just one (client -> server) or 1.5 (server -> client) roundtrips 
instead of 3.

Anyway if nobody else wants it, no point worrying about it.

-Andy

> \
> 
>     >Doesn’t the introduction of a new pseudo-header field violate RFC 7540
>     >Section 8.1.2.1, which says endpoints MUST NOT generate new
>     >pseudo-header fields?
>     >
>     >Or is the position that that MUST NOT implicitly applies only if there
>     >are no negotiated extensions in use?
> 
>     That is a good point... won't a new Sec-whatever do?  Being able to
>     use whatever it is in PUSH_PROMISE to unilaterally offer an
>     unambiguous pre-upgraded ws stream would be very nice.
> 
> 
> I answered this is a message that probably wasn't posted to hybi 
> https://lists.w3.org/Archives/Public/ietf-http-wg/2017OctDec/0034.html.. 
> tl;dr; an opt-in extension lets you amend 7540 in ways that would be 
> protocol violations without the opt-in.
> 
> pseudo-headers are meant to control protocol level features and are 
> unique to that version of the protocol - so this helps ensure that the 
> Sec- header wasn't introduced by some other non h2 application .
> 
> -Patrick
> 
> 
>     -Andy
> 
>      >Cory
>      >
>      >> On 15 Oct 2017, at 07:12, Patrick McManus <mcmanus@ducksong.com
>     <mailto:mcmanus@ducksong.com>>
>      >wrote:
>      >>
>      >> FYI - also see
>      >https://github.com/mcmanus/draft-h2ws/blob/master/README.md
>     <https://github.com/mcmanus/draft-h2ws/blob/master/README.md>
>      >>
>      >> Comments, expressions of interest, etc are very welcome.
>      >>
>      >>
>      >> ---------- Forwarded message ----------
>      >> From: <internet-drafts@ietf.org <mailto:internet-drafts@ietf.org>>
>      >> Date: Sun, Oct 15, 2017 at 10:08 AM
>      >> Subject: New Version Notification for
>      >draft-mcmanus-httpbis-h2-websockets-00.txt
>      >> To: Patrick McManus <mcmanus@ducksong.com
>     <mailto:mcmanus@ducksong.com>>
>      >>
>      >>
>      >>
>      >> A new version of I-D, draft-mcmanus-httpbis-h2-websockets-00.txt
>      >> has been successfully submitted by Patrick McManus and posted to the
>      >> IETF repository.
>      >>
>      >> Name:           draft-mcmanus-httpbis-h2-websockets
>      >> Revision:       00
>      >> Title:          Bootstrapping WebSockets with HTTP/2
>      >> Document date:  2017-10-15
>      >> Group:          Individual Submission
>      >> Pages:          7
>      >> URL:
>      >https://www.ietf.org/internet-drafts/draft-mcmanus-httpbis-h2-websockets-00.txt <https://www.ietf.org/internet-drafts/draft-mcmanus-httpbis-h2-websockets-00.txt>
>      >> Status:
>      >https://datatracker.ietf.org/doc/draft-mcmanus-httpbis-h2-websockets/ <https://datatracker.ietf.org/doc/draft-mcmanus-httpbis-h2-websockets/>
>      >> Htmlized:
>      >https://tools.ietf.org/html/draft-mcmanus-httpbis-h2-websockets-00
>     <https://tools.ietf.org/html/draft-mcmanus-httpbis-h2-websockets-00>
>      >> Htmlized:
>      >https://datatracker.ietf.org/doc/html/draft-mcmanus-httpbis-h2-websockets-00 <https://datatracker.ietf.org/doc/html/draft-mcmanus-httpbis-h2-websockets-00>
>      >>
>      >>
>      >> Abstract:
>      >>    This document defines a mechanism for running the WebSocket
>      >Protocol
>      >>    [RFC6455] over a single stream of an HTTP/2 connection.
>      >>
>      >>
>      >>
>      >>
>      >> Please note that it may take a couple of minutes from the time of
>      >submission
>      >> until the htmlized version and diff are available at
>     tools.ietf.org <http://tools.ietf.org>;.
>      >>
>      >> The IETF Secretariat
>      >>
>      >>
> 
>