[core] SUB/NOT - the sea level view

Cullen Jennings <fluffy@cisco.com> Fri, 04 June 2010 18:34 UTC

Return-Path: <fluffy@cisco.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 004013A69C5 for <core@core3.amsl.com>; Fri, 4 Jun 2010 11:34:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -108.42
X-Spam-Level:
X-Spam-Status: No, score=-108.42 tagged_above=-999 required=5 tests=[AWL=-0.422, BAYES_50=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-8, USER_IN_WHITELIST=-100]
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 PX4FLzaf3b9s for <core@core3.amsl.com>; Fri, 4 Jun 2010 11:34:08 -0700 (PDT)
Received: from sj-iport-4.cisco.com (sj-iport-4.cisco.com [171.68.10.86]) by core3.amsl.com (Postfix) with ESMTP id CA8583A6998 for <core@ietf.org>; Fri, 4 Jun 2010 11:34:08 -0700 (PDT)
Authentication-Results: sj-iport-4.cisco.com; dkim=neutral (message not signed) header.i=none
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AiIFADLkCEyrR7H+/2dsb2JhbACBQ50CcaVJmgiFFwSDSQ
X-IronPort-AV: E=Sophos; i="4.53,362,1272844800"; d="scan'208,217"; a="139572793"
Received: from sj-core-2.cisco.com ([171.71.177.254]) by sj-iport-4.cisco.com with ESMTP; 04 Jun 2010 18:33:55 +0000
Received: from [192.168.4.177] (rcdn-fluffy-8711.cisco.com [10.99.9.18]) by sj-core-2.cisco.com (8.13.8/8.14.3) with ESMTP id o54IXsmi004597 for <core@ietf.org>; Fri, 4 Jun 2010 18:33:54 GMT
From: Cullen Jennings <fluffy@cisco.com>
Content-Type: multipart/alternative; boundary="Apple-Mail-1-1016490393"
Impp: xmpp:cullenfluffyjennings@jabber.org
Date: Fri, 04 Jun 2010 12:33:53 -0600
Message-Id: <C07D3949-3CC2-4BB1-B8B6-6C2011675D50@cisco.com>
To: core <core@ietf.org>
Mime-Version: 1.0 (Apple Message framework v1078)
X-Mailer: Apple Mail (2.1078)
Subject: [core] SUB/NOT - the sea level view
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: Fri, 04 Jun 2010 18:34:10 -0000

Over the year I have had the pleasure of being in many conversations about what a stateless protocol is, what REST is, HTTP, polling, asynchronous notifications, web based RPC, and blowing soap bubbles.  Though interesting, I have a hard time concretely explaining it to anyone and the oxygen always seems a bit thin at the 10,000 foot view. I do however have a very easy time understanding a very low level view of the systems where there are  some boxes and arrow diagrams of  message flow and roughly the semantics of the data they cary. Let me try and draw my current understanding of how this is going to work.

We have two nodes - I will call them Source and Sink. 

                             
   Source         Sink       
     |    SUB      |         
     |<------------+         
     |             |         
     |    ACK      |         
     +------------>|         
     |             |         
    ... Time Passes ...          
     |             |         
     |   NOTIF     |         
     +------------>|          
     |             |         
     |   ACK       |         
     |<------------+          
     |             |         


Sink starts by sending a message I will label "SUB" to the Source. The SUB messages says which resource the Sink would like to be informed about when the resource changes. The Source sends a OK or No there is a problem in some sort of ACK message to the SUB. Eventually the resource changes and Source sends an message I called "NOTIFY" to the Sink. This tells the Sink which resource changed and the current value of it.The Sink sends some sort of acknowledgment. I find the terms client and server very confusing when discussing SUB/NOT so I'm not using those terms. 

The Sink could be a HTTP proxy that mapped this to COMET, WebSocket, or plain old polling, XMPP, SMTP, just about anything. As far as I can tell, pretty much everything people have been proposing fit into this model.  So first, I'd like to get an idea if people think I am in left field and there is a very different message flow to consider. Second we need to figure out some of the stuff I left out of the picture above such as 

a) how to cancel a subscription 

b) how to get the initial value of the subscription around the time you subscribe 

c) what sort of filtering is available to limit the types of resource changes that result in a NOTIFY 

d) lifespan of subscription how to refresh a subscription

e) caching and interaction with sleeping device 

We have to be clear on how this maps to HTTP and possibly other protocols. One of the problems with HTTP is it has so many ways of doing asynchronous notifications that it hard to decide what to map for. I would be very conformable if we clearly new how to map it to HiBy and to direct HTTP polling. It would be nice to have  back of the cocktail napkin belief that it probably could be mapped to SMNP, XMPP, and the other HTTP approaches. My guess is that the mapping to other protocols is going to turn out to be easy.