Re: [hybi] Clarify the role of closing handshake

Yutaka_Takeda@PlayStation.Sony.Com Tue, 15 February 2011 01:21 UTC

Return-Path: <Yutaka_Takeda@PlayStation.Sony.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 573413A6D9B; Mon, 14 Feb 2011 17:21:24 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.423
X-Spam-Level:
X-Spam-Status: No, score=-5.423 tagged_above=-999 required=5 tests=[AWL=-0.359, BAYES_00=-2.599, HTML_MESSAGE=0.001, IP_NOT_FRIENDLY=0.334, J_CHICKENPOX_22=0.6, J_CHICKENPOX_31=0.6, 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 OGX8xNz2571Q; Mon, 14 Feb 2011 17:21:19 -0800 (PST)
Received: from paris.playstation.sony.com (nat.playstation.sony.com [69.36.131.254]) by core3.amsl.com (Postfix) with ESMTP id 7E4673A6A0C; Mon, 14 Feb 2011 17:21:19 -0800 (PST)
Received: from constantine.playstation.sony.com ([162.49.67.15]) by paris.playstation.sony.com (Lotus Domino Release 8.5.1FP5) with ESMTP id 2011021417213830-544629 ; Mon, 14 Feb 2011 17:21:38 -0800
In-Reply-To: <CA566BAEAD6B3F4E8B5C5C4F61710C1126E142C9@TK5EX14MBXW605.wingroup.windeploy.ntdev.microsoft.com>
To: Gabriel Montenegro <Gabriel.Montenegro@microsoft.com>
MIME-Version: 1.0
X-KeepSent: 30386040:0060CBE1-88257838:0006060F; type=4; flags=0; name=$KeepSent
X-Mailer: Lotus Notes Release 7.0.2 September 26, 2006
Message-ID: <OF30386040.0060CBE1-ON88257838.0006060F-88257838.00077B4D@playstation.sony.com>
From: Yutaka_Takeda@PlayStation.Sony.Com
Date: Mon, 14 Feb 2011 17:21:42 -0800
X-MIMETrack: Serialize by Router on SCEA919ML04/SCEA(Release 8.5.1FP3|May 23, 2010) at 02/14/2011 05:21:37 PM, Serialize complete at 02/14/2011 05:21:37 PM, Itemize by SMTP Server on SCEA919ML02/SCEA(Release 8.5.1FP5|September 29, 2010) at 02/14/2011 05:21:38 PM, Serialize by Router on SCEA919ML02/SCEA(Release 8.5.1FP5|September 29, 2010) at 02/14/2011 05:21:44 PM, Serialize complete at 02/14/2011 05:21:44 PM
Content-Type: multipart/alternative; boundary="=_alternative 00077B4B88257838_="
Cc: hybi-bounces@ietf.org, "hybi@ietf.org" <hybi@ietf.org>
Subject: Re: [hybi] Clarify the role of closing handshake
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: Tue, 15 Feb 2011 01:21:24 -0000

Hi Gabriel,

> Most of the time, there won?t be a gracious Close, as users will 
> kill the browser window, exit out of the tab, etc. So I fear we?re 
> complicating the protocol for dubious benefits. We have to deal with
> sudden termination anyway.  At any rate, even if the RST prevents 
> the other peer from receiving the WS_Close, the intermediaries will see 
it. 

I was wondering about it.

> This is a case of added complexity for very little benefit.

Say, a client is trying to send an application data (for example, 
'presence' update) before closing 
WebSocket. The application data may not reach the server application 
either in some 
condition. It is not just 'Close frame' that may not reach.

If we cannot handle 'closing state' in the case where user kills the 
browser window, then the
consequence would be the loss of *application data*, which may not be 
trivial...

Any thoughts?
--
Yutaka Takeda - US R&D Sony Computer Entertainment, Inc.
Office: 650 655 7484   Fax: 650 655 8060


hybi-bounces@ietf.org wrote on 02/14/2011 12:34:01 PM:

> In A-2 and B, it seems you reversed the Pros and Cons.
> 
> I?m not clear on the algorithm for B. Could you formulate in terms 
> of peers A and B and clarify which side is doing what?
> 
> At any rate, the cons of adding a wait state and additional 
> complexity in the protocol is why I prefer the simplicity of A.
> 
> Most of the time, there won?t be a gracious Close, as users will 
> kill the browser window, exit out of the tab, etc. So I fear we?re 
> complicating the protocol for dubious benefits. We have to deal with
> sudden termination anyway.  At any rate, even if the RST prevents 
> the other peer from receiving the WS_Close, the intermediaries will see 
it. 
> 
> This is a case of added complexity for very little benefit.
> 
> From: hybi-bounces@ietf.org [mailto:hybi-bounces@ietf.org] On Behalf Of 
> Takeshi Yoshino
> Sent: Monday, February 14, 2011 11:33
> To: hybi@ietf.org
> Subject: Re: [hybi] Clarify the role of closing handshake
> 
> I'd like to summarize proposals again. It seems there's consensus on
> dropping acknowledgement feature, so I list only the others.
> 
> I prefer [B].
> 
> [Proposal A-1]
> Role of Close frame
> - Help intermediaries know the session is no longer used
> - Pass status code to the other peer
> 
> Algorithm
> - To initiate close, a peer MUST send Close frame, and then the peer 
MUST
> -- close the underlying transport channel ... (*)
> - Once a peer received a Close frame, the peer MUST close the 
> underlying transport channel
> - A peer MUST NOT send any more data (including control) after 
> sending or receiving a Close frame
> 
> Pros
> - There's no wait state needs to be handled after a peer decided to 
> abandon the WebSocket
> 
> Cons
> - When a peer call close(2) with some data left not recv-ed, the 
> peer's TCP stack may send out RST. This can impede the other peer 
> from receiving Close frame or even some data before a Close frame
> 
> [Proposal A-2]
> Replace (*) in A-2 with this
> -- wait until the underlying transport channel is closed (by recv 
> until EoS, wait for close event, etc.) with some timeout
> 
> Pros
> - There's a wait state needs to be handled after a peer decided to 
> abandon the WebSocket
> 
> Cons
> - No more data is coming after Close frame, and therefore a peer can
> call close(2) on its TCP socket safely
> - The algorithm depends on the underlying transport channel's EoS signal
> 
> [Proposal B]
> Role of Close frame
> - Help intermediaries know the session is no longer used
> - Pass status code to the other peer
> - Let each peer call close(2) on its TCP socket safely
> 
> Algorithm
> - To initiate close, send a Close frame
> - Once received a Close frame
> -- (already sent a Close frame) close the underlying transport channel
> -- (otherwise) send a Close frame, and then close the underlying 
> transport channel
> - A peer MUST NOT send any more data (including control) after 
> sending a Close frame
> 
> Reception of a Close frame means
> - All data the other peer sent has arrived
> 
> Reception of a Close frame DOES NOT mean
> - All data has been delivered to the other peer
> 
> Pros
> - There's a wait state needs to be handled after a peer decided to 
> abandon the WebSocket
> 
> Cons
> - No more data is coming after a Close frame, and therefore a peer 
> can call close(2) on its TCP socket safely
>  _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi