Re: [hybi] frame length encoding

John Tamplin <jat@google.com> Sat, 21 August 2010 18:55 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 3D9B43A697D for <hybi@core3.amsl.com>; Sat, 21 Aug 2010 11:55:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.845
X-Spam-Level:
X-Spam-Status: No, score=-105.845 tagged_above=-999 required=5 tests=[AWL=0.131, 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 JmSbuminl7IM for <hybi@core3.amsl.com>; Sat, 21 Aug 2010 11:55:41 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [216.239.44.51]) by core3.amsl.com (Postfix) with ESMTP id 1F9173A697A for <hybi@ietf.org>; Sat, 21 Aug 2010 11:55:41 -0700 (PDT)
Received: from hpaq13.eem.corp.google.com (hpaq13.eem.corp.google.com [172.25.149.13]) by smtp-out.google.com with ESMTP id o7LIuEsg005481 for <hybi@ietf.org>; Sat, 21 Aug 2010 11:56:14 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1282416974; bh=VsvHyDDAxpC3VjYXMYQbDQxD1Fs=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=aActwdkIGdmO8ISi4zy0QLJgGz1A5pAYstV3+8jBAupsclgp8qr/ulI6tIzEIoKhC Mh8v+3csb2MyLum8SwR5A==
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=EndSDMoFuWfZmwFAPDhLBoZMAT7vCi1MZgIZ/yl5wOBMZANEJFIC6qzGY8WNMJT/X tRB7cTaJ1/jy4VYq7NuGg==
Received: from gwb11 (gwb11.prod.google.com [10.200.2.11]) by hpaq13.eem.corp.google.com with ESMTP id o7LIuCp9019672 for <hybi@ietf.org>; Sat, 21 Aug 2010 11:56:13 -0700
Received: by gwb11 with SMTP id 11so2001003gwb.18 for <hybi@ietf.org>; Sat, 21 Aug 2010 11:56:12 -0700 (PDT)
Received: by 10.151.149.1 with SMTP id b1mr3292900ybo.303.1282416972203; Sat, 21 Aug 2010 11:56:12 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.151.60.3 with HTTP; Sat, 21 Aug 2010 11:55:52 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1008212037190.27211@tvnag.unkk.fr>
References: <AANLkTimKbmcpgx8k0uXUWvCO=8w9pPrtV=3y4qh6363k@mail.gmail.com> <alpine.DEB.2.00.1008212037190.27211@tvnag.unkk.fr>
From: John Tamplin <jat@google.com>
Date: Sat, 21 Aug 2010 14:55:52 -0400
Message-ID: <AANLkTikbyMHjPrgAoECKY1PeGmyWc2ODuX765R1=ugv3@mail.gmail.com>
To: Daniel Stenberg <daniel@haxx.se>
Content-Type: multipart/alternative; boundary="0015175709601508c9048e59f8ac"
X-System-Of-Record: true
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] frame length encoding
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: Sat, 21 Aug 2010 18:55:42 -0000

On Sat, Aug 21, 2010 at 2:39 PM, Daniel Stenberg <daniel@haxx.se> wrote:

> On Fri, 20 Aug 2010, John Tamplin wrote:
>
>  I thought I would ask for a "show of hands" about three possibilities.  If
>> you feel strongly for or against a particular option, please reply and say
>> so.  If you are fine with any of the three, then there is no need to reply.
>>
>
> I think I would prefer a plain 32 bit size, with no special treatment for
> smaller fragments.
>

See previous discussions -- many people thought it was unacceptable to have
to fragment a message which was already entirely in memory or a disk file
which could be sent with sendfile.  My conclusion from that discussion was
that there was no way we were going to achieve consensus with anything less
than a very large maximum frame size.

Aside from that, your suggestion more than doubles the frame size for small
frames.  As previously indicated, I think that is important because traces
of real-world WebSocket apps show that once compression is added, 98-99.9%
of frames will fit in approximately 126 bytes.  Paying three extra bytes for
the most common frames in exchange for a small gain in simplicity seems a
poor trade-off.

Combining these requirements seems to indicate that some form of encoding
the length in a variable number of bytes is required -- we are debating the
best way to do so.

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