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

Zhong Yu <zhong.j.yu@gmail.com> Mon, 22 November 2010 19:35 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 62AE028C13B for <hybi@core3.amsl.com>; Mon, 22 Nov 2010 11:35:10 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.399
X-Spam-Level:
X-Spam-Status: No, score=-2.399 tagged_above=-999 required=5 tests=[AWL=0.200, 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 EnYkyfTNwYSg for <hybi@core3.amsl.com>; Mon, 22 Nov 2010 11:35:09 -0800 (PST)
Received: from mail-qw0-f44.google.com (mail-qw0-f44.google.com [209.85.216.44]) by core3.amsl.com (Postfix) with ESMTP id 3C4A928C138 for <hybi@ietf.org>; Mon, 22 Nov 2010 11:35:09 -0800 (PST)
Received: by qwb7 with SMTP id 7so2719558qwb.31 for <hybi@ietf.org>; Mon, 22 Nov 2010 11:36:05 -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=hA3f5EyjgXkC3Oaf/EiCBW0RQ606Azxo7GySCZgxVD0=; b=O8yWKIyih6FwjBGbHBg9s9UmOIkO0Zg7A2tTIimG8DV5Q18Kh3T5lfBVCnZoKfi7cc aaR6Lr8EWcYx0q6jbzCtHvxaN/E0XafFLKrikuSrgRDd5e7giK9ZG9I+TO1f1AoTArqi 9FFVghGzzQAsyczuXceCNQVcXjunrWCPaChb0=
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=HRCXOtCB7jt5ljCEUjrtFb+IzCJL6CcjRGbX0IxeSAig/YB67BOuwSqPLYzpbxmAe7 HmOHukdEobmhMhz+Chf5FSVpuXJWWwJJMIqb6z8dqsj78Y2RAw/kxEtqAOLris/7F6eV eK/FTgjKUMCLCeUEWhPqZTrf+FNDZ8JqEIxsM=
MIME-Version: 1.0
Received: by 10.224.218.200 with SMTP id hr8mr1074287qab.37.1290454565095; Mon, 22 Nov 2010 11:36:05 -0800 (PST)
Received: by 10.220.189.136 with HTTP; Mon, 22 Nov 2010 11:36:05 -0800 (PST)
In-Reply-To: <AANLkTikS+N4ZjhoRLgZv5yetD2LceWXO=KC2ksgbfySQ@mail.gmail.com>
References: <059.5b3c3b280c1320a26d9c11c25e067e06@tools.ietf.org> <AANLkTinE95cwFQjFWc3SYsWFYSiY4mu27oQpedYJGgDJ@mail.gmail.com> <AANLkTikS+N4ZjhoRLgZv5yetD2LceWXO=KC2ksgbfySQ@mail.gmail.com>
Date: Mon, 22 Nov 2010 13:36:05 -0600
Message-ID: <AANLkTimnCTUQ58PJH9sSxev_AbW65Y3_nOptA4FTEH7=@mail.gmail.com>
From: Zhong Yu <zhong.j.yu@gmail.com>
To: John Tamplin <jat@google.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: hybi@ietf.org, sm+ietf@elandsys.com
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: Mon, 22 Nov 2010 19:35:10 -0000

On Mon, Nov 22, 2010 at 1:09 PM, John Tamplin <jat@google.com> wrote:
> On Mon, Nov 22, 2010 at 1:32 PM, Zhong Yu <zhong.j.yu@gmail.com> wrote:
>>
>> I think the answers to this question depend on specific programming
>> models, therefore they are best addressed by applications/frameworks.
>> WS protocol doesn't have to support streaming - that's the job of
>> frameworks. A single layer shouldn't mix streams and messages. (So we
>> have streaming framework, on top of WebSocket frames, on top of TCP
>> stream, on top of IP frames, on top of electronic stream, on top of
>> quantum of photons... It's turtle all the way, but there is only one
>> turtle at each level)
>
> I disagree completely.  WebSocket fragmentation isn't about supporting
> streams but rather supporting senders that don't know the length up front

if fragments of a single message must be consecutive and there cannot
be gaps between, then it is equivalent to in-frame chunking. That
sounds simple and fine.

> and advanced uses such as multiplexing.

for example?

> The unit of communication via
> WebSocket is always a message.
> This question has to be answered in order to interpret a stream of frames
> properly.  One of the following must be true to have a single unique
> interpretation of a sequence of frames:
> - control frames can't be fragmented
> - control frames cannot be inserted in the middle of a fragmented message
> - there must be a way to differentiate a control fragment from a data
> fragment
> - the receiver must keep an arbitrarily deep stack of in-progress messages
> --
> John A. Tamplin
> Software Engineer (GWT), Google
>