Re: [hybi] Fwd: The MessageBroker WebSocket Subprotocol

Bruce Atherton <bruce@callenish.com> Mon, 03 October 2011 16:47 UTC

Return-Path: <bruce@callenish.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 6D8DF21F8C4D for <hybi@ietfa.amsl.com>; Mon, 3 Oct 2011 09:47:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.52
X-Spam-Level:
X-Spam-Status: No, score=-2.52 tagged_above=-999 required=5 tests=[AWL=0.079, BAYES_00=-2.599]
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 jfE3yLTuxGzV for <hybi@ietfa.amsl.com>; Mon, 3 Oct 2011 09:47:24 -0700 (PDT)
Received: from biz82.inmotionhosting.com (biz82.inmotionhosting.com [74.124.202.87]) by ietfa.amsl.com (Postfix) with ESMTP id DCD9221F8C4B for <hybi@ietf.org>; Mon, 3 Oct 2011 09:47:24 -0700 (PDT)
Received: from [24.108.144.160] (port=51158 helo=[192.168.145.100]) by biz82.inmotionhosting.com with esmtpa (Exim 4.69) (envelope-from <bruce@callenish.com>) id 1RAlij-0002Cr-5f; Mon, 03 Oct 2011 09:50:25 -0700
Message-ID: <4E89E7D7.4010705@callenish.com>
Date: Mon, 03 Oct 2011 09:50:31 -0700
From: Bruce Atherton <bruce@callenish.com>
User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
MIME-Version: 1.0
To: Greg Wilkins <gregw@intalio.com>
References: <92457F4F764A5C4785FCDBDDDD76477A123C1C1A@dfweml506-mbx> <4E88236E.4040405@ericsson.com> <CABLsOLADfORBHVfPax75sQeRXTmTav8aOMfey_+KuSO=oPLsEA@mail.gmail.com> <4E88AB8D.6050407@callenish.com> <CAH_y2NH0KRi_mdvOQScFJtdWmKfFCk-g7C7F3e-xTYwA5C2CSw@mail.gmail.com>
In-Reply-To: <CAH_y2NH0KRi_mdvOQScFJtdWmKfFCk-g7C7F3e-xTYwA5C2CSw@mail.gmail.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - biz82.inmotionhosting.com
X-AntiAbuse: Original Domain - ietf.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - callenish.com
Cc: "hybi@ietf.org" <hybi@ietf.org>, Hapner mark <hapner.mark@huawei.com>
Subject: Re: [hybi] Fwd: The MessageBroker WebSocket Subprotocol
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: Mon, 03 Oct 2011 16:47:25 -0000

On 02/10/2011 5:45 PM, Greg Wilkins wrote:
> I do not think  opcodes are the right fit for defining messages in a
> subprotocol (at least not in the ws protocol as we have designed it).
>
> While I can imagine some subprotocols would desire to have opcode like
> metadata associated with a message, I  can also imagine many
> subprotocols will use JSON/XML as their message exchange format and
> thus will better use fields/elements/attributes to convey message
> type.

Exactly. Many subprotocols will not need anything more than the 
text/binary division we have. These subprotocols will not need any 
extension because they will not need new opcodes. Other subprotocols 
will contain the message type within the message themselves. HTTP 
requests are an example, as are SIP messages.

But then there are the ones where the type is not carried within the 
message. While you could define an extra header on the payload to carry 
that information, it seems like what the opcode is designed for. In 
fact, I can't think of any other use for the opcode than that. I could 
be wrong, perhaps it will turn out there are other uses for it. Time 
will tell once there are lots of implementations and deployments.

I am working on a Websocket-SIP bridge that uses different opcodes for 
SIP messages versus media channel messages. Now by happenstance I can 
send the SIP messages as text messages and media channel messages as 
binary (even if the media channel is a text one) and get the behaviour I 
want, but I would be lying to myself if I thought the opcodes still 
represented text and binary. I am overloading them to mean SIP and 
media. If I had needed more than 2 types of messages, or if I needed two 
types that were both binary, I would have had to define my own opcodes 
in an extension or prepend a header to get the behaviour I wanted.

MUX will be an example of a combination of subprotocol and extension 
assuming it ends up requiring new opcodes or flags. It defines a 
specific way for information to be passed over the Websocket transport 
making it a subprotocol that carries multiple channels, each potentially 
with its own subprotocol.

> Subprotocols are exposed to the application in the browser API, so I
> believe that sub protocol designs need to be restricted to what can be
> achieved without API changes or IANA allocations.   I think this is a
> good thing and keeps the barrier low for sub protocol development.
>

I expect that IANA registrations of opcodes will end up being specific 
to a particular subprotocol, but I could be wrong. We'll have to see how 
things turn out. But I would be surprised if this draft turned out to be 
the last one that wanted to use opcodes to define message types.

As for the barrier to entry for subprotocols, I am only suggesting that 
a few subprotocols with clear needs will want to define new opcodes. And 
I am hopeful that eventually browsers will provide APIs for people to 
plug in their own extensions.