Re: [hybi] I-D Action:draft-ietf-hybi-thewebsocketprotocol-01.txt

James Graham <jgraham@opera.com> Thu, 02 September 2010 11:47 UTC

Return-Path: <jgraham@opera.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 A75373A6A7E for <hybi@core3.amsl.com>; Thu, 2 Sep 2010 04:47:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.457
X-Spam-Level:
X-Spam-Status: No, score=-6.457 tagged_above=-999 required=5 tests=[AWL=0.142, BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4]
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 Zn5c2NPtCb60 for <hybi@core3.amsl.com>; Thu, 2 Sep 2010 04:47:29 -0700 (PDT)
Received: from smtp.opera.com (smtp.opera.com [213.236.208.81]) by core3.amsl.com (Postfix) with ESMTP id F331C3A68D6 for <hybi@ietf.org>; Thu, 2 Sep 2010 04:47:28 -0700 (PDT)
Received: from [10.30.0.35] (sgw-oslo2.opera.com [213.236.208.46]) (authenticated bits=0) by smtp.opera.com (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o82BltIY029040 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for <hybi@ietf.org>; Thu, 2 Sep 2010 11:47:57 GMT
Message-ID: <4C7F8EE7.1040106@opera.com>
Date: Thu, 02 Sep 2010 13:47:51 +0200
From: James Graham <jgraham@opera.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9pre) Gecko/20100217 Shredder/3.0.3pre
MIME-Version: 1.0
To: hybi@ietf.org
References: <20100901224502.0519B3A687C@core3.amsl.com>
In-Reply-To: <20100901224502.0519B3A687C@core3.amsl.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Subject: Re: [hybi] I-D Action:draft-ietf-hybi-thewebsocketprotocol-01.txt
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, 02 Sep 2010 11:47:30 -0000

On 09/02/2010 12:45 AM, Internet-Drafts@ietf.org wrote:

> A URL for this Internet-Draft is:
> http://www.ietf.org/internet-drafts/draft-ietf-hybi-thewebsocketprotocol-01.txt

A few initial comments:

The framing sections seem to have a lot of SHOULDs. This is worrying as 
SHOULD-level conditions can't really be tested (it is not an error to 
violate them) and can be a source of interoperability problems. I would 
prefer that we make all behaviour mandatory unless there is a good 
reason to do otherwise.

Some specific clauses seem problematic. For example:

"""A receiver MUST be prepared to accept arbitrarily fragmented
       messages, even if the sender sent the message in a single frame."""

"be prepared to accept" seems like poor wording. I would just say 
"Clients and servers MUST support recieving both fragmented and 
unfragmented messages". The clause "even if the sender sent the 
message..." seems odd because it is not clear how the recipient can know 
how the message is originally sent. In any case it seems redundant. This 
whole clause could be avoided with normative processing requirements 
that require support for fragmented and unfragmented messages (see below).

"""Ping

       Upon receipt of a Ping message, an endpoint SHOULD send a Pong
       response as soon as is practical.  The Pong response MUST contain
       the payload provided in the Ping message, though an implementation
       MAY truncate the message at an implementation-defined size which
       MUST be at least 8 _(TBD)_ bytes."""

It seems simpler and less error prone to require truncation always in 
case servers come to depend on the behaviour of specific implementations 
here.

"""      Ping frames MAY be sent as a keep-alive mechanism, but if so 
the interval SHOULD be configurable."""

I have no idea what this SHOULD is trying to require. Is it supposed to 
be a requirement on browser UI? On server implementations? Something 
else? In any case, we can't really require that things are configurable.

"""Close:

       Upon receipt of a close frame, an endpoint SHOULD send a Close
       frame to the remote recipient, if it has not already done so,
       deliver a close event to the application if necessary, and then
       close the WebSocket."""

It is not clear what the scope of the SHOULD here is. Since this is 
nested inside a MUST clause I guess "and then close the connection" is 
supposed to be a requirement. I'm not sure why sending the close frame 
is "SHOULD". I don't think it is necessary to talk about "deliver[ing] a 
close event to the application" since the interaction between the 
application and the protocol is for the application to determine. For 
the specific case of the JS API we just need to ensure we use the right 
terminology so that the description in the API document is correct (i.e. 
this needs to match section 7.3 of the protocol draft and section 5 of 
the API draft).


There seems to be a general lack of processing requirements. I don't 
know if this is just something that is missing from the first draft, but 
without such requirements there are a lot of missing details. For 
example it is unclear what happens if the first frame a client receives 
has opcode=0 (aside: it seems like we can design around this particular 
problem by e.g. ditching opcode=0 and just ignoring opcode after the 
first frame in a fragment). It is also not defined what should happen if 
any of the reserved bits are set or if the opcode is in the reserved 
range. All of these things are essential for interoperable implementations.