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

Jamie Lokier <jamie@shareable.org> Tue, 20 April 2010 01:40 UTC

Return-Path: <jamie@shareable.org>
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 4A3AF3A68B5 for <hybi@core3.amsl.com>; Mon, 19 Apr 2010 18:40:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.099
X-Spam-Level:
X-Spam-Status: No, score=-3.099 tagged_above=-999 required=5 tests=[AWL=-0.500, 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 q9AFkv5jMvU7 for <hybi@core3.amsl.com>; Mon, 19 Apr 2010 18:40:52 -0700 (PDT)
Received: from mail2.shareable.org (mail2.shareable.org [80.68.89.115]) by core3.amsl.com (Postfix) with ESMTP id 077EF3A67B4 for <hybi@ietf.org>; Mon, 19 Apr 2010 18:40:52 -0700 (PDT)
Received: from jamie by mail2.shareable.org with local (Exim 4.63) (envelope-from <jamie@shareable.org>) id 1O42S9-0006YD-PJ; Tue, 20 Apr 2010 02:40:41 +0100
Date: Tue, 20 Apr 2010 02:40:41 +0100
From: Jamie Lokier <jamie@shareable.org>
To: Markus.Isomaki@nokia.com
Message-ID: <20100420014041.GD21899@shareable.org>
References: <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> <l2v5821ea241004191326i50970f32zbda7f876eda777f1@mail.gmail.com> <B3F72E5548B10A4A8E6F4795430F841832040F78ED@NOK-EUMSG-02.mgdnok.nokia.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <B3F72E5548B10A4A8E6F4795430F841832040F78ED@NOK-EUMSG-02.mgdnok.nokia.com>
User-Agent: Mutt/1.5.13 (2006-08-11)
Cc: 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 01:40:53 -0000

Markus.Isomaki@nokia.com wrote:
> Hi Pieter,
> 
> Pieter Hintjens wrote:
> >
> >On Mon, Apr 19, 2010 at 10:17 PM,  <Markus.Isomaki@nokia.com> wrote:
> >
> >> I'd prefer request-response pattern.
> >
> >Which works only if the protocol is fully synchronous.  I 
> >thought WebSockets was async...?
> >
> 
> 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?
> 
> I guess a special situation arises when a client sends out a keepalive request and before responding, the server starts to send a data frame in the other direction (since these two events can happen asynchronously). But then the server just has to put the keepalive response in its sending queue. (In that case such a response would seem a bit redundant, since the client can see that the connection is up when it receives the data frame). I assume it would still possible to match the response to the request. 
> 
> Or am I missing something obvious here? 

Perhaps the missing thing is that request-response is more complicated
in this kind of protocol, because you also have to define a way to
_associated_ each response with the request.  That means sequence
numbers, or identifiers, or being careful with counting response
messages distinct from non-response messages.

There are also subtleties: If the other end sends a graceful close
message, and then receives a KA request, does it send a KA response,
or does the graceful close mean that KA response is among the message
types that won't be sent?

Because it's more complicated, it's not necessarily a great pattern
compared with async keepalive, which is quite simple, and doesn't even
need to send a KA message from the server in your example.  (The data
frame is enough by itself).

However for packet efficiency, synchronising timing by using
request-response, or another synchronisation method, may still be
advantageous.  Even though it's more complicated than async keepalive.

-- Jamie