Re: [hybi] Subprotocol and Control Frames

John Tamplin <jat@google.com> Wed, 05 October 2011 01:51 UTC

Return-Path: <jat@google.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 6CBD721F8AD1 for <hybi@ietfa.amsl.com>; Tue, 4 Oct 2011 18:51:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.911
X-Spam-Level:
X-Spam-Status: No, score=-105.911 tagged_above=-999 required=5 tests=[AWL=0.065, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8+LSf22K2hMZ for <hybi@ietfa.amsl.com>; Tue, 4 Oct 2011 18:51:27 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.67]) by ietfa.amsl.com (Postfix) with ESMTP id 5ED5C21F8ACA for <hybi@ietf.org>; Tue, 4 Oct 2011 18:51:27 -0700 (PDT)
Received: from wpaz1.hot.corp.google.com (wpaz1.hot.corp.google.com [172.24.198.65]) by smtp-out.google.com with ESMTP id p951sWmb016923 for <hybi@ietf.org>; Tue, 4 Oct 2011 18:54:33 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1317779673; bh=4snHxtJqGCmFR/C2TQ0GGm9ljHI=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=EDMIcglKbpSqhpPrXWoEPc5Kq/MU68QZIlfJpkR34tpMJAyGLbTgozCPaEinyTcfx Gwf6I21dHmKHuHTtkfn7g==
DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=dkim-signature:mime-version:in-reply-to:references:from:date: message-id:subject:to:cc:content-type:x-system-of-record; b=jIBAvCbXB9eW2Wl66C0d5CbzkbLEYNEp1i92KlQbWswtIJfpyugDEQRUnY4P7YEZG 1IEmwbQRMfa7jZl/0oZCA==
Received: from ggnq2 (ggnq2.prod.google.com [10.218.98.130]) by wpaz1.hot.corp.google.com with ESMTP id p951sUTh011340 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for <hybi@ietf.org>; Tue, 4 Oct 2011 18:54:30 -0700
Received: by ggnq2 with SMTP id q2so719765ggn.4 for <hybi@ietf.org>; Tue, 04 Oct 2011 18:54:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=f4m3W4PzA0ajoG4rILoENhJAonNL3dSsDnWB/DYMjQM=; b=aTMjtaGwZ8WRM9rdC2QtR4CiM8YoUO5tXyCO17hBpoAJcpLYKjY0Gmggfzs1Ud5Cl0 lQR+lRkUSRiasH3tCV5Q==
Received: by 10.150.104.10 with SMTP id b10mr1746874ybc.116.1317779670330; Tue, 04 Oct 2011 18:54:30 -0700 (PDT)
Received: by 10.150.104.10 with SMTP id b10mr1746869ybc.116.1317779670181; Tue, 04 Oct 2011 18:54:30 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.150.96.7 with HTTP; Tue, 4 Oct 2011 18:54:10 -0700 (PDT)
In-Reply-To: <92457F4F764A5C4785FCDBDDDD76477A123C6EA7@dfweml506-mbx>
References: <92457F4F764A5C4785FCDBDDDD76477A123C6E12@dfweml506-mbx> <CAH_y2NG+1TcQP6TVNbuwt6bjtCpQLaXtZvRjzBTefCrhb22+vA@mail.gmail.com> <92457F4F764A5C4785FCDBDDDD76477A123C6EA7@dfweml506-mbx>
From: John Tamplin <jat@google.com>
Date: Tue, 04 Oct 2011 21:54:10 -0400
Message-ID: <CABLsOLCiBg3qD0TS9fYwpiw_WeXW3FYKjVcn-SA-biHTUdwgiA@mail.gmail.com>
To: Hapner mark <hapner.mark@huawei.com>
Content-Type: multipart/alternative; boundary="000e0cd489d622274004ae837dd7"
X-System-Of-Record: true
Cc: "hybi@ietf.org" <hybi@ietf.org>, Greg Wilkins <gregw@intalio.com>
Subject: Re: [hybi] Subprotocol and Control Frames
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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: Wed, 05 Oct 2011 01:51:28 -0000

On Tue, Oct 4, 2011 at 9:36 PM, Hapner mark <hapner.mark@huawei.com> wrote:

> WebSocket provides support for both subprotocols and extensions and I
> believe both are available for use by outside parties as long as the IANA
> registration mechanisms are followed. Is this correct?
>

Yes, but there are very very few available, and they were intended for WS
infrastructure needs.  If the first WS subprotocol allocates two of them, do
we tell people in a couple of months "sorry, we are all out", and not have
any left for the purpose for which they are intended?  This is
notwithstanding the fact that current APIs make no provision for using other
opcodes, and as we have explained, we don't think they should.


> The core point in favor of using an extension is that WebSocket already
> defines an excellent framing protocol. There is simply no need for MBWS to
> layer yet another framing protocol over it. It would be equivalent to a REST
> service defining a request-response framing protocol within the HTTP
> request-response body when all it needed was to add a few new header fields.
> Let me see, I think I remember this being done, it was called WS* :>)
>

In most cases, such services *do* define a framing layer on top of HTTP --
for example, JSON, which defines how the payload carried by HTTP should be
interpreted.  They even have things like an opcode or message type inside
them.


> The point about control frame opcodes being 'scarce' is an issue; however,
> the spec already suggests the use of an extension bit to resolve this.
>
> The spec does not describe how the opcode space will be distributed across
> extensions. It does not say whether or not an extension opcode value can be
> 'redefined' by different extensions. Since a session can only be operating
> under one extension, there does not appear to be a technical reason why
> extensions could not redefine extension opcodes. If this is possible, then
> MBWS does not 'use up' any extension opcodes.
>

No, arbitrary extensions can be supported at the same time -- there is only
one subprotocol.


> Perhaps the fact that WebSocket itself does not reserve any of the opcode
> extension space for itself is an issue. There seems to be an implication in
> the comments so far that, in effect, they are all reserved and none are
> available for 'outside' use. I don't believe this is the case.
>

That was the intent of requiring registration of new opcodes and reserved
bits -- to basically require standards action for them to be assigned, since
they are so scarce.

Again, I think this issue is worthy of some serious debate. I'm not ready to
> concede, as yet, that defining MBWS as a WebSocket extension is wrong.


Let's say you did define it as an extension.  For it to be useful, the API
would have to be modified to suit your need and the browsers would have to
implement your extension.  What are the odds that will happen in a short
time period, vs. just using the facility already available via the
subprotocol?

@Ian - clearly, we need to add some text to the spec explaining the
distinction between subprotocols and extensions so others don't get the same
misconceptions.

-- 
John A. Tamplin
Software Engineer (GWT), Google