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

Generalizing CONNECT to allow you to tunnel protocols other than TCP – or rather, to explicitly state what protocol the other side should be expecting the TCP connection to speak – is a neat approach.  So first off, kudos!

If you say you’re upgrading to WebSockets, then I’d expect it to actually upgrade straight to WebSockets, not an HTTP/1.1 request which is expected to then upgrade to WebSockets.  I understand that would entail putting all the WebSocket negotiation headers on the CONNECT itself, etc. and I’m sympathetic to the argument that it is a larger change that may produce a roadbump.  But you’re making a commitment at the HTTP/2 layer that actually means nothing (“wss” scheme, “websocket” :protocol).

Given that you’re doing the full Upgrade-to-WebSockets dance inside the tunneled connection, why don’t you just say that you’re CONNECTing to an HTTP/1.1 tunnel?  That’s then treated as HTTP/1.1 over TCP, which is fully allowed to do Upgrade itself.  If you’re sure that’s the path you want, then simply say in the HTTP/2 layer that you’re doing HTTP/1.1 inside the stream.  Incidentally, that might be a nice alternative for dealing with HTTP_1_1_REQUIRED responses, too!

From: Patrick McManus [mailto:pmcmanus@mozilla.com]
Sent: Monday, October 16, 2017 5:16 AM
To: Andy Green <andy@warmcat.com>
Cc: Martin Thomson <martin.thomson@gmail.com>; Patrick McManus <pmcmanus@mozilla.com>; hybi <hybi@ietf.org>; Cory Benfield <cory@lukasa.co.uk>; Patrick McManus <mcmanus@ducksong.com>; HTTP Working Group <ietf-http-wg@w3.org>
Subject: Re: [hybi] New Version Notification for draft-mcmanus-httpbis-h2-websockets-00.txt



On Mon, Oct 16, 2017 at 12:44 AM, Andy Green <andy@warmcat.com<mailto:andy@warmcat.com>> wrote:

You can probably pipeline the CONNECT + ws handshake though, Patrick shows them sequentially and I didn't think about it myself.

right. The example is just for clarity and cannot show all expressions of h2 flows.

CONNECT + DATA before the response headers is pretty much the h2 analog of TCP Fast Open. The devil is in the details.. That's a general CONNECT + DATA issue not limited to the protocol upgrade described here so I don't think its worth discussion in a websockets rfc.

I think the path to success here hinges on a very tight scoping of work and therefore optimizing handshake latency is a non-goal of this effort.


Still only two round trips.

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

 - :method CONNECT
 - DATA ws handshake
                  - 200 HEADERS
                  - DATA ws handshake final
                  - DATA...

 - DATA ...             - DATA...

With the part of the pipelining that is legal for ws, two round trips before the client can start to send data and 1.5 before the server can send data... if it's true then you're right it's not so bad.
Were you concerned that the client needs to learn that the server
supports websockets and not just :protocol?

No I just followed Patrick's sequencing; he shows them serialized.  But you're right at least the CONNECT + ws handshake can probably be pipelined.

That's also going to be a variation from normal h2 HEADERS flow if I understood it, on one stream there will be END_HEADERs coming twice (for the CONNECT and the ws handshake separately)

Anyway you are right, it makes any difference with PUSH_PROMISE probably not worth the effort.

-Andy

Received on Monday, 16 October 2017 17:13:45 UTC