<?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" [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced. 
     An alternate method (rfc include) is described in the references. -->

<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC5988 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5988.xml">
<!ENTITY RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY RFC6763 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6763.xml">
<!ENTITY RFC7252 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7252.xml">
<!ENTITY RFC6690 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6690.xml">
<!ENTITY RFC7390 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7390.xml">
<!ENTITY I-D.ietf-core-observe SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-core-observe.xml">
<!ENTITY I-D.ietf-core-resource-directory SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-core-resource-directory.xml">
<!ENTITY I-D.ietf-core-interfaces SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-core-interfaces.xml">
<!ENTITY I-D.kumar-6lo-selective-bootstrap SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.kumar-6lo-selective-bootstrap.xml">
<!ENTITY I-D.vial-core-mirror-server SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.vial-core-mirror-server.xml">
<!ENTITY I-D.koster-core-coap-pubsub SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.koster-core-coap-pubsub.xml">
]>

<?rfc strict="yes" ?>

<?rfc toc="yes"?>

<?rfc tocdepth="4"?>

<?rfc symrefs="yes"?>

<?rfc sortrefs="yes" ?>

<?rfc compact="yes" ?>

<?rfc subcompact="no" ?>

<rfc ipr="trust200902" category="info" docName="draft-zotti-core-sleepy-nodes-01">
  
  <front> 

    <title abbrev="Sleepy Nodes">
    	Sleepy CoAP Nodes
 		</title> 

    <author fullname="Teresa Zotti" initials="T." 
            surname="Zotti">
      <organization>Philips Research</organization>
      <address>
        <postal>
          <street>High Tech Campus 34</street>
          <city>Eindhoven</city>
          <region></region>
          <code>5656 AE</code>
          <country>The Netherlands</country>
        </postal>
        <phone>+31 6 21175346</phone>
        <email>teresa.zotti@philips.com</email>
      </address>
    </author>
    
	 <author fullname="Peter van der Stok" initials="P." 
            surname="van der Stok">
      <organization>Consultant</organization>
      <address>
        <postal>
          <street>Kamperfoelie 8</street>
          <city>Helmond</city>
          <region></region>
          <code>5708 DM</code>
          <country>The Netherlands</country>
        </postal>
        <phone>+31 492474673</phone>
        <email>consultancy@vanderstok.com</email>   
      </address>
    </author>
    
	<author fullname="Esko Dijk" initials="E." 
            surname="Dijk">
      <organization>Philips Research</organization>
      <address>
        <postal>
          <street>High Tech Campus 34</street>
          <city>Eindhoven</city>
          <region></region>
          <code>5656 AE</code>
          <country>The Netherlands</country>
        </postal>
        <phone> +31 6 55408986</phone>
        <email>esko.dijk@philips.com</email>
      </address>
    </author>

    <date year="2015" />  

    <area>App</area>
    <workgroup>CoRE Working Group</workgroup> 

    <keyword>Sleepy Nodes</keyword>
    <keyword>low power</keyword>
    <keyword>battery-powered sensors</keyword>

    
    <abstract>
      <t>
	  <!--background: --> 
	  6LoWPAN networks rely on application protocols like CoAP to enable RESTful communications in constrained environments.
	  Many of these networks make use of "Sleepy Nodes": battery powered devices that switch off their (radio) interface during most of the time to conserve battery energy.
	  <!--problem: --> 
	  As a result of this, Sleepy Nodes cannot be reached most of the time.  
	  This fact prevents using normal communication patterns as specified in the CoRE group, since the server-model is not applicable to these devices.
	  
	  <!--contributions:--> 
	  This document discusses and specifies an architecture to support Sleepy Nodes such as battery-powered sensors in 6LoWPAN networks with the goal of 
	  guiding and stimulating the discussion on Sleepy Nodes support for CoAP in the CoRE WG. 
	  </t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
 <t>6LoWPAN networks rely on application protocols such as CoAP to enable RESTful communications in constrained environments.
 Many of these networks feature "Sleepy Nodes": battery-powered nodes which switch on/off their 
 communication interface to conserve battery energy. 
 As a result of this, Sleepy Nodes cannot be reached most of the time.
 This fact prevents using normal communication patterns as specified by the CoRE group, since the server model is clearly not applicable
 to the most energy constrained devices.
</t>
 <t>This document discusses and specifies an architecture to support Sleepy Nodes such as battery-powered sensors in 6LoWPAN networks.
 The proposed solution makes use of a Proxy Node to which a Sleepy Node delegates part of its communication tasks while it is not accessible in the 6LoWPAN network.
	  Direct interactions between Sleepy Nodes and non-Sleepy Nodes are only possible, when the Sleepy Node initiates the communication.
</t><t>
Earlier related documents treating the sleepy node subject are the CoRE mirror server <xref target="I-D.vial-core-mirror-server"/> and the Publish-Subscribe in the 
Constrained Application Protocol (CoAP) <xref target="I-D.koster-core-coap-pubsub"/>. Both documents describe the interfaces to the proxy accompanying the sleepy node. 
Both make use of the observe option discussed in <xref target="I-D.ietf-core-observe"/>. This document describes the roles of the nodes communicating with the sleepy 
node and/or its proxy. As such it contributes to understanding how well the other proposals support the operation of the sleepy nodes in a building control context.
</t>
 <t>The issues that need to be addressed to provide support for Sleepy Nodes in 6LoWPAN networks are summarized in <xref target="problem"/>.
 <xref target="solution"/> shows the communications patterns involving Sleepy Nodes in 6LoWPAN networks.
 <xref target="examples"/> provides a set of use case descriptions that illustrate how these communication patterns can be used in home and building control 
 scenarios.
For each of these scenarios, the behaviour of the Sleepy Node is explained in <xref target="behaviour"/>.
 
 </t>
<section anchor="problem" title="Problem statement">
     
<t>During typical operation, a Sleepy Node has its radio disabled and the CPU may be in a sleeping state. If an external event occurs 
(e.g. person walks into the room activating a presence sensor),
the CPU and radio are powered back on and they send out an event message to another node, or to a group of nodes.
After sending this message, the radio and CPU are powered off again, and the Sleepy Node sleeps until the next external event 
or until a predefined time period has passed.
The main problems when introducing Sleepy  Nodes into a 6LoWPAN network are as follows:</t>
<t>Problem 1: How to contact a Sleepy  Node that has its radio turned off most of the time for:</t>
      <t><list style="empty">
          <t>- Writing configuration settings.</t>
          <t>- Reading out sensor data, settings or log data.</t>
        <t>- Configuring additional event destination nodes or node groups.</t>
		</list></t>

<t>Problem 2: How to discover a Sleepy  Node and its services, while the node is asleep:</t>
      <t><list style="empty">
          <t>- Direct node discovery (CoAP GET /.well-known/core as defined in <xref target="RFC7252"/>) does not find the node with high probability.</t>

           <t>- Mechanisms may be needed to provide, as the result of node discovery, the IP address of a Proxy instead of the IP address of the node directly.</t>
        
		</list></t>
		<t>Problem 3: How a Sleepy  Node can convey data to a node or groups of nodes, with good reliability and minimal energy consumption.</t>
       </section>
	   <section title="Assumptions">
        <t>The solution architecture specified here assumes that a Sleepy Node has enough energy to perform bidirectional communication during its normal operational state. 
This solution may be applicable also to extreme low-power devices such as solar powered sensors as long as they have enough energy to perform commissioning
and the initial registration steps. These installation operations may require, in some cases, an additional source of power.
Since a Sleepy  Node is unreachable for relatively long periods of times, the data exchanges in the interaction model are always initiated by a Sleepy Node when its sleep period ends.</t>
</section>
      <section title="Requirements Language">
        <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 <xref target="RFC2119"/>.</t> 
		<t>This document assumes readers are familiar with the terms and concepts discussed in <xref target="RFC7252"/>,<xref target="RFC5988"/>, <xref target="I-D.ietf-core-resource-directory"/>,
		<xref target="I-D.ietf-core-interfaces"/>,<xref target="I-D.ietf-core-observe"/> and <xref target="I-D.vial-core-mirror-server"/>. 
		
  </t>
<t>In addition, this document makes use of the following additional terminology:</t>

      <t>Sleepy Node: a battery-powered node which does the on/off switching of its 
	  communication interface with the purpose of conserving battery energy</t>
	  
	  <t>Sleeping/Asleep: A Sleepy Node being in a "sleeping state" i.e. its network interface is switched off and a Sleepy Node is not able to send or receive messages.</t>
	  	  
	  <t>Awake/Not Sleeping: A Sleepy Node being in an "awake state" i.e. its network interface is switched on and the Sleepy Node is able to send or receive messages.</t>
	  
	  <t>Wake up reporting duration: the duration between a wake up from a Sleepy Node and the next wake up and report of the same Node.</t>

      <t>Proxy: any node that is configured to, or selected to,
	  perform communication tasks on behalf of one or more Sleepy Nodes.
   </t>

      <t>Regular Node: any node in the network which is not a Proxy or a Sleepy Node.</t>
	  
	  <t>Reading Node: any regular node that reads information from the Sleepy Node.</t>
	  
	  <t>Configuring Node: any regular node that writes information/configuration into Sleepy Node(s). 
	  Examples of configuration are new thresholds for a sensor or a new value for the wake-up cycle time.</t>
	  
	  <t>Discovering Node: any regular node that performs discovery of the nodes in a network, including Sleepy Nodes.</t>

      <t>Destination Node: any regular node or node in a group that receives a message that is generated by the Sleepy Node.</t>

      <t>Server Node: an optional server that the Sleepy Node knows about, or is told about, which is used to fetch information/configuration/firmware updates/etc.</t>
	  
	  <t>Discovery Server: an optional server that enables nodes to discover all the devices in the network, including Sleepy Nodes, 
	  and query their capabilities. For example, a Resource Directory server as defined in <xref target="I-D.ietf-core-resource-directory"/> or a DNS-SD server as defined in <xref target="RFC6763"/>.</t>
	  

      </section>
    </section>


  

    <section anchor="solution" title="Solution Architecture">
      <t>
The solution architecture described in this document makes use of a Proxy Node to which a Sleepy Node delegates part of its communication tasks during its sleeping periods.
	  In particular, the solution is based on the set of functionalities described in <xref target="I-D.vial-core-mirror-server"/> according to which a Proxy Node hosts a 'delegated' version of the original 
	  CoAP resources of the Sleepy Node. <xref target="I-D.vial-core-mirror-server"/> provides the interface to register, update and remove proxied resources, along with the interface to read and update the
proxied resources by both the Sleepy Node and Regular Nodes.
</t>
 <t><xref target="fig-Sleepy-nodes-interact"/> provides an overview of the communication interfaces required to support a Sleepy Node in a 6LoWPAN Network, 
 	highlighting the different types and roles of the Nodes (shown as blocks) along with the interactions between them. The interfaces are depicted as arrows. The arrows point from the Node taking
 	the communication initiative to the target Node.</t>
<t>In some implementations, the roles of Proxy and Discovery Server could be implemented by a single node. Furthermore, a single Node could act in a combination of roles (e.g. it may play both the role of discovering node and
Configuring Node).</t>

   <!--   <figure align="center" anchor="xml_happy">
        <preamble>Preamble text - can be omitted or empty.</preamble>-->
<figure title="Interaction model for Sleepy Nodes in 6LowPAN networks" anchor="fig-Sleepy-nodes-interact">
          <artwork><![CDATA[                                     
     
                                                           
                                                   
             +------------+             +-------------+
             | Discovery  | <-DISCOVERY-| Discovering |
             | server     |             |    Node     |
             | (Optional) |             +-------------+
             +------------+                      |  
                                                 |     
                                   .--DISCOVERY--'  +---------+
                                   |                | Reading |
                                   |            .---|   Node  |
                                   v            |   +---------+
+---------+               +-----------+         |                 
| Sleepy  |---REPORT(A)-->|           |<--READ--'  +-------------+
|  Node   |---READ------->|   Proxy   |<--WRITE----| Configuring |
|         |---WRITE------>|           |            |    Node     |
+---------+               +-----------+            +-------------+
  |     |                          |              +-------------+
  |     |                          '---REPORT(B)->| Destination |
  |     '-----DIRECT REPORT---------------------->|     Node    |
  |                                               +-------------+
  |                                            +-----------+
  '------------READ--------------------------->|  Server   | 
                                               |   Node    |  
                                               +-----------+
                                                 ]]></artwork>
        </figure>


      
    </section>

    <!-- This PI places the pagebreak correctly (before the section title) in the text output. -->

    <?rfc needLines="8" ?>
<section anchor="examples" title= "Use case scenarios">
<t> To describe the application viewpoint of the solution, we introduce some example scenarios for the various interface functions in <xref target="fig-Sleepy-nodes-interact"/>, assuming 
the Sleepy Node to be a sensor device in a home or a building control context.</t>
<t>Function 1: a Node DISCOVERs Sleepy Node(s) (via Proxy or Discovery Server); for example:</t>
<t><list style="empty">
          <t>- A Node wants to discover given services related to a group of deployed sensors via multicast. It gets responses
 for the sleeping sensors from the Proxy nodes.</t>

<t>- During commissioning phase, a configuring node queries a Discovery Server to find all the proxies providing a given service.</t>

</list></t>
<t>Function 2: Sleepy Node REPORTs event to other Node(s) (directly or via Proxy); for example:</t>
<t><list style="emp">
<t>- A battery-powered sensor sends an event "battery low" directly to a designated reporting location Node.</t>
 <t>- A battery-powered occupancy sensor detects an event "people present", switches on the radio and sends a request to one or a group of lights to turn on.</t>
 <t>- A battery-powered temperature sensor reports periodically the room temperature to a designated Node that controls HVAC devices. The sensor reports also extra events when the temperature change deviates
 from a predefined range.</t>
</list></t>

<t>Function 3: Sleepy Node WRITEs information to the Proxy; for example:</t>
<t><list style="empty">
<t>- A battery-powered sensor wants to extend the registration lifetime of its delegated resource at the Proxy.</t>
</list>
</t>
<t>Function 4: Sleepy Node READs from other Node(s) (directly or via Proxy); for example:</t>
<t><list style="empty">
<t>- A sensor (periodically) updates internal data tables by fetching it from a predetermined remote node.</t>
<t>- A sensor (periodically) checks for new firmware with a remote node. If new firmware is found, the sensor switches to a non-sleepy operation mode, and fetches the data.</t>
<t>- A sensor (periodically) checks with his Proxy availability of configuration updates or changes of its delegated resources (e.g. a sensor may detect in this way that a configuring Node has changed its name or modified 
 its reporting frequency).</t>
</list>
</t>
<t>Function 5: Node READs information from Sleepy Node(s) (via Proxy only); for example:</t>
<t><list style="empty">
<t>- A Node (e.g. in the backend) requests the status of a deployed sensor, e.g. asking the sensor state and/or firmware version and/or battery status and/or its error log. The Proxy returns this information.</t>
<t>- A Node requests a Proxy when a Sleepy sensor was 'last active' (i.e. identified as being awake) in the network.</t>
<t>- An authorized Node adds a new subscription to an operational sensor via the Proxy. From that moment on, the new Node receives also the sensor events and status updates from the sensor.</t>
</list>
</t>
<t> Function 6: A Node WRITEs information to a Sleepy Node (via Proxy only); for example:</t>
<t><list style="empty">
<t>- An authorized Node changes the reporting frequency of a deployed sensor by contacting the Proxy node to which the sensor is registered.</t>
<t>- Sensor firmware is upgraded. An authorized Node pushes firmware data blocks to the Proxy, which pushes the blocks to the Sleepy Node.</t>
</list></t>


<t>


</t>
</section>
   <section anchor="initial" title="Initial operations">
    <!--  <section title="subsection title">-->
        <t>In order to become fully operational in a network and to communicate over the interfaces shown in <xref
      target="fig-Sleepy-nodes-interact"/>, a Sleepy Node needs first to perform some initial operations:</t>
<t><list style="empty">
<t>- Discovery of Proxy (directly or via Discovery Server)</t>
<t>- Registration of resources to delegate at a Proxy</t>
<t>- Initialization of its delegated resources at the Proxy</t>
<t>- Registration to a Discovery Server via Proxy (optional)</t>
</list></t>
	<figure title="Overview of initial operations" anchor="fig-Sleepy-nodes-initial">
          <artwork><![CDATA[                                     
     
                                                           
                                                   
                          +------------+             
                          | Discovery  | 
      .-Proxy Discovery-->| server     |<--Register Sleepy-.       
      |                   | (Optional) |            Node   |
      |                   +------------+                   |
      |                                                    |
+---------+                              +-----------+     |
|         |----Direct Proxy Discovery--->|           |     |
| Sleepy  |----Register Resources------->|   Proxy   |-----'
| Node    |----Initialize Resources----->|           |
+---------+                              +-----------+            
                                
                                                      
                              ]]></artwork>
        </figure>	
		
     <!-- </section>-->

	  
      <section title="Proxy Discovery">
        <t>A Sleepy Node can find a Proxy implementing resource cache functionalities to which it can delegate its own resources by means of:</t>
<t><list style="numbers">
<t> Discovery via Discovery Server: this interface is the default one supplied by the Discovery Server, e.g. CoRE Resource Directory <xref target="I-D.ietf-core-resource-directory"/> or DNS-SD <xref target="RFC6763"/>.</t>
<t>Direct Discovery: a CoAP multicast GET request can be performed on the /.well-known/core resource
as specified for CoAP in <xref target="RFC7390"/>.</t>
</list>
In both cases, a query can be done for the core.ms resource type, defined in <xref target="I-D.vial-core-mirror-server"/>.
</t><t>
 In a system, The Proxy discovery  can be performed even in both ways (e.g. if Discovery via Discovery Server fails, the Sleepy Node can try Direct Discovery).
</t>

</section>


  

    
<section title="Registration at a Proxy">
 <t>Once a Sleepy Node has discovered a Proxy by means of one of the procedures described above, the registration step can be performed.
To perform registration, a Sleepy Node sends to the Proxy Node a CoAP POST request containing a description of the resources to be delegated to the Proxy as the message payload in the CoRE Link Format.
The description of the resource includes the Sleepy Node identifier, its domain and the lifetime of the registration.
The Link Format description is identical to the /.well-known/core resource.
At the moment of the registration at the Proxy, the Sleepy Node may specify the 'obs' attribute to indicate to the Proxy that a CoAP observation relationship between the delegated resource 
and a client is allowed and can be performed as described in IETF Draft CoRE Observe <xref
      target="I-D.ietf-core-observe"/>.
Upon successful registration, the Proxy creates a new resource and returns its location.</t>
</section>

<section title="Initialization of Delegated Resource">
<t>Once registration has been successfully performed, the Sleepy Node must initialize the delegated resource before it can be visible in Resource Discovery via the Proxy Node. 
To send the initial contents (e.g. values, device name, manufacturer name) of the delegated resources to the Proxy, the Sleepy Node uses CoAP PUT repeatedly.
The use of repeated CoAP PUT can be avoided by writing all relevant resources into the Proxy in one operation by means of the Batch interface described in <xref target="I-D.ietf-core-interfaces"/>
After successful initialization, a Proxy should enable resource discovery for the new delegated resources by updating its /.well-known/core resource.</t>
</section>

<section title="Proxy registers at a Discovery Server on behalf of Sleepy Node">
<t>Once a Sleepy Node has registered itself to a Proxy, the Proxy has the responsibility to register the Sleepy Node to a Discovery Server and to keep this registration up-to-date. 
This interface, not to be confused with the interface in which the Sleepy Node registers its resources to a Proxy, is required whenever a Discovery Server is present in the network. 
There may be in fact deployments that do not have a Discovery Server.
At run-time, the Proxy will try to find a Discovery Server and if such server is found it will register the Sleepy Node.
The details of the interface are exactly according to the respective Discovery Server specification.
A special case might be when Proxy and Discovery Server are embodied by the same node. In this case the registration occurs as an internal process within the Proxy Node itself, 
upon registration of the Sleepy Node at the Proxy.</t>
</section>


</section>


<section anchor="behaviour" title="Interfaces during operation">

<t>This section details the scope and behaviour of each interface function specified in the architecture in <xref
      target="fig-Sleepy-nodes-interact"/>.</t>
   <section title="Discovering Node DISCOVERs Sleepy Node via Discovery Server">
 <t>  Through this interface, a Discovering Node can discover one or more Sleepy Node(s) through a Discovery Server.
The interface is the default one supplied by the Discovery Server, e.g. CoRE Resource Directory or DNS-SD.</t>
</section>

 <section title="Discovering Node DISCOVERs Sleepy Node via Proxy"><t>
 Through this interface, a Discovering Node can discover one or more Sleepy Node(s) through a Proxy. In case a Discovery Server is not active in a system, this is the only way to discover Sleepy Nodes.
A CoAP client discovers resources owned by the Sleepy Node but hosted on the Proxy using typical mechanisms such as one or more GETs on the resource /.well-known/core <xref
      target="RFC6690"/>.
</t></section>

 <section title="Sleepy Node REPORTs events directly to Destination Node"><t>
When the Sleepy Node needs to report an event to Destination nodes or groups of Destination nodes present in the subscribers list, it becomes Awake and then it can use
standard CoAP POST unicast or multicast requests to report the event.</t></section>

 <section title="Sleepy Node REPORTs event to Destination Node(s) via Proxy"><t>
 This interface can be used by the Sleepy Node to communicate a sensor event report message to Proxy (REPORT A) which will further notify it to interested Destination Node(s) 
 (REPORT B) that are not directly present in the subscribers list of the Sleepy Node itself. This indirect reporting is useful for a scalable solution, e.g. there may be many interested
 subscribers but the Sleepy Node itself can only support a limited number of subscribers given its limits on battery energy.
The standard CoAP unicast POST can be used to report events to the Proxy (REPORT A), while the mechanism according to which the Proxy forwards the event to Destination Nodes 
(REPORT B) may be linked to a specific protocol (for example: CoAP, HTTP, or publish/subscribe as in MQTT).
A client interested in the events related with a specific resource may send a CoAP GET to the Proxy, to obtain the last published state.
If a Reading node is interested in receiving updates whenever the Sleepy Node reports event to its Proxy, it can perform a subscription at the 
Proxy to that specific resource. In this case, a standard CoAP GET with the CoAP Observe option on the delegated resource at the Proxy can be used, as described in <xref
      target="I-D.ietf-core-observe"></xref>.
</t></section>

 <section title="Sleepy Node WRITEs changed resource to Proxy"><t>
 A Sleepy Node can update a proxy resource at the Proxy using a standard CoAP PUT requests on the proxied resource. 
 This interface is only needed when a resource can be changed on the Sleepy Node outside the knowledge of the Proxy, i.e. by an entity which is not the Proxy.
 For example, a resource can be changed by the Sleepy Node itself.
It is good practice, to avoid write/write conflicts at the proxy side, to ensure that such frequently-updated resources are read-only, e.g. the 
sensed temperature value of a sensor can be read by external nodes but not written.
</t></section>

 <section title="A Node WRITEs to Sleepy Node via Proxy" anchor="WRITE"><t>
 A Configuring Node uses CoAP PUT to write information (such as configuration data) to the Proxy, where the information is destined for a Sleepy Node.
Upon change of a delegated resource, an internal flag is set in the Proxy that the specific resource has changed. Next time the Sleepy Node wakes up, the PS
Node checks the Proxy for any modification of its delegated resources and reads those changed resources using CoAP GET requests, as shown in <xref
      target="fig-Sleepy-nodes-READs"></xref>.
The allowed resources that a Configuring Node can write to, and the CoAP Content-Format of those CoAP resources, is determined in the initial registration phase.
</t></section>

 <section title="Sleepy Node READs resource updates from Proxy">
 <t>This interface allows a Sleepy Node to retrieve a list of delegated resources that have been modified at the Proxy by other nodes. As in <xref target="I-D.vial-core-mirror-server"/>, the path /ms is used to store the sleepy node resources in the proxy.
</t><t>
 The Sleepy Node can send GET requests to its Proxy on each delegated resource in order to receive their updated representation.
The example in <xref
      target="fig-Sleepy-nodes-READs"></xref> shows a configuration node which changes the name of a Sleepy Node at the Proxy. 
The Sleepy Node can then check and read the modification in its resource.</t>

<figure title="Example: A Sleepy Node READs resource updates from his Proxy" anchor="fig-Sleepy-nodes-READs">
          <artwork><![CDATA[ 

   +--------+              +-------+               +---------+   
   | Sleepy |              | Proxy |               | Regular |    
   |  Node  |              |       |               |   Node  |   
   +--------+              +-------+               +---------+   
       |                       | <---PUT /ms/0/dev/n----|          
       |                       | Payload: Sensor1       |
    Wake-up                    |---2.04 Changed-------->|           
     event                     |                        |           
       |                       |                        | 
       |--POST /ms/0?chk------>|                        |          
       |<----2.04 Changed------|                        | 
       | Payload: <ms/0/dev/n> |                        |           
       |                       |                        |  
       |---GET /ms/0/dev/n---->|                        |
       |<-----2.05 Content-----|                        |
       |  Payload: Sensor1     |                        |
       |                       |                        |
]]></artwork>
        </figure>	
		


</section>
 <section title="A Node READs information from Sleepy Node via Proxy"><t>
 A Reading Node uses standard CoAP GET to read information of a Sleepy Node via a Proxy.
However, not all information/resources from the Sleepy Node may be copied on the Proxy. In that case, the Reading Node cannot get direct access to resources that are not delegated to the Proxy.
 The strategy to follow in that case is to first WRITE to the Sleepy Node (via the Proxy, <xref
      target="WRITE"></xref>) 
a request for reporting this missing information; where the request can be fulfilled by the Sleepy Node the next time the Sleepy Node wakes up.
</t></section>
 <section title="A Sleepy Node READs information from a Server Node"><t>
 A Sleepy Node while Awake uses standard CoAP GET to read any information from a Server Node. While the Sleepy Node awaits a CoAP response containing the requested information, it remains awake.
To increase battery life of Sleepy Nodes, such an operation should not be performed frequently.
</t>
</section>

</section>

<section anchor="pubsub" title="Realization with PubSub server">
<t>
The registration and discovery of the PubSub broker <xref target="I-D.koster-core-coap-pubsub"/> is covered to the same extent as discussed in this document. Not covered is the direct interaction between sleepy node and destination nodes. The support from a server node to initialize resources or other information also represents an addition to PubSub broker.
</t><t>
In addition to the continuous updates provided by the PubSub broker, the ad-hoc query of values, the maintenance of operational parameters, the provision of direct update from sleepy node to a node, the reliability aspects of the update, and the concept of groups are equally important topics that need consideration. 
</t>
</section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>TBD
      </t>

      
    </section>

    <!-- Possibly a 'Contributors' section ... -->

    <section anchor="IANA" title="IANA Considerations">
      
      <t>The new Resource Type (rt=) Link Target Attribute,
		 'core.ms' needs to be registered in the "Resource Type (rt=) Link Target Attribute Values"
		 subregistry under the "Constrained RESTful Environments (CoRE) Parameters" registry.
      	This is not yet done by <xref target="I-D.vial-core-mirror-server"/>.</t>

    
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>Layer 2 (MAC) security is used in all communication in the 6LoWPAN network. A Sleepy Node may obtain the Layer 2 network key using the bootstrapping mechanism described in <xref target="I-D.kumar-6lo-selective-bootstrap"/>. 
On top of this, DTLS and DTLS-multicast can be used for further transport-layer protection of messages between a Sleepy Node and other nodes; and also between a Proxy and other nodes.
There are no special adaptations needed of the DTLS handshake to support Sleepy Nodes.
During the whole handshake, Sleepy Nodes are required to remain awake to avoid that, in case of small retransmission timers, the other node may think the handshake message was lost and starts retransmitting. 
In view of this, the only key point, therefore, is that DTLS handshakes are not performed frequently to save on battery power.
Based on the DTLS authentication, also an authorization method could be implemented so that only authorized nodes can e.g.</t>
<t><list style="empty">
<t>- Act as a Proxy for a Sleepy Node. (The Proxy shall be a trusted device given its important role of storing values of parameters for the delegated resources);</t>
<t>- READ data from Sleepy Nodes;</t>
<t>- WRITE data to Sleepy Nodes (via the Proxy);</t>
<t>- Receive REPORTs from Sleepy Nodes (direct or via Proxy).</t>
</list></t>
 
    </section>
  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

     Both are cited textually in the same manner: by using xref elements.
     If you use the PI option, xml2rfc will, by default, try to find included files in the same
     directory as the including file. You can also define the XML_LIBRARY environment variable
     with a value containing a set of directories to search.  These can be either in the local
     filing system or remote ones accessed by http (http://domain/dir/... ).-->

    <references title="Normative References">
	
      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
      &RFC2119;
      &RFC7252;
	  &RFC6690;
	  &RFC7390;
	  &RFC5988;
      
    </references>

    <references title="Informative References">
      <!-- Here we use entities that we defined at the beginning. -->
      
       
	 &RFC6763;
	&I-D.ietf-core-resource-directory;
	  &I-D.ietf-core-observe;
	  &I-D.ietf-core-interfaces;
	  &I-D.kumar-6lo-selective-bootstrap;
	  &I-D.vial-core-mirror-server;
	&I-D.koster-core-coap-pubsub; 

      <!-- A reference written by by an organization not a person. -->

      
	  
    </references>

 <!--   <section anchor="app-additional" title="Additional Stuff">
      <t>This becomes an Appendix.</t>
    </section>-->

    
  </back>
</rfc>
