Re: [hybi] [permessage-deflate] Renaming s2c_ and c2s_ prefix to server_ and client_

Joakim Erdfelt <joakim@intalio.com> Tue, 15 October 2013 15:13 UTC

Return-Path: <joakim@intalio.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 21FEA11E81E0 for <hybi@ietfa.amsl.com>; Tue, 15 Oct 2013 08:13:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.976
X-Spam-Level:
X-Spam-Status: No, score=-2.976 tagged_above=-999 required=5 tests=[AWL=-0.000, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QA4RI4nuBNgZ for <hybi@ietfa.amsl.com>; Tue, 15 Oct 2013 08:13:32 -0700 (PDT)
Received: from mail-ea0-f175.google.com (mail-ea0-f175.google.com [209.85.215.175]) by ietfa.amsl.com (Postfix) with ESMTP id 8382F11E8192 for <hybi@ietf.org>; Tue, 15 Oct 2013 08:13:25 -0700 (PDT)
Received: by mail-ea0-f175.google.com with SMTP id m14so4002451eaj.6 for <hybi@ietf.org>; Tue, 15 Oct 2013 08:13:24 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=e68Wm8XsblGgK6KYQsqZclph3mlwYHr4Jq7V1vqrYQo=; b=SThz8S/3e+XmbpGq3g59iwJlWG/M6PJTg7oGqPHhz+LwTg08cBO+tv67IvWMwJsWUs 56GwI19MaLrY1OI6dBp6gmuvM3TBCkRYLbRybSfFbx8QYpgWmyCAwGkcr3g3+fT/3HrF 1YEUbu2qbDAjsrURidwEUqK7PpAB69fMSCAmkWbpmFO2jmPkcHHkPOpwo41rYoG76onX AHrIjbAAWQ8pM4aXif1uDfvrGNAp5C22nSPmjNbMLSaELg7r+BV8QQz/4YoroUO0n3ZF Jn44bzwOpqyQpmnLbxR0pBev9rVo98SgKcY4WEgBDPR0xtZzET6iuxTwHpvGP097Te8p g1Jw==
X-Gm-Message-State: ALoCoQmlQtsF0ld5aPEirkvFDnOFJqZ0I8jRqTO7EcSHZWm5u6SS1shMDINOx5zLkxVYjSmpnXJP
MIME-Version: 1.0
X-Received: by 10.14.203.70 with SMTP id e46mr1412911eeo.33.1381850004497; Tue, 15 Oct 2013 08:13:24 -0700 (PDT)
Received: by 10.14.133.74 with HTTP; Tue, 15 Oct 2013 08:13:24 -0700 (PDT)
In-Reply-To: <CAH9hSJYNrBkf=2=2DHdipvXwN4XEKDe2BOc4g1eZr38U7m7jdw@mail.gmail.com>
References: <CAH9hSJant3VBw0FBM69V9wPvi3WmJLikZdX4ySELy+CShgoOKA@mail.gmail.com> <5BEA69BA-D0D4-4F4A-8CFB-741A433EAAA6@zaphoyd.com> <CAH9hSJYNrBkf=2=2DHdipvXwN4XEKDe2BOc4g1eZr38U7m7jdw@mail.gmail.com>
Date: Tue, 15 Oct 2013 08:13:24 -0700
Message-ID: <CAG4zZZDtUEnvgPmcKWsE9mFockUYA0PDFUE1SxNr+ubN0v9=xg@mail.gmail.com>
From: Joakim Erdfelt <joakim@intalio.com>
To: Takeshi Yoshino <tyoshino@google.com>
Content-Type: multipart/alternative; boundary="047d7b3440f4a6b5ef04e8c906b6"
Cc: "hybi@ietf.org" <hybi@ietf.org>, Peter Thorson <webmaster@zaphoyd.com>
Subject: Re: [hybi] [permessage-deflate] Renaming s2c_ and c2s_ prefix to server_ and client_
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: Tue, 15 Oct 2013 15:13:36 -0000

The problem is the language choices in the spec already.

Take this for example: (from Section
8.1.2.2<http://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-13#section-8.1.2.2>of
draft-ietf-hybi-permessage-compression-13)

8.1.2.2.  c2s_max_window_bits

   A client MAY include the "c2s_max_window_bits" extension parameter in
   an offer.  This parameter has no value or a decimal integer value
   without leading zeroes between 8 to 15 inclusive indicating the
   base-2 logarithm of the LZ77 sliding window size.  Using this
   parameter, a client tells the peer server that the client supports
   the server-to-client "c2s_max_window_bits" extension parameter.  If
   the parameter has a value, the parameter also tells the peer server a
   hint that even if the server sends the "c2s_max_window_bits"
   extension parameter with a bigger value or doesn't send it at all,
   the client is not going to use LZ77 sliding window size greater than
   the size specified by the value to compress messages.

   If a received offer has the "c2s_max_window_bits" extension
   parameter, the server MAY include the "c2s_max_window_bits" extension
   parameter in the response to the offer.  If the "c2s_max_window_bits"
   extension parameter in the received offer has a value, the server may
   either ignore this value or use this value to avoid allocating an
   unnecessarily big LZ77 sliding window by specifying
   "c2s_max_window_bits" extension parameter with a value equal to or
   smaller than the received value in the response.  This server-to-
   client parameter has a decimal integer value without leading zeroes
   between 8 to 15 inclusive indicating the base-2 logarithm of the LZ77
   sliding window size.

       c2s_max_window_bits = 1*DIGIT

   Using this server-to-client parameter, a server limits the LZ77
   sliding window size that the client uses to compress messages.  This
   reduces the amount of memory that the server has to reserve for the
   connection, in the same way the "s2c_max_window_bits" extension
   parameter does for the client.

   If a received offer doesn't have the "c2s_max_window_bits" extension
   parameter, the server MUST NOT include the "c2s_max_window_bits"
   extension parameter in the response to the offer.


We start by talking of "c2s_" then half way through the first paragraph we
start talking about "server-to-client" and even point out the "c2s_"
parameter as an example of the "server-to-client".

The spec mixes the use of "c2s" and "client-to-server" in various places,
in what we can only assume is sometimes it refers the parameter, sometimes
it refers to the direction of the conversation, sometimes it refers to the
extension negotiation step, sometimes it refers to the extension
negotiation phase.

Months have been spent trying to decipher this spec by multiple people with
years of experience on ietf specs, both as consumers and participants.  the
spec should be able to sit on its own, with as clear of definition as
possible at the time, reducing as much of the "interpretation" and question
asking that will arise from the spec.

The "2s" and "2c" portions are irrelevant, and actually cause confusion as
you use the same language elsewhere.

proposal:

"c2s_" used in extension-param tokens should be "client_" to refer to
"client produced compression"
"s2c_" used in extension-param tokens should be "server_" to refer to
"server produced compression"

"client-to-server", and "server-to-client" use within spec should be
clarified, and never be left without a clarification.
   when referring to the extension negotiation request phase.
      consider "extension negotiation request" or "extension negotiation
offer" for current "client-to-server" use
      consider "extension negotiation response" or "extension negotiation
accept" for current "server-to-client" use.
   when referring to the flow of frames on a connected websocket.
      this is where the existing "Client-to-Server" terminology is
consistent with RFC6455 (see Section
5.3<http://tools.ietf.org/html/rfc6455#section-5.3>
).
      so feel free to start using for "Server-to-Client" here as well, but
not in the above.

another choice is to never leave "Client-to-Server" alone with no
clarification, always follow it with consistent verbiage, like RFC6455 does.

Its never "Client-to-Server" just to refer to a directionality, its a
compound concept, such as "Client-to-Server Masking" or "Client-to-Server
message".

Suspicions/Theories:

The language choices of this spec probably come from the overall attempt at
being neutral to what side (client or server) the spec is documenting from.
If you look at the overall language of RFC6455, you see that it is
presented from the point of view of the Client, with the Server roles and
responsibilities being explained only when needed to.  Otherwise, both
sides are assumed to be the same in behavior.
If RFC6455 used the same techniques as the permessage-deflate spec, then
you'd have 2 sections: Client, fully documented with barely a mention of
server, then Server, fully documented we barely a mention of client.

Permessage-deflate could have been documented the same way as RFC6455, but
it isn't, so now you have extra work to be careful in your language
choices, eliminate ambiguity, make things more clear.


Our the final translation of the permessage-deflate extension spec, as
written:

Simplified Neutral Language:
Incoming frames/messages are compressed when RSV1 is set
Outgoing frames/messages can be compressed, but set RSV1 if you do.
Configuration of Incoming frames/messages compression is controlled by
Extension Parameters for the opposite side of yourself.
Configuration of Outgoing frames/messages compression is controlled by
Extension Parameters for your side.

Side Specific Language:
client_* Extension Parameters are for controlling frames/messages
compression produced by client
server_* Extension Parameters are for controlling frames/messages
compression produced by server

Here's the example of same Section 8.1.2.2 with the proposed change: (quick
edit)

8.1.2.2.  client_max_window_bits

   A client MAY include the "client_max_window_bits" extension parameter in
   an extension negotiation offer.  This parameter MAY have no value or a
decimal integer value
   without leading zeroes between 8 to 15 inclusive indicating the
   base-2 logarithm of the LZ77 sliding window size.  The use of this
   parameter in a extension negotiation offer informs the peer server that
   the client supports the "client_max_window_bits" extension parameter.
   If the parameter has a value, the parameter also tells the peer server a
   hint that even if the server sends the "client_max_window_bits"
   extension parameter on the extension negotiation response with a bigger
value,
   or doesn't send it at all, the client is not going to use LZ77 sliding
window
   size greater than the size specified by the value to compress messages.

   If a received extension negotiation offer has the
"client_max_window_bits" extension
   parameter, the server MAY include the "client_max_window_bits" extension
   parameter in the extension negotiation response.  If the
"client_max_window_bits"
   extension parameter in the received extension negotiation offer has a
value, the server may
   either ignore this value or use this value to avoid allocating an
   unnecessarily big LZ77 sliding window by specifying
   "client_max_window_bits" extension parameter with a value equal to or
   smaller than the received value in the response.
   The extension negotiation accept parameter value MUST have a decimal
   integer value without leading zeroes between 8 to 15 inclusive
   indicating the base-2 logarithm of the LZ77 sliding window size.

       client_max_window_bits = 1*DIGIT

   The use of the extension negotiation response parameter allows a server
to limit the LZ77
   sliding window size that the client uses to compress messages.  This
   reduces the amount of memory that the server has to reserve for the
   connection, in the same way the "server_max_window_bits" extension
   parameter does for the client.

   If a received extension negotiation offer doesn't have the
"client_max_window_bits" extension
   parameter, the server MUST NOT include the "client_max_window_bits"
   extension parameter in the extension negotiation response to the offer.

Hope this helps explain where we are coming from.


--
Joakim Erdfelt <joakim@intalio.com>
webtide.com <http://www.webtide.com/> - intalio.com/jetty
Expert advice, services and support from from the Jetty & CometD experts
eclipse.org/jetty - cometd.org


On Tue, Oct 15, 2013 at 7:08 AM, Takeshi Yoshino <tyoshino@google.com>wrote:

> Thanks, all.
>
> Joakim, please show Jetty's opinion again. Then, I'll make decision to
> move forward.
>
> Tobias: neutral
> Peter: neutral slight preference for s2c_
> Takeshi: neutral slight preference for s2c_
> Joakim: preference for server_
>
>