Re: [hybi] Frame size

Mike Belshe <mike@belshe.com> Mon, 19 April 2010 04:27 UTC

Return-Path: <mike@belshe.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 B5D5F28C10D for <hybi@core3.amsl.com>; Sun, 18 Apr 2010 21:27:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.864
X-Spam-Level:
X-Spam-Status: No, score=0.864 tagged_above=-999 required=5 tests=[AWL=0.240, BAYES_50=0.001, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=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 nCXZKj6UPapv for <hybi@core3.amsl.com>; Sun, 18 Apr 2010 21:27:28 -0700 (PDT)
Received: from mail-vw0-f44.google.com (mail-vw0-f44.google.com [209.85.212.44]) by core3.amsl.com (Postfix) with ESMTP id 9335928C10A for <hybi@ietf.org>; Sun, 18 Apr 2010 21:27:28 -0700 (PDT)
Received: by vws11 with SMTP id 11so2253078vws.31 for <hybi@ietf.org>; Sun, 18 Apr 2010 21:27:17 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.220.71.134 with HTTP; Sun, 18 Apr 2010 21:27:16 -0700 (PDT)
In-Reply-To: <4BCBD6B6.7010802@caucho.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>
Date: Sun, 18 Apr 2010 21:27:16 -0700
Received: by 10.220.108.79 with SMTP id e15mr3240759vcp.21.1271651236974; Sun, 18 Apr 2010 21:27:16 -0700 (PDT)
Message-ID: <x2i2a10ed241004182127oaee6eaf2j8c56d967a55353ad@mail.gmail.com>
From: Mike Belshe <mike@belshe.com>
To: Scott Ferguson <ferg@caucho.com>
Content-Type: multipart/alternative; boundary="00c09f8e59794212dc04848f600e"
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 04:27:29 -0000

On Sun, Apr 18, 2010 at 9:06 PM, Scott Ferguson <ferg@caucho.com> wrote:

> Mike Belshe wrote:
>
>>
>>
>>     - to leave room for transport control messages inserted by the
>>       transport (such as graceful close and transport error indicators),
>>       so that applications don't have implement them
>>
>>
>> The protocol has implicit chunks - frames.  Having a second level of
>> chunking has little value here.  Or at least I haven't heard the use case.
>>
> Same as HTTP/1.1 chunking: when the length of dynamically produced content
> cannot be calculated beforehand.
>
> Unless the frames can be assembled into messages, it's not implicit
> chunking.
>
>
>> Applications that want to use chunking can do so already by just using
>> smaller frames.
>>
> I don't see how that makes any sense.
>

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.

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.

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
>
>