Re: [hybi] hum #3: Message

Pieter Hintjens <ph@imatix.com> Mon, 09 August 2010 16:39 UTC

Return-Path: <pieterh@gmail.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 3F05C3A67E2 for <hybi@core3.amsl.com>; Mon, 9 Aug 2010 09:39:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
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 uSUE1Ucbrvau for <hybi@core3.amsl.com>; Mon, 9 Aug 2010 09:39:08 -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 255623A686A for <hybi@ietf.org>; Mon, 9 Aug 2010 09:39:08 -0700 (PDT)
Received: by vws10 with SMTP id 10so7364121vws.31 for <hybi@ietf.org>; Mon, 09 Aug 2010 09:39:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=b3GVEG5zpDkI7mhr/g7WjJT1E/lWBs48/uVv51rJX8A=; b=wppMVp/5NdsvVXrlbr3UsBM3tHmDPkcDQErfMXS0YaDDUXICfg9vQ1YJuEhlnxmlGw tQhcplJT6B/FckxQsWKKRahOm7YzcUNtGmy/GNLvnewPO0FPoukwXZ5twJLtTp+ovweA KtHl5g4LEfJi/26kAKyJxoKJoFP1ITI/SwAWA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=khq4d44DY6ukrZ10NdLLRuN8ZOiQ6wmlLbrV28tSdMBr6Sy7Ew/+t+Lb3t0fxWBst8 RVdHzuLadsAR7rfB0LG3NA6ldqpI1Q0rpnj1k4lBVWCnerKJQVLqcD1ItRk2ovjTIjMY DYCvLQkfFckhV2Fer4/MXz7k71UrGG41ph+6s=
Received: by 10.220.85.196 with SMTP id p4mr581314vcl.271.1281371982204; Mon, 09 Aug 2010 09:39:42 -0700 (PDT)
MIME-Version: 1.0
Sender: pieterh@gmail.com
Received: by 10.220.47.231 with HTTP; Mon, 9 Aug 2010 09:39:21 -0700 (PDT)
In-Reply-To: <AANLkTikmhNjm1kfuiyom=2zDrdyc4nsJBWC64Huhk4Ow@mail.gmail.com>
References: <4C5AE93D.4040803@ericsson.com> <Pine.LNX.4.64.1008051758290.5947@ps20323.dreamhostps.com> <AANLkTik0kbh14s2JZARY2MFh0iNGV7H+B4Px4yG+wX44@mail.gmail.com> <71BCE4BF-D3F6-4F94-BE76-306BDF6A2E67@apple.com> <Pine.LNX.4.64.1008051930160.5947@ps20323.dreamhostps.com> <4C5B1695.6070704@gmx.de> <F8E2F702-9F74-4316-B3B2-D5A731409ABF@apple.com> <AANLkTin=gO9D8K5NVhqCRKki-jrDmTYqF-gBjp9X41GN@mail.gmail.com> <4C5BF15E.1090608@noemax.com> <AANLkTinXLPmBACd3ji0V9wkAWmxOR7qBMED19KKMvJrd@mail.gmail.com> <AANLkTi=RWdqDDgy24C6qtUSr+5R5p=P15B=+aUZuE16Q@mail.gmail.com> <4C5C07D6.1030208@noemax.com> <AANLkTimj9RvzL8E+FmH=vT_TeECVNmDPXY0ymPnvBHSZ@mail.gmail.com> <AANLkTikmhNjm1kfuiyom=2zDrdyc4nsJBWC64Huhk4Ow@mail.gmail.com>
From: Pieter Hintjens <ph@imatix.com>
Date: Mon, 09 Aug 2010 18:39:21 +0200
X-Google-Sender-Auth: k2zBwAdJraXg1xA5Hx_YHjPmGtA
Message-ID: <AANLkTik=OZ+3hXfEsw9UXe6Q+kJ+dT0+QTej8kzuNZTV@mail.gmail.com>
To: Greg Wilkins <gregw@webtide.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: "hybi@ietf.org" <hybi@ietf.org>
Subject: Re: [hybi] hum #3: Message
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, 09 Aug 2010 16:39:12 -0000

On Mon, Aug 9, 2010 at 2:50 AM, Greg Wilkins <gregw@webtide.com> wrote:

> However, I do like having a very small minimal frame size for short
> messages, so I would modify Johns proposal to:
>
>  1 bit - fragment
>  2 bits - reserved
>  5 bits - opcode
>  8 bits - short length
>  [if length = 255: 6 bytes length]
>  length bytes of payload
>
> With opcodes defined for text, binary, mime and ping/pong frames

What we've also found in ZeroMQ is that we need two fragment bits, not
one.  That is, a 'first' and 'last' bit.  That lets a receiver catch
frames in mid-stream and decide whether to collect them, or discard
them.  I'm not sure WebSockets has current use cases for that.
However if we *ever* want WebSockets' framing to work on UDP or
multicast I'd recommend two fragment bits.  It may also reduce
somewhat the state needed in clients.

> I've proposed a 48 bit length to make the total header 64bits, but I'm
> ok with it being 64 bit length as well.

I think history teaches us that "big enough" never is.  Data gets a
bit larger every 18 months.  (I.e. data sizes double every 18 months.)
There is great benefit in allowing 1 frame = 1 message.  So I'd use 64
bits now and expect that we upgrade to 128 bits in 30 years or so.

-Pieter