Re: [hybi] Framing Take VI (a compromise proposal)

John Tamplin <jat@google.com> Tue, 17 August 2010 18:10 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 D3F533A6869 for <hybi@core3.amsl.com>; Tue, 17 Aug 2010 11:10:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.203
X-Spam-Level:
X-Spam-Status: No, score=-105.203 tagged_above=-999 required=5 tests=[AWL=-0.427, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, J_CHICKENPOX_29=0.6, J_CHICKENPOX_33=0.6, 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 lxES6PX3Fie2 for <hybi@core3.amsl.com>; Tue, 17 Aug 2010 11:10:40 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [216.239.44.51]) by core3.amsl.com (Postfix) with ESMTP id DB9B13A69FC for <hybi@ietf.org>; Tue, 17 Aug 2010 11:10:32 -0700 (PDT)
Received: from kpbe19.cbf.corp.google.com (kpbe19.cbf.corp.google.com [172.25.105.83]) by smtp-out.google.com with ESMTP id o7HIB7AU028547 for <hybi@ietf.org>; Tue, 17 Aug 2010 11:11:08 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1282068668; bh=tZ1WzdbW5sphGlZ7v0x2JDNBWdM=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=sFlArB/Ea2a2sZt9VbteauBi0NUsHusWe5qfiYRxsI5WQ0/iE1PAE4Aw7nLrv7/mC AIlkjEQtiPGjVQgJYSvxQ==
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=mAzIvp861HG89IXmaDuBQxKOAL0JOGJHD2AUl81oX1Zmk4WpUdCWXcY66GkpBWyos otlYXvxrRcWzYsAx3aDTw==
Received: from qyk5 (qyk5.prod.google.com [10.241.83.133]) by kpbe19.cbf.corp.google.com with ESMTP id o7HIAoJi001675 for <hybi@ietf.org>; Tue, 17 Aug 2010 11:11:06 -0700
Received: by qyk5 with SMTP id 5so939049qyk.18 for <hybi@ietf.org>; Tue, 17 Aug 2010 11:11:06 -0700 (PDT)
Received: by 10.224.19.195 with SMTP id c3mr4543402qab.270.1282068666607; Tue, 17 Aug 2010 11:11:06 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.229.17.130 with HTTP; Tue, 17 Aug 2010 11:10:46 -0700 (PDT)
In-Reply-To: <AANLkTim7=QavZVV8_qc+cSk3ZqZcRC1Jk9WiOOdShroW@mail.gmail.com>
References: <AANLkTi=TBXO_Cbb+P+e2BVfx69shkf8E1-9ywDh_Y+Kz@mail.gmail.com> <AANLkTi=52ARa2v9oZ1tGosN7oL+kBBVH20XmtkXzPMM0@mail.gmail.com> <AANLkTimjt0YbXfLf83od5b2cSJaZUboBy3-03LFf=Kv8@mail.gmail.com> <AANLkTimV4Xvashf8SZAHS15FCLiX7pUnXcae20Ph73YY@mail.gmail.com> <AANLkTindxmp_cPTZx+6FXsfMt2R0mJt_vNtDZsLRO8Ms@mail.gmail.com> <AANLkTikRJGAbjv9apOC0W4td4h0fJoH75eZ+WkoRgKbm@mail.gmail.com> <AANLkTinyLyOUje4sNkwdYueS17OEvKybtr4z8AHtBbYR@mail.gmail.com> <AANLkTik9y3zyMBXBtYF+zAJEr1bANr5CpfKdEsmhSZoU@mail.gmail.com> <AANLkTim7=QavZVV8_qc+cSk3ZqZcRC1Jk9WiOOdShroW@mail.gmail.com>
From: John Tamplin <jat@google.com>
Date: Tue, 17 Aug 2010 14:10:46 -0400
Message-ID: <AANLkTi=EAN=q3jN-sCrDs+AaHwRJ58Ym_yBNMEdOOwuc@mail.gmail.com>
To: Greg Wilkins <gregw@webtide.com>
Content-Type: multipart/alternative; boundary="001517503b22736888048e08df65"
X-System-Of-Record: true
Cc: hybi@ietf.org
Subject: Re: [hybi] Framing Take VI (a compromise 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: Tue, 17 Aug 2010 18:10:47 -0000

On Mon, Aug 16, 2010 at 11:27 AM, John Tamplin <jat@google.com> wrote:

> The problem I have with this approach is when you have multiple extensions
> you make a long chain to process.  For example, you want to send total
> message length on muxed messages:
>
> op=extension, ext=MUX (channel id=1, type=META_DATA(..., type=text,
> data="Hello world"))
>
> As more extensions are defined, finding the data you want gets more
> problematic.  Instead, if there is one extension data field, presumably an
> implementation could compute pointers to specific the field for a specific
> extension during the handshake when the extension is negotiated (there might
> need to be another level of indirection if variable-length per-extension
> data is supported).
>
> Anyway, if others like your proposal I don't feel strongly enough against
> it to object.
>

How about deferring the decision of exactly how to represent extensions
until later?  That would be

   - INI - 1 bit, indicates initial frame of message
   - FIN - 1 bit, indicates final frame of message
   - Reserved1 - 1 bit - must be 0, except for private use by external
   agreement
   - Opcode - 4 bits, 0=Control, 1=Text, 2=Binary, 3-11=Reserved for future
   definition, 12-15=Reserved for private use
   - Reserved2 - 1 bit - must be 0
   - Length - 7 bits, 127=uses extended length
   - Extended length - 8 bytes [if Length=127]
   - Total message length - 8 bytes [if INI=1 & FIN=0] -- all 0s means
   unknown
   - Payload - (Extended) Length bytes - interpretation defined by opcode

Later, we can decide to allocate one of the reserved bits adjacent to the
opcode as an Extension Data Present flag, as proposed originally in this
thread, or as an extra bit in the Opcode field if we decide that we want all
extensions to be defined with new opcodes (and nesting the final payload
opcode in the extension's payload).  That way we can defer deciding exactly
how extensions should be represented until we actually have an extension to
implement.

I can see rationale for your suggestion, but I still think some extensions
are ignorable (for example, an intermediary that doesn't understand the
MIME-type extension data could safely ignore it) -- maybe at the point we
define extension data formats we can define "critical" extension types which
must be understood or the message is altered vs "optional" extension types
("critical" terminology taken from the PNG spec about chunks).

Note that if we defer defining extension data, we can't move the total
message length to extension data, so I am leaving it where it is.

Would this remove remaining objections to this proposal?

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