Re: [core] Observe Cancellation: The outcome

"Victor Blake" <victorblake@victorblake.org> Sun, 09 March 2014 21:08 UTC

Return-Path: <victorblake@victorblake.org>
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 BBC9C1A0392 for <core@ietfa.amsl.com>; Sun, 9 Mar 2014 14:08:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001] 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 jmJO_9Z9VYfo for <core@ietfa.amsl.com>; Sun, 9 Mar 2014 14:08:43 -0700 (PDT)
Received: from p3plsmtpa06-10.prod.phx3.secureserver.net (p3plsmtpa06-10.prod.phx3.secureserver.net [173.201.192.111]) by ietfa.amsl.com (Postfix) with ESMTP id 021711A0391 for <core@ietf.org>; Sun, 9 Mar 2014 14:08:42 -0700 (PDT)
Received: from Study ([216.246.69.52]) by p3plsmtpa06-10.prod.phx3.secureserver.net with id bZ8c1n00917gBDU01Z8cTh; Sun, 09 Mar 2014 14:08:37 -0700
From: Victor Blake <victorblake@victorblake.org>
To: "'Peter A. Bigot'" <pab@pabigot.com>, 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> <531BB39E.7050109@pabigot.com>
In-Reply-To: <531BB39E.7050109@pabigot.com>
Date: Sun, 09 Mar 2014 17:08:57 -0400
Message-ID: <003701cf3bdb$c9a6c460$5cf44d20$@victorblake.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 14.0
Thread-Index: AQI3KNd7qygjE7xcYsJFNERKx8P53gLCSvCIAYk9lgsB5mIWe5nX1kGg
Content-Language: en-us
Archived-At: http://mailarchive.ietf.org/arch/msg/core/-XujQM6mThZC3kBwPxsY6WXn-iY
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 21:08:47 -0000

Well stated Peter. I agree, it's a choice to "create a resource representing
a subscription" and thereafter treat it as such.

-Victor

-----Original Message-----
From: Peter A. Bigot [mailto:pab@pabigot.com] 
Sent: Saturday, March 08, 2014 7:20 PM
To: core@ietf.org
Subject: Re: [core] Observe Cancellation: The outcome

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