Re: [hybi] Frame size

Scott Ferguson <ferg@caucho.com> Mon, 19 April 2010 05:16 UTC

Return-Path: <ferg@caucho.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 BE47D3A6895 for <hybi@core3.amsl.com>; Sun, 18 Apr 2010 22:16:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.182
X-Spam-Level:
X-Spam-Status: No, score=0.182 tagged_above=-999 required=5 tests=[AWL=-0.154, BAYES_50=0.001, IP_NOT_FRIENDLY=0.334, UNPARSEABLE_RELAY=0.001]
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 sKSjHw6Sgntw for <hybi@core3.amsl.com>; Sun, 18 Apr 2010 22:16:46 -0700 (PDT)
Received: from smtp114.biz.mail.sp1.yahoo.com (smtp114.biz.mail.sp1.yahoo.com [69.147.92.227]) by core3.amsl.com (Postfix) with SMTP id 1BA333A6AA7 for <hybi@ietf.org>; Sun, 18 Apr 2010 22:16:43 -0700 (PDT)
Received: (qmail 59082 invoked from network); 19 Apr 2010 05:16:28 -0000
Received: from scott-fergusons-macbook-pro-3.local (ferg@70.231.144.150 with plain) by smtp114.biz.mail.sp1.yahoo.com with SMTP; 18 Apr 2010 22:16:27 -0700 PDT
X-Yahoo-SMTP: L1_TBRiswBB5.MuzAo8Yf89wczFo0A2C
X-YMail-OSG: QBrN0ncVM1lGq6GMsLYlnuAU9KvgdYZnBV_PHSCgDsyv5O6NKdCGIuD3L5PMCtqHBLh3glCHlq6nywz0JdI9KCVi1tleu.3Mmo1Vtu4oAbUeH92jmxkQva_SeaNqcaiOEdUZRS8bbVylbfrslOo3TfQ5u2f1qcg0f_tqLUy0_Y7SQQL0Pdg_zcOJYpagXkoOQ2OC3J.ccyzk7gJLVhNSrbJBhJau7EsQmtXOJiTpUntk1TH0AgaPPLzrEl0b8k7z7i7DczX57kfnzuSOXq8YwS8RNmsBw6jJlO0jISUat21yLPwP6a193rTqsj2etEKOgrVtHdrO601wZJjZvoBVo58-
X-Yahoo-Newman-Property: ymail-3
Message-ID: <4BCBE72A.50009@caucho.com>
Date: Sun, 18 Apr 2010 22:16:26 -0700
From: Scott Ferguson <ferg@caucho.com>
User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228)
MIME-Version: 1.0
To: Mike Belshe <mike@belshe.com>
References: <8B0A9FCBB9832F43971E38010638454F03E3F313ED@SISPE7MB1.commscope.com> <s2qad99d8ce1004160053w436a29b1idae0c66737b3760a@mail.gmail.com> <4BC85A31.6060605@webtide.com> <t2iad99d8ce1004160949yb1ba9582l3b626c19dacf8d9@mail.gmail.com> <4BC96DA1.3000706@webtide.com> <u2m2a10ed241004181635qd0554193v36da94ecd7284d31@mail.gmail.com> <l2o2a10ed241004181637hdfab97d5r68f6845be49e8ad8@mail.gmail.com> <20100419005102.GC18876@shareable.org> <g2n2a10ed241004182005n9d8a5f02o29702620ae6205f4@mail.gmail.com> <4BCBD6B6.7010802@caucho.com> <x2i2a10ed241004182127oaee6eaf2j8c56d967a55353ad@mail.gmail.com>
In-Reply-To: <x2i2a10ed241004182127oaee6eaf2j8c56d967a55353ad@mail.gmail.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] Frame size
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, 19 Apr 2010 05:16:54 -0000

Mike Belshe wrote:
>
>
> On Sun, Apr 18, 2010 at 9:06 PM, Scott Ferguson <ferg@caucho.com 
> <mailto:ferg@caucho.com>> wrote:
>
>     Mike Belshe wrote:
>
>
> Sorry - we're thinking of two different things for chunking.  I was 
> thinking of chunking in terms of enabling multiplexing; but maybe I 
> was off from the original poster.  Sorry if that is the case.
Gotcha. I'm pretty sure both ideas are going on at the same time :).
>
> As for the example you pose - of course this is important.  But isn't 
> this up to the user of the websocket (e.g. the application)?  I don't 
> think the websocket protocol needs to do anything for this - as 
> chunking for two different applications is likely to be very different.
I think chunking for many/most applications will be similar because it's 
a pretty generic need, like HTTP's chunking is.  In the case of HTTP, 
many developers don't need to be aware that their output is getting 
chunked; it just works. I'd expect the same to be true for the simple 
frame/message model. Assuming it does cover the common cases, it's a 
useful abstraction to give users.

To tie this into the KISS requirement, it's a way to keep the 
client/server APIs and application code simple for the simple cases. 
Applications don't need to know about frames/chunks, just messages.

-- Scott

> Mike
>  
>
>
>     Here's a basic, typical application. Suppose messages are XMPP
>     packets (ours are binary HMTP, but the idea's the same). The
>     message is identical to the entire packet.  The sender don't know
>     how big the packet will be until serialization completes, but
>     receivers may need to know the message/packet end before parsing.
>
>     For sanity and performance, we use a fixed-size output buffer for
>     each packet. Each frame is a fragment of the XMPP packet and the
>     message only ends with the final frame. We don't know the length
>     of the entire packet until the entire thing is serialized. So the
>     protocol needs multiple frames forming a message.
>
>     This is a very basic pattern. There's nothing unusual about it and
>     I don't see how smaller frames addresses the issue, because it's
>     the message boundary that's important. If you're not marking
>     message boundaries, you may as well eliminate the frames entirely
>     and just have raw TCP.
>
>     16 vs 32 vs variable-length integer encoding isn't hugely
>     important. Chunking is important.
>
>         Overall, I'm talking about simplicity.  A 32bit fixed length
>         is simple and sufficient for purposes today and tomorrow.
>
>     HTTP's fixed Content-Length is not sufficient for the same reasons.
>
>     -- Scott
>
>