Re: [hybi] Framing take IV

Greg Wilkins <gregw@webtide.com> Thu, 05 August 2010 04:35 UTC

Return-Path: <gregw@webtide.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 07E9B3A6A40 for <hybi@core3.amsl.com>; Wed, 4 Aug 2010 21:35:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.737
X-Spam-Level:
X-Spam-Status: No, score=-1.737 tagged_above=-999 required=5 tests=[AWL=0.240, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 71pVFinHMz0Q for <hybi@core3.amsl.com>; Wed, 4 Aug 2010 21:35:31 -0700 (PDT)
Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by core3.amsl.com (Postfix) with ESMTP id 661893A68DC for <hybi@ietf.org>; Wed, 4 Aug 2010 21:35:31 -0700 (PDT)
Received: by fxm16 with SMTP id 16so1984849fxm.31 for <hybi@ietf.org>; Wed, 04 Aug 2010 21:35:40 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.223.119.136 with SMTP id z8mr9885070faq.63.1280982939929; Wed, 04 Aug 2010 21:35:39 -0700 (PDT)
Received: by 10.223.57.12 with HTTP; Wed, 4 Aug 2010 21:35:39 -0700 (PDT)
In-Reply-To: <Pine.LNX.4.64.1008050318300.5947@ps20323.dreamhostps.com>
References: <AANLkTinyrDoG5d_Ur6HVRy=SgMPjLzJtpJ++Ye=1DQdj@mail.gmail.com> <Pine.LNX.4.64.1008040050040.5947@ps20323.dreamhostps.com> <28A6543A-5CA6-42B7-8D2E-F5511EE20008@apple.com> <4C58C2F6.8050608@caucho.com> <Pine.LNX.4.64.1008040132190.5947@ps20323.dreamhostps.com> <4C58C4C8.5020900@caucho.com> <Pine.LNX.4.64.1008040139520.5947@ps20323.dreamhostps.com> <AANLkTikDX1jgjs9DekvhPzov_sqySEfnTGQR9b85W7Uc@mail.gmail.com> <Pine.LNX.4.64.1008050318300.5947@ps20323.dreamhostps.com>
Date: Thu, 05 Aug 2010 14:35:39 +1000
Message-ID: <AANLkTikq88XyCRbPLS_GWAzMVwQWrF7nQPczZj3woEd5@mail.gmail.com>
From: Greg Wilkins <gregw@webtide.com>
To: Ian Hickson <ian@hixie.ch>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Cc: hybi@ietf.org
Subject: Re: [hybi] Framing take IV
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/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: Thu, 05 Aug 2010 04:35:33 -0000

On 5 August 2010 13:24, Ian Hickson <ian@hixie.ch> wrote:
> On Thu, 5 Aug 2010, Greg Wilkins wrote:
>>
>> the thing that stops people defining subprotocols is that the concept of
>> a subprotocol is entirely undefined.
>>
>> Currently it is exposed in the js API as a simple string.  There is no
>> indication how that string can be used, how capabilities can be
>> discovered, declared or negotiated.  There is no mechanism to allocate
>> op-codes in the first byte other than to come here and try to convince
>> you that my extension is a good idea.
>>
>> If we can clearly define an extension and/or subprotocol mechanism then
>> I think we would be able to answer the concerns of those that feel the
>> need for particular features but see no way of achieving them in the
>> current protocol.
>
> I'm not sure I follow. A subprotocol wouldn't use "opcodes".

I'm sure a subprotocol would not use opcodes as I'm pretty sure that a
subprotocol is an application concern and therefore nothing to do with
the infrastructure over which the connection passes.

However, things like multiplexing, compression, fragmentation, load
balancing, connection aggregation etc are all concerns of the
infrastructure that would be best implemented transparently to the
application.  That is why we have been talking about extensions as
distinct from sub protocols.

subprotocols are not sufficient for infrastructural extensions.  Let's
assume that somebody invented a multiplexed-ws subprotocol and that it
was widely implemented by browsers and servers.   It supports virtual
connections and the real application sub protocol is sent over the
virtual connections in a virtual handshake.

So the browser supporting this would always send a ws handshake to the
server with the multiplexed-ws subprotocol.   But what if the
application was deployed on a server that did not support that
subprotocol? The only choice if for the server to reject that
handshake (which at the moment also means closing the connection.   So
the browser then has to suffer 2 more RTT while it cracks open a
dedicated basic websocket connection for the application and sends the
real subprotocol this time.     So infrastructure that uses
subprotocols for extensions are heavily penalized.

There are also complications in terms of the subprotocol field is able
to be set by the user.  I want my server to be able to have some
confidence that the extensions that it is negotiating with are from
the browser and not from the user.  We could get into all sorts of
mess if the the application starts pretending to be a browser
extension.

So there is a desire to define an extension mechanism that is above
the base protocol, but below the application layer and sub protocols.
Many think that it would be entirely appropriate for such extensions
to be able to use op-codes without the need to go through a painful
standardization process first in order to get op-codes allocated that
will not clash.


> Is there an equivalent for Comet-style protocols? (That is, subprotocols
> that use HTTP as the transport?)

HTTP is rich with extension points.  You can add new methods,
arbitrary headers, new content types, new URLs etc.
Comet protocols make use of  1 or more of these.