Re: [hybi] Framing take IV [why fragment]

John Tamplin <jat@google.com> Thu, 05 August 2010 17:00 UTC

Return-Path: <jat@google.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 3DB2C3A68CC for <hybi@core3.amsl.com>; Thu, 5 Aug 2010 10:00:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.863
X-Spam-Level:
X-Spam-Status: No, score=-105.863 tagged_above=-999 required=5 tests=[AWL=0.113, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, 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 LWjZhcuAoVWp for <hybi@core3.amsl.com>; Thu, 5 Aug 2010 10:00:20 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [216.239.44.51]) by core3.amsl.com (Postfix) with ESMTP id 26EE13A6B17 for <hybi@ietf.org>; Thu, 5 Aug 2010 10:00:20 -0700 (PDT)
Received: from hpaq1.eem.corp.google.com (hpaq1.eem.corp.google.com [172.25.149.1]) by smtp-out.google.com with ESMTP id o75H0ncM004564 for <hybi@ietf.org>; Thu, 5 Aug 2010 10:00:50 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1281027650; bh=ycGu4T/jGxgjxrJMzgkDqHyBkuc=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=qSVWIITbf8jxbvablHLAI9o/y0lY9bC1p19A9ZWYY3CcBSR7LB5ijO6wcv+WkuYRo Ll9CBwqc5LPL9V42RUQpA==
DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:from:date:message-id: subject:to:cc:content-type:x-system-of-record; b=jn98TJEVS1UBPVIAsvnGG1DnIpvk+e6e9fntstoZWstuJUKpQnL9y8I9sYYjmCxcv cug3Wz4wBSM012R6QTYZg==
Received: from gyc15 (gyc15.prod.google.com [10.243.49.143]) by hpaq1.eem.corp.google.com with ESMTP id o75H0KGG028729 for <hybi@ietf.org>; Thu, 5 Aug 2010 10:00:48 -0700
Received: by gyc15 with SMTP id 15so3133254gyc.23 for <hybi@ietf.org>; Thu, 05 Aug 2010 10:00:48 -0700 (PDT)
Received: by 10.150.202.18 with SMTP id z18mr8840326ybf.90.1281027648292; Thu, 05 Aug 2010 10:00:48 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.151.60.3 with HTTP; Thu, 5 Aug 2010 10:00:27 -0700 (PDT)
In-Reply-To: <AANLkTim6Do+P4sCXsR+sJ6R_ZYQKQYvpakPdKV9aNv6b@mail.gmail.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> <1280937841.7561.292.camel@tng> <Pine.LNX.4.64.1008041754000.5947@ps20323.dreamhostps.com> <1280947861.7561.388.camel@tng> <Pine.LNX.4.64.1008041956161.5947@ps20323.dreamhostps.com> <AANLkTim6Do+P4sCXsR+sJ6R_ZYQKQYvpakPdKV9aNv6b@mail.gmail.com>
From: John Tamplin <jat@google.com>
Date: Thu, 05 Aug 2010 13:00:27 -0400
Message-ID: <AANLkTik1MwyeA3aO62t=cZhKCofSVEWVXe+zDfdqSRcZ@mail.gmail.com>
To: Roberto Peon <fenix@google.com>
Content-Type: multipart/alternative; boundary="000e0cd4d380ec8944048d167d5f"
X-System-Of-Record: true
Cc: hybi@ietf.org
Subject: Re: [hybi] Framing take IV [why fragment]
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: Thu, 05 Aug 2010 17:00:23 -0000

On Thu, Aug 5, 2010 at 12:47 PM, Roberto Peon <fenix@google.com> wrote:

> The biggest reason that variable length encoding is annoying is that it
> either adds complexity of buffer management or it adds overhead dealing with
> the system.
>
> A big advantage of length-prefixed data is that one need only read the
> length, and then one can do a single alloc and read() to consume the rest of
> the message exactly.
>
> If any part of this is sentinel based (and that is what BER is,
> effectively), you end up either doing read() one byte at a time, or you end
> up doing a read for something you're guessing is larger than the max length.
> If you guess wrong, you either have to have kept the encoded state from the
> previous read, read more (involves another alloc), and only then do you get
> to alloc and read the payload.
>
> If you've guessed wrong and you read too much, then you have to save that
> data, alloc another buffer, move it, and only then can you safely delete the
> previous buffer.
>
> This is a fair bit of complexity.
> What is the gain?
>

I agree completely with this argument.

Since there was a post made by the chair saying that a fixed-length length
field and fragment support had strong support and would be declared the
consensus unless technical arguments for the variable-length length fields
are presented, it seems like those who don't like the fixed length field
need to present a case.

-- 
John A. Tamplin
Software Engineer (GWT), Google