Re: [hybi] Framing take IV

Maciej Stachowiak <mjs@apple.com> Wed, 04 August 2010 02:40 UTC

Return-Path: <mjs@apple.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 8151E3A6A41 for <hybi@core3.amsl.com>; Tue, 3 Aug 2010 19:40:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.51
X-Spam-Level:
X-Spam-Status: No, score=-106.51 tagged_above=-999 required=5 tests=[AWL=0.088, BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
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 pxBOapx9yjOj for <hybi@core3.amsl.com>; Tue, 3 Aug 2010 19:40:38 -0700 (PDT)
Received: from mail-out3.apple.com (mail-out3.apple.com [17.254.13.22]) by core3.amsl.com (Postfix) with ESMTP id 197DD3A68EA for <hybi@ietf.org>; Tue, 3 Aug 2010 19:40:38 -0700 (PDT)
Received: from relay14.apple.com (relay14.apple.com [17.128.113.52]) by mail-out3.apple.com (Postfix) with ESMTP id 4F8E8A15F4B6 for <hybi@ietf.org>; Tue, 3 Aug 2010 19:41:07 -0700 (PDT)
X-AuditID: 11807134-b7b36ae000004afc-34-4c58d343d883
Received: from et.apple.com (et.apple.com [17.151.62.12]) by relay14.apple.com (Apple SCV relay) with SMTP id FB.0C.19196.343D85C4; Tue, 3 Aug 2010 19:41:07 -0700 (PDT)
MIME-version: 1.0
Content-type: multipart/alternative; boundary="Boundary_(ID_xQraNn8QqOm8LHK1mvtVxg)"
Received: from [17.151.86.255] by et.apple.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPSA id <0L6L00LL3WSI9X30@et.apple.com> for hybi@ietf.org; Tue, 03 Aug 2010 19:41:06 -0700 (PDT)
From: Maciej Stachowiak <mjs@apple.com>
In-reply-to: <AANLkTi=i5haWmJ49ZUcQsV0Wi47v6gkxoHm_Ctb89KQ-@mail.gmail.com>
Date: Tue, 03 Aug 2010 19:41:06 -0700
Message-id: <F969386E-330A-4754-8644-1FB990F160A9@apple.com>
References: <AANLkTinyrDoG5d_Ur6HVRy=SgMPjLzJtpJ++Ye=1DQdj@mail.gmail.com> <Pine.LNX.4.64.1008040050040.5947@ps20323.dreamhostps.com> <AANLkTi=3CJDKu37LV+6CG=d7VP5fOe-JNV9Cd=99BjjA@mail.gmail.com> <2AD09E86-CFFE-4378-A437-7EAE2E3026FD@apple.com> <AANLkTi=i5haWmJ49ZUcQsV0Wi47v6gkxoHm_Ctb89KQ-@mail.gmail.com>
To: Greg Wilkins <gregw@webtide.com>
X-Mailer: Apple Mail (2.1081)
X-Brightmail-Tracker: AAAAAQAAAZE=
Cc: hybi@ietf.org
Subject: Re: [hybi] Framing take IV
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, 04 Aug 2010 02:40:39 -0000

On Aug 3, 2010, at 6:29 PM, Greg Wilkins wrote:

> 
> 
> On 4 August 2010 11:20, Maciej Stachowiak <mjs@apple.com> wrote:
> 
> On Aug 3, 2010, at 6:07 PM, Greg Wilkins wrote:
> 
> 
> Hum volume is not an adequate response to a reasoned argument. If people think fragmentation is simpler than a variable size length field, they should explain why, rather than just citing the number of people who agree.
> 
> 
> I did briefly explain.  I cited the hum volume not as an argument, but as an indication that we have already had the arguments explained.

If good arguments were presented at the face-to-face, they should be presented on the mailing list, since the IETF process is that consensus cannot be declared without confirming on the mailing list.

> 
> happy to explain again in a little bit more detail:

Thanks for the explanation, here are some counterpoints:
> variable length length fields is more complex than a fixed length length field.
Is it more complex than fragment reassembly? I find that extremely unlikely based on my experience as a programmer.
> sending large content in a single frame is difficult if the content is being generated dynamically or it's length is otherwise not known.
You are correct, and that is a good reason for optional chunking. However, sending large content as chunks instead of a single frame is harder when it already exists as a data item of known length (e.g. a large file). Extremely large objects (over a gig, say) tend not to be dynamically generated. If you have to send a gig of data, chunking it into 64k frames is likely to be extremely inefficient.
> a small fixed sized length allows simple implementations to have fixed sized buffers (eg 64k)
A variable size length allows this too - you can just read up to 64k at a time. Whether with a single large frame or multiple fragments, you can choose yourself whether to process 64k at a time or reassemble at the end.
> fragmentation prepares the ground for future extensions for multiplexing and flow control.
I'm not assuming we will need such extensions until we have data to back it up.
> fragmentation on its own is not that complex
I disagree. It's more complex for senders of fixed-length content, and for receivers in nearly all cases.

On the other hand:

* If the receiver would like to read all contents into a single large memory buffer up to some fairly large size (say, a gigabyte), then it's a significant disadvantage, and likely performance hit, to get it in chunked form. The length is not known up front, therefore it is impossible to pre-allocate a buffer of the right size. To read a 256k message if chunks are 64k max, you have to perform at least 4 memory reallocations; with a single frame it could be one. Browser-hosted clients will likely have to provide a 256k message in memory to JavaScript, so it's not an option to have a 64k buffer and process the content in chunks or spool it to disk.

Thus, a single large message supports both of the following strategies:

A) Read a chunk at a time into a smallish fixed-size buffer.
B) Pre-allocate a buffer large enough for all the data and read it all in.

Mandatory fragmentation for large messages only supports strategy (A). Strategy (B) is likely preferable in the case where the browser is the receiver.

> But if you have a counter proposal that you think might satisfy the hummers, please make it.  The current protocol certainly does not.

Without knowing the rationale of any given hummer, I cannot predict what they would find satisfactory. I hope I have explained enough of my reasoning that others can guess whether a proposal would seem good me. Mandatory chunking for large messages does not sound good. 

Regards,
Maciej