Re: [hybi] thewebsocketprotocol #28 (new): Fragmentation

Zhong Yu <zhong.j.yu@gmail.com> Wed, 24 November 2010 18:00 UTC

Return-Path: <zhong.j.yu@gmail.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 E33B13A6944 for <hybi@core3.amsl.com>; Wed, 24 Nov 2010 10:00:24 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.435
X-Spam-Level:
X-Spam-Status: No, score=-2.435 tagged_above=-999 required=5 tests=[AWL=0.164, 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 WqWmzUstrCUZ for <hybi@core3.amsl.com>; Wed, 24 Nov 2010 10:00:24 -0800 (PST)
Received: from mail-qy0-f179.google.com (mail-qy0-f179.google.com [209.85.216.179]) by core3.amsl.com (Postfix) with ESMTP id DD8233A68E0 for <hybi@ietf.org>; Wed, 24 Nov 2010 10:00:23 -0800 (PST)
Received: by qyk11 with SMTP id 11so14009qyk.10 for <hybi@ietf.org>; Wed, 24 Nov 2010 10:01:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=bueVzivL5NMnnVj+8tNCn4fWEwQyHnA2ZxRptpnPWQw=; b=nx6dBAGg39l3kJ2rnq9gAW7Y/l2GwJvD2DOMmjbP9xPST8sGmGL840X98DtA3RkhP7 VI7KDapB0wnPOWukXOOoGRCyy3Zchwu+2srzJLIzFGuguwFTNth5JYBIbcBk4lpDlm+W 5ix65kxhxpIn/1wYXm5k3YVgaLougbVIk1KeM=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=D5dv32VLxOS4MqmqDFfOE9b0ONuTMaJn3SctiWWugR7L5v4/WPP3rJP7wL8zybeSDf trzr+YHGi3Hewgwnm5sQgk2TLogGOdeE9+57qBligD7J/9sU3sqDqedScG7ygHVkc8pG s9R1AcvGti0pX+eCIQeYRTrMJIyinBwb5mBPc=
MIME-Version: 1.0
Received: by 10.224.45.139 with SMTP id e11mr7160133qaf.87.1290621683446; Wed, 24 Nov 2010 10:01:23 -0800 (PST)
Received: by 10.220.189.136 with HTTP; Wed, 24 Nov 2010 10:01:23 -0800 (PST)
In-Reply-To: <20101124104050.GY22787@shareable.org>
References: <059.5b3c3b280c1320a26d9c11c25e067e06@tools.ietf.org> <AANLkTinE95cwFQjFWc3SYsWFYSiY4mu27oQpedYJGgDJ@mail.gmail.com> <AANLkTikS+N4ZjhoRLgZv5yetD2LceWXO=KC2ksgbfySQ@mail.gmail.com> <AANLkTimaRzGObYrTCB8p7qbvqUpPPhR-uErNRaV_wPzr@mail.gmail.com> <AANLkTikzKLVT=kYKoc67rsZOaeP=0hKe8rkk7y8kuimH@mail.gmail.com> <20101124104050.GY22787@shareable.org>
Date: Wed, 24 Nov 2010 12:01:23 -0600
Message-ID: <AANLkTim4djXE2DXdqpn5kSbHPj93UgE3rOvO7vvUE+=m@mail.gmail.com>
From: Zhong Yu <zhong.j.yu@gmail.com>
To: Jamie Lokier <jamie@shareable.org>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: hybi <hybi@ietf.org>
Subject: Re: [hybi] thewebsocketprotocol #28 (new): Fragmentation
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: Wed, 24 Nov 2010 18:00:25 -0000

On Wed, Nov 24, 2010 at 4:40 AM, Jamie Lokier <jamie@shareable.org> wrote:
> Zhong Yu wrote:
>> The most important thing I think is the abstraction WS provides to app
>> developers. Right now the abstraction is simple -- one message after
>> another. The simplicity is a good thing, if it is compromised I don't
>> know what websocket is supposed to be any more.
>
> Right now, WS provides *two* abstractions: The one to app developers,
> and the one over TCP.
>
> Some of us believe they *should not be the same* due to network
> engineering issues *because that makes the app developer's job easier*.
>
> Right now, the "simplicity" of WS means *robust* apps need to
> implement half of TCP in Javascript on the client, which is not a good

That's where frameworks come in, which can provide degrees of
robustness suitable for different applications. I don't think WS
should or could address these application level concerns.

The #1 feature needed for robustness is auto reconnect. Nobody
proposed to build that feature in the WS protocol.

> sign.  (For example the "tic tac toe" example, which is supposed to be
> simple, can lock up on real networks: No more moves when a TCP is
> silently dropped.  A HTTP equivalent doesn't have this problem.)
>
> Why do you think the two abstractions should be the same?

They should not be. But no matter how complex the protocol must
become, I wish it won't jeopardize the simple application abstraction.
I don't want WebSocket to become WebService, and everybody needs to
buy a 1000 page "The Definitive Guide".

>
> HTTP's app abstraction is quite different from its wire abstraction,
> and that separation has worked extremely well for everyone.
>
>> Let's just kill fragments and don't even think about any advanced
>> features that depend on it. Every message stays in one frame, even
>> ones with unknown lengths.
>
> Technical question: How would you send a binary message with unknown
> length, in a single frame without fragments?

chunks within a frame. frames can't overlap, therefore messages cannot overlap.

>
> That said, I'm not sure why we need to support messages with unknown
> lengths in advance in the simplest protocol level anyway.  Is there a
> use case for control frames such as graceful close or error indication
> in the middle of a message?
>
> The use cases which come to my mind are: Keepalives - those are
> desirable in th middle of a large message, if the message is being
> generated slowly;

If it is so slow and it exceeds the timeout, who are we to say that
the connection is "alive"? The ping-pong test certainly says nothing
about application liveliness. I don't see the point.

> and graceful close/error indicator, in the case of
> WS being forwarded over a proxy.  But neither of those behaviours are
> in the simplest protocol.
>
> Imho, what we do need to do, though, is make it clear what proxies are
> supposed to do when forwarding a large or unbounded-length WS
> message...  Forward every byte as soon as they receive it, buffer
> whole messages if they so wish, or something between?  The first is
> inefficient over TCP (it can make unnecessary packets and unnecessary
> delays), and the second would lead to breakage because proxy behaviour
> would be different from non-proxy behaviour.  Right now, proxies doing
> CONNECT implement the first.
>
> -- Jamie
>