<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC7950 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7950.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 RFC6614 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6614.xml">
<!ENTITY RFC6733 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6733.xml">
<!ENTITY RFC7920 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7920.xml">
<!ENTITY RFC7921 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7921.xml">
<!ENTITY RFC7922 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7922.xml">
<!ENTITY RFC7923 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7923.xml">
<!ENTITY RFC7950 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7950.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 submissionType="IETF" category="info" consensus="yes" number="8242"  ipr="trust200902">
  <front>
    <title abbrev="I2RS Ephemeral State Requirements">Interface to the Routing System (I2RS) Ephemeral State Requirements </title>

	<author fullname="Jeff Haas" initials="J." surname="Haas">
      <organization>Juniper</organization>
      <address>
        <postal>
          <street></street>
          <city> </city>
          <country></country>
        </postal>
        <email>jhaas@juniper.net</email>
      </address>
    </author>
	<author fullname="Susan Hares" initials="S." surname="Hares">
	<organization> Huawei </organization>
	<address>
	  <postal>
	   <street></street>
	    <city>Saline</city>
		<country>United States of America</country>
	  </postal>
	 <email>shares@ndzh.com </email>
	</address>
	</author>
	 
    <date month="September" year="2017" />
    <area>Routing Area</area>
    <workgroup>I2RS working group</workgroup>

    <keyword>I2RS</keyword>
    <abstract>
      <t>
	 "An Architecture for the Interface to the Routing System" (RFC 7921) 
	 abstractly describes a number of requirements for ephemeral state 
	 (in terms of capabilities and behaviors) that any protocol suite 
	attempting to meet the needs of the Interface to the Routing System (I2RS) protocol has to provide.  
	 This document describes, in detail, requirements for ephemeral 
	 state for those implementing the I2RS protocol.
	 </t>
	 </abstract>
  </front>
  <middle>
<section anchor="intro" title="Introduction">
<t> The Interface to the Routing System (I2RS) Working Group (WG) is chartered
    with providing architecture and mechanisms to inject into and
    retrieve information from the routing system.  The I2RS Architecture
    document <xref target="RFC7921"></xref> abstractly documents a number of requirements for
    implementing the I2RS and defines ephemeral state as
    "state that does not survive the reboot of a routing device or the
    reboot of the software handling the I2RS software on a routing
    device" (see Section 1.1 of <xref target="RFC7921"/>).  <xref target="architectural"/> of this document describes the
    specific requirements that the I2RS WG has identified
    based on the I2RS architecture's abstract requirements.



  The Interface to the Routing System (I2RS) Working Group (WG) is
  chartered with providing architecture and mechanisms to inject into
  and retrieve information from the routing system.  The I2RS
  Architecture document <xref target="RFC7921"/> abstractly documents a number of
  requirements for implementing the I2RS and defines ephemeral state as
  "state that does not survive the reboot of a routing device or the
  reboot of the software handling the I2RS software on a routing
  device" (see Section 1.1 of <xref target="RFC7921"/>).  <xref target="architectural"/> of this document
  provides a summary of these abstract requirements, and section 
  3 recasts these abstract requirements into specific requirements for the 
  Ephemeral state for any IETF network management system.  
 </t>
   <t>
   The I2RS WG has chosen to use the YANG data modeling
   language <xref target="RFC7950"></xref> as the basis to implement its mechanisms.
   </t>
   <t> 
   Additionally, the I2RS WG has chosen to reuse two existing protocols,  
   NETCONF <xref target="RFC6241"></xref> and its similar but lighter-weight relative RESTCONF
   <xref target="RFC8040"></xref>, as the protocols for carrying I2RS.
   </t>
   <t>
    What does reuse of a protocol mean?  Reuse means that while the
    combination of the YANG modeling language and the NETCONF and
    RESTCONF protocols is a good starting basis for the I2RS data
    modeling language and protocol, the requirements for I2RS 
   protocol implementations should:   <list style="numbers">

   <t>select features from the YANG modeling language and the  
   NETCONF and RESTCONF protocols per version of the I2RS protocol
    (see Sections <xref target="YANG" format="counter"/>, <xref target="NETCONF" format="counter"/>, and <xref target="RESTCONF" format="counter"/>), and
   </t>
   <t>propose additions to YANG, NETCONF, and RESTCONF per version of the I2RS protocol 
    for key functions (ephemeral state, protocol security, publication/subscription service, 
	traceability).</t>
   </list>   
     The purpose of these requirements is to ensure clarity during I2RS protocol creation.
     </t>
	 <t>Support for ephemeral state is an I2RS protocol requirement that necessitates datastore 
	 changes (see <xref target="ephemeral" />), YANG additions (see <xref target="YANG" />), NETCONF additions (see <xref target="NETCONF"/>),
	 and RESTCONF additions (see <xref target="RESTCONF"/>).  
	 </t>
	 <t>Sections <xref target="Reqs" format="counter" />-<xref target="pubsub" format="counter" /> provide details that expand upon the changes in 
	 Sections <xref target="ephemeral" format="counter"/>-<xref target="RESTCONF" format="counter"/> to clarify requirements discussed by the I2RS and NETCONF WGs. 
	 <xref target="Reqs" /> provides additional requirements that detail how write-conflicts 
	 should be resolved if two I2RS client write the same data. 
	 <xref target="multiple"/> describes I2RS requirements for support of multiple message transactions.
	 <xref target="pubsub"/> highlights two requirements for I2RS publication/subscription <xref target="RFC7923"></xref> that must be expanded for 
	 ephemeral state. 
	 </t>
<section title="Requirements Language">
        <t>
    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
    NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
    "MAY", and "OPTIONAL" in this document are to be interpreted as
    described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>
	</section></section>
<section title="Architectural Requirements for Ephemeral State" anchor="architectural"> 
 <t> The I2RS architecture <xref target="RFC7921"></xref> and
 the I2RS problem statement <xref target="RFC7920"></xref> define
 the important high-level requirements for the I2RS protocol in abstract terms. 
 This section distills this high-level abstract guidance 
 into specific requirements for the I2RS protocol.  To aid the reader, 
 there are references back to the abstract descriptions in the I2RS architecture 
 document and the I2RS problem statement, but the
 reader should note the requirements below are not explicitly stated in the
 I2RS architecture document or in the 
 I2RS problem statement. 
 </t>
 <t>Requirements:</t>
 <t>
 <list style="numbers">

 <t>The I2RS protocol SHOULD support an asynchronous programmatic interface
with properties described in Section 5 of <xref target="RFC7920"></xref> 
(e.g., high throughput) with support for target information streams, 
filtered events, and thresholded events (real-time events) sent by an I2RS agent to
an I2RS client (from Section 1.1 of <xref target="RFC7921"></xref>).   </t>
<t>An I2RS agent MUST record the client identity when a node is created or modified. 
The I2RS agent SHOULD be able to read the client identity of a node and 
use the client identity's associated priority to resolve conflicts.   
The secondary identity is useful for traceability and may also be recorded
(from Section 4 of <xref target="RFC7921"></xref>).  
</t>
<t>An I2RS client identity MUST have only one priority for the client's identifier. A
collision on writes is considered an error, but the priority associated 
with each client identifier is utilized to compare 
requests from two different clients in order to modify an existing
node entry.  Only an entry from a client that is higher priority can modify
an existing entry (first entry wins). Priority only has meaning at the time
of use (from Section 7.8 of <xref target="RFC7921"></xref>).
</t>

<t> An I2RS client's secondary identity data is read-only metadata that
       is recorded by the I2RS agent associated with a data model's node
       when the data node is written.  Just like the primary client 
       identity, the secondary identity SHOULD only be recorded when the 
       data node is written
(from Sections 7.4 of <xref target="RFC7921"></xref>.)</t>
<t>An I2RS agent MAY have a lower-priority I2RS client attempting to modify
a higher-priority client's entry in a data model.  The filtering out of
lower-priority clients attempting to write or modify a higher-priority
client's entry in a data model SHOULD be effectively handled and SHOULD not put an
undue strain on the I2RS agent. (See Section 7.8 of <xref target="RFC7921"></xref> augmented by the resource limitation 
language in Section 8 <xref target="RFC7921"></xref>.)
</t>
</list>
</t>
</section>
<section title="Ephemeral State Requirements" anchor="ephemeral"> 
<t>
In requirements Ephemeral-REQ-01 to Ephemeral-REQ-15, Ephemeral state 
is defined as potentially including in a data model 
ephemeral configuration and operational state which is flagged as 
ephemeral. 
</t>
<section title="Persistence">
   <t> Ephemeral-REQ-01: I2RS requires ephemeral state, i.e., state that does not persist
    across reboots. If state must be restored, it should be done solely
    by replay actions from the I2RS client via the I2RS agent. 
  </t>
   <t>At first glance, the I2RS ephemeral state may seem equivalent to the
writable-running datastore in NETCONF (e.g., running-config),
which can be copied to a datastore that persists across a reboot
(software or hardware).
However, I2RS ephemeral state MUST NOT persist across a reboot  (software
or hardware).
   </t>
   </section>
 <section title="Constraints">
   <t>Ephemeral-REQ-02: Non-ephemeral state MUST NOT refer to 
   ephemeral state for constraint purposes; 
   it SHALL be considered a validation error if it does. </t>
      
   <t>Ephemeral-REQ-03: Ephemeral state MUST be able to have constraints that refer
     to operational state, this includes potentially fast-changing or
     short-lived operational state nodes, such as MPLS LSP-ID (label-switched path ID) 
	 or a BGP Adj-RIB-IN (Adjacent RIB Inbound). Ephemeral state constraints 
	 should be assessed when the ephemeral state is written, and if 
	 any of the constraints change to make the constraints invalid
	after that time, the I2RS agent SHOULD notify the I2RS client. 
      </t>
	  
   <t>Ephemeral-REQ-04: Ephemeral state MUST be able to refer to non-ephemeral state 
   as a constraint. Non-ephemeral state can be configuration state or operational state. 
   </t>
   <t>Ephemeral-REQ-05: I2RS pub-sub <xref target="RFC7923"></xref>, tracing <xref target="RFC7922"></xref>, 
   RPC, or other mechanisms may lead to undesirable 
   or unsustainable resource consumption on a system implementing an I2RS agent.
   It is RECOMMENDED that mechanisms be made available to permit 
   prioritization of I2RS operations, when appropriate, to permit 
   implementations to shed work load when operating under constrained 
   resources.  An example of such a work-shedding mechanism is rate-limiting.
   </t>
 </section>
<section title="Hierarchy">
<t> 
Ephemeral-REQ-06: YANG MUST have the ability to do the following:
<list style="numbers">
<t>define a YANG module or submodule schema that
   only contains data nodes with the property of being ephemeral, and 
</t>
<t>augment a YANG module with additional YANG
   schema nodes that have the property of being ephemeral.
</t>


</list>
</t>
</section> 
<section title="Ephemeral Configuration Overlapping Local Configuration">
<t>
Ephemeral-REQ-07: Local configuration MUST have a priority that is comparable
with individual I2RS client priorities for making changes.  This
priority will determine whether local configuration changes or
individual ephemeral configuration changes take precedence as described in
<xref target="RFC7921"/>.  The I2RS protocol MUST support this mechanism.

</t>
</section>
</section> 
<section title="YANG Features for Ephemeral State" anchor="YANG">
<t>Ephemeral-REQ-08: In addition to config true/false, there MUST be a
way to indicate that YANG schema nodes represent ephemeral state.
It is desirable to allow for, and have a way to indicate, config
false YANG schema nodes that are writable operational state.
</t>
</section>
<section title="NETCONF Features for Ephemeral State" anchor="NETCONF">
<t>
Ephemeral-REQ-09: The changes to NETCONF must include: 	
<list style="numbers">
<t>Support for communication mechanisms to enable an I2RS client to 
determine that an I2RS agent supports the mechanisms needed for I2RS operation. 
</t>
<t>The ephemeral state MUST support notification 
of write conflicts using the priority requirements 
defined in <xref target="Reqs" /> (see requirements Ephemeral-REQ-11 through Ephemeral-REQ-14). 
</t>
</list>
</t>
</section>
<section title="RESTCONF Features for Ephemeral State" anchor="RESTCONF">
<t>Ephemeral-REQ-10: The conceptual changes to RESTCONF are:   	
<list style="numbers">
<t>Support for communication mechanisms to enable an I2RS client to 
determine that an I2RS agent supports the mechanisms needed for I2RS operation. 
</t>
<t>The ephemeral state MUST support notification 
of write conflicts using the priority requirements 
defined in <xref target="Reqs" /> (see requirements Ephemeral-REQ-11 through Ephemeral-REQ-14). 
</t>
</list>
</t>
</section>
 <section title="Requirements regarding Supporting Multi-Head Control via Client Priority" anchor="Reqs">
   <t> To support multi-headed control, I2RS requires that there be a
   decidable means of arbitrating the correct state of data when
   multiple clients attempt to manipulate the same piece of data.  This
   is done via a priority mechanism with the highest priority winning.
   This priority is per client.
  </t>
   <t>Ephemeral-REQ-11: The following requirements must be 
   supported by the I2RS protocol 
   in order to support I2RS client identity and priority: 
      <list style="symbols">
   <t>the data nodes MUST store I2RS client identity and MAY store
   the effective priority at the time the data node is stored. 
   </t>
   <t>Per SEC-REQ-07 in Section 4.3 of <xref target="RFC8241"></xref>, 
   an I2RS Identifier MUST have just one priority. 
   The I2RS protocol MUST support the ability to have data nodes 
   store I2RS client identity and not the effective priority 
   of the I2RS client at the time the data node is stored.  
   </t>
   <t>The priority MAY be 
   dynamically changed by AAA, but the exact actions
   are part of the protocol definition as long as collisions are handled 
   as described in Ephemeral-REQ-12, Ephemeral-REQ-13, and Ephemeral-REQ-14. 
   </t>
   </list>
   </t>
   
    <t>Ephemeral-REQ-12: When a collision occurs as two I2RS clients are trying
    to write the same data node, this collision is considered an error.  The  
    I2RS priorities are used to provide a deterministic resolution to the conflict.  
	When there is a collision, and the data node is changed,
       a notification (which includes indicating the data
    node the collision occurred on) MUST be sent to the original client
    to give the original client a chance to deal with the issues
    surrounding the collision.  The original client may need to fix their
    state.
   </t>
   <t>Explanation: RESTCONF and NETCONF updates can come in concurrently from alternative sources. 
   Therefore, the collision detection and comparison of priority needs to occur for any type of update.
   </t>
   <t>For example, RESTCONF tracks the source of configuration change via the 
   entity-tag (see Section 3.5.2 of <xref target="RFC8040"></xref>),
   which the server returns to the client along with the value in GET or HEAD methods. 
   RESTCONF requires that this resource entity-tag be updated whenever a resource or 
   configuration resource within the resource is altered. In the RESTCONF processing, 
   when the resource or a configuration resource within the resource is altered, 
   the processing of the configuration change for two I2RS clients must detect an 
   I2RS collision and resolve the collision using the priority mechanism. 
   </t>
  
   <t>Ephemeral-REQ-13: Multi-headed control is required for collisions and the priority
   resolution of collisions. Multi-headed control is not tied to 
   ephemeral state. The I2RS protocol MUST NOT mandate the internal mechanism for how AAA protocols 
   (e.g., Radius or Diameter) or mechanisms distribute priority per identity except that
   any AAA protocols MUST operate over a secure transport layer (see Radius <xref target="RFC6614"></xref>
   and Diameter <xref target="RFC6733"></xref>).  Mechanisms that prevent collisions of
   two clients trying to modify the same node of data are the focus.  
   
   </t>
   <t>Ephemeral-REQ-14: A deterministic conflict resolution mechanism MUST
   be provided to handle the error scenario in which two clients, with
   the same priority, update the same configuration data node.  The I2RS
   architecture gives one way that this could be achieved: by
   specifying that the first update wins.  Other solutions that prevent
   oscillation of the config data node are also acceptable.
 </t>
 </section>
  <section title="Multiple Message Transactions" anchor="multiple">
 <t>Ephemeral-REQ-15: Section 7.9 of 
 the <xref target="RFC7921"></xref>
states the I2RS architecture does not include
multi-message atomicity and roll-back mechanisms. 
The I2RS protocol implementation MUST NOT require the support of these features.
As part of this requirement, the I2RS protocol should support: 
<list>
<t>multiple operations in one message.  An error in one operation 
MUST NOT stop additional operations from being carried out, nor
can it cause previous operations to be rolled back. </t>
<t>multiple operations in multiple messages, but 
multiple message-command error handling MUST NOT
insert errors into the I2RS ephemeral state.
</t>
</list>
</t>
 </section>
 <section title="Pub/Sub Requirements Expanded for Ephemeral State" anchor="pubsub">
 <t>
   I2RS clients require the ability to monitor changes to ephemeral
   state.  While subscriptions are well defined for receiving
   notifications, the need to create a notification set for all
   ephemeral configuration state may be overly burdensome to the user.
   </t>
   <t>
   Thus, there is a need for a general subscription mechanism that can
   provide notification of changed state, with sufficient information to
   permit the client to retrieve the impacted nodes.  This should be
   doable without requiring the notifications to be created as part of
   every single I2RS module. 
</t>
<t>The publication/subscription requirements for I2RS are in 
   <xref target="RFC7923"></xref>, and the 
   following general requirements SHOULD be understood to be expanded to
   include ephemeral state: 
   <list style="symbols">
   <t>Pub-Sub-REQ-01: The subscription service MUST support 
   subscriptions against ephemeral state in operational datastores, configuration datastores, or both.
   </t>
   <t>Pub-Sub-REQ-02: The subscription service MUST support filtering so
   that subscribed updates under a target node might publish either: <list style="numbers">
   <t>only ephemeral state in operational data or configuration data, or</t>
   <t>both ephemeral and operational data. </t></list>

    </t>
	<t>Pub-Sub-REQ-03:   The subscription service MUST support subscriptions that are ephemeral. 
    (For example, an ephemeral data model that has ephemeral subscriptions.)
	</t>
   </list>
   </t>
 </section>
<section anchor="IANA" title="IANA Considerations">

      <t>This document does not require any IANA actions.</t>

</section>
 <section title="Security Considerations">
      <t>The security requirements for the I2RS protocol are 
	  covered in <xref target="RFC8241"></xref>.
	  </t>
    </section>

</middle>
  <back>
    <references title="Normative References">
	 &RFC6241;
<!-- draft-ietf-netconf-restconf; Now RFC 8040-->
<?rfc include="reference.RFC.8040"?>
<?rfc include="reference.RFC.8174"?>
	 &RFC6614;
	 &RFC6733;
	 &RFC7920;
	 &RFC7921;
	 &RFC7922;
	 &RFC7923;
     &RFC7950;

<!-- draft-ietf-i2rs-protocol-security-requirements; companion document-->
<reference anchor='RFC8241' target='https://www.rfc-editor.org/info/rfc8241'>
<front>
<title>Interface to the Routing System (I2RS) Security-Related Requirements</title>

<author initials='S' surname='Hares' fullname='Susan Hares'>
    <organization />
</author>

<author initials='D' surname='Migault' fullname='Daniel Migault'>
    <organization />
</author>

<author initials='J' surname='Halpern' fullname='Joel Halpern'>
    <organization />
</author>

<date month='September' year='2017' />

</front>

<seriesInfo name='RFC' value='8241' />
<seriesInfo name="DOI" value="10.17487/RFC8241"/>
</reference>




	</references>
    <references title="Informative References">
      &RFC2119;
    </references>

<section anchor="Acknowledgements" title="Acknowledgements" numbered="no">
	<t>
	    This document is an attempt to distill lengthy conversations on
	    the I2RS mailing list for an architecture that was, for a long
	    period of time, a moving target.  Some individuals in particular
	    warrant specific mention for their extensive help in providing
	    the basis for this document:
	</t>
	<t>
<?rfc subcompact="yes"?>
	    <list style="empty">
		<t>Alia Atlas,</t>
		<t>Andy Bierman,</t>
		<t>Martin Bjorklund,</t>
		<t>Dean Bogdanavic,</t>
		<t>Rex Fernando,</t>
		<t>Joel Halpern,</t>
		<t>Thomas Nadeau,</t>
		<t>Juergen Schoenwaelder,</t>
		<t>Kent Watsen,</t>
		<t>Robert Wilton, and</t>
		<t>Joe Clarke.</t>
	    </list>
	</t>
<?rfc subcompact="no"?>
</section>


  </back>
</rfc>
