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

Vladimir Katardjiev <vladimir@d2dx.com> Mon, 19 April 2010 21:36 UTC

Return-Path: <vladimir@d2dx.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 D77813A68AA for <hybi@core3.amsl.com>; Mon, 19 Apr 2010 14:36:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.299
X-Spam-Level:
X-Spam-Status: No, score=-1.299 tagged_above=-999 required=5 tests=[AWL=1.300, 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 lMACPuqlj5av for <hybi@core3.amsl.com>; Mon, 19 Apr 2010 14:36:32 -0700 (PDT)
Received: from homiemail-a4.g.dreamhost.com (caiajhbdcbef.dreamhost.com [208.97.132.145]) by core3.amsl.com (Postfix) with ESMTP id E886A3A6781 for <hybi@ietf.org>; Mon, 19 Apr 2010 14:36:32 -0700 (PDT)
Received: from c-39e6e055.321-1-64736c12.cust.bredbandsbolaget.se (c-39e6e055.321-1-64736c12.cust.bredbandsbolaget.se [85.224.230.57]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by homiemail-a4.g.dreamhost.com (Postfix) with ESMTP id BC22441A2A; Mon, 19 Apr 2010 14:36:23 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1077)
Content-Type: text/plain; charset="us-ascii"
From: Vladimir Katardjiev <vladimir@d2dx.com>
In-Reply-To: <r2v5821ea241004191405i24bb2dbbp7d63399720672efc@mail.gmail.com>
Date: Mon, 19 Apr 2010 23:36:19 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <3E6E5266-E837-4114-B426-38A7C687A70C@d2dx.com>
References: <Pine.LNX.4.64.1004181812370.751@ps20323.dreamhostps.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> <l2v5821ea241004191326i50970f32zbda7f876eda777f1@mail.gmail.com> <B3F72E5548B10A4A8E6F4795430F841832040F78ED@NOK-EUMSG-02.mgdnok.nokia.com> <r2v5821ea241004191405i24bb2dbbp7d63399720672efc@mail.gmail.com>
To: Hybi <hybi@ietf.org>
X-Mailer: Apple Mail (2.1077)
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: Mon, 19 Apr 2010 21:36:33 -0000

On 19 apr 2010, at 23.05, Pieter Hintjens wrote:

> On Mon, Apr 19, 2010 at 10:54 PM,  <Markus.Isomaki@nokia.com> wrote:
> 
>> Hmm... Even if the protocol as a whole is asynchronous (both ends can generate frames at any time), isn't it still possible to exchange requests and responses as well over the same transport connection?
> 
> Here is the logic we used when designing AMQP's KA mechanism.
> 
> Let's say we use a req-resp model over a symmetric async connection...
> 
> * if the other party is sending us stuff, KA responses are redundant
> * If we're sending stuff, KA requests are redundant
> * Since we're symmetric, both peers would send requests when idle
> * Thus a response is always redundant
> 
> And it boils down to sending NOOPs when otherwise idle, to ensure the
> other party knows we're still alive (as a process).
> 
> Incidentally this simplified async KA is also much easier to
> implement, requiring no state at the recipient.

Don't both sender and receiver need state? Each node needs to know:

- When it last sent an outgoing message (so it can send a noop when it's time)
- When it last received an incoming message (so it knows when to treat the connection as "dead")

Having said that, from a mobile perspective this is disastrous. In the worst-case scenario, if your keepalive interval is 5 minutes, you could end up sending a keepalive message every 2.5 minutes. This would wake up the radio twice as often, and, consequently, halve battery life. In a scenario where the server's keepalive is triggered by the client's, the message from the server would likely arrive within the timeframe that the radio is "awake" anyway (3-5 seconds on smartphones) and thus avoid waking it up again. 

The usage of keepalive as an ack was an interesting proposal, although I'm not sure if the websocket level can properly define an ack... It would only mean the message had been received, not necessarily processed, so I'm not sure what the benefit is. From a data integrity perspective, the interesting ack is "processing complete", not "delivery performed". The latter we have on some level via TCP already.

Vladimir