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

Kazuho Oku <> Thu, 20 October 2016 03:50 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 27B47129689 for <>; Wed, 19 Oct 2016 20:50:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -6.932
X-Spam-Status: No, score=-6.932 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, 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: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 5PgL_h85fhd9 for <>; Wed, 19 Oct 2016 20:50:54 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 6ED4C12946C for <>; Wed, 19 Oct 2016 20:50:53 -0700 (PDT)
Received: from lists by with local (Exim 4.80) (envelope-from <>) id 1bx4JZ-0008FK-9n for; Thu, 20 Oct 2016 03:46:45 +0000
Resent-Date: Thu, 20 Oct 2016 03:46:45 +0000
Resent-Message-Id: <>
Received: from ([]) by with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <>) id 1bx4JR-0008Cf-BX for; Thu, 20 Oct 2016 03:46:37 +0000
Received: from ([]) by with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <>) id 1bx4JM-0003mi-7E for; Thu, 20 Oct 2016 03:46:34 +0000
Received: by with SMTP id b81so60553039lfe.1 for <>; Wed, 19 Oct 2016 20:46:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=WKA32w5t0xtkXT1RGWupVvHt+iGkKBv7G0iIU7smuik=; b=GNQESDnAZLKMlwy9C2J1QaWpbQX4mc2H2+kB7JAHOZfw063i7IKaLq0Nzj6p4WfFjz BQcIrjVmTUhCZZHhYTs6tHwVZMdAalpqAT8vV5muoPyEsOgimRo6H4Yp4hxclWN/pFqL 35AUfqOMV6SLutq/LIftFKGunQ8N1jGzeHz9zouNzHq7dImpuls51vY6vJTUHUVVs+vK klMXBdcT8d799hGOulfFI+qG/fkNxjnhXTf+j/BAvP4LE7W318yTg6VlYcoPNsf9neqn fujjIYicCnbij0FmEWQj6Aw6uy9bG2Y4NMlGe33CmWX2zsFMcPqCY85anL1NQ6VQrWyn V5Ag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=WKA32w5t0xtkXT1RGWupVvHt+iGkKBv7G0iIU7smuik=; b=JLSY5A3I5r4zo49TQYwHq5qN/9eHD4jjQRSImOI6hqXNl0jFowBhl8q8/vS+dCwKAD qFkM+aUW75bCwEMCZxa0owyjrYeC7EPo2Qi5mJknyIWh13M31enq1YIvJhs80+6j/d6z TbpeyBQuSqr2joRo8jYmkCaUk5Y762PNJX7+tZtt4k+miA5emXXuJ9dFsQtQiJ/BZZLh cNK/ohIznqlf0FnpbunjpruQFfKUx8LJPey4Ryff3k5lpie578MXuHSsaYX8CfArdcPf DNffeBxVZMEqTHnyev9O1uZeJiLfuqV5Ite9lFMVY+eqOr4D3yrxawslra8tRu5U6o0h FYyg==
X-Gm-Message-State: AA6/9Rlr28xtNOX4//GRTiVovg7Td1n/F25np3O1zDW/Ue8O0TcSq5vUtCWQojx3JoKi2Ybj0F/1ToQcbqNpuw==
X-Received: by with SMTP id n127mr4573983wma.31.1476935164852; Wed, 19 Oct 2016 20:46:04 -0700 (PDT)
MIME-Version: 1.0
Received: by with HTTP; Wed, 19 Oct 2016 20:46:04 -0700 (PDT)
In-Reply-To: <>
References: <> <> <> <> <>
From: Kazuho Oku <>
Date: Thu, 20 Oct 2016 12:46:04 +0900
Message-ID: <>
To: Tom Bergan <>
Cc: Ilari Liusvaara <>, Van Catha <>, HTTP Working Group <>
Content-Type: text/plain; charset="UTF-8"
Received-SPF: pass client-ip=;;
X-W3C-Hub-Spam-Status: No, score=-3.5
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: 1bx4JM-0003mi-7E 7a1bd57ff97cbf11c647a3b5a2a8f194
Subject: Re: Quick review for draft-svirid-websocket2-over-http2 (Was: Re: Draft HTTPbis Agenda For Seoul IETF 97)
Archived-At: <>
X-Mailing-List: <> archive/latest/32648
Precedence: list
List-Id: <>
List-Help: <>
List-Post: <>
List-Unsubscribe: <>

2016-10-20 10:31 GMT+09:00 Tom Bergan <>:
> On Wed, Oct 19, 2016 at 5:48 PM, Kazuho Oku <> wrote:
>> Hi,
>> 2016-10-20 1:50 GMT+09:00 Ilari Liusvaara <>:
>> > 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.
>> >>
>> >
>> > 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:

Thank you for your comment.

I agree that a stream remains in open state until a frame with an
END_STREAM flag is sent by either of the two communication bodies. So
HTTP/2 as a spec. does not forbid using DATA frames for bidirectional

> 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.


This could be the case for any HTTP/2 gateway that translates incoming
requests to HTTP/1, that does not reject unknown schemes. And whether
such gateway needs to reject schemes that do not match to the
request-response model of HTTP seems to be vague in reading RFC 7540.
Section states that:

      ":scheme" is not restricted to "http" and "https" schemed URIs.  A
      proxy or gateway can translate requests for non-HTTP schemes,
      enabling the use of HTTP to interact with non-HTTP services.

My interpretation of this paragraph would be that it is permitted for
an HTTP/2 intermediary to transmit requests with schemes other than
"http" or "https", expecting that an upstream server would process the
request according to the scheme, considering the fact that (per my
understanding) such action is permitted in HTTP/1.1.

Kazuho Oku