<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC6020 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6020.xml">
<!ENTITY RFC6241 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6241.xml">
<!ENTITY RFC6536 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6536.xml">
<!ENTITY I-D.ietf-i2rs-architecture SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-i2rs-architecture.xml">
<!ENTITY I-D.ietf-i2rs-rib-info-model SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-i2rs-rib-info-model.xml">
<!ENTITY I-D.ietf-netmod-acl-model SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-netmod-acl-model.xml">
<!ENTITY I-D.ietf-i2rs-traceability SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-i2rs-traceability.xml">
<!ENTITY I-D.ietf-i2rs-usecase-reqs-summary SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-i2rs-usecase-reqs-summary.xml">
<!ENTITY I-D.ietf-i2rs-pub-sub-requirements SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-i2rs-pub-sub-requirements.xml">
<!ENTITY I-D.hares-i2rs-auth-trans SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.hares-i2rs-auth-trans.xml">
<!ENTITY I-D.ietf-netmod-yang-metadata SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-netmod-yang-metadata.xml">
<!ENTITY I-D.ietf-netconf-restconf SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-netconf-restconf.xml">
<!ENTITY I-D.ietf-netconf-yang-patch SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-netconf-yang-patch.xml">
<!ENTITY I-D.openconfig-netmod-opstate SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.openconfig-netmod-opstate.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<?rfc iprnotified="no" ?>
<?rfc strict="no" ?>
<rfc category="std" docName="draft-ietf-i2rs-protocol-strawman-00.txt"  ipr="trust200902">
  <front>
    <title abbrev="I2RS Ephemeral State Requirements">I2RS protocol strawman</title>
	<author fullname="Susan Hares" initials="S." surname="Hares">
	<organization> Huawei </organization>
	<address>
	  <postal>
	   <street></street>
	    <city>Saline</city>
		<country>US</country>
	  </postal>
	 <email>shares@ndzh.com </email>
	</address>
	</author>
	 	<author fullname="Andy Bierman" initials="A." surname="Beirman">
      <organization>YumaWorks</organization>
      <address>
        <postal>
          <street></street>
          <city> </city>
          <country></country>
        </postal>
        <email>andy@yumaworks.com </email>
      </address>
    </author>
	<author fullname="Kent Watsen" initials="K." surname="Watsen">
      <organization>Juniper</organization>
      <address>
        <postal>
          <street></street>
          <city> </city>
          <country></country>
        </postal>
        <email>kwatsen@juniper.net</email>
      </address>
    </author>
    <date year="2015" />
    <area>Routing Area</area>
    <workgroup>I2RS working group</workgroup>
    <keyword>RFC</keyword>
    <keyword>Request for Comments</keyword>
    <keyword>I-D</keyword>
    <keyword>Internet-Draft</keyword>
    <keyword>I2RS</keyword>
    <abstract>
      <t>This document provides a strawman proposal for the I2RS protocol covering
        the ephemeral data store.  It provides Yang ephemeral statement, 
        netconf protocol extensions for the ephemeral data store, and 
        RESTCONF protocol extensions for the protocol data store.  
	  </t>
	 </abstract>
  </front>
  <middle>
 <section anchor="intro" title="Introduction">
   <t>This documents is a strawman for the I2RS Protocol from early 
   I2RS design team discusses. It focuses on the protocol extensions for
   ephemeral data store.</t>
   <t> This draft provides suggests the following additions to support the I2RS ephemeral state:
   <list style="symbols">
   <t>Yang ephemeral statement,</t>
   <t>NETCONF (<xref target="RFC6241"></xref>) protocol extensions for the ephemeral data store,</t>
   <t>RESTCONF (<xref target="I-D.ietf-netconf-restconf"></xref>) protocol extensions for the ephemeral data store </t> 
   </list>
   </t>
   <t> 
   draft-hares-i2rs-protocol-strawman-examples provides 
   provides examples of this strawman protocol use for I2RS.  This 
   draft uses a simple thermostat model to illustrate commands.     
   </t>
   <t>This draft is input to a NETCONF review and design team. </t>
   </section>
   <section title="Resolve before publishing draft">
   <t>
   <list style="numbers">
   <t>(dean)What edits are allowed in the ephemeral data store. Should those be 
   syntactically correct or syntacticly and semantically?</t>
<t>Validation slows things down a lot, so datastore validation needs to be
considered carefully.  This is where I think routing expertise will help
decide how much validation can really be skipped for a particular use-case.
</t>
 <t>(Anu)On priority: So the priority maximum will be same as the max-clients , 
 if  we are assigning unique priorities from 1 – max-clilents.
 (Eg , if max clients is 100  (leaf max clients , range 1 .. max ) then priority range is also from 1 – max )
  So the leaf max-clients { .. range 1- 32 } represents priority information also , 
  so it can be max-clients or max-priorities  ??
  <list>
  <t>(Andy)The term 'max' in YANG resolves to 4B-1 in this range, not 32. 
  Actually, the text I sent allows for multiple clients to all have the default priority
which is not good -- if client-id is needed to resolve collisions then there is
no point to requiring a unique priority per client.
</t>
<t>(Andy)The priority is not required to be densely numbered.
Whether there are 1 pane per client or 1 pane per priority or
1 giant blob full of everything, the code will be the same.
The goal of "unique priority" is to require that only priority be saved
in the meta-data for the ephemeral datastore.  Without that, client-id and priority
must be saved (per data node).
  </t>
  </list>
  </t>
  </list>
 </t>
</section>
<section title="Definitions Related to Ephemeral Configuration">
<t>
Currently the configuration systems managed by NETCONF (<xref target="RFC6241"></xref>) or 
RESTCONF (<xref target="I-D.ietf-netconf-restconf"></xref>) has three
types of configuration: candidate, running, and startup running under the config=true flag. 
<list style="symbols">
<t>The candidate receives configuration changes from NETCONF/RESTCONF.</t>
<t>The running configuration is the configuration currently operating on a devices </t>
<t>The start-up configuration is the configuration that survives a reboot. </t>
</list>
</t>
<t>
The config=false flag has operational data which exists alongside the config=true data.
However, at this point there is no datastored defined for configuration false.  
</t>
<t>
<figure>
<artwork>
 ...........      ...........     ...........
 :Candidate : --> : running : --> :start-up  :
 ...........      ...........     ...........
 
 config true
 ---------------------------------------------
 config false    
            ===============
            | operational  |
            | data         |
            ================

 Figure 1 				
</artwork>
</figure>
</t>
<t>
In reality, the running configuration becomes the intended
configuration that is intended to be loaded into a device. 
The loading process of the intended configuation into a
devices compares it against the actual devices and 
creates the actual configuration loaded into a box.
</t>
<t>
Some people denote the actual configuration as applied
configuration. The <xref target="I-D.openconfig-netmod-opstate"></xref>
denotes the actual configuration as derived state.
This document will use the term actual configuration. 
</t>
<t> 
<figure>
<artwork>
 ...........      ...........     ...........
 :Candidate : --> : running : --> :start-up :
 ...........      ...........     ...........
                          
                 =============
                 | Intended  |
                 | config    |
                 =============					
 config true 
 ---------------------------------------------
 config false  
                 =============
                 | Actual    |
                 | config    |
                 =============	
             ______________
            | operational  |
            | data         |
            |______________|

 Figure 2 				
</artwork>
</figure>
</t>
<t>
Recently the <xref target="I-D.openconfig-netmod-opstate"></xref> has proposed
that intended configuration, actual configuration, and the traditional type of 
operational data included as operational state.  Operational data may include:
<list style="symbols">
<t>derived state (e.g. negotiated bgp hold timer)</t>
<t>operational state for counters or statistics (interface counters)</t>
</list>
Again, this document will use the definitions above to discuss ephemeral state
until the  NETCONF WG agrees upon the changes to the state diagrams. 
</t>
</section>
 <section title="Definition of ephemeral datastore for NETCONF/RESTCONF"> 
 <t>
 This section describes the properties of the ephemeral datastore. 
 The ephemeral datastore is not unique to I2RS. This approach to the 
 ephemeral datastore is a panes-of-glass model. This definition of
 I2RS does not support caching in the I2RS Agents.  Future I2RS
 work may reconsidered supporting caching. 
 </t>
<t>
The ephemeral data store has the following qualities: 
<list style="numbers">
<t> Ephemeral state is not unique to I2RS work.</t>
<t> The ephemeral datastore is a datastore holds ephemeral
configuration information that is intended to not survive a reboot.  
Configuration information  is defined as "config=trude nodes".  
Ephemeral nodes will be denoted by an "ephemeral config statement
in the yang protocol. </t>
<t>The ephemeral datastore is never locked. </t>
<t>The ephemeral datastore is one pane of glass that
overrides the running data store.  
</t>
<t>Each client has a unique priority
<list style="symbols">
<t>client identities and priorities are assigned outside of I2RS. 
Examples of mechanisms are AAA or adminstrative.
</t>
<t>A valid I2RS client must have both an identity and a priority.
</t>
<t>A sample container for I2RS client information is shown below.</t>
</list>
</t>
</list>
</t>
<t> 
<figure>
<artwork>
   container i2rs-clients {
       leaf max-clients {
          config false;
          mandatory true;
          type uint32 {
            range "1 .. max";
          }
       }
       list i2rs-client {
          key name;
          unique priority;
          leaf name { ... }
          leaf priority { ... }
       }
    }
 Figure 3 				
</artwork>
</figure>
</t>
</section>
<section title="I2RS Error handling">
<t>
Error handling is an I2RS protocol features.  Normal error handling of 
I2RS Agent for an I2RS client's information examines the following: 
<list style="symbols"> 
<t>syntax of I2RS commands,</t>
<t>syntactic validation for nodes of data models,</t>
<t>permission to write nodes of data model, </t>
<t>grouping, </t>
<t>priority to write nodes of data model being higher than 
existing priority</t>
</list>
</t>
<t>Question of editor: Should grouping be tagged somehow? 
</t>
<t>
The <xref target="I-D.ietf-i2rs-architecture"></xref> specifies three types
of error handling for a partial write operation: "all-or-nothing", 
"stop-on-error", or "continue-on-error".   Partial write operations 
are allowed only for data writes which are not a part of a grouping within a data model.
Groupings are defined by data models. The definition of these error conditions are: 
<list style="symbols">
<t>stop-on-error - means that the configuration process stops when a write
to the configuration detects an error due to write conflict.</t>
<t>continue-on-error - means the configuration process continues when a
write to the configuration detects an error due to write process, and
error reports are transmitted back to the client writing the error. </t>
<t>all-or-nothing - means that all of the configuration process is 
correctly applied or no configuration process is applied.
(Inherent in all-or-nothing is the concept of checking all changes
before applying.)</t>
</list>
</t>
<t>RESTCONF has a complete set of operations per message. 
The RESTCONF patch can support accesing multiple data messages. </t>
<t>NETCONF stop-on-error and continue-on-error are not going to work.
There is no mandated processing order for edits. For the stop-on-error 
and the continue-on-error process to work, the I2RS protocol
extensions to NETCONF will have to force some processing order in order to support 
partial edits.  
 </t>
<t>NETCONF has no current mechanism for reporting which edits were accepted
and which edits were reject for partial operations.  The I2RS protocol
extensions will have to provide new error handling to the response data. 
</t>
<t>These features were removed from NETCONF (RFC 6241) because it was
too complicated, and no company had implemented these features. 
</t>
<t>Interoperability issues must be considered in all three cases:
a) all-or-nothing, b) stop-on-error, and c) continue-on-error. 
 
</t>
</section>
<section title="Simple Thermostat Model">
<t> 
In this discussion of ephemeral configuration, 
this draft utilizes a simple thermostat model with the
yang configuration found in figure 4. 
</t>
<t> 
<figure>
<artwork>
module thermostat {
  ..
  leaf desired-temp {
     type int32;
	 units "degrees Celsius";
	 description "The desired temperature";
	 }
  
  leaf actual-temp {
     type int32;
	 config false;
	 units "degrees Celsius";
	 description "The measured temperature
	 (operational state).";
	 }
  }

Figure 4 - Simple thermostat model yabng
</artwork>
</figure>
</t>
<t> 
Figure 5 shows the diagram of the configuration state
with the Simple thermostat model being attached to by 
an I2RS scheduler client receiving query information 
regarding intended configuration and actual configuration. 
Scheduler has a schedule set of temperatures to put in the thermostat.
Actual temperature is operational state. 
<figure>
<artwork>
 ...........      ...............   ...........
 :Candidate : --> : Desired temp:-->:start-up :
 ...........      ...............   ...........
                       |
                       V					   
                 ============    ===========
                 | Intended |----| I2RS    |
                 | config   |    |scheduler|
                 |          |    | client  |
                 ============	 ===========
 config true                          ^
 -------------------------------      |
 config false                         |
                 =============        |
                 | Actual    |--------|
                 | config    |
                 =============
                      				 
             ______________
            | actual temp  |
            |              |
            ---------------
 
Figure 5 - Scheduler client only  
</artwork>
</figure>
</t>
<t>
Figure 6 shows two I2RS clients talking to this model: scheduler and hold-temp.
Scheduler has a schedule set of temperatures to put in the thermostat.
Hold-temp holds the temperature at the same value. The hold-temp 
I2RS client has a higher priority than the scheduler client. 
<figure>
<artwork>
 ...........      ...............   ...........
 :Candidate :---: Desired temp  : -- :start-up :
 ...........      ...............   ...........
                       |   
                       |          =============
                       |          |I2rs Client|
                       |          |scheduler  |
                       V         / ============
              ................../			 
 ephemeral    . '''''''''''''''/.  ==============
 datastore    . 'desired-temp'---- |I2RS Client |
              . '''''''''|'''' .   | hold temp  |   
              .          |     .   ==============
              .          |     .   ============
              .          |---------| intended |
              .                 .  | config   |
              .                 .  ======||====  
 config true  .                 .        ||      
 --------------------------------------  || 
 config false                            ||   
                 =============           ||    
                 | Actual    |============ 
                 | config    |
                 =============
          					 
             ______________
            | actual temp  |
            |              |
            ----------------
 
Figure 6 - Two I2RS clients 
</artwork>
</figure>
</t>
</section>
<section title="Yang changes">
 <t>
 Yang needs to add a key word ephemeral that signal the ephemeral datatstore
 for items in the config true or the config false state.  
<figure>
<artwork>
module thermostat {
  ..
 
  leaf desired-temp {
     type int32;
	 units "degrees Celsius";
	 ephemeral true;
	 description "The desired temperature";
	 ephemeral true; 
	 }
   
  leaf actual-temp {
     type int32;
	 config false;
	 units "degrees Celsius";
	 description "The measured temperature";
	 }
  }

Figure 8 - Simple Thermostat Yang with ephemeral 
</artwork>
</figure>
</t>
<t>
Figure 6 shows the thermostat model has emphemeral variable desired-temp in the
running configuration and the ephemeral data store. The RESTCONF way of 
addressings is below: 
<figure>
<artwork>
RESTCONF running data store

PUT /resconf/data/thermostat:desired-temp
{"desired-temp":18}

RESTCONF ephemeral datastore 

PUT /restconf/data/thermostat:desired-temp?datastore=ephemeral
{"desired-temp":19 }
</artwork>
</figure>
</t>
 </section>
<section title="NETCONF protocol extensions for the ephemeral datastore">
<t>
capability-name: ephemeral-datastore
</t>
<section title="Overview">
<t>
This capability defines the NETCONF protocol extensions for the ephemeral state.
The ephemeral state has the following features: 
<list style="symbols">
<t>the ephemeral datastore is a datastore holds configuration that is 
intended to not survive a reboot. </t>
<t>The ephemeral datastore is never locked. </t>
<t>Each client has a unique priority.</t>
<t>Each client writes into its own pane so there is no conflict
within a pane. The implementation combines the panes into the appropriate image.</t>
<t>A Partial operation is one where a subset of the written data
is not applied because of better priority for that node. 
A partial operation is only allowed if the error-option is 
stop-on-error or continue-on-error. </t>
<t>Caching is optional and and a server may retain the pain for each client. </t>
</list>
</t>
</section>
<section title="Dependencies">
<t>The Yang data modules must be flag with the ephemeral data store.
The Yang modules must support the notification of write-conflicts. </t>
</section>
<section title="Capability identifier">
<t>
The ephemeral-datastore capability is identified by the following capability
 string: (capability uri)</t>
</section>
<section title="New Operations">
<section title="Bulk-write">
<t>The bulk-write goes here.</t>
</section>
<section title="Bulk-Read">
<t>The bulk-read goes here.</t>
</section>
</section>
<section title="Modification to existing operations">
<section title="PUT changes">
<t>
The phrase "?datastore=ephemeral" following an element will specify
the ephemeral data store.  
</t>
</section>
</section>
<section title="Interactions with Other Capabilities">
<t> TBD </t>
</section> 
</section>
<section title="RESTCONF protocol extensions for the ephemeral datastore">
<t>
capability-name: ephemeral-datastore
</t>
<section title="Overview">
<t>
This capability defines the RESTCONF protocol extensions for the ephemeral state.
The ephemeral state has the following features: 
<list style="numbers">
<t> The ephemeral datastore is a datastore holds ephemeral
configuration information that is intended to not survive a reboot.  
Configuration information  is defined as "config=trude nodes".  
Ephemeral nodes will be denoted by an "ephemeral config statement
in the yang protocol. </t>
<t>The ephemeral datastore is never locked. </t>
<t>The ephemeral datastore is one pane of glass that
overrides the running data store.  
</t>
<t>Each I2RS client has a unique priority and a unique identity. </t>

</list>
</t>
</section>
<section title="Dependencies">
<t>The Yang data modules must be flag with the ephemeral data store.
The Yang modules must support the notification of write-conflicts.
The Yang modules must support the yang-patch features as specified in 
<xref target="I-D.ietf-netconf-yang-patch"></xref>.</t>
</section>
<section title="Capability identifier">
<t>
The ephemeral-datastore capability is identified by the following capability
 string: (capability uri)</t>
</section>
<section title="New Operations">
<section title="Bulk-write">
<t>The bulk-write goes here.</t>
</section>
<section title="Bulk-Read">
<t>The bulk-read goes here.</t>
</section>
</section>
<section title="Modification to existing operations">
<section title="PATCH changes">
<t>
TBD
</t>
</section>
<section title="PUT changes">
<t>
The phrase "?datastore=ephemeral" following an element will specify
the ephemeral data store.  
</t>
</section>
</section>
<section title="Interactions with Other Capabilities">
<t> TBD </t>
</section> 
</section>  
<section anchor="IANA" title="IANA Considerations">
      <t>TBD </t>
    </section>
 <section title="Security Considerations">
      <t>TBD
	  </t>
    </section>
<section anchor="Acknowledgements" title="Acknowledgements">
	<t>
	    This document is an attempt to distill lengthy conversations on
	    the I2RS proto design team from August 
	</t>
	<t> Here's the list of the I2RS protocol design team members
	    <list style="symbols">
		<t>Alia Atlas</t>
		<t>Andy Bierman</t>
		<t>Alex Clemm</t>
		<t>Eric Voit</t>
		<t>Kent Watsen </t>
		<t>Jeff Haas</t>
		<t>Keyur Patel</t>
		<t>Hari</t>
		<t>Dean Bogdanavich</t>
		<t>Anu Nair</t>
		<t>Juergen Schoenwaelder</t>
		<t>Kent Watsen</t>
	    </list>
	</t>
</section>
</middle>
  <back>
    <references title="Normative References:">
	 &I-D.ietf-i2rs-architecture;
     &I-D.ietf-i2rs-rib-info-model;
	 &I-D.ietf-i2rs-traceability;
	 &I-D.ietf-i2rs-pub-sub-requirements;
	 &I-D.ietf-netmod-yang-metadata;
	 &I-D.hares-i2rs-auth-trans;
	 &I-D.openconfig-netmod-opstate;
	 &I-D.ietf-netconf-yang-patch;
	</references>
    <references title="Informative References">
      &RFC2119;
	  &RFC6020;
	  &RFC6241;
	  &RFC6536;
	  &I-D.ietf-netconf-restconf;
    </references>
  </back>
</rfc>