Re: [hybi] method of allocation of reserved bits to extensions

Brodie Thiesfield <brodie@jellycan.com> Thu, 28 April 2011 02:57 UTC

Return-Path: <brofield@gmail.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5FE16E0689 for <hybi@ietfa.amsl.com>; Wed, 27 Apr 2011 19:57:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.677
X-Spam-Level:
X-Spam-Status: No, score=-2.677 tagged_above=-999 required=5 tests=[AWL=0.300, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 98LF3-FwHr8A for <hybi@ietfa.amsl.com>; Wed, 27 Apr 2011 19:57:30 -0700 (PDT)
Received: from mail-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by ietfa.amsl.com (Postfix) with ESMTP id 8366CE0678 for <hybi@ietf.org>; Wed, 27 Apr 2011 19:57:30 -0700 (PDT)
Received: by pzk5 with SMTP id 5so1717693pzk.31 for <hybi@ietf.org>; Wed, 27 Apr 2011 19:57:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Fq5NHuJWHYOTuksFyu5NzTv4tdyU4uo/fGd0qxSTEJM=; b=e1zAkyUYPqj51dK6WBr+EKyEgI/cpzXboqKErBE5uLjVj9ceAs0iMLZf0LNmgmU5Ks qCV+lfOi/tqUcOl9WQ3VGrj1eBuUNQR9Vo/1KUUOE+TLd+BamZTqjy9TgZQHafDBU8P3 ge1tEmtcczWbw1poGvcbBEXbxz56xhGJLDHzA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=j9H80ZaN4Xf5AKz5Jgij3DTPdyG6ATZxR2m33Zml+trXwvKOfSTl2hIrlrOV0w1xrP Jd3UpipTvHEba+RzvMvhA7TIjy7f1SC7cUe9NZ7Xv7MROOU5vMlm2TmzkWsEvdGQz+DG 7BONMzV0RBDTtxwcOpu+nmH/a/5R3Ks8kzj9k=
MIME-Version: 1.0
Received: by 10.68.33.41 with SMTP id o9mr3189117pbi.174.1303959450127; Wed, 27 Apr 2011 19:57:30 -0700 (PDT)
Sender: brofield@gmail.com
Received: by 10.68.54.35 with HTTP; Wed, 27 Apr 2011 19:57:30 -0700 (PDT)
In-Reply-To: <BANLkTim9w83iSY-TH1yuVAUXxypJk_tmrw@mail.gmail.com>
References: <BANLkTi=vOQDtL5GobitKe8yiUoQFb2go_Q@mail.gmail.com> <BANLkTikaOXg0u+4d8Ly6OxUQ7PFUU=udgQ@mail.gmail.com> <BANLkTikiUkivJitZGU-+q6wBfJ3VW45F8g@mail.gmail.com> <BANLkTindmLQ0KE6K5qUX2ue+=hoLUaznLA@mail.gmail.com> <BANLkTim9w83iSY-TH1yuVAUXxypJk_tmrw@mail.gmail.com>
Date: Thu, 28 Apr 2011 11:57:30 +0900
X-Google-Sender-Auth: mjrnU5i09RqbKS1ep-vlEiEvBY8
Message-ID: <BANLkTimnMBwNgP_e29exT6dUkp60s2xU3g@mail.gmail.com>
From: Brodie Thiesfield <brodie@jellycan.com>
To: Greg Wilkins <gregw@intalio.com>
Content-Type: text/plain; charset="ISO-8859-1"
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] method of allocation of reserved bits to extensions
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/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, 28 Apr 2011 02:57:31 -0000

If we accept Greg's suggestion, then the following text can be a base:



8.2 Allocating Reserved Bits

An extension may require the use of a reserved bit in the framing for
proper operation. Because both the server and client must know all
extension requirements before negotiating their use, requirements for
use of reserved frame bit are known.

The server and client will allocate reserved frame bits in a
predefined order. The order for the reserved bits is defined as the
number of the reserved bit as defined in section 4.2, i.e. RSV1 ->
RSV2 -> RSV3. The order of the extensions is defined by the order of
the extensions in the the Sec-WebSockets-Extensions response header.

Example;

The client requests the following 3 extensions:
Sec-WebSocket-Extensions: deflate-frame, sign-frame, mux-o-magic

The server supports all extensions and sends the response header:
Sec-WebSocket-Extensions: deflate-frame, sign-frame, mux-o-magic

If the deflate-frame extension requires 1 reserved bit and the
mux-o-magic extension requires 2 reserved bits, then the bits are
allocated as:

deflate-frame: RSV1
mux-o-magic: RSV2, RSV3

If the server response used a different ordering of extensions, the
allocated bits will be different according to the response extension
ordering.

For example, given the following server response header:
Sec-WebSocket-Extensions: mux-o-magic, deflate-frame, sign-frame

The reserved bits would be allocated as:
mux-o-magic: RSV1, RSV2
deflate-frame: RSV3

If there are no available reserved bits to be allocated to an
extension the server MUST NOT agree to use the extension.