Re: [hybi] Dave's Framing Proposal

Greg Wilkins <gregw@webtide.com> Thu, 05 August 2010 22:13 UTC

Return-Path: <gregw@webtide.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 9023F3A693F for <hybi@core3.amsl.com>; Thu, 5 Aug 2010 15:13:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.736
X-Spam-Level:
X-Spam-Status: No, score=-1.736 tagged_above=-999 required=5 tests=[AWL=0.241, 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 jN8Iw+KTA0VY for <hybi@core3.amsl.com>; Thu, 5 Aug 2010 15:13:41 -0700 (PDT)
Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by core3.amsl.com (Postfix) with ESMTP id 024733A6891 for <hybi@ietf.org>; Thu, 5 Aug 2010 15:13:40 -0700 (PDT)
Received: by fxm16 with SMTP id 16so2817321fxm.31 for <hybi@ietf.org>; Thu, 05 Aug 2010 15:14:11 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.223.123.79 with SMTP id o15mr11647595far.12.1281046451193; Thu, 05 Aug 2010 15:14:11 -0700 (PDT)
Received: by 10.223.57.12 with HTTP; Thu, 5 Aug 2010 15:14:11 -0700 (PDT)
In-Reply-To: <4C5B2A05.6000209@mail-abuse.org>
References: <2286.1281041555.477702@puncture> <4C5B2A05.6000209@mail-abuse.org>
Date: Fri, 06 Aug 2010 08:14:11 +1000
Message-ID: <AANLkTimm8G9Y9d4Gx0oZ9KgqDQo902VVXvf0mExjJpjr@mail.gmail.com>
From: Greg Wilkins <gregw@webtide.com>
To: hybi@ietf.org
Content-Type: text/plain; charset="UTF-8"
Subject: Re: [hybi] Dave's Framing Proposal
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 22:13:42 -0000

Dave,

trying to reduce your proposal to it's essentials and avoid debates
about length encoding etc...

I think the main essence of  what you are saying is that all frames should be:

 opcode + meta-length + total-length + meta data + data


But you have also declared some fixed lengths etc. which I feel might
detract from the core proposal.

For instance, I think we could achieve most of you want with variable
length encoding as follows:

   opcode + var-length + var-meta-length + metadata + data


So for a simple helloworld message, the bytes would be

  0x00 0x0B 0x00 'hello world'

We could still have a fragment bit in the opcode

  0x40 0x06 0x00 'hello '
  0x00 0x05 0x00 'world'

But we could also negotiate an extension to add a channel ID to every
frame (for example 0x1234)

  0x40 0x08 0x02 0x12 0x34 'hello '
  0x00 0x07 0x02 0x12 0x34 'world'


I like the variable length version of this proposal (let's call it
"Daves even more awesome proposal") because it has a very simple base
case.  Even for the most complex of cases, the framing is pretty
simple and infrastructure can deal with it.

However, there will still be complexity in how the extensions are
negotiated and how they interact with op-codes.  Me may also need to
negotiate op-codes and could even need a variable length op-code, so
the header is just 3 variable length integers (hmm less keen on that).


cheers