Re: [hybi] Changing meaning of 1007 status code ("frame" => "message")

"Richard L. Barnes" <rbarnes@bbn.com> Tue, 06 September 2011 17:00 UTC

Return-Path: <rbarnes@bbn.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 4353E21F8C67 for <hybi@ietfa.amsl.com>; Tue, 6 Sep 2011 10:00:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.553
X-Spam-Level:
X-Spam-Status: No, score=-106.553 tagged_above=-999 required=5 tests=[AWL=0.046, BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
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 p6rDkydF4w7E for <hybi@ietfa.amsl.com>; Tue, 6 Sep 2011 10:00:02 -0700 (PDT)
Received: from smtp.bbn.com (smtp.bbn.com [128.33.1.81]) by ietfa.amsl.com (Postfix) with ESMTP id A9FF621F8C65 for <hybi@ietf.org>; Tue, 6 Sep 2011 10:00:02 -0700 (PDT)
Received: from ros-dhcp192-1-51-76.bbn.com ([192.1.51.76]:61423) by smtp.bbn.com with esmtps (TLSv1:AES128-SHA:128) (Exim 4.74 (FreeBSD)) (envelope-from <rbarnes@bbn.com>) id 1R0z1x-000Kue-8Q; Tue, 06 Sep 2011 13:01:49 -0400
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset="iso-8859-1"
From: "Richard L. Barnes" <rbarnes@bbn.com>
In-Reply-To: <634914A010D0B943A035D226786325D422C0EB8DB1@EXVMBX020-12.exch020.serverdata.net>
Date: Tue, 06 Sep 2011 13:01:48 -0400
Content-Transfer-Encoding: quoted-printable
Message-Id: <46409BE1-625D-42ED-8FED-1438866FD43F@bbn.com>
References: <CALiegf=D5K9H0uckc_zLVbaLieyu082g8kooAXa-3LkG+g_XGQ@mail.gmail.com> <634914A010D0B943A035D226786325D422C0EB8DB1@EXVMBX020-12.exch020.serverdata.net>
To: Tobias Oberstein <tobias.oberstein@tavendo.de>
X-Mailer: Apple Mail (2.1084)
Cc: "hybi@ietf.org" <hybi@ietf.org>
Subject: Re: [hybi] Changing meaning of 1007 status code ("frame" => "message")
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, 06 Sep 2011 17:00:03 -0000

> Why should I read the subsequent 99 frames after having
> received the first frame with invalid UTF-8 before failing
> the connection?

Because frames don't have to contain valid UTF-8.  Didn't we just have this argument?  :)

--Richard




>> WS message format/encoding/content MUST be validated when receiving all
>> the frames belonging to such message, as message inspection/usage belongs
>> to the WS application, rather than the WS "transport" layer (framing stuf).
> 
> No, since that would imply that you can't have a message of arbitrary
> number of frames, or a message frame with 2^63 octets. No one could
> buffer that, and there is no need to do so anyway, when you have a frame-based
> or a streaming API in your implementation.
> 
> The question of API is orthogonal to the protocol.
> 
>> 
>> Of couse, a WS endpoint COULD validate each text frame by inspecting
>> whether it contains valid UTF-8 bytes (completed or splitted bytes).
>> That's could be an optimization out of the scope of the protocol specification
>> (as many others).
>> 
>> I insist: this specification SHOULD define logic layers, basically:
>> 
>> * WS transport layer: framing stuff and control frames.
>> * WS application layer: sends and receives *full* WS messages (binary or
>> text).
> 
> No, thats not WS. WS itself is not a message based, but framed streaming
> protocol.
> 
>> 
>> - The WS transport layer receives control frames and send control frames to
>> the other endpoint.
>> - The WS transport layer gives received *messages* to the WS application
>> layer (it doesn't matter giving the full buffered message or using straming).
> 
> No, I have 3 types of API: message-based, frame-based and streaming.
> 
>> - The WS application layer sends *messages* to the WS transport layer.
>> The transport layer decides whether to split, or not, the message into N
>> frames.
> 
> No, there may be valid scenarios when the application wants to control
> fragmentation. Think about multi-channel media streaming.
> 
>> - The WS application layer notifies the WS transport layer to close the
>> connection with status 1007 upon receipt of an invalid UTF-8 text message.
> 
> No, the WS implementation fails the connection and fires a connectionClose()
> handler on the application. See the JS WS API.
> 
>> Please consider it. Any protocol in Internet is designed with logical layers, all
>> but WebSocket.
> 
> Your premise is false, and thus any conclusion void.
> 
>> 
>> Regards.
>> 
>> --
>> Iñaki Baz Castillo
>> <ibc@aliax.net>
>> _______________________________________________
>> hybi mailing list
>> hybi@ietf.org
>> https://www.ietf.org/mailman/listinfo/hybi
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi