Re: [hybi] WS framing alternative

"Martin J. Dürst" <duerst@it.aoyama.ac.jp> Fri, 30 October 2009 03:01 UTC

Return-Path: <duerst@it.aoyama.ac.jp>
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 07A6C3A67C0 for <hybi@core3.amsl.com>; Thu, 29 Oct 2009 20:01:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.471
X-Spam-Level:
X-Spam-Status: No, score=0.471 tagged_above=-999 required=5 tests=[AWL=0.261, BAYES_00=-2.599, HELO_EQ_JP=1.244, HOST_EQ_JP=1.265, MIME_8BIT_HEADER=0.3]
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 p8440cJOXm6W for <hybi@core3.amsl.com>; Thu, 29 Oct 2009 20:01:54 -0700 (PDT)
Received: from scmailgw02.scop.aoyama.ac.jp (scmailgw02.scop.aoyama.ac.jp [133.2.251.42]) by core3.amsl.com (Postfix) with ESMTP id 052F23A679C for <hybi@ietf.org>; Thu, 29 Oct 2009 20:01:53 -0700 (PDT)
Received: from scmse01.scbb.aoyama.ac.jp (scmse01.scbb.aoyama.ac.jp [133.2.253.158]) by scmailgw02.scop.aoyama.ac.jp (secret/secret) with SMTP id n9U31xEQ021252 for <hybi@ietf.org>; Fri, 30 Oct 2009 12:01:59 +0900
Received: from (unknown [133.2.206.133]) by scmse01.scbb.aoyama.ac.jp with smtp id 1e03_97431e84_c500_11de_937b_001d096c566a; Fri, 30 Oct 2009 12:01:59 +0900
Received: from [IPv6:::1] ([133.2.210.1]:33608) by itmail.it.aoyama.ac.jp with [XMail 1.22 ESMTP Server] id <S124B55F> for <hybi@ietf.org> from <duerst@it.aoyama.ac.jp>; Fri, 30 Oct 2009 11:58:30 +0900
Message-ID: <4AEA5713.8020008@it.aoyama.ac.jp>
Date: Fri, 30 Oct 2009 12:01:39 +0900
From: "\"Martin J. Dürst\"" <duerst@it.aoyama.ac.jp>
Organization: Aoyama Gakuin University
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b3pre) Gecko/20090108 Eudora/3.0b1pre
MIME-Version: 1.0
To: Greg Wilkins <gregw@webtide.com>
References: <8B0A9FCBB9832F43971E38010638454F0F1EA72C@SISPE7MB1.commscope.com> <Pine.LNX.4.62.0910270903080.9145@hixie.dreamhostps.com> <a9699fd20910270426u4aa508cepf557b362025ae5db@mail.gmail.com> <Pine.LNX.4.62.0910271824200.25616@hixie.dreamhostps.com> <4AE76137.8000603@webtide.com> <Pine.LNX.4.62.0910272118590.25608@hixie.dreamhostps.com> <20091029123121.GA24268@almeida.jinsky.com> <4AEA0E6C.1060607@webtide.com>
In-Reply-To: <4AEA0E6C.1060607@webtide.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 8bit
Cc: hybi@ietf.org
Subject: Re: [hybi] WS framing alternative
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: Fri, 30 Oct 2009 03:01:56 -0000

I'm in general very sympathetic to the WebSocket protocol, because it's 
exactly what we would have needed a year ago in some research we did 
here (using browsers for collaborative editing, coordinated through a 
server).

Also I agree with Ian that for communication between a single server and 
a single client, applications can work out their own "protocol", or some 
classes of applications (e.g. collaborative editing of some type of 
structures) can converge on a "protocol".

As far as the client and the server are concerned, negotiating things 
such as frame length seems rather pointless to me, because: a) we don't 
have any such negotiation currently for e.g. Web pages or images. b) The 
client should know the server reasonably well, and for applications 
where frame length is an issue (e.g. image upload, although I think 
there are way better ways to do image upload than with WebSockets), an 
external description of the service may contain some limits, or the 
"protocol" will say that you have to send the size first and wait for a 
"uploading is okay" from the server.

Where length issues or the like may come into play may be 
intermediaries. And (generic) intermediaries are where metadata is most 
valuable.

That said, however, I also agree with some other people on this list 
that extension points should be considered carefully. Greg's proposal:

 >   1) WS should allow arbitrary headers in the upgrade request/response
 >
 >   2) WS should define a frame type for transport meta data, whose
 >      content is defined only as Mime (or just mime headers).
 >      The semantics of these can be left to other protocols built
 >      on top of WS.

seems to be a very good starting point.

Regards,   Martin.

On 2009/10/30 6:51, Greg Wilkins wrote:
> Rory Byrne wrote:
>> In a further effort to boost our chances of building robust
>> WebSocket servers, I would hope that we might consider adding some
>> sort of maximum frame length negotiation. Nothing fancy, there
>> could be a suitable default maximum, and a 'Max-Frame-Length' header
>> which enables a client to negotiate a higher maximum. Maybe something
>> like this:
>>
>>          GET /demo HTTP/1.1
>>          Upgrade: WebSocket
>>          Connection: Upgrade
>>          Host: example.com
>>          Origin: http://example.com
>>          WebSocket-Protocol: sample
>>          Max-Frame-Length: 2097152
>>
>>          HTTP/1.1 101 Web Socket Protocol Handshake
>>          Upgrade: WebSocket
>>          Connection: Upgrade
>>          WebSocket-Origin: http://example.com
>>          WebSocket-Location: ws://example.com/demo
>>          WebSocket-Protocol: sample
>>          Max-Frame-Length: 1048576
>>
>> The server would only send a 'Max-Frame-Length' header if it wanted to
>> set the maximum to be lower than the client suggested. Any thoughts?
>
>
> I think having the ability to negotiate such parameters is a good
> way to fail fast if a server and client are not compatible (eg
> client needs to send larger messages than server is willing to
> receive).
>
> But I'm sure that there will be resistance to having such negotiation
> as a mandatory part of the protocol.
>
> However, the problem with making this kind of negotiation optional
> (and this goes for my earlier examples of a load balancer
> communicating SSL info and/or node stickyness), is that the current
> WS protocol has no place for meta data to be added in an optional
> manner - so that it can be ignored by implementations that don't care.
>
> Ian has previously said that instead of adding headers to the
> Upgrade request/response, messages should be injected into the
> stream to communicate this meta data.      However, because
> there is no way to flag these messages as meta data, simple
> implementations are going to try to handle them as messages.
>
> This limitation of no standard meta-data paths, means that it
> is nigh impossible to introduce features like multiplexing,
> load balancing, fragmentations, HTTP transport etc. as optional
> additional specifications built on top of ws.   Because there
> is no meta channel, simple implementations will treat everything
> as a message and break if there is any new protocol layered
> on top.
>
> This is SO simple to fix:
>
>   1) WS should allow arbitrary headers in the upgrade request/response
>
>   2) WS should define a frame type for transport meta data, whose
>      content is defined only as Mime (or just mime headers).
>      The semantics of these can be left to other protocols built
>      on top of WS.
>
> With these 2 simple additions, then we could later develop a
> standards that (for example):
>
>   + implement  multi-plexing by negotiated support  in the
>     upgrade request/response and then injecting a meta data
>     packet, before each data packet, containing the information
>     needed to route the subsequent data message.
>
>   + implement standards to send content advisory messages
>     that would contain info such as language, content-type etc
>     for a connection.   These could be used by implementations
>     that wanted to be flexible, or ignored by implementations
>     that are sure they know what they are connecting to.
>
> The current proposal is just too nailed down.  There is no where
> to insert any optional handling.   The API is wired to the TCP/IP
> layer.  The handshake messages are locked down to binary equivalence.
> There are spare framing types available - but any suggestions to
> allocate that space for meta-data have been rejected.
>
> It appears that the whatwg want layered protocols to be controlled by
> the allocation of frame byte values to them and only officially
> sanctified extensions will get the nod.   The Whatwg needs to loosen
> up and realize  that it should not try to completely control how a
> protocol will be used in the wild (eg an not force all servers
> to be 100 line perl scripts).  They have to allow it some room to
> breath and grow.    They need to allocate some space for some
> arbitrary meta data to be used or ignored as implementations see fit.
>
>
> regards
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi
>

-- 
#-# Martin J. Dürst, Professor, Aoyama Gakuin University
#-# http://www.sw.it.aoyama.ac.jp   mailto:duerst@it.aoyama.ac.jp