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

Willy Tarreau <w@1wt.eu> Wed, 25 May 2011 04:38 UTC

Return-Path: <w@1wt.eu>
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 DB853E0665 for <hybi@ietfa.amsl.com>; Tue, 24 May 2011 21:38:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.854
X-Spam-Level:
X-Spam-Status: No, score=-5.854 tagged_above=-999 required=5 tests=[AWL=-3.812, BAYES_00=-2.599, HELO_IS_SMALL6=0.556]
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 w10nT8sdI7XI for <hybi@ietfa.amsl.com>; Tue, 24 May 2011 21:38:40 -0700 (PDT)
Received: from 1wt.eu (1wt.eu [62.212.114.60]) by ietfa.amsl.com (Postfix) with ESMTP id 17F09E0699 for <hybi@ietf.org>; Tue, 24 May 2011 21:38:39 -0700 (PDT)
Received: (from willy@localhost) by mail.home.local (8.14.4/8.14.4/Submit) id p4P4cW8k006354; Wed, 25 May 2011 06:38:32 +0200
Date: Wed, 25 May 2011 06:38:32 +0200
From: Willy Tarreau <w@1wt.eu>
To: Patrick McManus <pmcmanus@mozilla.com>
Message-ID: <20110525043832.GA6328@1wt.eu>
References: <ED13A76FCE9E96498B049688227AEA292C6A81E4@TK5EX14MBXC206.redmond.corp.microsoft.com> <4DD9686C.7020509@callenish.com> <BANLkTin2LcHgPH7s4-T_1LJa_UhkigJziw@mail.gmail.com> <1306285493.1782.33.camel@ds9> <BANLkTino-_v8VKMXaUG0WH9HgsFedWgHtg@mail.gmail.com> <1306294656.1782.50.camel@ds9>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <1306294656.1782.50.camel@ds9>
User-Agent: Mutt/1.4.2.3i
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: Wed, 25 May 2011 04:38:41 -0000

Hi Patrick,

On Tue, May 24, 2011 at 11:37:36PM -0400, Patrick McManus wrote:
> On Wed, 2011-05-25 at 12:08 +0900, Takeshi Yoshino wrote:
> 
> > . Yes, preparing something unpredictable solves this.
> 
> right, without further changes to the protocol. Then we could ship
> websockets and people could start writing applications instead of
> documents. Stability is a worthwhile goal.
> 
> > But this is interoperability problem between user-agents and servers
> > provided by various vendors/people
> 
> I disagree, because [see below]
> 
> >  enough, maybe I would use random bytes of 3 or more byte long.
> 
> right. The ping-generating-peer doesn't need cooperation from the other
> peer in order to create a unique payload. Interoperabiity does not
> require that each end use the same algorithm - either the client or the
> server can be the ping generating peer.

I would add that if one peer randomly sends pong messages, it's just
deliberately trying to get its communication degraded. Ping/pong may
be used in order to improve quality of service by detecting quickly
that a connection seems to be broken. There's nothing to win by fooling
this. It's similar to ICMP ping : instead of wondering what would happen
if Google sends me fake echo reply messages when I ping them to check if
my DSL line is OK, I prefer to ask why would they do this in the first
place and for what purpose ?

Here it's the same. We could similarly have peers that randomly send
crap just because it's fun, or send wrong size message on purpose, we
can imagine anything. It just has no use for the one sending that crap,
so basically I4d say that unsollicited pong messages must be ignored,
and that even if the other end fakes a perfect pong that you take for
valid, we should't care. This fake pong will lead to wrong RTT estimates
and the valid one will be ignored, end of the story.

In ICMP we have a sequence number in ping messages. This might be useful
to ensure we're getting the association right, and it's easier to recommend
using a counter than sending a random message. Some users might prefer to
send a timestamp in the message maybe.

Regards,
Willy