Re: [hybi] Fwd: The MessageBroker WebSocket Subprotocol

Frank Salim <frank.salim@kaazing.com> Mon, 03 October 2011 17:18 UTC

Return-Path: <frank.salim@kaazing.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 56A2621F8C22 for <hybi@ietfa.amsl.com>; Mon, 3 Oct 2011 10:18:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.977
X-Spam-Level:
X-Spam-Status: No, score=-2.977 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-1]
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 lExMTRt6GWo3 for <hybi@ietfa.amsl.com>; Mon, 3 Oct 2011 10:18:25 -0700 (PDT)
Received: from mail-vx0-f172.google.com (mail-vx0-f172.google.com [209.85.220.172]) by ietfa.amsl.com (Postfix) with ESMTP id 1ACA021F8C1F for <hybi@ietf.org>; Mon, 3 Oct 2011 10:18:25 -0700 (PDT)
Received: by vcbfo11 with SMTP id fo11so4623990vcb.31 for <hybi@ietf.org>; Mon, 03 Oct 2011 10:21:25 -0700 (PDT)
Received: by 10.220.7.146 with SMTP id d18mr53552vcd.178.1317662484082; Mon, 03 Oct 2011 10:21:24 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.220.83.201 with HTTP; Mon, 3 Oct 2011 10:21:02 -0700 (PDT)
X-Originating-IP: [64.71.23.250]
In-Reply-To: <4E89E7D7.4010705@callenish.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> <4E89E7D7.4010705@callenish.com>
From: Frank Salim <frank.salim@kaazing.com>
Date: Mon, 03 Oct 2011 10:21:02 -0700
Message-ID: <CA+sC5_99_7Ws5136RWpVGWGDwiNe2AHMPNpuBn2_wL07p7asVA@mail.gmail.com>
To: Bruce Atherton <bruce@callenish.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: "hybi@ietf.org" <hybi@ietf.org>, Hapner mark <hapner.mark@huawei.com>, Greg Wilkins <gregw@intalio.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 17:18:26 -0000

If you needed more than two types of messages, you would simply put
the message type in the payload. The fact that there are typed
messages at all is an artifact of the API and protocol evolution, not
something to design your protocols around.

Extensions should be used to transform the message stream (for example
by compressing payload bytes). A protocol, on the other hand, defines
an interaction. Protocols should not depend on the presence or absence
of particular extensions.

-Frank Salim

On Mon, Oct 3, 2011 at 9:50 AM, Bruce Atherton <bruce@callenish.com> wrote:
> 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.
>
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi
>