Re: WebSocket over HTTP/2.0

Roberto Peon <grmocg@gmail.com> Fri, 14 February 2014 20:29 UTC

Return-Path: <ietf-http-wg-request@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 (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3E20E1A0403 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 14 Feb 2014 12:29:07 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.549
X-Spam-Level:
X-Spam-Status: No, score=-7.549 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.548, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
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 rqBvoPFPBHgJ for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 14 Feb 2014 12:29:02 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id BDDD01A0404 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Fri, 14 Feb 2014 12:29:02 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1WEPLI-0002lo-52 for ietf-http-wg-dist@listhub.w3.org; Fri, 14 Feb 2014 20:26:36 +0000
Resent-Date: Fri, 14 Feb 2014 20:26:36 +0000
Resent-Message-Id: <E1WEPLI-0002lo-52@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <grmocg@gmail.com>) id 1WEPL8-0002ky-EF for ietf-http-wg@listhub.w3.org; Fri, 14 Feb 2014 20:26:26 +0000
Received: from mail-ob0-f179.google.com ([209.85.214.179]) by maggie.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <grmocg@gmail.com>) id 1WEPL7-0005AY-5r for ietf-http-wg@w3.org; Fri, 14 Feb 2014 20:26:26 +0000
Received: by mail-ob0-f179.google.com with SMTP id wo20so14487970obc.38 for <ietf-http-wg@w3.org>; Fri, 14 Feb 2014 12:25:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=hDxFjb8/UNPqGpPuR1mYCJkKdLQKfAPHNy0oLfNnzwM=; b=fZMqKq67VRJnT8z8k5egtSuLxePBleiXqhEQn5LrVEA6dDnisCFzaxFbGVNM260WIu t/Xr8c2quCyl92W/qE6WsY8F9D7VsSdBMnd8zxgD7TNtTvfVDxrgSiAO+3R+jadFMTlc ExWUBCpS1kO+/rvNO8cyifcHu3ElqsFtGxmR4N6ZBKbO/h7r/ycQPFIVoF+U12T6fynQ CllDOWa7E2i3ZsgRmzf7I3sgin3S3CJji0MaTe0yBeSVbB9fb25/u/iyHJsC9NzRJAp9 iVpAut4f8192fbBT9jstHss8iOGOK5RnEyN3BfM7B8wFNFM8/x6EzXa2przOERAFwccp CsoQ==
MIME-Version: 1.0
X-Received: by 10.182.33.102 with SMTP id q6mr8311846obi.8.1392409558216; Fri, 14 Feb 2014 12:25:58 -0800 (PST)
Received: by 10.76.100.103 with HTTP; Fri, 14 Feb 2014 12:25:58 -0800 (PST)
In-Reply-To: <CABihn6GO7wmYNhyx58Jt43vv0QXzn2=QDqny14byA7DbKfbEcA@mail.gmail.com>
References: <CABihn6GO7wmYNhyx58Jt43vv0QXzn2=QDqny14byA7DbKfbEcA@mail.gmail.com>
Date: Fri, 14 Feb 2014 12:25:58 -0800
Message-ID: <CAP+FsNeRCatTXan6j97JQWBrmhjqB5W7msNfoK7rGsFTKnUkZQ@mail.gmail.com>
From: Roberto Peon <grmocg@gmail.com>
To: Yutaka Hirano <yhirano@google.com>
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="047d7b5d90b51976d304f2639dc9"
Received-SPF: pass client-ip=209.85.214.179; envelope-from=grmocg@gmail.com; helo=mail-ob0-f179.google.com
X-W3C-Hub-Spam-Status: No, score=-3.5
X-W3C-Hub-Spam-Report: AWL=-2.708, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001
X-W3C-Scan-Sig: maggie.w3.org 1WEPL7-0005AY-5r 37887e9d76b1d12492641167858477e7
X-Original-To: ietf-http-wg@w3.org
Subject: Re: WebSocket over HTTP/2.0
Archived-At: <http://www.w3.org/mid/CAP+FsNeRCatTXan6j97JQWBrmhjqB5W7msNfoK7rGsFTKnUkZQ@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/22235
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>

As I've said in hybi (but needs to be said here since we've changed venues):

I'd like to see a mapping of WS onto HTTP/2.

I am completely uninterested in any option that keeps full RFC6455
semantics (frame extensions make zero sense) without significant ofsetting
benefits, and I would work to ensure such was not again created at IETF,
and would work to ensure that it was not implemented at Google.


Plan D makes no sense to me. It requires implementation of two separate
parsers and yields no benefit for intermediary loadbalancing
infrastructure. Arguably it additionally increases latency, since the
handshake is still preserved as written in RFC6455.

Plan A offers some benefits for loadbalancers, etc. so long as END_SEGMENT
always correlates to the end of a message, and so seems potentially
tenable. Loadbalancers need not implement the RFC6455 parser in order to
load balance, which is a significant benefit. It is sad that there would
still be the latency of the handshake. I dislike that this would still
include much of the silliness in RFC6455 w.r.t. frame extensions.

I'd prefer/love to see a 1:1 mapping of the WS API to http2's framing layer:
Streams-of-messages would be initiated using HEADERS which included scheme
host path and content-type (for binary vs not binary), with messages
delimited using END_SEGMENT. If there is need to change the content type,
an additional HEADERS frame could be emitted changing the content-type.
This reduces the amount of latency overhead necessary, doesn't
significantly decrease byte efficiency, and requires less code long-term,
which enhances interop.

Loadbalancing HTTP and WS could be accomplished using the same code and
rulesets. A loadbalancer would simply check the scheme, host, path, and see
if it should demux the messages to separate backends, or forward the stream
normally. By default I'd assume a loadbalancer would forward the stream
unless it saw the scheme was http or https.

-=R


On Fri, Feb 14, 2014 at 6:23 AM, Yutaka Hirano <yhirano@google.com> wrote:

> Hi,
>
> I've submitted a draft of the WebSocket over HTTP/2.0 specification.
> http://tools.ietf.org/html/draft-hirano-httpbis-websocket-over-http2-00
> https://github.com/yutakahirano/ws-over-http2
>
> It has been discussed at hybi-ietf and spdy-dev, so I would like to recap
> the past discussions.
>
> Two years ago, Takashi started a discussion of WebSocket over SPDY at
> spdy-dev[1]. Mainly framing and the protocol negotiation method was
> discussed. For framing, three plans (A, B and C) were proposed. Many people
> liked plan C while some liked plan A.
> Unfortunately, the discussion faded away.
>
> I restarted the discussion in this January. I posted a message to spdy-dev
> and hybi-ietf. There were no response from spdy-dev and hence we discussed
> at hybi-ietf[2].
> For framing, the existing plans were updated and further plans were
> proposed. Some of them keep the RFC6455 semantics and map a WebSocket frame
> to some HTTP/2.0 frames. Others don't preserve the RFC6455 semantics. To
> narrow the discussion focus I proposed to decide if we should preserve the
> RFC6455 semantics or not. Many but not all agree to preserve the RFC6455.
> For protocol negotiation, thanks to the Tobias and Adam's comments, I
> revised the protocol negotiation method.
> As suggested by Salvatore, I decided to submit a draft and move the
> discussion to httpbis wg.
>
> The submitted draft contains several framing plans, but all of them
> preserve the RFC6455 semantics. Accepting a plan that doesn't preserve the
> RFC6455 requires rewriting the draft from scratch.
>
> WebSocket over HTTP/2.0 requires some additional definitions to be
> introduced in HTTP/2.0.
> - Introduce SETTINGS_SUPPORTED_SCHEMES as described in the draft.
> - A server MUST send a RST_STREAM when it receive a HEADERS with
>   an unsupported scheme.
> - Introduce HTTP/2.0[xx] as the "Application Layer Protocol Negotiation
>   (ALPN) Protocol IDs" registry established in [TLSALPN] for each xx,
>   meaning that the HTTP/2.0 protocol with scheme xx (e.g. HTTP/2.0[wss]).
>
> Your comments will be appreciated.
>
> Thanks,
>
> [1]:
> https://groups.google.com/forum/#!searchin/spdy-dev/WebSocket/spdy-dev/rwOh5dH4ibU/6QK-egrwDgsJ
> [2]: http://www.ietf.org/mail-archive/web/hybi/current/msg10266.html
>