One document matched: draft-jimenez-p2psip-coap-reload-10.xml


<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC5226 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5226.xml">
<!ENTITY RFC7252 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7252.xml">
<!ENTITY RFC5280 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5280.xml">
<!ENTITY RFC6940 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6940.xml">
<!ENTITY RFC7228 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7228.xml">
<!ENTITY RFC6690 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6690.xml">
<!ENTITY RFC3986 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3986.xml">
<!ENTITY I-D.ietf-p2psip-concepts SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-p2psip-concepts.xml">
<!ENTITY I-D.ietf-core-resource-directory SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-core-resource-directory.xml">

]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs),
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="3"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->

<rfc ipr="trust200902" docName="draft-jimenez-p2psip-coap-reload-10" category='std'>

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no" ?>
<?rfc strict="yes" ?>
	
<front>
    <title abbrev="A CoAP Usage for RELOAD">
A Constrained Application Protocol (CoAP) Usage for REsource LOcation
And Discovery (RELOAD)
    </title>
	<author initials="J.J." surname="Jimenez" fullname="Jaime Jimenez">  
		<organization>Ericsson</organization>
		<address>
			<postal>
				<street>Hirsalantie 11</street>
				<code>02420</code> 
				<city>Jorvas</city> 
				<country>Finland</country>
			</postal>
			<email>jaime.jimenez@ericsson.com</email>
		</address>
	</author>

	<author initials="J.M.L.V." surname="Lopez-Vega" 
		fullname="Jose M. Lopez-Vega">
		<organization>University of Granada</organization>
		<address>
			<postal>
				<street>CITIC UGR Periodista Rafael Gomez Montero 2</street>
				<code>18071</code> 
				<city>Granada</city> 
				<country>Spain</country>
			</postal>
			<email>jmlvega@ugr.es</email>
		</address>
	</author>

	<author initials="J.M." surname="Maenpaa" 
		fullname="Jouni Maenpaa">
		<organization>Ericsson</organization>
		<address>
			<postal>
				<street>Hirsalantie 11</street>
				<code>02420</code> 
				<city>Jorvas</city> 
				<country>Finland</country>
			</postal>
			<email>jouni.maenpaa@ericsson.com</email>
		</address>
	</author>

	<author initials="G.C." surname="Camarillo" 
		fullname="Gonzalo Camarillo">
		<organization>Ericsson</organization>
		<address>
			<postal>
				<street>Hirsalantie 11</street>
				<code>02420</code> 
				<city>Jorvas</city> 
				<country>Finland</country>
			</postal>
			<email>gonzalo.camarillo@ericsson.com</email>
		</address>
	</author>
	
    <date  year="2015" />
    <area>RAI</area>
    <workgroup>P2PSIP</workgroup>
    <keyword>CoAP, RELOAD</keyword>

    <abstract>
    <t>
This document defines a Constrained Application Protocol (CoAP) Usage for REsource LOcation And Discovery (RELOAD). The CoAP Usage provides the functionality to federate Wireless Sensor Networks (WSN) in a peer-to-peer fashion. The CoAP Usage for RELOAD allows CoAP nodes to store resources in a RELOAD peer-to-peer overlay, provides a lookup service, and enables the use of RELOAD overlay as a cache for sensor data. This functionality is implemented in the RELOAD overlay itself, without the use of centralized servers. The RELOAD AppAttach method is used to establish a direct connection between nodes through which CoAP messages are exchanged. 
    </t>
    </abstract>
</front>

<middle>

<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** --> 
<section anchor='introduction' title="Introduction">
<t>
The CoAP Usage for RELOAD allows CoAP nodes to store resources in a RELOAD peer-to-peer overlay, provides a lookup service, and enables the use of RELOAD overlay as a cache for sensor data. This functionality is implemented in the RELOAD overlay itself, without the use of centralized servers. 
</t>
<t>
This usage is intended for interconnected devices over a wide-area geographical coverage, such as in cases where multiple Wireless Sensor Networks (WSN) need to be federated over some wider-area network. These WSNs would interconnect by means of nodes that are equipped with long range modules (e.g., 2G, 3G, 4G) as well as short range ones (e.g., XBee, ZigBee, BLE). </t> <t>
Constrained devices are likely to be heterogeneous when it comes to their radio layer, however we expect them to use a common application layer protocol, CoAP. The Constrained Application Protocol (CoAP) is a specialized web transfer protocol <xref target="RFC7252"/>. It realizes the Representational State Transfer (REST) architecture for the most constrained nodes, such as sensors and actuators. CoAP can be used not only between nodes on the same constrained network but also between constrained nodes and nodes on the Internet. The latter is possible since CoAP can be translated to Hypertext Transfer Protocol (HTTP) for integration with the web. Application areas of CoAP include different forms of M2M communication, such as home automation, construction, health care or transportation. Areas with heavy use of sensor and actuator devices that monitor and interact with the surrounding environment.
</t>
<t>
As specified in <xref target="RFC6940"/> RELOAD is fundamentally an overlay network. Providing a layered architecture with pluggable application layers than can use the underlaying forwarding, storage and lookup functionalities. <xref target="fig-arc"/> illustrates where the CoAP Usage is placed within the RELOAD architecture.
</t>

<figure anchor="fig-arc" title="Architecture">
<artwork align="left"><![CDATA[
 			Application

        +-------+  
        | CoAP  |   ...
        | Usage |  
        +-------+  
    ------------------------------------ Messaging Service 
    +------------------+     +---------+
    |     Message      |<--->| Storage |
    |    Transport     |     +---------+
    +------------------+           ^
           ^       ^               |
           |       v               v
           |     +-------------------+
           |     |    Topology       |
           |     |    Plug-in        |
           |     +-------------------+
           |         ^
           v         v
        +------------------+
        |  Forwarding &    |
        | Link Management  |
        +------------------+
    ------------------------------------ Overlay Link Service 
         +-------+  +-------+
         |TLS    |  |DTLS   |  ...
         |Overlay|  |Overlay|
         |Link   |  |Link   |
         +-------+  +-------+
]]>
</artwork>
</figure>
           
<t>
The CoAP Usage involves three basic functions: 
</t>

<t>
Registration: CoAP nodes that can use the RELOAD data storage functionality, can store a mapping from their CoAP URI to their Node-ID in the overlay. They can also retrieve the Node-IDs of other nodes. Nodes that are not RELOAD aware can use other mechanisms, for example <xref target="I-D.ietf-core-resource-directory"/> in their local network.
</t>
<t>
Lookup: Once a CoAP node has identified the Node-ID for an URI it wishes to retrieve, it can use the RELOAD message routing system to set up a connection which can be used to exchange CoAP messages. Similarly as with the registration, nodes that are not RELOAD aware can use CoAP messages with an Reload Node (RN) that will in turn perform the lookup in the overlay.   
</t>
<t>
Caching: Nodes can use the RELOAD overlay as a caching mechanism for information about what CoAP resources are available on the node. This is specially useful for battery constrained nodes that can make their data available in the cache provided by the overlay while in sleep mode.
</t>

<t>
For instance, a CoAP proxy (See <xref target="sec-arc"/>) could register its Node-ID (e.g. "9996172") and a list of sensors (e.g. "/sensors/temp-1; /sensors/temp-2; /sensors/light, /sensors/humidity") under its URI (e.g. "coap://overlay-1.com/proxy-1/").
</t>
<t>
When a node wants to discover the values associated with that URI, it queries the overlay for "coap://overlay-1.com/proxy-1/" and gets back the Node-ID of the proxy and the list of its associated sensors. The requesting node can then use the RELOAD overlay to establish a direct connection with the proxy and to read sensor values.
</t>
<t>
Moreover, the CoAP proxy can store the sensor information in the overlay. In this way information can be retrieved directly from the overlay without performing a direct connection to the storing proxy.
</t>
</section>

<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** --> 
	
<section anchor='terminology' title="Terminology">
	<t>
		The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
		"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
		document are to be interpreted as described in RFC 2119 <xref
		target="RFC2119"/>.
	</t>
	<t>
		We use the terminology and definitions from the RELOAD Base Protocol <xref target="RFC6940"/> extensively in this document. Some of those concepts are further described in the Concepts and Terminology for Peer to Peer SIP <xref target="I-D.ietf-p2psip-concepts"/> document.
	</t> 
</section>

<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** --> 
	
<section anchor='sec-arc' title="Architecture">

	<t> In our architecture we extend the different nodes present in RELOAD (Peer, Client) and add support for sensor devices or other constrained devices. <xref target="fig-topo"/> illustrates the overlay topology. The different nodes, according to their functionality are :
	<list style='hanging'>	
		<t hangText="Client"><vspace /> 
		As specified in <xref target="RFC6940"/> clients are nodes that do not have routing or storage responsibilities in the Overlay.</t>
		<t hangText="Peer"><vspace /> 
		As specified in <xref target="RFC6940"/> peers are nodes in the overlay that can route messages for nodes other than those to which it is directly connected.</t> 
		<t hangText="Sensor"><vspace />
		Devices capable of measuring a physical quantity. Sensors usually acquire quantifiable information about their surrounding environment such as: temperature, humidity, electric current, moisture, radiation, and so on.</t>
		<t hangText="Actuator"><vspace /> 
		Devices capable of interacting and affecting their environment such as: electrical motors, pneumatic actuators, electric switches, and so on.</t>
		<t hangText="Proxy Node"><vspace /> 
		Devices having sufficient resources to run RELOAD either as client or peer. These devices are located at the edge of the sensor network and, in case of Wireless Sensor Networks (WSN), act as coordinators of the network.</t>
	</list>
</t>

<t> Physical devices can have one or several of the previous functional roles. According to the functionalities that are present in each of the nodes, they can be:
	<list style='hanging'>
		<t hangText="Constrained Node"><vspace /> 
		A Constrained Node (CN) is a node with limited computational capabilities. CN devices belong to classes of at least C1 and C2 devices as defined in <xref target="RFC7228"/>, their main constraint being the implementation of the CoAP protocol. If the CN is wireless then it will be part of a Low-Rate Wireless Personal Area Network (LR-WPAN), also termed Low-Power and Lossy Network (LLN). Lastly, devices will usually be in sleep mode in order to prevent battery drain, and will not communicate during those periods. A CN is NOT part of the RELOAD overlay, therefore it can not act as a client, peer nor proxy. A CN is always either a either a Sensor or an Actuator. In the latter case the node is often connected to a continuous energy power supply.</t>
		<t hangText="RELOAD Node"><vspace /> 
		A Reload Node (RN) MUST implement the client functionality in the Overlay. Additionally the node will often be a full RELOAD peer. A RN may also be sensor or actuator since it can have those devices connected to it.</t>	
		<t hangText="Proxy Node"><vspace /> 
		A Proxy Node (PN) MUST implement the RN functionality and act as a sink for the LR-WPAN network. The PN connects the short range Wireless Network to the Wide Area Network or the Internet. A Proxy Node fulfills the "Proxy Node" role as described above in the Architecture.</t>
	
	</list>
</t>

<figure anchor="fig-topo" title="Overlay Topology">
<artwork align="left"><![CDATA[
		             +------+
		             |      |
		    +--------+  RN  +---------+
		    |        |      |         |
		+---+--+     +------+      +--+---+
		|      |                   |      |
		|  RN  |                   |  RN  |
		|      |                   |      |   +------------+
		+---+--+                   +--+---+   |        WSN |
		    |         RELOAD          |       |     +----+ |
		    |         OVERLAY         |       | +---+ CN | |
		+---+--+                   +--+---+   | |   +----+ |
		|      |                   |      +-----+          |
		|  RN  |                   |  PN  |   |            |
		|      |                   |      +-----+          |
		+---+--+     +------+      +--+---+   | |   +----+ |
		    |        |      |         |       | +---+ CN | |
		    +--------+  PN  +---------+       |     +----+ |
		             |      |                 +------------+
		             +-+--+-+
		               |  |
		      +--------|--|--------+
		      |     +--+  +--+     |
		      |     |        |     |
		      |  +--+-+    +-+--+  |
		      |  | CN |    | CN |  |
		      |  +----+    +----+  |
		      |                WSN |
		      +--------------------+
]]>
</artwork>
</figure>

</section>

<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** --> 
	
<section anchor="sec-reg-uri" title="Registering CoAP URIs">
<t>
CoAP URIs are typically resolved using a DNS. When CoAP is needed in a RELOAD environment, URI resolution is provided by the overlay as a whole. Instead of registering a URI, a peer stores a CoAPRegistration structure under a hash of its own URI. This uses the CoAP REGISTRATION Kind-ID, which is formally defined in <xref target="sec-dir"/>, and that uses a DICTIONARY data model.
</t>
<t>
As an example, if a CoAP proxy that is located in an overlay overlay-1.com using a Node-ID "9996172" wants to register four different sensors to the URI "coap://overlay-1.com/proxy-1/.well-known/". We will be using the link format specified in <xref target="RFC6690"/> to store the following mapping in the overlay:
</t>

<figure>
  <artwork align="left"><![CDATA[
	Resource-ID = h(coap://overlay-1.com/proxy-1/.well-known/) 
	KEY =	 9996172,

	VALUE = [
		</sensors/temp-1>;rt="temperature-c";if="sensor",
		</sensors/temp-2>;rt="temperature-c";if="sensor",
		</sensors/light>;rt="light-lux";if="sensor",
		</sensors/humidity>;rt="humidity-p";if="sensor"
   		]

    ]]></artwork>
</figure>			  


<t>
Note that the Resource-ID stored in the overlay is calculated as hash over the URI (i.e. h(URI)), which in RELOAD usually is SHA-1.
</t>
<t>
This would inform any other node performing a lookup for the previous URI "coap://overlay-1.com/proxy-1/.well-known" that the Node-ID value for proxy-1 is "9996172". In addition, this mapping provides relevant information as to the number of sensors (CNs) and the URI path to connect to them using CoAP. 
</t>
</section>

<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** --> 
	
<section anchor="sec-ren" title="Lookup">
<t>
The RELOAD overlay supports a rendezvous system that can be used for the lookup of other CoAP nodes. This is done by fetching mapping information between CoAP URIs and Node-IDs. 
</t>
<t>
As an example, if a node RN located in the overlay overlay-1.com wishes to read which resources are served at a RN with URI coap://overlay-1.com/proxy-1/, it performs a fetch in the overlay. The Resource-ID used in this fetch is a SHA-1 hash over the URI "coap://overlay-1.com/proxy-1/.well-known/". 
</t>
<t>
After this fetch request, the overlay will return the following result:
</t>

	<figure>
	<artwork align="left"><![CDATA[
	Resource-ID = h(coap://overlay-1.com/proxy-1/.well-known/) 
	KEY =	 9996172,

	VALUE = [
		</sensors/temp-1>;rt="temperature-c";if="sensor",
		</sensors/temp-2>;rt="temperature-c";if="sensor",
		</sensors/light>;rt="light-lux";if="sensor",
		</sensors/humidity>;rt="humidity-p";if="sensor"
		]
  	    ]]></artwork>
  	</figure>		

<t>
The obtained KEY is the Node-ID of the RN responsible of this KEY/VALUE pair. The VALUE is the set of URIs necessary to read data from the CNs associated with the RN.
</t>
<t>
Using the RELOAD DICTIONARY model allows for multiple nodes to perform a store to the same Resource-ID. This can be used, for example, to perform a store of resources of the same type or with similar characteristics. After performing a lookup, this feature allows to fetch those multiple RNs that host CNs of the same class. 
</t>
<t>
As an example, providing that the previous peer (9996172) and another peer (9996173) have stored the links to their respective temperature resources in this same Resource-ID (temperature), a RN (e.g., node-A) can do a fetch to the URI "coap://overlay-1.com/temperature/.well-known/", obtaining the following results:
</t>
<figure>
<artwork align="left"><![CDATA[
	Resource-ID = h(coap://overlay-1.com/temperature/.well-known/)

	KEY =	 9996172,
	VALUE = [
		</sensors/temp-1>;rt="temperature-c";if="sensor",
		</sensors/temp-2>;rt="temperature-c";if="sensor",
			]

	KEY =	9996173,
	VALUE = [
		</sensors/temp-a>;rt="temperature-c";if="sensor",
        </sensors/temp-b>;rt="temperature-c";if="sensor"
			]
  	    ]]></artwork>
  	</figure>		
</section>

<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** --> 
	
<section anchor="sec-dir" title="Forming a Direct Connection and Reading Data">
<t>
Once a RN (e.g., node-A) has obtained the lookup information for a node in the overlay (e.g., proxy-1), it can directly connect to that node. This is performed by sending an AppAttach request to the Node-ID obtained during the lookup process.
</t>
<t>
After the AppAttach negotiation, node-A can access to the values of the CNs at proxy-1 using the information obtained during the lookup. Following the example in Section 5, and according to <xref target="RFC6690"/>, the requests for accessing to the CNs at proxy-1 would be:
</t>
<t>
<figure>
<artwork align="left"><![CDATA[
	REQ: GET /sensors/temp-1
	REQ: GET /sensors/temp-2
    ]]></artwork>
</figure>
</t>
<t>
<xref target="fig-sample"/> shows a sample of a node reading temperature data.
</t>

<figure title="An Example of a Message Sequence" 
anchor="fig-sample">
<artwork>
<![CDATA[
+-----+     +---------+    +-----+          +---+
| PNA |     | OVERLAY |    | PNB |          |CNB|
+-----+     +---------+    +-----+          +---+
   |             |            |                |
   |             |            |                |
   | 1.RELOAD    |            |                |
   | FetchReq    |            |                |
   |+----------->|            |                |
   |             |            |                |
   | 2.RELOAD    |            |                |
   | FetchAns    |            |                |
   |<-----------+|            |                |
   |             |            |                |
   | 3.RELOAD    |            |                |
   |  AppAttach  |            |                |
   |+----------->|            |                |
   |             | 4.RELOAD   |                |
   |             | AppAttach  |                |
   |             |+---------->|                |
   |             |            |                |
   |             | 5.RELOAD   |                |
   | 6.RELOAD    |AppAttachAns|                |
   |AppAttachAns |<----------+|                |
   |<-----------+|            |                |
   |             |            |                |
   |                          |                |
   |   ---------------------  |                |
   | /        7.ICE          \|                |
   | \   connectivity checks /|                |
   |   ---------------------  |                |
   |                          |                |
   |      8.CoAP CON          |                |
   |    GET /sensors/temp-1   |                |
   |+------------------------>|                |
   |                          |  9.CoAP  GET   |
   |                          |/sensors/temp-1 |
   |                          |+-------------->|
   |                          | 10.CoAP        |
   |     11.CoAP              |    ACK 200     |
   |        ACK 200           |<--------------+|
   |<------------------------+|                |
   |                          |                |
]]>
</artwork>
</figure>
</section>

<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** --> 
	
<section anchor="sec-cach" title="Caching Mechanisms">

<t>
The CoAP protocol itself supports the caching of sensor information in order to reduce the response time and network bandwidth consumption of future, equivalent requests. CoAP caching is specified in the Section 5 of the CoAP RFC <xref target="RFC7252"/>, it consists on reusing stored responses when new requests arrives. This type of storage is done in CoAP proxies. 
</t>
<t>
This CoAP usage for RELOAD proposes an additional caching mechanism for storing sensor information directly in the overlay. In order to do so, it is necessary to define how the data should be stored. Such caching mechanism is primarily intended for CNs with sensor capabilities, not for RN sensors. This is due to the battery constrains of CNs, forcing them to stay in sleep mode for long periods of time. 
</t>

<t>	 	 	 	
Whenever a CN wakes up, it sends the most recent data from its sensors to its proxy (PN), which stores the data in the overlay using a RELOAD StoredData structure defined in Section 6 of the RELOAD RFC <xref target="RFC6940"/>. We use the StoredDataValue structure defined in Section 6.2 of the RELOAD RFC, in particular we use the SingleValue format type to store the cached values in the overlay.  From that structure length, storage_time,  lifetime and Signature are used in the same way. The only difference is DataValue which in our case can be either a ProxyCache or a SensorCache:
</t>
<t>
	<figure>
	<artwork align="left"><![CDATA[
enum { reserved (0), proxy_cache(1), sensor_cache(2), (255) }
	            CoAPCachingType;
struct {
	CoAPCachingType coap_caching_type;

	select(coap_caching_type) {
		case proxy_cache:	ProxyCache proxy_cache_entry;
		case sensor_cache:	SensorCache sensor_cache_entry;
		/* extensions */

	}	
} CoAPCaching;
]]></artwork>
</figure>	
</t>
	
<section title="ProxyCache">
<t>	
ProxyCache is meant to store values and sensor information (e.g. inactivity time) for all the sensors associated with a certain proxy, as well as their CoAP URIs. On the other hand, SensorCache is used for storing the information and cached value of only one sensor (CoAP URI is not necessary, as is the same as the one used for generating the Resource-ID associated to that SensorCache entry).
</t>
<t>
ProxyCache contains the fields Node-ID and series of SensorEntry types.
<figure>
<artwork align="left"><![CDATA[
struct {
	Node-ID		Node_ID;
	uint32 		length;
	SensorEntry	sensors[count];
} ProxyCache;
]]></artwork>
</figure>	
</t>

<t>
<list style='hanging'>	
	<t hangText="Node-D"><vspace /> The Node-ID of the Proxy Node (PN) responsible for different sensor devices;</t>
	<t hangText="length"><vspace /> The length of the rest of the structure;</t>
	<t hangText="Sensor-Entry"><vspace /> List of sensors in the form of SensorEntry types;</t>
</list>
</t>

<t>
SensorEntry contains the coap_uri, sensor_info and a series of SensorValue types.
<figure>
<artwork align="left"><![CDATA[
struct {
	opaque		coap_uri;
	SensorInfo  sensor_info;
	uint32		length;
	SensorValue	sensor_value[count];
} SensorEntry;
]]></artwork>
</figure>	
</t>
<t>
<list style='hanging'>
<t hangText="coap_uri"><vspace blankLines='0' />CoAP name of the sensor device in question;</t>
<t hangText="sensor_info"><vspace blankLines='0' />contains relevant sensor information;</t>
<t hangText="length"><vspace blankLines='0' />The length of the rest of the structure;</t>
<t hangText="sensor_value"><vspace blankLines='0' />contains a list of values stored by the sensor;</t>
</list>
</t>
</section>
	
<section title="SensorCache">
<t>
SensorCache: contains the information related to one sensor.
<figure>
<artwork align="left"><![CDATA[
struct {
	Node-ID		Node_ID;
	SensorInfo	sensor_info;
	uint32		length;
	SensorValue	sensor_value[count];
} SensorCache;
]]></artwork>
</figure>	
</t>
<t>
<list style='hanging'>
<t hangText="Node_ID"><vspace blankLines='0' />identifies the Node-ID of the Proxy Node responsible for the sensor;</t>
<t hangText="sensor_info"><vspace blankLines='0' />contains relevant sensor information;</t>
<t hangText="length"><vspace blankLines='0' />The length of the rest of the structure;</t>
<t hangText="sensor_value"><vspace blankLines='0' />contains a list of values stored by the sensor;</t>
</list>
</t>
<t>
SensorInfo contains relevant sensor information that is dependent on the use case. As an example we use the sensor manufacturer as relevant information.
<figure>
<artwork align="left"><![CDATA[
struct {
	opaque		dev_info;

	/* extensions */
	
} SensorInfo;
]]></artwork>
</figure>	
</t>
<t>
<list style='hanging'>
<t hangText="dev_info"><vspace blankLines='0' /> Contains specific device information as defined in <xref target="RFC6690"/>, for example temperature, luminosity, etc. It can also represent other semantic information about the device.</t>
</list>
</t>
<t>
SensorValue contains the measurement_time, lifetime and value of the measurement. 
<figure>
<artwork align="left"><![CDATA[
struct {
	uint32		measurement_time;
	uint32		lifetime;
	opaque		value;
	
	/* extensions */
	
} SensorValue;
]]></artwork>
</figure>	
</t>
<t>
<list style='hanging'>
<t hangText="measurement_time"><vspace blankLines='0' />indicates the moment in which the measure was taken represented as the number of milliseconds elapsed since midnight Jan 1, 1970 UTC not counting leap seconds;</t>
<t hangText="lifetime"><vspace blankLines='0' />indicates the validity time of that measured value in milliseconds since measurement_time;</t>
<t hangText="value"><vspace blankLines='0' />indicates the actual value measured. It can be of different types (integer, long, string) therefore opaque has been used;</t>
</list>
</t>
</section>
</section>

<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** --> 
	
<section anchor="sec-kind" title="CoAP Usage Kinds Definition"> 
<t>
This section defines the CoAP-REGISTRATION and CoAP-CACHING kinds.
</t>
<section title="CoAP-REGISTRATION Kind">	
<t>
	<list style='hanging'>
<t hangText="Kind IDs"><vspace blankLines='0' />
The Resource Name for the CoAP-REGISTRATION Kind-ID is the CoAP URI. The data stored is a CoAPRegistration, which contains a set of CoAP URIs.
</t>
<t hangText="Data Model"><vspace blankLines='0' />
The data model for the CoAP-REGISTRATION Kind-ID is
dictionary. The dictionary key is the Node-ID of the storing
RN. This allows each RN to store a single mapping.
</t>
<t hangText="Access Control"><vspace blankLines='0' />
URI-NODE-MATCH. The "coap:" prefix needs to be  removed from the COAP URI before matching.
</t>
</list>
</t>
<t>
Data stored under the COAP-REGISTRATION kind is of type
CoAPRegistration, defined below.
<figure>
<artwork align="left"><![CDATA[
struct {
	Node-ID Node_ID;
	uint16 coap_uris_length;
	opaque coap_uris (0..2^16-1);
} CoAPRegistration;		
]]></artwork>
</figure>	
</t>

</section>
	
<section title="CoAP-CACHING Kind">
<t><list style='hanging'>
<t hangText="KindIDs"><vspace blankLines='0' />	The Resource Name for the CoAP-CACHING Kind-ID is the CoAP URI. The data stored is a CoAPCaching, which contains a cached value. </t>
<t hangText="Data Model"><vspace blankLines='0' />The data model for the CoAP-CACHING Kind-ID is single value.
</t>
<t hangText="Access Control"><vspace blankLines='0' />URI-MATCH. The "coap:" prefix needs to be removed from the COAP URI before matching.
</t>
</list>
</t>
<t>
Data stored under the CoAP-CACHING kind is of type CoAPCaching, defined in <xref target="sec-cach"/>.
</t>

</section>
</section>
<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** --> 
	
<section title="Access Control Rules"
anchor="sec-rules">
<t>
As specified in RELOAD base <xref target="RFC6940"/>, every kind which is storable in an overlay must be associated with an access control policy.  This policy defines whether a request from a given node to operate on a given value should succeed or fail. Usages can define any access control rules they choose, including publicly writable values.
</t>	
<t>
CoAP Usage for RELOAD requires an access control policy	that allows multiple nodes in the overlay read and write access. This access is for registering and caching information using CoAP URIs as identifiers.  Therefore, none of the access control policies specified in RELOAD base are sufficient. 
</t>	
<t>
This document defines two access control policies, called URI-MATCH and URI-NODE-MATCH. In URI-MATCH policy, a given value MUST be written and overwritten if and only if the signer's certificate contains an uniformResourceIdentifier entry in the subjectAltName Extension <xref target="RFC5280"/> that in canonicalized form hashes to the Resource-ID for the resource. As explained on Section 6.3 of the COAP RFC <xref target="RFC7252"/> the "coap" and "coaps" schemes conform to the generic URI, thus they are normalized in the generic form as explained on Section 6 of <xref target="RFC3986"/>. The hash function used is specified in Section 10.2 of <xref target="RFC6940"/>. The certificate can be generated as specified on Section 9 of the COAP RFC <xref target="RFC7252"/>, Certificate Option.
</t>	
<t>
In URI-NODE-MATCH policy, a given value MUST be written and overwritten if and only if the condition for URI-MATCH is met and, in addition, the dictionary key is equal to the Node-ID in the certificate and that Node-ID is the one indicated in the SignerIdentity value cert_hash. 
</t>
<t>
These Access Control Policies are specified for IANA in Section <xref target="sec-access-control"/>.
</t>

</section>

<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** --> 

<section title="Security Considerations"
anchor="sec-security">
<t>
The security considerations of RELOAD <xref target="RFC6940"/> and CoAP <xref target="RFC7252"/> apply to this specification. RELOAD's security model is based on public key certificates, which are used for signing messages and stored objects. At the connection level RELOAD can use either TLS or DTLS. In the case of CoAP, several security modes have been defined. Implementations of this specification MUST follow all the security-related rules specified in the RELOAD <xref target="RFC6940"/> and CoAP <xref target="RFC7252"/> specifications. 
</t>
<t>
Additionally, in RELOAD every kind which is storable in an overlay must be associated with an access control policy. This document specifies two new access control policies, which are specified in <xref target="sec-rules"/>. These policies cover the most typical deployment scenarios. 
</t>
<t>
During the phase of registration and lookup, security considerations relevant to RELOAD apply. A CoAP node that advertises it's existence via this mechanism, is more likely to be attacked, compared to a node (especially a sleepy node) that does not advertise it's existence. Section 11 of <xref target="RFC7252"/> and Section 13 of <xref target="RFC6940"/> have more information on the kinds of attack and mitigation possible. </t>
<t>
The caching mechanism specified in this draft is additional to the caching already done in CoAP. Access control is handled by the RELOAD overlay, where the peer storing the data is responsible of validating the signature on the data being stored.
</t>

</section>

<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** -->
<!-- **************************************************************** --> 
	
<section title="IANA Considerations" anchor="sec-iana">

	<section title="CoAP-REGISTRATION Kind-ID">
		<t>
			This document introduces one additional data Kind-ID to the "RELOAD
			Data Kind-ID" Registry:
		</t>
		<t>

			
			<figure>	<artwork>
				+-------------------+------------+----------+
				| Kind              |    Kind-ID |      RFC |
				+-------------------+------------+----------+
				| CoAP-REGISTRATION |        105 | RFC-AAAA |
				+-------------------+------------+----------+	
			</artwork></figure>	
		</t>
		<t>
			This Kind-ID was defined in <xref target="sec-reg-uri"/>.
		</t>
	</section>

	<section title="CoAP-CACHING Kind-ID">
		<t>
			This document introduces one additional data Kind-ID to the "RELOAD
			Data Kind-ID" Registry:
		</t>
		<t>
			<figure>	<artwork>
				+--------------+------------+----------+
				| Kind         |    Kind-ID |      RFC |
				+--------------+------------+----------+
				| CoAP-CACHING |        106 | RFC-AAAA |
				+--------------+------------+----------+
			</artwork></figure>	
		</t>
		<t>
			This Kind-ID was defined in <xref target="sec-reg-uri"/>.
		</t>
	</section>

	<section title="Access Control Policies" anchor= "sec-access-control">
		<t>
			IANA is asked to create a "CoAP Usage for RELOAD Access Control Policy" Registry. This registry is to be added to the existing RELOAD registry. Entries in this registry are strings denoting access control policies, as described in Section 8.1. New entries in this registry are to be registered per the Specification Required policy in <xref target="RFC5226"/>. The initial contents of this registry are:
		</t>
		<t>
			<figure><artwork>	
				+-----------------+----------+
				| Access Policy   |      RFC |
				+-----------------+----------+
				| URI-NODE-MATCH  | RFC-AAAA |
				| URI-MATCH       | RFC-AAAA |
				+-----------------+----------+
			</artwork></figure>	
		</t>
		<t>
			This access control policy was described in <xref target="sec-rules"/>.
		</t>
	</section>
</section>
</middle>

<back>
    <references title="Normative References">
	    &RFC2119;
	    &RFC7252;
		&RFC6940;
		&RFC6690;
		&RFC5280;
		&RFC3986;
    </references>
    <references title="Informative References">
    	&RFC5226; 
		&RFC7228;
		&I-D.ietf-p2psip-concepts;
		&I-D.ietf-core-resource-directory;
    </references>
</back>

</rfc>

PAFTECH AB 2003-20262026-04-24 04:52:18