One document matched: draft-ietf-netconf-with-defaults-11.xml


<?xml version="1.0" encoding="UTF-8"?>


<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
	  <!ENTITY rfc2119 PUBLIC '' 
		   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
	  <!ENTITY rfc3688 PUBLIC '' 
		   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3688.xml'>
	  <!ENTITY rfc4741 PUBLIC '' 
		   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4741.xml'>
	  <!ENTITY xmlspec PUBLIC '' 
		   'http://xml.resource.org/public/rfc/bibxml4/reference.W3C.REC-xml-20081126'>
	  <!ENTITY xsdspec PUBLIC '' 
		   'http://xml.resource.org/public/rfc/bibxml4/reference.W3C.REC-xmlschema-0-20041028'>
	  <!ENTITY yangspec PUBLIC '' 
		   'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-netmod-yang.xml'>
	  <!ENTITY netconfspec PUBLIC '' 
		   'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-netconf-4741bis.xml'>

	  ]>

<rfc 
   category="std" 
   docName="draft-ietf-netconf-with-defaults-11" 
   ipr="trust200902">

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

  <?rfc strict="yes"?>
  <?rfc comments="no" ?>
  <?rfc inline="no" ?>
  <?rfc editing="no" ?>
  <?rfc toc="yes"?>
  <?rfc tocompact="yes"?>
  <?rfc tocdepth="4"?>
  <?rfc symrefs="yes"?>
  <?rfc sortrefs="no" ?>
  <?rfc compact="yes"?>
  <?rfc iprnotified="no"?>

  <front>
    <title abbrev="with-defaults">
      With-defaults capability for NETCONF
    </title>

    <author fullname="Andy Bierman" 
            initials="A.B."
            surname="Bierman">
      <organization>Brocade</organization>
      <address>
	<email>andy.bierman@brocade.com</email>
      </address>
    </author>
    
    <author fullname="Balazs Lengyel" initials="B. L."
	    surname="Lengyel">
      <organization>Ericsson</organization>
      <address>
	<postal>
	  <street></street>
	  <city>Budapest</city>
	  <region></region>
	  <code></code>
	  <country>Hungary</country>
	</postal>
	<email>balazs.lengyel@ericsson.com</email>
      </address>
    </author>
    
    <date />
    <area>OPS</area>
    <workgroup>NETCONF</workgroup>
    <keyword>with-defaults</keyword>
    <keyword>XML</keyword>
    <abstract>
      <t>
	The NETCONF protocol defines ways to read and edit configuration data
	from a NETCONF server.  In some cases, part of this data may not be set 
        by the NETCONF client, but rather a default value known to the server
        is used instead.  In many situations the 
	NETCONF client has a priori knowledge about default data, so the NETCONF 
	server does not need to save it in a NETCONF configuration datastore or 
        send it to the client in a retrieval operation reply. In other situations the 
	NETCONF client will need this data from the server.
        Not all server implementations treat this default data the same way.  

	This document defines a capability-based extension to 
	the NETCONF protocol that allows the NETCONF client to 
        identify how defaults are processed by the server, and
        also defines new mechanisms for client control of
        server processing of default data.
      </t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>
	The NETCONF protocol <xref target="RFC4741"/> defines ways to read 
        configuration and state data from a NETCONF server. 
        Part of the configuration data may not be set by the NETCONF client, 
	but rather by a default value from the data model. In many situations the 
	NETCONF client has a priori knowledge about default data, so the NETCONF 
	server does not need to send it to the client. A priori knowledge can be
        obtained, e.g., a document formally describing the data models supported by 
        the NETCONF server. 
      </t>
      <t>
        It can be important for a client to know exactly how a server
        implementation will handle default data.  There are subtle
        differences in some protocol operations where the defaults
        handling behavior of the server will affect the outcome
        of the operation.
      </t>

      <section 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 <xref target="RFC2119"/>.
	</t>
	<t>
	  <list style="hanging">
	    <t hangText="Data model schema:">
	      A document or set of documents describing the 
	      data models supported by the NETCONF server.
	    </t>
	    <t hangText="Management Application:">
              A computer program running outside the NETCONF server  
              that configures or supervises the NETCONF server. 
              A management application can reach the device e.g. 
              via NETCONF, CLI or SNMP.
	    </t>
	    <t hangText="Schema default data:">
              Data specified in the data model schema as default, 
              that is set or used by the device whenever the NETCONF client or 
              other management application/user does not provide a specific 
              value for the relevant data node.             
              Schema default data MAY or may not be stored as part of a 
              configuration datastore, depending on the basic mode
              used by a particular server.
	    </t>       
	    <t hangText="Default data:">
              Conceptual data containing a default value.
              Default data is not kept in
              a datastore.  Not all servers use the
              same criteria to decide if a data node is actually
              instantiated in a datastore.  If a data node is not
              present in a datastore, and a schema default definition
              is in use by the server instead, then it is considered 
              to be a default data node.
	    </t>
	    <t hangText="Default value:">
              A default value is a value for
              a data node instance that is conceptually in use
              by the server, when the data node instance does not exist.
            </t>
	    <t hangText="Explicitly set data:">
              Data that is set to any value by a NETCONF client or 
              other management application by the way of an explicit
              management operation,
              including any data model schema default value.
              Any value set by the NETCONF server which is not 
              the schema defined default value
              is also considered explicitly set data.
	    </t>
	    <t hangText="<with-defaults> retrieval:">
              Refers to a protocol operation which includes the
              <with-default> parameter to control the handling
              of default data.
            </t>
	    <t hangText=":with-defaults:">
              The shorthand notation for the with-defaults capability identifier.
            </t>
	  </list>
	</t>     
	<t>
	  The following terms are defined in <xref target="RFC4741"/>:
	  <list style="symbols">
	    <t>client</t>
            <t>datastore</t>
	    <t>operation</t>
	    <t>server</t>
	  </list>
	</t>
        <t>
	  The following term is defined in <xref target="I-D.ietf-netmod-yang"/>:
	  <list style="symbols">
	    <t>data node</t>
	  </list>
	</t>
      </section>
      <section title="Defaults Handling Behavior">
        <t>
          The defaults handling behavior used by a server will
          impact NETCONF protocol operations in two ways:
	  <vspace blankLines="1"/>
          <list style="numbers">
            <t>
              Data retrieval:  A server is normally allowed to
              exclude data nodes which it considers to contain
              the default value.  The actual nodes omitted depends
              on the defaults handling behavior used by the server.
	      <vspace blankLines="1"/>
            </t>
            <t>
              Create and delete operations: The <edit-config>
              'operation' attribute can be used to create
              and/or delete specific data nodes.  These
              operations depend on whether the target node
              currently exists or not.  The server's
              defaults handling behavior will determine whether the
              requested node currently exists in the configuration datastore or not.
	      <vspace blankLines="1"/>
            </t>
          </list>
        </t>
      </section>
      <section title="Client Controlled Retrieval of Default Data">
        <t>
	  A networking device may have a large number of default values. 
	  Often the default values are not interesting or specifically defined 
	  with a "reasonable" value, so that the management user does not 
          have to handle them.
	  For these reasons it is quite common for networking devices to
	  suppress the output of parameters having the default value.
        </t>
        <t>
	  However, there are use-cases when a NETCONF client 
	  will need the default data from the server:
	  <vspace blankLines="1"/>
	  <list style="symbols">
	    <t>
              The management application often needs a single, definitive 
              and complete set of configuration values that determine 
              how the a networking device works.
            </t>
	    <t>
              Documentation about default values can be unreliable or unavailable.
            </t>
	    <t>
              Some management applications might not have the capabilities to 
	      correctly parse and interpret formal data models.
            </t>
	    <t>
              Human users might want to understand the received 
	      data without consultation of the documentation.
            </t>
	  </list>
        </t>
        <t>
	  In all these cases, the NETCONF client will need a mechanism
          to retrieve default data from a NETCONF server.
	  <vspace blankLines="1"/>
	  This document defines a NETCONF protocol capability to identify
          the server defaults handling behavior, an XML attribute to identify
          default data, and a YANG module extension to 
	  the NETCONF protocol that allows the NETCONF client to control whether
	  default data is returned by the server.
        </t>
      </section>
    </section>
    <section title="Defaults Handling Basic Modes" anchor="basicHandling">
      <t>
        Not all server implementations treat default data in the same way.
        Instead of forcing a single implementation strategy, this
        document allows a server to advertise a particular
        style of defaults handling, and the client can adjust
        accordingly. 
      </t>
      <t>
	NETCONF servers report default data in different ways. This 
	document specifies three standard defaults handling
        basic modes that a server implementor may choose from:
	<vspace blankLines="1"/>
        <list style="symbols">
          <t>report-all</t>
          <t>trim</t>
          <t>explicit</t>
        </list>
      </t>
      <t>
        A server MUST select one of the three basic modes defined
        in this section for handling default data.  
      </t>
      <section title="'report-all' Basic Mode">
        <t>
          A server which uses the 'report-all' basic mode
          does not consider any data node to
          be default data, even schema default data.
        </t>
        <section title="'report-all' Basic Mode Retrieval">
          <t>
            When data is retrieved from a server using the 'report-all' basic
            mode, and the <with-defaults> parameter is not present, all data
            nodes MUST be reported.
          </t>
        </section>
        <section title="'report-all' <with-defaults> Retrieval">
          <t>
            The server MUST support the <with-defaults> parameter
            with a value equal to 'report-all', as specified in 
            <xref target="reportAllRetrievalMode"/>.
          </t>
        </section>
        <section title="'report-all' <edit-config> and <copy-config> Behavior">
	  <t>
            The server MUST consider every data node to exist,
            even those containing a schema default value.
            A valid 'create' operation attribute for a data node that contains its
            schema default value MUST fail with a 'data-exists' error-tag.
            A valid 'delete' operation attribute for a data node that contains
            its schema default value MUST succeed, even though the data node is
            immediately replaced by the server with the default value.
          </t>
          <t>
            A server which uses the 'report-all' basic-mode has no 
            concept of a default node, so the 'report-all-tagged' <with-defaults>
            retrieval mode is not relevant.  There will never be any tagged nodes,
            since there are no nodes which are omitted in a basic-mode retrieval
            operation.  If the wd:default attribute is present in any
            configuration data, the server MUST return an <rpc-error> response
            with an 'unknown-attribute' error-tag.
          </t>
        </section>
      </section>
      <section title="'trim' Basic Mode">
        <t>
          A server which uses the 'trim' basic mode MUST consider
          any data node set to its schema default value to
          be default data.
        </t>
        <section title="'trim' Basic Mode Retrieval">
          <t>
            When data is retrieved from a server using the 'trim' basic
            mode, and the <with-defaults> parameter is not present, 
            data nodes MUST NOT be reported if they contain the schema default value.
            Non-configuration data nodes containing the 
            schema default value MUST NOT be reported.
          </t>
        </section>
        <section title="'trim' <with-defaults> Retrieval">
          <t>
            The server MUST support the <with-defaults> parameter
            with a value equal to 'trim', as specified in 
            <xref target="reportAllRetrievalMode"/>.
          </t>
        </section>
        <section title="'trim' <edit-config> and <copy-config> Behavior">
          <t>
            The server MUST consider any data node 
            that does not contain its schema default value to exist.
            A valid 'create' operation attribute for a data node that has a schema default
            value defined MUST succeed.
            A valid 'delete' operation attribute for a missing data node that has a schema default
            value MUST fail.  The server MUST return an <rpc-error>
            response with a 'data-missing' error-tag.
          </t>
          <t>
            If a client sets a data node to its schema default value, using any valid
            operation, it MUST succeed, although the data node MUST NOT be saved 
            in the NETCONF configuration datastore.  This has the same effect as removing the
            data node and treating it as default data.
          </t>
          <t>
            If the server supports the 'report-all-tagged' value for the
            <with-defaults> parameter, then the 'wd:default' attribute MUST be
            accepted in configuration input, as described in 
            <xref target="copyConfigOperation"/> and
            <xref target="editConfigOperation"/>.
          </t>
        </section>
      </section>
      <section title="'explicit' Basic Mode">
        <t>
          A server which uses the 'explicit' basic mode MUST consider
          any data node that is not explicitly set data to be default data.
        </t>
        <section title="'explicit' Basic Mode Retrieval">
          <t>
            If a client sets a data node to its schema default value,
            it MUST always be reported.
            If the server sets a data node to its schema default value,
            it MUST NOT be reported.
            Non-configuration data nodes containing the 
            schema default value MUST be reported.
          </t>
        </section>
        <section title="'explicit' <with-defaults> Retrieval">
          <t>
            The server MUST support the <with-defaults> parameter
            with a value equal to 'explicit', as specified in 
            <xref target="explicitRetrievalMode"/>.
          </t>
        </section>
        <section title="'explicit' <edit-config> and <copy-config> Behavior">
          <t>
            The server considers any data node 
            that is explicitly set data to exist.
            A valid 'create' operation attribute for a data node that has been set by
            a client to its schema default value MUST fail
            with a 'data-exists' error-tag.
            A valid 'create' operation attribute for a data node that has been set by
            the server to its schema default value MUST succeed.
            A valid 'delete' operation attribute for a data node that has been set
            by a client to its schema default value MUST succeed.
            A valid 'delete' operation attribute for a data node that has been set
            by the server to its schema default value MUST 
            fail with a 'data-missing' error-tag.
          </t>
          <t>
            If the server supports the 'report-all-tagged' retrieval mode in
            its :with-defaults capability, then the 'wd:default' attribute MUST be
            accepted in configuration input. If all NETCONF <edit-config>
            or <copy-config>  parameters are valid, then the server 
            will treat a wd:default="true" tagged data node
            as a request to return that node to default data.  If this request
            is valid within the context of the requested NETCONF operation,
            then the data node is removed and returned to its default value.
            The data node within the NETCONF message MUST contain a
            value in this case, which MUST be equal to the schema default value. 
            If not, the server MUST return an <rpc-error> response
            with a 'invalid-value' error-tag.
          </t>
        </section>
      </section>
    </section>

    <section title="Retrieval of Default Data" anchor="retrievalHandling">
      <t>
        This document defines a new parameter, called <with-defaults>,
        which can be added to specific NETCONF operation request
        messages to control how retrieval of default data is
        treated by the server.
      </t>
      <t>
        A server which implements this specification MUST 
        accept the <with-defaults> parameter
        containing the enumeration for any of the defaults 
        handling modes it supports.
        The <with-defaults> parameter contains one of the four
        enumerations defined in this section.
      </t>

      <section title="'report-all' Retrieval Mode" anchor="reportAllRetrievalMode">
        <t>
          When data is retrieved with a <with-defaults> parameter equal to
          'report-all', all data nodes MUST be reported, including any data
          nodes considered to be default data by the server.
        </t>
      </section>

      <section title="'trim' Retrieval Mode" anchor="trimRetrievalMode">
        <t>
          When data is retrieved with a <with-defaults> parameter equal to
          'trim', data nodes MUST NOT be reported if they contain the schema default value.
          Non-configuration data nodes containing the 
          schema default value MUST NOT be reported.
        </t>
      </section>

      <section title="'explicit' Retrieval Mode" anchor="explicitRetrievalMode">
        <t>
          When data is retrieved with a <with-defaults> parameter equal to
          'explicit', a data node which was set by a client to its schema default value
          MUST be reported.  A conceptual data node which would be set by the 
          server to the schema default value MUST NOT be reported.
          Non-configuration data nodes containing the 
          schema default value MUST be reported.
        </t>
      </section>

      <section title="'report-all-tagged' Retrieval Mode"
               anchor="reportAllTaggedRetrievalMode">
        <t>
          In addition to the basic modes, a special variant
          of the 'report-all' basic mode is available
          called 'report-all-tagged'.  This mode MUST be supported
          on a server if the 'also-supported'
          parameter in the :with-defaults capability
          contains the 'report-all-tagged' option.
          Refer to <xref target="WDCAP"/> for encoding details
          for this capability.
        </t>
        <t>
          In this mode the server returns all data nodes,
          just like the 'report-all' mode, except
          a data node that is considered by the server to contain
          default data will include an XML attribute to indicate
          this condition.  This is useful
          for an application to determine which nodes are considered
          to contain default data by the server, within a single
          retrieval operation.
        </t>
        <t>
          A server which supports 'report-all-tagged' MUST also
          accept the 'wd:default' XML attribute within configuration
          input to the <edit-config> or <copy-config> operations.
          Refer to <xref target="ATTRXSD" /> for XML encoding details
          of the 'wd:default' XML attribute.
        </t>
      </section>
    </section>

    <section anchor="WDCAP" title="With-defaults Capability">
      <section title="Overview">
        <t>
	  The :with-defaults capability indicates which
          defaults handling basic mode is supported by the server.  It may
          also indicate support for additional defaults retrieval modes.
          These retrieval modes allow a NETCONF client to control whether 
          default data is returned by the server.
          The capability affects both configuration and state data 
          (while acknowledging that the usage of default 
	  values for state data is less prevalent). 
	  Sending of default data is controlled for each individual 
          operation separately. 
        </t>
        <t>
	  A NETCONF server implementing the :with-defaults capability:
	  <vspace blankLines="1"/>
          <list style="symbols">
            <t>
              MUST indicate its basic mode behavior by including the
              'basic-mode' parameter in the capability URI, as defined
              in <xref target="capabilityIdChapter"/>.
            </t>
            <t>
              MUST support the YANG module defined in 
              <xref target="YANGMOD"/>.
            </t>
            <t>
              SHOULD support the 'report-all' or 'report-all-tagged'
              defaults handling mode.
            </t>
            <t>
              MAY support additional defaults handling modes.
            </t>
          </list>
        </t>
      </section>
      <section title="Dependencies">
	<t>None</t>
      </section>
      <section title="Conformance">
	<t>Every NETCONF server SHOULD implement this capability.</t>
      </section>
      <section title="Capability Identifier" anchor="capabilityIdChapter">
	<t>
	  urn:ietf:params:netconf:capability:with-defaults:1.0
	  <vspace blankLines="1"/>
	  The identifier MUST have a parameter: "basic-mode". This indicates how 
	  the server will treat default data, as defined in 
          <xref target="basicHandling"/>.
	  The allowed values of this parameter are 
	  'report-all', 'trim', and
          'explicit', as defined in <xref target="basicHandling"/>. 
	</t>
	<t>
	  The identifier MAY have another parameter: "also-supported". 
          This parameter 
	  indicates which additional default handling modes the server supports. 
	  The value of the parameter is a comma separated list of one or more modes 
	  that are supported beside the mode indicated in the 'basic-mode' parameter.
	  Possible modes are 'report-all', 'report-all-tagged', 'trim', and
          'explicit', as defined in <xref target="retrievalHandling"/>.
	</t>
        <t>
          Note that this protocol capability URI is separate from the 
          YANG module capability URI
          for the YANG module in <xref target="YANGMOD" />.  A server which 
          implements this  module MUST also advertise a YANG module 
          capability URI according to the rules specified in
          <xref target="I-D.ietf-netmod-yang"/>.          
        </t>
	<t>Examples:
	  <vspace blankLines="1"/>
	  urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=explicit
	  <vspace blankLines="1"/>
	  urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=explicit&also-supported=report-all,report-all-tagged
	</t>
      </section>

      <section title="New Operations">
	<t>None</t>
      </section>  

      <section title="Modifications to Existing Operations">
        <section anchor="copyConfigOperation"
           title="<get>, <get-config>, and <copy-config> Operations">
	  <t>
	    A new <with-defaults> XML
	    element is added to the input for the
	    <get>, <get-config> and <copy-config> operations.
	    If the  <with-defaults> element is present, it controls the 
	    reporting of default data. The server MUST return 
	    default data in the NETCONF <rpc-reply> messages 
            according to the value of this element, if the server
            supports the specified retrieval mode.
	  </t>
          <t>
            This parameter only controls these specified
            retrieval operations, and does not impact any other
            operations or the non-volatile storage of
            configuration data.
          </t>
	  <t>
	    The <with-defaults> element is defined in the XML namespace for the
	    ietf-netconf-with-defaults.yang module in <xref target="YANGMOD" />, 
	    not the XML namespace for the <get>, <get-config> and 
            <copy-config> operations.
	  </t>
	  <t>
	    Allowed values of the with-defaults element are taken from 
	    the 'with-defaults-type' typedef in <xref target="YANGMOD"/>. 
            The allowed values for a particular server are restricted to the 
            values that the server indicates it supports within the :with-defaults
            capability, in the 'basic-mode' and 'also-supported' parameters.
	  </t>
	  <t>
	    If an unsupported value is used, the NETCONF server MUST
	    return an <rpc-error> response with an 'invalid-value' error-tag.
	  </t>
	  <t>
	    If the <with-defaults> element is not present, 
	    the server MUST follow its basic mode behavior as indicated 
	    by the :with-defaults capability identifier's 'basic-mode' parameter,
            defined in <xref target="capabilityIdChapter"/>.
	  </t>
          <t>
            The <get> and <get-config> operations support a separate
            filtering mechanism, using the <filter> parameter.  The
            defaults filtering is conceptually done before the <filter> parameter
            is processed.  For example, if the <with-defaults>
            parameter is equal to 'report-all', then the <filter> parameter
            is conceptually applied to all data nodes and all default data.
          </t>
	  <t> 
	    The <copy-config> operation is only affected by the
            <with-defaults> parameter if the target 
            of the operation is specified with the <url> parameter.
	    If the target is a NETCONF configuration datastore (i.e., running, candidate or startup), the 
	    <with-defaults> parameter has no effect.  The server MUST use its basic mode
            when copying data to a NETCONF configuration datastore.
	    If the <with-defaults> parameter is present in this case, 
            it MUST be silently ignored by the server.
          </t>
          <t>
            If the server supports the 'report-all-tagged' mode,
            then the 'wd:default' attribute defined in 
            <xref target="ATTRXSD" /> also impacts the <copy-config>
            operation.  If the wd:default attribute is present 
            and set to 'true', then the server MUST treat the
            new data node as a request to return that node to its
            default value (i.e., remove it from the configuration datastore).
            The data node within the NETCONF message MUST contain a
            value in this case, which MUST be equal to the schema default value. 
            If not, the server MUST return an <rpc-error> response
            with a 'invalid-value' error-tag.
          </t>
        </section>
        <section anchor="editConfigOperation" title="<edit-config> Operation">
          <t>
           The <edit-config> operation has several editing modes.
           The 'create' and 'delete' editing operations are affected
           by the defaults handling basic mode. The other enumeration values
           for the NETCONF operation attribute are not affected.
          </t>
          <t>
            If the operation attribute contains the value 'create', 
            and  the data node already exists in the target configuration datastore,
            then the server MUST return an  <rpc-error> response
            with a 'invalid-value' error-tag.
          </t>
          <t>
            If the client sets a data node to its schema default value,
            the server MUST accept the request if it is valid.
            The server MUST keep or discard the new value based on
            its defaults handling basic mode. For the 'trim' basic mode, 
            all schema default values are discarded, otherwise a
            client-provided schema default value is saved in
            a NETCONF configuration datastore.
          </t>
          <t>
            If the server supports the 'report-all-tagged' mode,
            then the 'wd:default' attribute defined in 
            <xref target="ATTRXSD" /> also impacts the <edit-config>
            operation.  If the wd:default attribute is present 
            and set to 'true', then the server MUST treat the
            new data node as a request to return that node to its
            default value (i.e., remove it from the configuration datastore).
            The data node within the NETCONF message MUST contain a
            value in this case, which MUST be equal to the schema default value. 
            If not, the server MUST return an <rpc-error> response
            with a 'invalid-value' error-tag.
          </t>
          <t>
            If the wd:default attribute is present, then the effective
            operation for the target data node MUST be
            'create', 'merge' or 'replace'.  If not, then
            the server MUST return an <rpc-error> response
            with an 'invalid-value' error-tag.  For example,
            if 'create' is the
            effective operation, then the create request must
            be valid on its own (e.g., current data node MUST NOT exist).
            The procedure for determining the effective operation
            is defined in <xref target="I-D.ietf-netconf-4741bis"/>.
            It is derived from the 'default-operation' parameter and/or
            any operation attributes that
            are present in the data node or any of its ancestor nodes,
            within the <edit-config> request.
          </t>
        </section>
        <section title="Other Operations">
          <t>
	    Other operations that return configuration data SHOULD 
            also handle default data according to the rules set in 
            this document, and explicitly state this in their documentation. 
	    If this is not specified in the document defining the
            respective operation, the default handling rules described 
            herein do not affect these operations.
	  </t>
        </section>
      </section>
      <section title="Interactions with Other Capabilities">
        <t>None</t>
      </section>  
    </section>

    <section anchor="YANGMOD" 
             title="YANG Module for the <with-defaults> Parameter">
      <t>
	The following YANG module defines the addition of the with-defaults element 
	to the <get>,  <get-config>, and <copy-config> operations. 
	The YANG language is defined in <xref target="I-D.ietf-netmod-yang"/>.
	The above operations are defined in YANG in 
        <xref target="I-D.ietf-netconf-4741bis"/>.
	Every NETCONF server which supports the :with-defaults capability
        MUST implement this YANG module.
      </t>
      <t>
	<figure>
	  <artwork><![CDATA[

<CODE BEGINS> file="ietf-netconf-with-defaults@2010-06-09.yang"

module ietf-netconf-with-defaults {

   namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults";

   prefix ncwd;

   import ietf-netconf { prefix nc; }

   organization
    "IETF NETCONF (Network Configuration Protocol) Working Group";

   contact
    "WG Web:   <http://tools.ietf.org/wg/netconf/>
     WG List:  <mailto:netconf@ietf.org>

     WG Chair: Bert Wijnen
               <mailto:bertietf@bwijnen.net>

     WG Chair: Mehmet Ersue
               <mailto:mehmet.ersue@nsn.com>

     Editor: Andy Bierman
             <mailto:andy.bierman@brocade.com>

     Editor: Balazs Lengyel
             <mailto:balazs.lengyel@ericsson.com>";

   description
    "This module defines an extension to the NETCONF protocol
     that allows the NETCONF client to control how default
     values are handled by the server in particular NETCONF operations.

     Copyright (c) 2010 IETF Trust and the persons identified as
     the document authors.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject
     to the license terms contained in, the Simplified BSD License
     set forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (http://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX; see
     the RFC itself for full legal notices.";
   // RFC Ed.: replace XXXX with actual RFC number and remove this note

   // RFC Ed.: remove this note
   // Note: extracted from draft-ietf-netmod-with-defaults-10.txt

   revision 2010-06-09 {
     description
       "Initial version.";
     reference
      "RFC XXXX: With-defaults capability for NETCONF";
   }
   // RFC Ed.: replace XXXX with actual 
   // RFC number and remove this note
   
   typedef with-defaults-mode {
      description 
        "Possible modes to report default data.";
      reference
         "RFC XXXX; section 3.";
         // RFC Ed.: replace XXXX with actual 
         // RFC number and remove this note

      type enumeration {
         enum report-all {
             description 
               "All default data is reported.";
             reference
               "RFC XXXX; section 3.1";
               // RFC Ed.: replace XXXX with actual 
               // RFC number and remove this note

         }
         enum report-all-tagged {
             description 
               "All default data is reported.
                Any nodes considered to be default data
                will contain a 'wd:default' XML attribute,
                set to 'true'.";
             reference
               "RFC XXXX; section 3.4";
               // RFC Ed.: replace XXXX with actual 
               // RFC number and remove this note
         }
         enum trim {
             description 
               "Values are not reported if they contain the default.";
             reference
               "RFC XXXX; section 3.2";
               // RFC Ed.: replace XXXX with actual 
               // RFC number and remove this note

         }
         enum explicit {
             description 
               "Report values that contain the definition of 
                explicitly set data.";
             reference
               "RFC XXXX; section 3.3";
               // RFC Ed.: replace XXXX with actual 
               // RFC number and remove this note
         }
     }   
   }

   grouping with-defaults-parameters {
     description
       "Contains the <with-defaults> parameter for control
        of defaults in NETCONF retrieval operations.";

     leaf with-defaults {
       description
         "The explicit defaults processing mode requested.";
       reference
         "RFC XXXX; section 4.6.1";
         // RFC Ed.: replace XXXX with actual 
         // RFC number and remove this note

       type with-defaults-mode;
     }
   }

   // extending the get-config operation
   augment /nc:get-config/nc:input {
       description
         "Adds the <with-defaults> parameter to the
          input of the NETCONF <get-config> operation.";
       reference
         "RFC XXXX; section 4.6.1";
         // RFC Ed.: replace XXXX with actual 
         // RFC number and remove this note

       uses with-defaults-parameters;
   }

   // extending the get operation
   augment /nc:get/nc:input {
       description
         "Adds the <with-defaults> parameter to 
          the input of the NETCONF <get> operation.";
       reference
         "RFC XXXX; section 4.6.1";
         // RFC Ed.: replace XXXX with actual 
         // RFC number and remove this note

       uses with-defaults-parameters;
   }

   // extending the copy-config operation
   augment /nc:copy-config/nc:input {
       description
         "Adds the <with-defaults> parameter to
          the input of the NETCONF <copy-config> operation.";
       reference
         "RFC XXXX; section 4.6.1";
         // RFC Ed.: replace XXXX with actual 
         // RFC number and remove this note

       uses with-defaults-parameters;
   }

}

<CODE ENDS>
                  ]]></artwork>
	</figure>
	<vspace blankLines="1"/>
      </t>   
    </section>

    <section anchor="ATTRXSD" 
             title="XSD for the 'wd:default' Attribute">
      <t>
	The following XML Schema document defines the 'default' attribute,
        described within this document.  This XSD is only relevant if
        the server supports the 'report-all-tagged' defaults retrieval mode.
      </t>
      <t>
	<figure>
	  <artwork><![CDATA[

<CODE BEGINS> file="defaults.xsd"

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns="urn:ietf:params:xml:ns:netconf:default:1.0"
           targetNamespace="urn:ietf:params:xml:ns:netconf:default:1.0"
           elementFormDefault="qualified"
           attributeFormDefault="unqualified"
           xml:lang="en">

  <xs:annotation>
    <xs:documentation>
      This schema defines the syntax for the 'default' attribute
      described within this document.
    </xs:documentation>
  </xs:annotation>

  <!--
    default attribute
    -->
  <xs:attribute name="default" type="xs:boolean" default="false">
    <xs:annotation>
      <xs:documentation>
        This attribute indicates whether the data node represented 
        by the XML element containing this attribute is considered
        by the server to be default data.  If set to 'true' then
        the data node is default data.  If 'false', then the
        data node is not default data.
      </xs:documentation>
    </xs:annotation>
  </xs:attribute>

</xs:schema>
    
<CODE ENDS>
                  ]]></artwork>
	</figure>
      </t>   
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>
        This document registers the following capability identifier 
        URN in the 'Network Configuration Protocol
        Capability URNs registry':
	<vspace blankLines="1"/>
        <list>
          <t>
            urn:ietf:params:netconf:capability:with-defaults:1.0
          </t>
        </list>
	<vspace blankLines="1"/>
	Note that the capability URN is compliant to 
        <xref target="RFC4741"></xref> section 10.3.
      </t>
      <t>
        This document registers two XML namespace URNs
	in the 'IETF XML registry', following the format 
        defined in <xref target="RFC3688"/>. 
	<vspace blankLines="1"/>
        <list>
          <t>URI: urn:ietf:params:xml:ns:netconf:default:1.0</t>
          <t>URI: urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults</t>
        </list>
	<vspace blankLines="1"/>
        Registrant Contact: The NETCONF WG of the IETF.
	<vspace blankLines="1"/>
        XML: N/A, the requested URIs are XML namespaces.
      </t>
      <t>
	This document registers one module name 
        in the 'YANG Module Names' registry,
	defined in <xref target="I-D.ietf-netmod-yang" /> .  
	<vspace blankLines="1"/>
        <list>
          <t>name: ietf-netconf-with-defaults</t>
          <t>prefix: ncwd</t>
          <t>namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults</t>
          <t>RFC: XXXX // RFC Ed.: replace XXXX and remove this comment</t>
        </list>
      </t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>
	This document defines an extension to existing
	NETCONF protocol operations. It does not introduce
	any new or increased security risks into the management system.
      </t>
      <t>
        The 'with-defaults' capability gives clients control over the
        retrieval of default data from a NETCONF datastore. The
        security consideration of <xref target="I-D.ietf-netconf-4741bis"/> apply
        to this document as well. 
      </t>
    </section>  

    <section title="Acknowledgements">
      <t>
        Thanks to Martin Bjorklund, Sharon Chisholm, Phil Shafer, 
        Juergen Schoenwaelder, Washam Fan and 
	many other members of the NETCONF WG for providing important 
        input to this document.
      </t>
    </section>

  </middle>

  <back>
    <references title="Normative References">
      &rfc2119;
      &rfc3688;
      &rfc4741;
      &netconfspec;
      &yangspec;
      &xmlspec;
    </references>

    <section title="Usage Examples">

      <section anchor="EXAMPLEMOD" title="Example YANG Module">
        <t>
	  The following YANG module defines an example interfaces table
	  to demonstrate how the <with-defaults> parameter behaves
	  for a specific data model.
        </t>
        <t>
	  Note that this is not a real module, and implementation
	  of this module is not required for conformance to the
	  :with-defaults capability, defined in <xref target="WDCAP" />.
          This module is not to be registered with IANA, and is not
          considered to be a code component.  It is
          intentionally very terse, and includes few descriptive statements.
        </t>
        <t>
	  <figure>
	    <artwork><![CDATA[
  module example {

  namespace "http://example.com/ns/interfaces";

  prefix exam;

  typedef status-type {
     description "Interface status";
     type enumeration {
       enum ok;
       enum 'waking up';
       enum 'not feeling so good';
       enum 'better check it out';
       enum 'better call for help';
     }
     default ok;
  }

  container interfaces {
      description "Example interfaces group";

      list interface {
        description "Example interface entry";
        key name;

        leaf name {
          description 
            "The administrative name of the interface.  
             This is an identifier which is only unique 
             within the scope of this list, and only
	     within a specific server.";
          type string {
            length "1 .. max";
          }
        }

        leaf mtu {
          description 
            "The maximum transmission unit (MTU) value assigned to
	     this interface.";
          type uint32;
          default 1500;
        }

        leaf status {
          description 
            "The current status of this interface.";
          type status-type;
          config false;
        }
      }
    }
  }
]]>
            </artwork>
	  </figure>
	  <vspace blankLines="1"/>
        </t>   
      </section>

      <section anchor="DATASET" title="Example Data Set">
        <t>
          The following data element shows the conceptual contents of the
          example server for the protocol operation examples in the
          next section.  This includes all the configuration data nodes,
          non-configuration data nodes, and default leafs.
        </t>
	<t>
	  <figure>
	    <artwork>
	      <![CDATA[
    <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
      <interfaces xmlns="http://example.com/ns/interfaces">
        <interface>
          <name>eth0</name>
          <mtu>8192</mtu>
          <status>up</status>
        </interface>
        <interface>
          <name>eth1</name>
          <mtu>1500</mtu>
          <status>up</status>
        </interface>
        <interface>
          <name>eth2</name>
          <mtu>9000</mtu>
          <status>not feeling so good</status>
        </interface>
        <interface>
          <name>eth3</name>
          <mtu>1500</mtu>
          <status>waking up</status>
        </interface>
      </interfaces>
    </data>
    ]]>
	    </artwork>
	  </figure>
	</t>
        <t>
          In this example, the 'mtu' field for each interface entry
          is set in the following manner:
        </t>
        <texttable>
	  <ttcol  align="left" width="20%">name</ttcol>
	  <ttcol  align="left" width="20%">set by</ttcol>
	  <ttcol align="left" width="20%">mtu</ttcol>
	  <c>eth0</c>
	  <c>client</c>
	  <c>8192</c>
	  <c>eth1</c>
	  <c>server</c>
	  <c>1500</c>
	  <c>eth2</c>
	  <c>client</c>
	  <c>9000</c>
	  <c>eth3</c>
	  <c>client</c>
	  <c>1500</c>
        </texttable>
      </section>

      <section title="Protocol Operation Examples">
        <t>
	  The following examples shows some <get> operations
	  using the 'with-defaults' element.
	  The data model used for these examples is defined in 
	  <xref target="EXAMPLEMOD" />.
        </t>
        <t>
	  The client is retrieving all the data nodes within the 'interfaces' object,
          filtered with the <with-defaults> parameter.
        </t>

        <section title="<with-defaults> = 'report-all'">
	  <t>
	    The behavior of the <with-defaults>
	    parameter handling for the value 'report-all'
	    is demonstrated in this example.
	  </t>
	  <t>
	    <figure>
	      <artwork>
	      <![CDATA[
    <rpc message-id="101"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
      <get>
        <filter type="subtree">
          <interfaces xmlns="http://example.com/ns/interfaces"/>
        </filter>
        <with-defaults 
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults">
          report-all
        </with-defaults>
      </get>
    </rpc>
    
    <rpc-reply message-id="101" 
               xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
      <data>
        <interfaces xmlns="http://example.com/ns/interfaces">
          <interface>
            <name>eth0</name>
            <mtu>8192</mtu>
            <status>up</status>
          </interface>
          <interface>
            <name>eth1</name>
            <mtu>1500</mtu>
            <status>up</status>
          </interface>
          <interface>
            <name>eth2</name>
            <mtu>9000</mtu>
            <status>not feeling so good</status>
          </interface>
          <interface>
            <name>eth3</name>
            <mtu>1500</mtu>
            <status>waking up</status>
          </interface>
        </interfaces>
      </data>
    </rpc-reply>

    ]]>
	      </artwork>
	    </figure>
	  </t>
        </section>

        <section title="<with-defaults> = 'report-all-tagged'">
	  <t>
	    The behavior of the <with-defaults>
	    parameter handling for the value 'report-all-tagged'
	    is demonstrated in this example.  A 'tagged' data node
            is an element that contains the wd:default
            XML attribute, set to 'true'.
	  </t>
          <t>
            The actual data nodes tagged by the server depends on the 
            defaults handling basic mode used by the server.
            Only the data nodes that are considered to be default data
            will be tagged.
          </t>
          <t>
            In this example, the server's basic mode is equal to 'trim',
            so all data nodes that would contain the schema default value
            are tagged.  If the server's basic mode is 'explicit', 
            then only data nodes that are not explicitly set data 
            are tagged.  If the server's basic mode is 'report-all', 
            then no data nodes are tagged. 
          </t>
	  <t>
	    <figure>
	      <artwork>
	      <![CDATA[
    <rpc message-id="102"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
      <get>
        <filter type="subtree">
          <interfaces xmlns="http://example.com/ns/interfaces"/>
        </filter>
        <with-defaults 
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults">
          report-all-tagged
        </with-defaults>
      </get>
    </rpc>
    
    <rpc-reply message-id="102" 
               xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
               xmlns:wd="urn:ietf:params:xml:ns:netconf:default:1.0">
      <data>
        <interfaces xmlns="http://example.com/ns/interfaces">
          <interface>
            <name>eth0</name>
            <mtu>8192</mtu>
            <status wd:default="true">up</status>
          </interface>
          <interface>
            <name>eth1</name>
            <mtu wd:default="true">1500</mtu>
            <status wd:default="true">up</status>
          </interface>
          <interface>
            <name>eth2</name>
            <mtu>9000</mtu>
            <status>not feeling so good</status>
          </interface>
          <interface>
            <name>eth3</name>
            <mtu wd:default="true">1500</mtu>
            <status>waking up</status>
          </interface>
        </interfaces>
      </data>
    </rpc-reply>

    ]]>
	      </artwork>
	    </figure>
	  </t>
        </section>

        <section title="<with-defaults> = 'trim'">
	  <t>
	    The behavior of the <with-defaults>
	    parameter handling for the value 'trim'
	    is demonstrated in this example.
	  </t>   
	  <t>
	    <figure>
	      <artwork>
	      <![CDATA[
    <rpc message-id="103"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
      <get>
        <filter type="subtree">
          <interfaces xmlns="http://example.com/ns/interfaces"/>
        </filter>
        <with-defaults 
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults">
	  trim
        </with-defaults>
      </get>
    </rpc>
    
    <rpc-reply message-id="103" 
               xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
      <data>
        <interfaces xmlns="http://example.com/ns/interfaces">
          <interface>
            <name>eth0</name>
            <mtu>8192</mtu>
          </interface>
          <interface>
            <name>eth1</name>
          </interface>
          <interface>
            <name>eth2</name>
            <mtu>9000</mtu>
            <status>not feeling so good</status>
          </interface>
          <interface>
            <name>eth3</name>
            <status>waking up</status>
          </interface>
        </interfaces>
      </data>
    </rpc-reply>
    ]]>
	      </artwork>
	    </figure>
	  </t>
        </section>

        <section title="<with-defaults> = 'explicit'">
	  <t>
	    The behavior of the <with-defaults>
	    parameter handling for the value 'explicit'
	    is demonstrated in this example.
	  </t>   
	  <t>
	    <figure>
	      <artwork>
	      <![CDATA[
    <rpc message-id="104"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
      <get>
        <filter type="subtree">
          <interfaces xmlns="http://example.com/ns/interfaces"/>
        </filter>
        <with-defaults 
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults">
          explicit
        </with-defaults>
      </get>
    </rpc>
    
    <rpc-reply message-id="104" 
               xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
      <data>
        <interfaces xmlns="http://example.com/ns/interfaces">
          <interface>
            <name>eth0</name>
            <mtu>8192</mtu>
            <status>up</status>
          </interface>
          <interface>
            <name>eth1</name>
            <status>up</status>
          </interface>
          <interface>
            <name>eth2</name>
            <mtu>9000</mtu>
            <status>not feeling so good</status>
          </interface>
          <interface>
            <name>eth3</name>
            <mtu>1500</mtu>
            <status>waking up</status>
          </interface>
        </interfaces>
      </data>
    </rpc-reply>
    ]]>
	      </artwork>
	    </figure>
	  </t>
        </section>
      </section>
    </section>

    <section title="Change Log"> 
      <t>
	-- RFC Ed.: remove this section before publication.
      </t>

      <section title="10-11">
        <t>
          Changed term 'database' to 'configuration datastore' or generic 'datastore'.
        </t>
      </section>

      <section title="09-10">
        <t>
          Changed term 'datastore' to 'database'.
        </t>
        <t>
          Added term 'default value'.
        </t>
        <t>
          Clarified verbage for data node containing a default value.
        </t>
      </section>

      <section title="08-09">
        <t>
          Removed non-volatile server requirements.
        </t>
        <t>
          Moved some text from basic-mode section into
          the the retrieval modes section.
        </t>
	<t>
          Added description and reference statements to the YANG module.
        </t>
        <t>
          Many bugfixes and clarifications, based on WGLC review comments.
        </t>
      </section>

      <section title="07-08">
        <t>
          Added report-all-tagged mode.
        </t>
        <t>
          Changed conformance so report-all or
          report-all-tagged mode SHOULD be supported.
        </t>
	<t>
          Clarified capability requirements for each mode,
          for edit-config and NV storage requirements.
        </t>
        <t>
          Changed rpc-error details for unsupported with-defaults
          value.
        </t>
        <t>
          Added XSD for wd:default attribute
        </t>
        <t>
          Expanded example to show report-all-tagged for
          a basic-mode=trim server.
        </t>
      </section>

      <section title="06-07">
        <t>
          Removed text in capability identifier section about adding
          YANG module capability URI parameters.
        </t>
	<t>Changed YANG module namespace to match YANG format,
          and updated examples to use this new namespace.</t>
        <t>Fixed some typos.</t>
      </section>

      <section title="05-06">
	<t>Removed ':1.0' from capability URI.</t>
	<t>Removed open issues section because all known issues are closed.</t>
        <t>Moved examples to a separate appendix, and expanded them.</t>
	<t>Added example.yang as an appendix to properly explain
	  the examples used within the document.
	</t>
        <t>Replaced normative term 'SHALL' with 'MUST' to be consistent within
          this document.
        </t>
        <t>Clarified <with-defaults> behavior for non-configuration data nodes.</t>
        <t>Clarified various sections based on WGLC comments on mailing list.</t>
        <t>Removed some unused terms.</t>
        <t>Reversed the order of the change log sections so the
          most recent changes are shown first.
        </t>
      </section>

      <section title="04-05">
	<t>Updated I-D and YANG module boiler-plate.</t>
	<t>Removed redundant 'with-defaults' YANG feature.</t>
	<t>Changed definition of 'explicit' mode to match the YANG definition</t>
	<t>Removed XSD because the YANG is normative and the XSD is unconstrained,
          and does not properly extend the 3 affected NETCONF operations.
	</t>
	<t>Made the YANG module a normative section instead of non-normative appendix.</t>
	<t>Changed YANG from an informative to a normative reference,</t>
	<t>Changed 4741bis from an informative to a normative reference because the YANG
          module imports the ietf-netconf module in order to augment some operations.</t>
	<t>Updated capability requirements to include YANG module capability parameters.</t>
	<t>Added a description statement to the with-defaults leaf definition.</t>
	<t>Update open issues section; ready to close all open issues.</t>
      </section>

      <section title="03-04">
	<t>Clarifications</t>
	<t>Added non-netconf interfaces to the definition of explicitly set default data</t>
      </section>

      <section title="02-03">
	<t>Clarifications</t>
	<t>YAM added</t>
	<t>Use the same URN for the capability and the XML namespace to 
          accommodate YANG, and avoid two separate URN/URIs being advertised 
          in the HELLO message, for such a small function.</t>
      </section>

      <section title="01-02">
	<t>report-all made mandatory</t>
	<t>Placeholder for YAM added, XSD will be removed when 4741 provides the NETCONF YAM</t>
	<t>with-defaults is valid for state data as well 
          (if state data has a defined default which might not be so frequent).
          The definition of explicit was modified for state data.
	</t>
      </section>

      <section title="00-01">
	<t>Changed value set of with-default capability and element</t>
	<t>Added version to URI</t>
      </section>

      <section title="-00">
	<t>Created from draft-bierman-netconf-with-defaults-01.txt</t>
	<t>
          It was decided by the NETCONF mailing list, that with-defaults should be a 
          sub-element of each affected operation. 
          While this violates the XSD of RFC4741 this is acceptable and follows 
          the ideas behind NETCONF and YANG.
          <vspace blankLines="1"/>
          Hopefully it will be clarified in the 4741bis RFC whether such extensions are allowed.
	</t>
      </section>
    </section>
  </back>
</rfc>


PAFTECH AB 2003-20262026-04-24 04:36:33