Re: [hybi] WS framing alternative

Greg Wilkins <gregw@webtide.com> Fri, 30 October 2009 08:03 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 273D83A69D9 for <hybi@core3.amsl.com>; Fri, 30 Oct 2009 01:03:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.382
X-Spam-Level:
X-Spam-Status: No, score=-2.382 tagged_above=-999 required=5 tests=[AWL=0.217, BAYES_00=-2.599]
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 qiWZmQk9KXUo for <hybi@core3.amsl.com>; Fri, 30 Oct 2009 01:03:20 -0700 (PDT)
Received: from mail-gx0-f228.google.com (mail-gx0-f228.google.com [209.85.217.228]) by core3.amsl.com (Postfix) with ESMTP id C4CDB3A67B1 for <hybi@ietf.org>; Fri, 30 Oct 2009 01:03:19 -0700 (PDT)
Received: by gxk28 with SMTP id 28so2616843gxk.9 for <hybi@ietf.org>; Fri, 30 Oct 2009 01:03:34 -0700 (PDT)
Received: by 10.150.173.17 with SMTP id v17mr2355714ybe.80.1256889813994; Fri, 30 Oct 2009 01:03:33 -0700 (PDT)
Received: from ?10.10.1.9? (60-242-119-126.tpgi.com.au [60.242.119.126]) by mx.google.com with ESMTPS id 14sm1315255gxk.14.2009.10.30.01.03.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 30 Oct 2009 01:03:33 -0700 (PDT)
Message-ID: <4AEA9DCE.7000703@webtide.com>
Date: Fri, 30 Oct 2009 19:03:26 +1100
From: Greg Wilkins <gregw@webtide.com>
User-Agent: Thunderbird 2.0.0.23 (X11/20090817)
MIME-Version: 1.0
To: hybi@ietf.org
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> <4AEA5713.8020008@it.aoyama.ac.jp> <Pine.LNX.4.62.0910300346010.25616@hixie.dreamhostps.com>
In-Reply-To: <Pine.LNX.4.62.0910300346010.25616@hixie.dreamhostps.com>
X-Enigmail-Version: 0.95.7
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
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 08:03:21 -0000

Ian Hickson wrote:

> The server will know what the clients will generally be sending -- e.g. a 
> chat client is going to be expecting messages in the range of half a 
> kilobyte or less, generally.

Why will the server know what the client will be sending?

The application built on top of the server might well know what
it is expecting, and maybe that will be of a size within a know
range and maybe that wont be able to be influenced by users doing
silly things etc.

but the application knowing and the code that implements the protocol
knowing are two entirely separate issues.

The application could tell the server implementation what size
to expect - but insert all your arguments against buffer size
negotiation on the wire here as arguments against passing
buffers sizes from app to server.

Besides, you keep saying that the people programming this don't
know how to calculate their own messages sizes - so they don't
know the length and couldn't tell you anyway.



> On Fri, 30 Oct 2009, Greg Wilkins wrote:
>> 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).
> 
> How could that ever happen? A client isn't ever going to just randomly 
> connect to a WebSocket server and start sending messages -- it's only 
> going to send messages the server wants to support.

People write new versions of software
Utilities and debugging tools can be written to talk to more than one server.
Mysterious intermediaries are inserted between you and the server.
Layered protocols are written on top of websocket that have options.
Programmers make mistakes



>> 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.
> 
> Sure, you just put them in the frames, as part of the higher-level 
> protocol.

But unless you allocate a standard flag for meta data, then
implementations that don't implement these optional features will
crash because they don't understand these injected frames.

If a ws client connects to a ws server, and neither knows if
the other supports some layered protocol - how do they discover
that? neither one can just send a message asking, because it
will break the other end if they don't support it!


>> 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 either completely false, or we have dramatically different goals.

Let's say that we have dramatically different goals.... sometimes that
happens and the sort of changes I'm minimally asking for are absolutely
trivial to the protocol and you can meet your goals and I can meet mine.



> Given the goal of just providing TCP for Web pages, it doesn't really make 
> sense to have a more involved protocol.

I'm not asking for a more involved protocol.
I'm asking for 1 bit to be allocated to indicate that a frame
contains mime-encoded data.    That is mostly sufficient
for layered protocols to be built on.



> It *would* make sense if your goal is something else, like tunneling 
> Jabber over HTTP or something. But that's a different project than 
> WebSockets. It's probably a perfectly reasonable thing for Hybi to work 
> on, but it should be articulated as its own project.

The sensible way to proceed would be to develop a simple but
extensible protocol that provides bidirectionality over the
web for all types of clients.

This can then be extended and/or layered upon for each type
of client.   So browsers could add on their origin security model
for example.

>From a servers/intermediaries point of view, browser are just
not that special that they deserve their entirely their own
protocol.




> I think you are misunderstanding the point of the frame types.

yes - kind of on purpose.

The WS Frame "byte" is really a frame bit, which is also
used indicate content-type (or at least content-encoding).

There are  7 unused bits in that byte. Allocating 1 of them
to indicate a meta data frame seams an entirely simple and
reasonable way to address one of the major concerns raised
by many people on this list.

Are you really saying you need to reserve space for 254 more
types of framing?

It's not like you are suggesting alternative ways to solve
the issues that we are raising.  You just keep saying "these
are not the droids that you are looking for....".  ie you
just say that the problems we raise are not problems for
you, so you don't care about them.


regards