Re: [hybi] Reliable message delivery (was Re: Technical feedback.)

Maciej Stachowiak <mjs@apple.com> Tue, 02 February 2010 03:55 UTC

Return-Path: <mjs@apple.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 4984F3A69EF for <hybi@core3.amsl.com>; Mon, 1 Feb 2010 19:55:31 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.599
X-Spam-Level:
X-Spam-Status: No, score=-106.599 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
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 CtmM0ra7hGIH for <hybi@core3.amsl.com>; Mon, 1 Feb 2010 19:55:30 -0800 (PST)
Received: from mail-out4.apple.com (mail-out4.apple.com [17.254.13.23]) by core3.amsl.com (Postfix) with ESMTP id 7AC3E3A684F for <hybi@ietf.org>; Mon, 1 Feb 2010 19:55:30 -0800 (PST)
Received: from relay13.apple.com (relay13.apple.com [17.128.113.29]) by mail-out4.apple.com (Postfix) with ESMTP id 2A0E189B727C for <hybi@ietf.org>; Mon, 1 Feb 2010 19:56:07 -0800 (PST)
X-AuditID: 1180711d-b7b18ae000001001-d6-4b67a2567993
Received: from elliott.apple.com (elliott.apple.com [17.151.62.13]) by relay13.apple.com (Apple SCV relay) with SMTP id D7.FC.04097.752A76B4; Mon, 1 Feb 2010 19:56:07 -0800 (PST)
MIME-version: 1.0
Content-transfer-encoding: 7bit
Content-type: text/plain; charset="us-ascii"
Received: from [17.246.17.218] by elliott.apple.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPSA id <0KX7008K449INE00@elliott.apple.com> for hybi@ietf.org; Mon, 01 Feb 2010 19:56:06 -0800 (PST)
From: Maciej Stachowiak <mjs@apple.com>
In-reply-to: <8B0A9FCBB9832F43971E38010638454F032E50667D@SISPE7MB1.commscope.com>
Date: Mon, 01 Feb 2010 19:56:06 -0800
Message-id: <D17188F8-4B5B-41B4-993F-7AF0DC0B4D47@apple.com>
References: <5c902b9e1001292310l5442d476n8375139f3480671b@mail.gmail.com> <26D406E7-2319-476E-9ADF-80D84200C270@apple.com> <5c902b9e1001292333k79569316lf371938c9aa766@mail.gmail.com> <128BFD31-9835-47B1-B7A9-F20F5CDA8D8C@apple.com> <20100130144936.GD19124@shareable.org> <5c902b9e1001301552n6efb7969o34110373e3ab4945@mail.gmail.com> <4B672C9D.9010205@ericsson.com> <op.u7gy9bag64w2qv@annevk-t60> <96935605-E8B8-4718-B60F-570FD2C199E4@apple.com> <8B0A9FCBB9832F43971E38010638454F032E5065ED@SISPE7MB1.commscope.com> <20100202012534.GB32743@shareable.org> <8B0A9FCBB9832F43971E38010638454F032E50667D@SISPE7MB1.commscope.com>
To: "Thomson, Martin" <Martin.Thomson@andrew.com>
X-Mailer: Apple Mail (2.1077)
X-Brightmail-Tracker: AAAAAQAAAZE=
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] Reliable message delivery (was Re: Technical feedback.)
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, 02 Feb 2010 03:55:31 -0000

On Feb 1, 2010, at 6:42 PM, Thomson, Martin wrote:

>> That is fine for TCP; the 0xff 0x00 is redundant.
> 
> What I get from this is that TCP connections haemorrhaging data can be solved without support in the higher layer - all that it requires is that the implementation of the next layer be aware of the limitations of TCP and that it uses shutdown(...) or whatever is necessary.
> 
> That's a pretty strong argument against putting specific close semantics in WS.  I don't buy the "let's make our protocol transport-layer-agnostic argument"; that only leads to the protocol picking up unnecessary baggage.

I'm not overly concerned about being transport-layer-agnostic on this feature - after all, other transports may not need the special close semantics. For example, SCTP likely does not. But I am concerned about whether a close handshake using only half-closes is as widely implementable as we would like. Two concerns here: (1) it's been reported that some TCP stacks do not actually expose the ability to do a half-close - it would be a shame if you could never write a WebSocket client or server for such an OS; (2) When using SSL as the transport, does the same issue arise, and can SSL implementations be convinced to do a half-close on demand?

If either of these concerns makes half-close-only impractical, then I think Jamie's suggestion is the best: allow any of half-close, explicit close frame, or both. 

 - Maciej

> 
> If an explicit close notification is required for an alternative transport, then let those who are porting the protocol to that environment add a shim for that purpose.
> 
> Having text that explains the assumptions of the current solution and maybe even suggests an implementation option (preferably by reference) seems most appropriate to me.
> 
> --Martin
> 
> 
>> Please note: The close-frame is *not* for acknowledgement of prior
>> messages.  It is a mechanism to prevent closes from turning into
>> "connection reset" TCP errors and the data-discarding behaviour.  It
>> would be *most unwise* of an endpoint to refuse to send the
>> close-frame (or shutdown) because it was keeping it to acknowledge an
>> expected message - because that would force the other end to keep a
>> connection open for a long timeout, when receiving close and lack of
>> an expected message is precisely a situation when connections should
>> be closed quickly because an unrecoverable error has occured.
> 
> This too is useful information - but this could be applied to the FIN, rather than the close frame.  That is, if you receive a FIN, that doesn't mean that the other peer received everything that you've already sent.  When you put it like that, it doesn't seem like much of a stretch ;)