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

John Tamplin <jat@google.com> Thu, 28 April 2011 01:17 UTC

Return-Path: <jat@google.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 4D2EBE066F for <hybi@ietfa.amsl.com>; Wed, 27 Apr 2011 18:17:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -104.135
X-Spam-Level:
X-Spam-Status: No, score=-104.135 tagged_above=-999 required=5 tests=[AWL=1.841, 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.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SYBnmWR6BOE2 for <hybi@ietfa.amsl.com>; Wed, 27 Apr 2011 18:17:03 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [216.239.44.51]) by ietfa.amsl.com (Postfix) with ESMTP id 23E5DE0902 for <hybi@ietf.org>; Wed, 27 Apr 2011 18:17:03 -0700 (PDT)
Received: from wpaz24.hot.corp.google.com (wpaz24.hot.corp.google.com [172.24.198.88]) by smtp-out.google.com with ESMTP id p3S1H2QO001815 for <hybi@ietf.org>; Wed, 27 Apr 2011 18:17:02 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1303953422; bh=E8GgNWG96La4XOvy6ZQ21vWYaGA=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=QBCDeEwf6sqM0aueS4W3y+lbfTc/gnVnbqMdJfE+M2jaVeaZ6cXgzq+QU0w0HL4Bi VAtWUQQlGXz0fH+XCaYFw==
Received: from gxk1 (gxk1.prod.google.com [10.202.11.1]) by wpaz24.hot.corp.google.com with ESMTP id p3S1G0LS025278 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for <hybi@ietf.org>; Wed, 27 Apr 2011 18:17:01 -0700
Received: by gxk1 with SMTP id 1so1102773gxk.24 for <hybi@ietf.org>; Wed, 27 Apr 2011 18:17:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=QTJrY86oKektDuBdZUpkHT3iljQCIKe8A2WmnqdRbIc=; b=uYAi40yE0atuN03MARMdudGuufntQYX7hAiM3ZrDoWBz+woRRMQnBgbGZvuOOkfBMe yhK/PwSTiczn38VMX6/Q==
DomainKey-Signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=ZF1Ar6tNE4gU/3pNQ0MyR5Lmp5P7rZkMm3UAA3TqOoiFR5wLv2tS7/Cxu1vw1kCi0R njUQ/9Ys4mxae+fpDPiw==
Received: by 10.151.112.11 with SMTP id p11mr2510133ybm.59.1303953421186; Wed, 27 Apr 2011 18:17:01 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.150.199.16 with HTTP; Wed, 27 Apr 2011 18:16:41 -0700 (PDT)
In-Reply-To: <BANLkTi=vOQDtL5GobitKe8yiUoQFb2go_Q@mail.gmail.com>
References: <BANLkTi=vOQDtL5GobitKe8yiUoQFb2go_Q@mail.gmail.com>
From: John Tamplin <jat@google.com>
Date: Wed, 27 Apr 2011 21:16:41 -0400
Message-ID: <BANLkTikaOXg0u+4d8Ly6OxUQ7PFUU=udgQ@mail.gmail.com>
To: Brodie Thiesfield <brodie@jellycan.com>
Content-Type: multipart/alternative; boundary="00151757462e7936bf04a1f050dd"
X-System-Of-Record: true
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 01:17:04 -0000

On Wed, Apr 27, 2011 at 9:12 PM, Brodie Thiesfield <brodie@jellycan.com>wrote:

> The WebSocket spec permits extensions to use reserved bits, however I
> can't see that it provides any way to negotiate which bit should be
> used in the presence of multiple extensions competing for a reserved
> bit. If a negotiation method is not prescribed, each extension will
> just state "using RSV1" or similar in their spec and then either that
> bit will become the "extension X bit" or that extension will not be
> compatible with other extensions that want to use the same bit.
>
> For example, a "deflate-payload" extension that allows optional
> compression might want to use a bit in the frame to denote
> compression. If it is used with the "mux-a-million" extension that
> also wants to use a reserved bit, both server and client need to agree
> on which bits are used. The server needs to allocate these reserved
> bits to the extensions that require them.
>
> I propose the following addition to the extensions section:
>
>
> 8.2 Negotiating Reserved Bits
>
> An extension may require or desire the use of a reserved bit in the
> framing for proper operation. It is the responsibility of the server
> to allocate the reserved bits to those extensions that require them.
> Because the server must know all extension requirements before
> negotiating its use, requirements for mandatory or optional use of a
> reserved frame bit is assumed to be known by the server. Extensions
> that allocated a reserved frame bit will have that allocation included
> in the response as a bit allocation header.
>
> If an extension requires the use of one or more reserved bits but it
> has not been allocated all required bits, the extension MUST NOT be
> included in the list of negotiated extensions in the response. If an
> extension can optionally use a reserved bit but it has not been
> allocated the bit, the extension MAY be included in the list of
> negotiated extensions but a bit allocation will not be present in the
> response for that extension. The selection of extensions and
> allocation of reserved frame bits to the extensions is at the
> discretion of the server. Extensions MUST NOT depend on the reserved
> bit staying the same as any previous allocation.
>
> The server MUST return a bit reservation header, and include an entry
> for each extension that has been allocated a reserved frame bit:
>
> bit-reservation-header = "Sec-WebSocket-Reserved-Bits:" bit-allocation
> bit-allocation = extension-token "=" allocated-bits
> allocated-bits = bitnum *(";" bitnum)
> bitnum = 1#digit
>
> The bitnum is the number of the reserved bit corresponding to the
> WebSocket protocol specification section 4.2 where "1" is RSV1, "2" is
> RSV2, etc.
>
> For example, to allocate RSV3 to deflate-payload and RSV1 to
> mux-a-million would add the following two headers to the response:
>
> Sec-WebSocket-Reserved-Bits: deflate-payload=3
> Sec-WebSocket-Reserved-Bits: mux-a-million=1
>
> Note that like other HTTP headers, this header MAY be split or
> combined across multiple lines.  Ergo, the following header is
> equivalent to the two headers above:
>
> Sec-WebSocket-Reserved-Bits: deflate-payload=3, mux-a-million=1
>
> If an extension has been allocated the use of multiple bits, multiple
> allocations MUST follow it's token. An extension token MUST NOT appear
> more than once in the Sec-WebSocket-Reserved-Bits header. For example,
> if it assumed that the "mux-a-million" extension requires the use of a
> single bit, but can optionally use another bit. If the server
> allocates two bits to the extension, the following header may be
> returned:
>
> Sec-WebSocket-Reserved-Bits: mux-a-million=1;3
>
> The order of the bits within the allocated-bits field is significant
> and should be interpreted as appropriate by the extension. The order
> of the bit-allocation fields within the Sec-WebSocket-Reserved-Bits is
> not significant.
>
> If an extension is negotiated which requires a frame bit, but the
> server fails to allocate that frame bit, the client MUST disconnect.
>
>
> However the allocation works, for the sake of extensibility of the
> protocol, I think that we need to get some method of allocating these
> bits into the spec before final. Note that I have used the Sec- header
> prefix just for consistency with other headers.
>

We had this discussion during the framing discussion, and we couldn't reach
consensus then.  So, instead we simply said that each extension defines how
bits are to be interpreted.   That could mean the bits are statically
allocated, or it could mean some negotiation scheme like what you propose.

I would be opposed to delaying the spec to try and get consensus on
negotiating the usage of reserved bits into the base spec, since it can be
just as easily postponed until the first extension that wants to make use of
some reserved bit.

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