Re: [hybi] NAT reset recovery? Was: Extensibility mechanisms?

"Thomson, Martin" <Martin.Thomson@andrew.com> Tue, 20 April 2010 07:08 UTC

Return-Path: <Martin.Thomson@andrew.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 8C83B3A6910 for <hybi@core3.amsl.com>; Tue, 20 Apr 2010 00:08:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.936
X-Spam-Level:
X-Spam-Status: No, score=-1.936 tagged_above=-999 required=5 tests=[AWL=0.663, BAYES_00=-2.599]
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 51y1wzUirVS5 for <hybi@core3.amsl.com>; Tue, 20 Apr 2010 00:08:32 -0700 (PDT)
Received: from csmailgw2.commscope.com (csmailgw2.commscope.com [198.135.207.242]) by core3.amsl.com (Postfix) with ESMTP id 90B363A69F0 for <hybi@ietf.org>; Tue, 20 Apr 2010 00:08:31 -0700 (PDT)
Received: from [10.86.20.103] ([10.86.20.103]:61109 "EHLO ACDCE7HC2.commscope.com") by csmailgw2.commscope.com with ESMTP id S223166Ab0DTHIV (ORCPT <rfc822; hybi@ietf.org>); Tue, 20 Apr 2010 02:08:21 -0500
Received: from SISPE7HC1.commscope.com (10.97.4.12) by ACDCE7HC2.commscope.com (10.86.20.103) with Microsoft SMTP Server (TLS) id 8.1.436.0; Tue, 20 Apr 2010 02:08:21 -0500
Received: from SISPE7MB1.commscope.com ([fe80::9d82:a492:85e3:a293]) by SISPE7HC1.commscope.com ([fe80::8a9:4724:f6bb:3cdf%10]) with mapi; Tue, 20 Apr 2010 15:08:11 +0800
From: "Thomson, Martin" <Martin.Thomson@andrew.com>
To: "Markus.Isomaki@nokia.com" <Markus.Isomaki@nokia.com>, "ph@imatix.com" <ph@imatix.com>, "jamie@shareable.org" <jamie@shareable.org>
Date: Tue, 20 Apr 2010 15:09:39 +0800
Thread-Topic: [hybi] NAT reset recovery? Was: Extensibility mechanisms?
Thread-Index: AcrgTvQnApmteXUaSny7rKTiU724LAAARuTAAADmC7AAAMe20A==
Message-ID: <8B0A9FCBB9832F43971E38010638454F03E7D06A56@SISPE7MB1.commscope.com>
References: <20100419091736.GA28758@shareable.org> <B3F72E5548B10A4A8E6F4795430F841832040920C4@NOK-EUMSG-02.mgdnok.nokia.com> <20100419121000.GG28758@shareable.org> <87764B8E-5872-40EE-AA2F-D4E659B94F63@d2dx.com> <20100419140423.GC3631@shareable.org> <6959E9B3-B1AC-4AFB-A53D-AB3BA340208C@d2dx.com> <B3F72E5548B10A4A8E6F4795430F841832040F78C0@NOK-EUMSG-02.mgdnok.nokia.com> <w2q5821ea241004191309t7362de42p922788d380119dc4@mail.gmail.com> <B3F72E5548B10A4A8E6F4795430F841832040F78DB@NOK-EUMSG-02.mgdnok.nokia.com> <20100420013220.GC21899@shareable.org> <l2s5821ea241004192301u692d2344y8da146470a68ab75@mail.gmail.com> <8B0A9FCBB9832F43971E38010638454F03E7D06A36@SISPE7MB1.commscope.com> <B3F72E5548B10A4A8E6F4795430F841832040F7B57@NOK-EUMSG-02.mgdnok.nokia.com>
In-Reply-To: <B3F72E5548B10A4A8E6F4795430F841832040F7B57@NOK-EUMSG-02.mgdnok.nokia.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-BCN: Meridius 1000 Version 3.4 on csmailgw2.commscope.com
X-BCN-Sender: Martin.Thomson@andrew.com
Cc: "hybi@ietf.org" <hybi@ietf.org>
Subject: Re: [hybi] NAT reset recovery? Was: Extensibility mechanisms?
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, 20 Apr 2010 07:08:33 -0000

Responses are of some use at the application layer, so the second option might make some sense.

However, negotiation seems like overkill for this sort of mechanism.  Each peer has some expectations and constraints that it knows best.  Let them each take whatever action they need to ensure that the connection stays alive.

If a keep-alive frame is defined, either peer could unilaterally initiate it.  There's no technical reason why this shouldn't be allowed.  If the server cares, and it doesn't see any activity from the client, it could use the keep-alive too.

As Jamie points out, the server frequently doesn't care.  More to the point - the server can't do little about it if the connection does go away.  (I can imagine use of other channels to prod the client into wakefulness, but that's not something inherent to WS.)  Rather than outright prohibition, I'd instead prefer to discourage server use of keep-alive (SHOULD NOT).

Servers might know better - we have a server that has a 5 minute TCP "go dead" interval on the load balancer in front of it.  That server should not be outright prevented from sending a 4:55 keep-alive if it sees nothing from a client.

--Martin

> -----Original Message-----
> From: Markus.Isomaki@nokia.com [mailto:Markus.Isomaki@nokia.com]
> Sent: Tuesday, 20 April 2010 4:51 PM
> To: Thomson, Martin; ph@imatix.com; jamie@shareable.org
> Cc: hybi@ietf.org
> Subject: RE: [hybi] NAT reset recovery? Was: Extensibility mechanisms?
> 
> Hi,
> 
> Martin Thomson wrote:
> >
> >Furthermore, you don't need a response, TCP provides ACKs.  A
> >one-way exchange of as little as a single byte should be
> >enough to keep any bindings alive in (TCP) intermediaries.
> >
> 
> This is true.
> 
> I would say there are two options to do keepalives:
> i) Define a keepalive frame that the client sends. There is no
> websocket level response but the TCP ACK is still enough to keep NATs,
> firewalls etc. open.
> Ii) Define a keepalive request frame that the client sends and
> keepalive response that the server uses to respond to it. The response
> is not really necessary for NATs etc., but might help the client to
> notice a broken connection faster. (I'm not sure if this is true but I
> remember this was an argument in another protocol, SIP, why keepalive
> over TCP was done in that way.) The response may make the protocol more
> complicated, though, as people have commented.
> 
> I would not want to make the keepalives peer-to-peer in a sense that
> also the server could send keepalives. I think the client should be in
> charge. The reason is that as a client developer for a mobile device I
> would like to be able to send keepalives as infrequently as possible.
> We have had some bad experiences with IMAP servers sending stuff
> frequently back to the client (presumably because not all clients are
> clever enough to do any keepalives themselves - this is a risk of
> course if we don't specify this at all in websocket spec), and the
> client has no way to affect their rate, which has been fixed.
> 
> If there really is a requirement for the server to see keepalives at a
> certain minimum rate (for instance so that it can abandon stale
> connections), I would then have that negotiated so that the server can
> tell that back to the client who would still do the sending. But I'm
> not sure if that's needed.
> 
> Markus