Re: [core] Observe Cancellation: The outcome

"Peter A. Bigot" <pab@pabigot.com> Sun, 09 March 2014 00:19 UTC

Return-Path: <pab@pabigot.com>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B721C1A02FC for <core@ietfa.amsl.com>; Sat, 8 Mar 2014 16:19:50 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9zLFwqD7hRJI for <core@ietfa.amsl.com>; Sat, 8 Mar 2014 16:19:48 -0800 (PST)
Received: from p3plsmtpa09-06.prod.phx3.secureserver.net (p3plsmtpa09-06.prod.phx3.secureserver.net [173.201.193.235]) by ietfa.amsl.com (Postfix) with ESMTP id 501401A013A for <core@ietf.org>; Sat, 8 Mar 2014 16:19:48 -0800 (PST)
Received: from [192.168.65.10] ([66.41.60.82]) by p3plsmtpa09-06.prod.phx3.secureserver.net with id bCKi1n0041mTNtu01CKinX; Sat, 08 Mar 2014 17:19:43 -0700
Message-ID: <531BB39E.7050109@pabigot.com>
Date: Sat, 08 Mar 2014 18:19:42 -0600
From: "Peter A. Bigot" <pab@pabigot.com>
Organization: Peter Bigot Consulting, LLC
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
MIME-Version: 1.0
To: core@ietf.org
References: <5A8F12CD-25B5-4915-A298-0AB0F6FA47F7@tzi.org> <CF40AD3C.1331B%thomas.fossati@alcatel-lucent.com> <307ACD9F-86D9-47A9-8D4B-DEA9BCB9C360@tzi.org>
In-Reply-To: <307ACD9F-86D9-47A9-8D4B-DEA9BCB9C360@tzi.org>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 8bit
Archived-At: http://mailarchive.ietf.org/arch/msg/core/hybD46jhZO3xJgDamG2wyazNr2I
Subject: Re: [core] Observe Cancellation: The outcome
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/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: Sun, 09 Mar 2014 00:19:51 -0000

On 03/08/2014 11:15 AM, Carsten Bormann wrote:
> On 08 Mar 2014, at 16:10, FOSSATI, Thomas (Thomas) <thomas.fossati@alcatel-lucent.com> wrote:
>
>> b) reusing an existing request code as GET (or any other already allocated
>>    method).
> (Personal view follows, no hat:)
>
> There is no “reuse”.
>
> This is still a GET: A client is obtaining a representation of the resource.
> At the level of the REST model, there is no change: These representations are cacheable, they can be operated on by chains of proxies (“layered system”) only some of which make use of Observe, maintaining a uniform interface, and so on.
>
> The details of how the GET request is operated are in the Observe request option (absent, =0, =1).
> Setting up an Observation relationship asks for future representations as well; renewing checks and possible re-establishes it, canceling ends the indication of interest.
> But this is not application state: This is entirely an optimization that saves polling (or, long-polling, which goes much further in the way of bending the REST principles).
> Saying this is “not RESTful” is tantamount to claiming HTTP is not RESTful because it involves setting up TCP state.

Agreed: There is no state at the HTTP (request/response transaction) 
layer; it's present at the TCP (data transport) layer, which is 
conceptually decoupled from HTTP in a RESTful system (e.g., HTTP/SMTP).

In CoAP, the state that's being created for -observe is being created 
and destroyed as a side-effect of a GET request (transaction), and is 
identified through a transaction-layer concept (Token).  So we can say 
there's no inter-transaction state preserved in an -observe operation 
because the transaction simply hasn't completed until something causes 
it to stop; all those requests/responses over long periods are the moral 
equivalent of IP packets, and the state required to support them the 
moral equivalent of TCP state.

This is an interesting perspective, and I see the argument.

> The Observation relationship state is not modeled as a resource, because it really isn’t one.

It's not a resource only because it was decided that it shouldn't be.  
It'd be a resource if you think of handling observation this way:

1) Create a resource representing a subscription from a client to a 
server, containing the URI of the resource to be observed and a URI to 
which changes to the observed resource should be sent.  (Creation does 
not have to be done on a server that hosts the observed resource.  
Exercise: why might this be desirable?)

2) Sit back and wait for updates.  (Notifications don't need to be sent 
by the owner of the observed resource.  Exercise: why might this be 
desirable?)

3) Delete the subscription resource when the subscription is no longer 
desired.

Sure there are details to be worked out, but this seems more RESTful 
(and clean and harmonious) than having subscriptions (aka state, at 
whatever layer) created and destroyed as a side effect of requesting 
transfer of a (representation of a) resource.

Something for CoAPbis to consider, or not.

Peter