Re: [core] Can all responses be instant? (Re: Fwd: New Version Notification for draft-hartke-coap-observe-00)

Zach Shelby <zach@sensinode.com> Mon, 28 June 2010 21:06 UTC

Return-Path: <zach@sensinode.com>
X-Original-To: core@core3.amsl.com
Delivered-To: core@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 7D53D3A6A79 for <core@core3.amsl.com>; Mon, 28 Jun 2010 14:06:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.935
X-Spam-Level:
X-Spam-Status: No, score=-1.935 tagged_above=-999 required=5 tests=[AWL=-0.750, BAYES_40=-0.185, RCVD_IN_DNSWL_LOW=-1]
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 bhCZSkwBVso3 for <core@core3.amsl.com>; Mon, 28 Jun 2010 14:06:00 -0700 (PDT)
Received: from auth-smtp.nebula.fi (auth-smtp.nebula.fi [217.30.180.105]) by core3.amsl.com (Postfix) with ESMTP id A0F293A69EA for <core@ietf.org>; Mon, 28 Jun 2010 14:05:55 -0700 (PDT)
Received: from [192.168.1.3] (line-4648.dyn.kponet.fi [85.29.64.121]) (authenticated bits=0) by auth-smtp.nebula.fi (8.13.4/8.13.4) with ESMTP id o5SL61DE004539 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 29 Jun 2010 00:06:01 +0300
Mime-Version: 1.0 (Apple Message framework v1081)
Content-Type: text/plain; charset="us-ascii"
From: Zach Shelby <zach@sensinode.com>
In-Reply-To: <08C9302C-72D4-496B-A7B3-3F37DD1CA759@tzi.org>
Date: Tue, 29 Jun 2010 00:06:03 +0300
Content-Transfer-Encoding: quoted-printable
Message-Id: <E4BAC433-1DAB-440B-95EF-5EEB7BFCE36C@sensinode.com>
References: <20100622203528.0519A28C0D0@core3.amsl.com> <A9654C45-840C-4682-AA1A-9EAF44D81138@tzi.org> <3A0432F2-457D-47B4-A826-9678E8F5DB57@sensinode.com> <08C9302C-72D4-496B-A7B3-3F37DD1CA759@tzi.org>
To: Carsten Bormann <cabo@tzi.org>
X-Mailer: Apple Mail (2.1081)
Cc: core <core@ietf.org>
Subject: Re: [core] Can all responses be instant? (Re: Fwd: New Version Notification for draft-hartke-coap-observe-00)
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/core>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 28 Jun 2010 21:06:01 -0000

Bingo, I have been thinking about this more and to me it seems like dealing with asynchronous responses to delayed normal requests (not subscriptions) is actually the key piece we have been missing. We need this kind of asynchronous response (notification) for this purpose. So what if we build this observation thing like:

1. Integrate this asynchronous response message into the core protocol for the purpose of normal requests. This might be similar to the current notify message, or a different kind of response. I think this is what Robert Cragie was getting to before, asynchronous interactions are key here.

2. We consider the observation feature as just another way to invoke asynchronous responses. If we consider that GET can be answered later asynchronously. Then adding a subscription is simply a GET with some more specific meta-data (subscription/observation option). That also makes the HTTP mapping more like what some were hoping for?

Both 1 and 2 are part of the transfer protocol interaction model, and can be done transparently to the REST methods. I start to see a way we could achieve both the observation and notification without requiring new methods and making it possible for a more "transparent" HTTP mapping even for observation.

On Jun 23, 2010, at 7:55 PM, Carsten Bormann wrote:

> Zach,
> 
> that are a number of very good questions.
> 
> Let's start discussing this one:
> 
>> - I am not sure about the implications of allowing a delayed GET and PUT response on implementations. Currently in coap-00 if an end-point doesn't make use of subscribe/notify it doesn't have to implement code to wait for asynchronous notifications. For example it might simply make a request, open a temporary UDP socket waiting for the response, and then close that and go to sleep. Well, I guess if it gets an intermediate response code it would know to stay awake waiting for the response. Is this an efficient way of using energy in a constrained network though? What if a client doesn't want a delayed response?
> 
> Right now, CoAP is silent on how much time a server has to answer a request.
> 
> Certainly, that time will never be zero.
> 
> Can we live with limiting this time to < RESPONSE_TIMEOUT hard?

Nope, I think you are right that we need asynchronous responses.  

> 
> If yes, everything gets simpler.
> If not, there is always the alternative not to do an inversion of control; in that case, the server would reply with a "please wait and try again", maybe including a duration that gives the estimated time until an answer, and the client would simply repeat asking at its convenience.
> (Of course, the server could simply remain silent, prompting retransmissions, but this means that we limit the time to RESPONSE_TIMEOUT * MAX_RETRANSMIT, assuming no errors, and we increase the likelihood of a transfer failing just because of lost packets.)
> 
> On the other hand, if we do have a "notify" style packet, there is very little stopping us from implementing an "I'll give it to you later" reply (the "ACK" packet in Figure 1 of coap-observe).  A client that doesn't want to wait can simply treat that as a failure.


Zach

> 
> As usual, we should probably err on the side of simplicity, but only after having discussed whether we are hitting Einstein's "but no simpler".
> 
> Gruesse, Carsten
> 

-- 
Zach Shelby, Chief Nerd, Sensinode Ltd.
http://zachshelby.org  - My blog "On the Internet of Things"
http://6lowpan.net - My book "6LoWPAN: The Wireless Embedded Internet"
Mobile: +358 40 7796297