Re: [hybi] Clarify the role of closing handshake

Yutaka_Takeda@PlayStation.Sony.Com Tue, 15 February 2011 00:14 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 680723A6DE6 for <hybi@core3.amsl.com>; Mon, 14 Feb 2011 16:14:20 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.459
X-Spam-Level:
X-Spam-Status: No, score=-5.459 tagged_above=-999 required=5 tests=[AWL=-0.395, BAYES_00=-2.599, HTML_MESSAGE=0.001, IP_NOT_FRIENDLY=0.334, J_CHICKENPOX_32=0.6, J_CHICKENPOX_35=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 66LmCkL2OJUj for <hybi@core3.amsl.com>; Mon, 14 Feb 2011 16:14: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 691583A6D7D for <hybi@ietf.org>; Mon, 14 Feb 2011 16:14:15 -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 2011021416143193-541947 ; Mon, 14 Feb 2011 16:14:31 -0800
In-Reply-To: <AANLkTimizRk+73rHJcw16JdWwM8Ax9dhpUqNxEdPLyL4@mail.gmail.com>
To: Takeshi Yoshino <tyoshino@google.com>
MIME-Version: 1.0
X-KeepSent: 161FAA38:F9E0465F-88257837:007F80AD; type=4; flags=0; name=$KeepSent
X-Mailer: Lotus Notes Release 7.0.2 September 26, 2006
Message-ID: <OF161FAA38.F9E0465F-ON88257837.007F80AD-88257838.00015665@playstation.sony.com>
From: Yutaka_Takeda@PlayStation.Sony.Com
Date: Mon, 14 Feb 2011 16:14:35 -0800
X-MIMETrack: Serialize by Router on SCEA919ML04/SCEA(Release 8.5.1FP3|May 23, 2010) at 02/14/2011 04:14:31 PM, Serialize complete at 02/14/2011 04:14:31 PM, Itemize by SMTP Server on SCEA919ML02/SCEA(Release 8.5.1FP5|September 29, 2010) at 02/14/2011 04:14:31 PM, Serialize by Router on SCEA919ML02/SCEA(Release 8.5.1FP5|September 29, 2010) at 02/14/2011 04:14:40 PM, Serialize complete at 02/14/2011 04:14:40 PM
Content-Type: multipart/alternative; boundary="=_alternative 0001566388257838_="
Cc: 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 00:14:20 -0000

Hi Takeshi-san,

My comments inline..

Takeshi Yoshino <tyoshino@google.com> wrote on 02/11/2011 04:17:44 PM:

> Hi Yutaka,
> 
> Thank you for joining the discussion.
> 
> Good point. I know that close(2) with incoming data remaining unread
> in kernel causes RST for example on Linux. It looks like this is 
> very platform dependent.

Yes, that may be platform dependent. At least, my linux (Ubuntu 9.04)
and my Windows XP SP3 send RST on close() when there's data in the receive
buffer.

> Let me confirm your claim. Here, you mean that RST coming after 
> PSH(Close frame octets) may cause trouble the receiver side in recv-
> ing Close frame octets?

Yes, but not limited to it. recv() may allow receiver to read data reached 

before RST(on Linux), but any send() after RST will fail with ECONRESET 
for sure. 
On this send error, typical implementation may close socket without 
bothering 
to read data in the receive buffer.

> In a bit different context but I see that 
> Jamie is also saying so in http://www.ietf.org/mail-
> archive/web/hybi/current/msg01044.html. On what platform this really
> occurs for example? Just curious. Linux socket allows us to recv 
> data PSH-ed before RST, then ECONNRESET is returned, so I missed this 
point.

Yes, my linux, too it lets receiver to read data received before RST.
My windows, though, does not seem to let receiver to read the data and 
recv()
returned 'ECONNRESET' right away.

# If we need some experiment, I can help.


> If we still take the way to drop Close reply,
> - Just as a hint for intermediaries to know the session is abandoned
> earlier than transport layer phenomenon (as Gabriel first 
> suggested), it's still worth try to send out Close and let 
> intermediaries see it, I think. We don't have to make it sure that 
> it's seen by intermediaries or delivered to the other peer.

# I am still not sure why 'intermediaries' need to see it. I will look 
into Gabriels suggestion.

> - If we decide to let a Close frame carry error code (as Greg and 
> Brodie suggest), yes, it may be problematic that Close frames are 
> dropped even though there's no network/intermediate problem.

Right.

> IIRC, there was discussion in designing -00 closing handshake that 
> we should avoid underlying transport layer's semantics in realizing 
> WebSocket layer event. To follow this philosophy, we could replace 
> the last FIN with Close frame. i.e. we again ask both sides send a 
> Close frame so that both sides can safely invoke close(2) after 
> seeing Close frame.

In browser usage, can we actually wait for Close frame from the peer
after sending Close frame (=app already closed.) ?
When user jumps to another page, or close browser, is WS-layer able
to wait for Close frame to begin with? It just occurred to me...
(I have no knowledge in browser design/policy.)

Best.
- Yutaka