Re: [hybi] Ping/Pong body (was Re: TSV-Directorate review of draft-ietf-hybi-thewebsocketprotocol-07)

Gabriel Montenegro <Gabriel.Montenegro@microsoft.com> Thu, 19 May 2011 23:44 UTC

Return-Path: <Gabriel.Montenegro@microsoft.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 4E842E074C for <hybi@ietfa.amsl.com>; Thu, 19 May 2011 16:44:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.599
X-Spam-Level:
X-Spam-Status: No, score=-10.599 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p55bPLRYrPNQ for <hybi@ietfa.amsl.com>; Thu, 19 May 2011 16:44:37 -0700 (PDT)
Received: from smtp.microsoft.com (mailc.microsoft.com [131.107.115.214]) by ietfa.amsl.com (Postfix) with ESMTP id 391D1E06D3 for <hybi@ietf.org>; Thu, 19 May 2011 16:44:37 -0700 (PDT)
Received: from TK5EX14HUBC107.redmond.corp.microsoft.com (157.54.80.67) by TK5-EXGWY-E803.partners.extranet.microsoft.com (10.251.56.169) with Microsoft SMTP Server (TLS) id 8.2.176.0; Thu, 19 May 2011 16:44:37 -0700
Received: from TK5EX14MLTW651.wingroup.windeploy.ntdev.microsoft.com (157.54.71.39) by TK5EX14HUBC107.redmond.corp.microsoft.com (157.54.80.67) with Microsoft SMTP Server (TLS) id 14.1.289.8; Thu, 19 May 2011 16:44:36 -0700
Received: from TK5EX14MBXW603.wingroup.windeploy.ntdev.microsoft.com ([169.254.3.209]) by TK5EX14MLTW651.wingroup.windeploy.ntdev.microsoft.com ([157.54.71.39]) with mapi id 14.01.0289.008; Thu, 19 May 2011 16:44:36 -0700
From: Gabriel Montenegro <Gabriel.Montenegro@microsoft.com>
To: Jamie Lokier <jamie@shareable.org>, Greg Wilkins <gregw@intalio.com>
Thread-Topic: [hybi] Ping/Pong body (was Re: TSV-Directorate review of draft-ietf-hybi-thewebsocketprotocol-07)
Thread-Index: AcwVjUa0m40rVBn+TCqGvkziRY4GLAARGKcAAAmwAIAAASH6gAAui92AAA5D4fA=
Date: Thu, 19 May 2011 23:44:35 +0000
Message-ID: <CA566BAEAD6B3F4E8B5C5C4F61710C11402DAF7B@TK5EX14MBXW603.wingroup.windeploy.ntdev.microsoft.com>
References: <ED13A76FCE9E96498B049688227AEA292C6A81E4@TK5EX14MBXC206.redmond.corp.microsoft.com> <F390D8D1-335B-4595-93A2-0741DD693559@gmail.com> <ED13A76FCE9E96498B049688227AEA292C6A85DE@TK5EX14MBXC206.redmond.corp.microsoft.com> <BANLkTimg6Z8rs+SDp-HX+FzJQukKndWqkg@mail.gmail.com> <20110519232827.GA969@shareable.org>
In-Reply-To: <20110519232827.GA969@shareable.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [157.54.51.28]
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Cc: "hybi@ietf.org" <hybi@ietf.org>
Subject: Re: [hybi] Ping/Pong body (was Re: TSV-Directorate review of draft-ietf-hybi-thewebsocketprotocol-07)
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: Thu, 19 May 2011 23:44:38 -0000

This usage is supported in revision 07, which only has text on the responder (the "Pingee"?) allowing it to respond only to the latest Ping, but it has no constrain on the initiator (the "Pinger"), which is currently free to send more than one (which you indicate might actually make sense in your case). 

I'm curious, if a Pong has not been received in such long time, why is the course of action to Ping again versus declaring that node gone or down and unavailable? I thought your goal was to detect dead nodes. Wouldn't this constitute a dead node?

> -----Original Message-----
> From: Jamie Lokier [mailto:jamie@shareable.org]
> Sent: Thursday, May 19, 2011 16:28
> To: Greg Wilkins
> Cc: Piotr Kulaga; hybi@ietf.org; Gabriel Montenegro
> Subject: Re: [hybi] Ping/Pong body (was Re: TSV-Directorate review of draft-ietf-
> hybi-thewebsocketprotocol-07)
> 
> Greg Wilkins wrote:
> > On 19 May 2011 10:43, Piotr Kulaga <piotrku@microsoft.com> wrote:
> > > Personally I do not see any point of allowing multiple outstanding
> > > pings. If a sender did not get a response to first of them, sending
> > > another one probably will not increase its chances. To me, saying
> > > that only one ping is allowed is a simplification of the protocol
> > > which does not limit protocol’s functionality.
> >
> >
> > I agree that multiple outstanding pings do not initially appear useful.
> >
> > But then I don't see why we need to restrict it to only 1.    Either
> > it will not have a use and thus nobody will send multiple pings,  or
> > somebody will discover a use and we should let them.
> 
> Naturally I have a use, and it came up in my very first application for WebSocket.
> What follows is an example.
> 
> A server needs to know which clients are currently "online" for the purpose of
> reporting this to other clients, detecting dead clients etc.
> 
> "Online" is defined (in this example) as "received something in the last 30
> seconds".  This ensures it's fairly up to date, which is important in a number of
> applications.
> 
> No guarantees can be made about the network, but we choose to treat a delay
> of up to 10 seconds in the client-to-server direction as acceptable.
> (This is based on 3G experiences, which commonly delay for that long.)
> 
> Therefore the client sends 1 ping message every *20* seconds, if there is no
> other client-to-server data.
> 
> The client must send another ping after 20 seconds even if it hasn't had a pong
> for the previous ping yet.
> 
> Pongs can be delayed quite a lot due to queueing behind other messages already
> queued from server-to-client, plus network delays.
> 
> If the client had to wait for pong before sending another ping, that would cause
> spurious "offline" statuses whenever there was a lot of data transiting in server-
> to-client direction.  Or we'd have to use a custom keepalive protocol to avoid
> the restriction.  Or we couldn't provide such an up to date measure.
> 
> (In reality we'll probably use a custom keepalive protocol anyway, to reduce the
> amount of packets needed, but that's a separate issue.)
> 
> -- Jamie