Re: Quick review for draft-svirid-websocket2-over-http2 (Was: Re: Draft HTTPbis Agenda For Seoul IETF 97)

Tom Bergan <tombergan@chromium.org> Thu, 20 October 2016 01:36 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 6942912984F for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 19 Oct 2016 18:36:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.931
X-Spam-Level:
X-Spam-Status: No, score=-6.931 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_SORBS_SPAM=0.5, RP_MATCHES_RCVD=-0.431, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=chromium.org
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 qk6O1HLjDo3Z for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 19 Oct 2016 18:36:26 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id BFC54129495 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 19 Oct 2016 18:36:26 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1bx2DI-0003Bp-9p for ietf-http-wg-dist@listhub.w3.org; Thu, 20 Oct 2016 01:32:08 +0000
Resent-Date: Thu, 20 Oct 2016 01:32:08 +0000
Resent-Message-Id: <E1bx2DI-0003Bp-9p@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <tombergan@chromium.org>) id 1bx2DA-0003B1-Nn for ietf-http-wg@listhub.w3.org; Thu, 20 Oct 2016 01:32:00 +0000
Received: from mail-it0-f43.google.com ([209.85.214.43]) by lisa.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <tombergan@chromium.org>) id 1bx2D4-0002wM-Et for ietf-http-wg@w3.org; Thu, 20 Oct 2016 01:31:57 +0000
Received: by mail-it0-f43.google.com with SMTP id 139so132434193itm.1 for <ietf-http-wg@w3.org>; Wed, 19 Oct 2016 18:31:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=O3JenhQ/nfDAoKZ6W/Ss+1YyW1e+5xwsB25IjQ4he74=; b=PdzEzELnM/aQfyVSlOwPXCY64VqrwyclVazegd8LFclMHQ4WBHXdM3BdkCmIPTVf2j yHt3MwhSVO0x9bUgJUXx0GG8ymD2fSCarG4m9RVjrq1hc4eBNK9s+/BiaKXepJl9Qxht ujv1+6m4iacDRzB1oDmQggyE3RxiHQi8+dN7Y=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=O3JenhQ/nfDAoKZ6W/Ss+1YyW1e+5xwsB25IjQ4he74=; b=RgC8pBpCB8IN0E63a7oyqbRNUKmmrr/BvB3SCZO7ulp8N7ohWHcDXoc7k3uPQWe/OQ 5dMrxHv1+YxnXDZb0LLwnwv3H58qYUui5z1V/9NGhwG7ZGJplFhnXSfdo0Ejy2pRu8ew nyOGIGlPMDx2vhITW1NtmfQ+ZHbdbjn4zq3vDQ+MlmbLrtTkpgx5MuVDd83r7tc3GKw6 2oInWeRj7Qc/ThGa1UbwmZfsOp2IWVAFjh77wZchtG/yu11d5tFERlx1CV4AVKaH+Z/G P/lOHyXAJ6jbzAqQmw8bfRqE9LuANHYeCPPF8goxV/kNbP3eMaXtyXx+MsssTjCkXqMy logQ==
X-Gm-Message-State: AA6/9RkKxyHYKbo0U1AeSjaYiFlr5/9kMjxDXSH/ewvf9uMem4e0oP7JsFW4+jROkrtCCi7P
X-Received: by 10.107.175.93 with SMTP id y90mr9627440ioe.86.1476927088062; Wed, 19 Oct 2016 18:31:28 -0700 (PDT)
Received: from mail-it0-f46.google.com (mail-it0-f46.google.com. [209.85.214.46]) by smtp.gmail.com with ESMTPSA id o144sm4415702itc.8.2016.10.19.18.31.27 for <ietf-http-wg@w3.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Oct 2016 18:31:27 -0700 (PDT)
Received: by mail-it0-f46.google.com with SMTP id 66so57798976itl.1 for <ietf-http-wg@w3.org>; Wed, 19 Oct 2016 18:31:27 -0700 (PDT)
X-Received: by 10.36.22.19 with SMTP id a19mr5804277ita.4.1476927086957; Wed, 19 Oct 2016 18:31:26 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.107.17.82 with HTTP; Wed, 19 Oct 2016 18:31:26 -0700 (PDT)
In-Reply-To: <CANatvzzJ89JKteRrhO19c6gmw5xdbZMKMFwUPjQpQhjWM1VOvA@mail.gmail.com>
References: <CAOdDvNrLJVxrPV54Jk3gKXmnZQQo8KGhaaCUu19phCLsP_H9zQ@mail.gmail.com> <CAG-EYCiJQQBe5_=vSn5sCC2inJgj+Pc6ePxgzw20AyzY1hAq7w@mail.gmail.com> <20161019165045.GA4278@LK-Perkele-V2.elisa-laajakaista.fi> <CANatvzzJ89JKteRrhO19c6gmw5xdbZMKMFwUPjQpQhjWM1VOvA@mail.gmail.com>
From: Tom Bergan <tombergan@chromium.org>
Date: Wed, 19 Oct 2016 18:31:26 -0700
X-Gmail-Original-Message-ID: <CA+3+x5E7OWPVbzgTo5XQcY5E1C9817ptpbj3PBmmxibctP_t5Q@mail.gmail.com>
Message-ID: <CA+3+x5E7OWPVbzgTo5XQcY5E1C9817ptpbj3PBmmxibctP_t5Q@mail.gmail.com>
To: Kazuho Oku <kazuhooku@gmail.com>
Cc: Ilari Liusvaara <ilariliusvaara@welho.com>, Van Catha <vans554@gmail.com>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="001a114534d260ed94053f41e2a3"
Received-SPF: pass client-ip=209.85.214.43; envelope-from=tombergan@chromium.org; helo=mail-it0-f43.google.com
X-W3C-Hub-Spam-Status: No, score=-5.2
X-W3C-Hub-Spam-Report: AWL=-1.010, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: lisa.w3.org 1bx2D4-0002wM-Et 487227b0df7b7baa433540487c7532ee
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Quick review for draft-svirid-websocket2-over-http2 (Was: Re: Draft HTTPbis Agenda For Seoul IETF 97)
Archived-At: <http://www.w3.org/mid/CA+3+x5E7OWPVbzgTo5XQcY5E1C9817ptpbj3PBmmxibctP_t5Q@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/32646
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: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

On Wed, Oct 19, 2016 at 5:48 PM, Kazuho Oku <kazuhooku@gmail.com> wrote:

> Hi,
>
> 2016-10-20 1:50 GMT+09:00 Ilari Liusvaara <ilariliusvaara@welho.com>:
> > On Wed, Oct 19, 2016 at 10:03:18AM -0400, Van Catha wrote:
> >> I am particularly interest in the future of 2 way binary streaming.  So
> the
> >> topics of WebSocket, Streams API and other related. I have even put
> forward
> >> a draft related to the WebSocket part.
> >> https://datatracker.ietf.org/doc/draft-svirid-websocket2-over-http2/
> >
> > Some quick review comments:
> >
> > - The handshake seems to negotiate compression and then the frames
> >   contain compression method indicator. Are there really multiple
> >   compression methods available on per-frame basis, or should the
> >   compression just be 1 bit (compressed or not)?
> > - The abbrevations in frame diagram are bit difficult to understand
> >   (have those be expanded in above text?).
> > - Somebody needs to try what this does against many HTTP/2 origins
> >   that don't support WebSockets2 and against intermediaries with
> >   custom server that actually supports it. Just to see what the
> >   heck happens (if it is nasty, one might need to use SETTINGS to
> >   signal support, either for WebSockets directly or for some sort
> >   of strict scheme).
>
> That's a good point.
>
> In case of H2O, all schemes are handling equally at the protocol
> layer. In other words, whatever the :scheme is, the server is designed
> to wait for a request, and then send response.
>
> My understanding is that the HTTP/2 specification is written in mind
> to allow such implementations, and that it would be a violation of
> HTTP/2 to introduce different interactions by using :scheme as an
> indicator. For example, transition of the stream states described in
> section 5.1 is not restricted to specific schemes.
>
> So if we are to start using the HTTP/2 framing layer to transmit
> websocket or other bi-directional communication, I think we should
> require negotiation using SETTINGS frame. Also, it might be beneficial
> to use a frame type other than DATA to convey bi-directional
> information to avoid potential issues (since the transition of the
> stream states are mostly related to how DATA frames are handled).


Ignoring the practical issues for a moment (which are obviously important),
which part of the H2 spec forbids bidirectional communication as desired by
WebSockets2? The stream state diagram in section 5.1 says that a stream
transitions from "idle" to "open" when the client/server sends/receives a
HEADERS frame (with CONTINUATIONs). A stream doesn't transition to a
"closed" state until a peer sends an ENDS_STREAM flag. Section 5.1 says: "A
stream in the 'open' state may be used by both peers to send frames of any
type." This seems to explicitly allow bidirectional communication with DATA
frames as desired by WebSockets2. Further, WebSockets2's bidirectional
communication looks very similar to bidirectional streaming in gRPC:
http://www.grpc.io/docs/guides/concepts.html#bidirectional-streaming-rpc
http://www.grpc.io/docs/guides/wire.html

In practice, I could see that some servers will try to consume the entire
request before returning any kind of response, and this definitely might
interact poorly with WebSockets2.