<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>
<?rfc toc="yes"?>
<?rfc compact="no"?>
<?rfc subcompact="no"?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no"?>
<?rfc strict="yes"?>

<rfc ipr="trust200902" category="info" docName="draft-ietf-netmod-arch-01">
    <front>
    <title abbrev="NETMODARCH">An NETCONF- and NETMOD-based Architecture for Network Management</title>

    <author initials="P" surname="Shafer" fullname='Phil Shafer' >
      <organization>Juniper Networks</organization>
      <address>
        <email>phil@juniper.net</email>
      </address>
    </author>
	<date/>
    <abstract>
	<t>
NETCONF gives access to native capabilities of the
devices within a network, defining methods for manipulating
configuration databases, retrieving operational data, and invoking
specific operations.  YANG provides the means to define the content
carried via NETCONF, both data and operations.  Using both
technologies, standard modules can be defined to give interoperability
and commonality to devices, while still allowing devices to express
their unique capabilities.
	</t>
	<t>
This document describes how NETCONF and YANG help build network
management applications that meet the needs of network operators.
	</t>
</abstract>
</front>
<middle>
<section title="Key Words">
    <t>
The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;,
&quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;NOT RECOMMENDED&quot;, &quot;MAY&quot;, and
&quot;OPTIONAL&quot; in this document are to be interpreted as described in BCP
14, <xref target="RFC2119"/>.
    </t>
</section>
<section title="Introduction">
    <t>
Networks are increasing in complexity and capacity, as well as the
density of the services deployed upon them.  Uptime, reliability, and
predictable latency requirements drive the need for automation.
    </t>
    <t>
The problems with network management are not simple.  They are complex
and intricate.  But these problems must be solved for networks to meet the
stability needs of existing services while incorporating new
services in a world where the growth of the networks is exhausting the
supply of qualified networking engineers.  We need to move from a CLI
world into a world of automation, but that automation must be robust
and trustworthy.
    </t>
    <t>
This document presents an architecture based on NETCONF (<xref target="RFC4741"/>)
and <xref target="YANG"/>.  NETCONF and YANG address the problems of network
management with flexibility and expressiveness.  NETCONF allows any
manner of configuration and operational data to be carried with
few rules governing the data.  YANG allows data models to be defined
that are flexible and extensible in ways that allow the data to
be cohesive and structured, but not rigid.
    </t>
    <t>
This approach allows the device to express its native capabilities in
a way that is flexible and extensible.  Evolution of devices and data
models are permitted and managed.
    </t>
<section title="Terminology">
    <t>
The document mirrors terminology from NETCONF.  NETCONF uses a simple
RPC-based mechanism to facilitate communication between a client and a
server.  The client can be a script or application typically running
as part of a network management system.  The server is typically a network
device.  The terms &quot;device&quot; and &quot;server&quot; are used interchangeably in
this document, as are &quot;client&quot; and &quot;application&quot;.
    </t>
</section>
<section title="NETCONF">
    <t>
NETCONF defines an XML-based RPC mechanism that leverages the
simplicity and availability of high-quality XML parsers.  XML gives a
rich, flexible, hierarchical, standard representation of data that
matches the needs of networking devices.  NETCONF carries
configuration data and operations encoded in XML using an RPC
mechanism over a connection-oriented transport.
    </t>
    <t>
XML&apos;s hierarchical data representation allows complex networking data
to be rendered in a natural way.  For example, the following
configuration places interfaces in OSPF areas.  The &lt;ospf&gt; element
contains a list of &lt;area&gt; elements, each of which contain a list of
&lt;interface&gt; elements.  The &lt;name&gt; element identifies the specific area
or interface.  Additional configuration for each area or interface
appears directly inside the appropriate element.
    </t>
	<figure>
	    <artwork><![CDATA[
      <ospf xmlns="http://ns.ietf.org/netconf/ospf">

        <area>
          <name>0.0.0.0</name>

          <interface>
            <name>ge-0/0/0.0</name>
            <!-- The priority for this interface -->
            <priority>30</priority>
            <metric>100</metric>
            <dead-interval>120</dead-interval>
          </interface>

          <interface>
            <name>ge-0/0/1.0</name>
            <metric>140</metric>
          </interface>
        </area>

        <area>
          <name>10.1.2.0</name>

          <interface>
            <name>ge-0/0/2.0</name>
            <metric>100</metric>
          </interface>

          <interface>
            <name>ge-0/0/3.0</name>
            <metric>140</metric>
            <dead-interval>120</dead-interval>
          </interface>
        </area>
      </ospf>
	    ]]></artwork>
	</figure>
    <t>
NETCONF includes mechanisms for controlling configuration datastores,
fetching state data, receiving notifications, and allows for
additional RPC methods.  Configuration operations include the ability
to lock datastores to isolate one application from the actions of
others, the ability to save and restore configuration data sets, and
the ability to discover (via the &lt;hello&gt; message) the capabilities of
the device.
    </t>
</section>
<section title="YANG">
    <t>
YANG is the data model language for NETCONF that allows the
description of hierarchies of data model nodes (&quot;nodes&quot;) and the
constraints that exist amongst them.  YANG defines data models and how
to manipulate those models via NETCONF protocol operations.
    </t>
    <t>
Each YANG module defines a data model, uniquely identified by a
namespace URI.  These data models are extensible in a manner that
allows tight integration of standard data models and proprietary data
models.  Models are built from organizational containers, lists of
data instances and leaf data values.
    </t>
	<figure>
	    <artwork><![CDATA[
    module ietf-ospf {
        namespace http://ns.ietf.org/netconf/ospf;
        prefix ospf;

        import network-types {  // Access another module's def'ns
            prefix nett;
        }

        container ospf {   // Declare the top-level tag
            list area {    // Declare a list of "area" nodes
                key name;  // The key "name" identifies list members
                leaf name {
                    type nett:area-id;
                }
                list interface {
                    key name;
                    leaf name {
                        type nett:interface-name;
                    }
                    leaf priority {
                        description "Designated router priority";
                        type uint {       // The type and range are
                            range 0..255; //  constraints on valid
                        }                 //  values for "priority".
                    }
                    leaf metric {
                        type uint {
                            range 1..65535;
                        }
                    }
                    leaf dead-interval {
                        units seconds;
                        type uint {
                            range 1..65535;
                        }
                    }
                }
            }
        }
    }
	    ]]></artwork>
	</figure>
    <t>
A YANG module defines a data model in terms of the data, its
hierarchical organization, and the constraints on that data.  YANG
defines how this data is represented in XML and how that data is used
in NETCONF operations.
    </t>
<section title="Extensibility Model">
    <t>
XML includes the concept of namespaces, allowing XML elements from
different sources to be combined in the same hierarchy without
risking collision.  YANG modules define content for specific
namespaces, but one module may augment the definition of another module,
introducing elements from that module&apos;s namespace into the first
module&apos;s hierarchy.
    </t>
    <t>
Since one module can augment another module&apos;s definition, hierarchies
of definitions are allowed to grow, as definitions from multiple
sources are added to the base hierarchy.  These augmentations are
qualified using the namespace of the source module, helping to avoid
issues with name conflicts as the modules change over time.
    </t>
    <t>
For example, if the above OSPF configuration were the standard, a
vendor module may augment this with vendor-specific extensions.
    </t>
	<figure>
	    <artwork><![CDATA[
    module vendorx-ospf {
        namespace http://vendorx.example.com/ospf;
        prefix vendorx;

        import ietf-ospf {
            prefix ospf;
        }
	    ]]></artwork>
	</figure>
    <t>
BL: need leading slash:
    </t>
	<figure>
	    <artwork><![CDATA[
        augment ospf:ospf/ospf:area/ospf:interfaces {
            leaf no-neighbor-down-notification {
                type empty;
                description "Don't inform other protocols about"
                          + " neighbor down events";
            }
        }
    }
	    ]]></artwork>
	</figure>
    <t>
The &lt;no&#8209;neighbor&#8209;down&#8209;notification&gt; element is then placed in the
vendorx namespace:
    </t>
	<figure>
	    <artwork><![CDATA[
    <protocols xmlns="http://ietf.org/netconf/protocols"
               xmlns:vendorx="http://vendorx.example.com/ospf">
      <ospf xmlns="http://ietf.org/netconf/ospf">

        <area>
          <name>0.0.0.0</name>

          <interface>
            <name>ge-0/0/0.0</name>
            <priority>30</priority>
            <vendorx:no-neighbor-down-notification/>
          </interface>

        </area>
      </ospf>
    </protocols>
	    ]]></artwork>
	</figure>
    <t>
Augmentations are seamlessly integrated with base modules, allowing
them to be fetched, archived, loaded, and deleted within their natural
hierarchy.  If a client application asks for the configuration for a
specific OSPF area, it will receive the sub-hierarchy for
that area, complete with any augmentations.
    </t>
</section>
</section>
</section>
<section title="An Architecture for NETMOD">
    <t>
In the NETMOD architecture, each device vendor implements a set of
data models in their devices.  These models are either standard data
models, defined in YANG modules published by a standards body, or
proprietary data models, defined in YANG modules published by vendors.
    </t>
    <t>
Standard data models define content that is independent of the vendor,
allowing client applications to request specific behavior without
concern for the vendor, product line, or installed software revision.
The translation between the standard model and the device specific
behavior is performed by the device, freeing the application from such
concerns.
    </t>
    <t>
Proprietary data models allow the vendor to accurately describe the
content and behavior of their devices in explicit detail.
Applications may take advantage of these specifics to give their users
complete control over the device.
    </t>
    <t>
When a NETCONF session begins, the namespaces for all supported
modules are announced as capabilities via the device&apos;s &lt;hello&gt;
message.  The device should also support the schema discovery
mechanism [ref], enabling applications to discover the location from
which the modules may be downloaded.
    </t>
    <t>
The schema discovery for standard YANG modules should list
a common, standard location for these modules, presumably one set by
the organization that defined the standard.
    </t>
    <t>
When an application connects with a device, it receives the list of
capabilities supported by that device.  The application may compare
the set of capabilities announced by the device with the set of
modules the application is aware of.  Any new modules or new revisions
of known modules may be downloaded as needed from the locations given
via the schema discovery mechanism.
    </t>
    <t>
Once the application has access to the YANG modules, it may manipulate
the device as a &quot;YANG data browser&quot;, capable of parsing the elements
sent from the device with an understanding of the organization of the
data.  The module describes the syntax of the data and constraints on
that data, allowing the application to create data that abides by
those constraints.
    </t>
    <t>
To have a real understanding of a module&apos;s content, the application
may need to incorporate logic specific to that module.  Semantic
information contained in description statements is not machine
readable, but module-specific custom work can be done to tailor the
user interface to the particular semantic needs of a module.
    </t>
    <t>
For example, a module could define the &quot;location&quot; of a device using
longitude and latitude, and the application can use the &quot;browser&quot;
style to display this data using input fields in a web form.  Custom
logic would be needed to take the value of these fields and place the
device on a map of the world, and additional logic would be needed to
update the data values when the user drags the device from Dallas to
Dulles.
    </t>
    <t>
If an application is meant to manage a specific problem, it may model
the data internally in whatever form is most convenient to its
organizational needs.  When the application interacts with a device,
it may choose one of two paths.  If the device implements a standard
module, the application may generate content for that standard by
translating its internal form into the standard one.
    </t>
    <t>
If the device doesn&apos;t implement such a standard or no such standard
exists, the application may use a transformation that is particular to
that device&apos;s vendor, product model, hardware, or software.  Depending
on the application, this transformation may be provided by the
application vendor, the device vendor, a third-party, or the provider.
    </t>
    <t>
For a popular application, the device vendor may wish to provide this
transformation to increase market acceptance of their devices.  For popular
devices, the application may provide this transformation as a means of
making the application useful in the maximum number of provider
networks.  For problem domains where the mapping from the application
to the device is not straight-forward or requires tailoring to the
specific provider or environment, the provider may wish to control
this transformation. Additionally, other parties may make
such transformations available via open source.
    </t>
    <t>
Note that both cases may appear within a single application on an &quot;as
needed&quot; basis.  If the device announces the capability for the
standard YANG module, the application may transmit to the device via
NETCONF the content in the standard modules format.  If the device
does not announce the appropriate capability, the application may find
a transformation that matches the device, perform the transformation
on the standard data to produce device native configuration, and
transmit via NETCONF that device configuration to the device.
    </t>
    <t>
In both cases, the key is the ability to discover the capabilities of
the specific device, download the YANG modules that support those
capabilities, gain an understanding of those data models and their
constraints, generate appropriate content, and transmit that content
to the device.
    </t>
</section>
<section title="YANG and Related Technologies">
    <t>
The YANG data modeling language is the central piece of a group of
related technologies.  The YANG language itself, described in [ref],
defines the syntax of the language and its statements, the meaning of
those statements, and how to combine them to build the hierarchy of
nodes that describe a data model.
    </t>
    <t>
That document also defines the &quot;on the wire&quot; XML content for NETCONF
operations on data models defined in YANG modules.  This includes the
basic mapping between YANG data tree nodes and XML elements, as well
as mechanisms used in &lt;edit&#8209;config&gt; content to manipulate that data,
such as arranging the order of nodes within a list.
    </t>
    <t>
YANG uses a syntax that is regular and easily described, primarily
designed for human readability.  YANG&apos;s syntax is friendly to email,
diff, patch, and the constraints of RFC formatting.
    </t>
<section title="YIN">
    <t>
In some environments, incorporating a YANG parser may not be an
acceptable option.  For those scenarios, an XML grammar for YANG is
defined in YIN (YANG Independent Notation) [ref].  YIN allows the use
of XML parsers which are readily available in both open source and
commercial versions.  Conversion between YANG and YIN is direct,
loss-less and reversible.  YANG statements are converted to XML
elements, preserving the structure and content of YANG, but enabling
the use of off-the-shelf XML parsers rather than requiring the
integration of a YANG parser.  YIN maintains complete semantic
equivalence with YANG.
    </t>
    <t>
BL: use of xslt is a key use
    </t>
</section>
<section title="DSDL (Relax NG)">
    <t>
Since NETCONF content is encoded in XML, it is natural to use XML
schema languages for their validation. To facilitate this, YANG
offers a standardized mapping of YANG modules into Document Schema
Description Languages (DSDL) [DSDL].
    </t>
    <t>
DSDL is considered to be the best choice for the given purpose
because it addresses not only grammar and datatypes of XML
documents but also semantic constraints and rules for modifying
information set of the document.
    </t>
    <t>
In addition, DSDL offers formal means for coordinating multiple
independent schemas and specifying how to apply the schemas to the
various parts of the document. This is useful since YANG content
is typically composed of multiple vocabularies.
    </t>
</section>
<section title="YANG Types">
    <t>
YANG supports a number of builtin types, and allows additional types
to be derived from those types in an extensible manner.  New types can
add additional restrictions to allowable data values.
    </t>
    <t>
A standard type library for use by YANG is available [ref].
These YANG modules define commonly used data types for IETF-related
standards.
    </t>
</section>
</section>
<section title="Applicability">
    <t>
The data model in a YANG module yields value in five specific
areas.
    </t>
<section title="Device Developer">
    <t>
The YANG model tells the device developer what data is being modeled.
The developer reads the YANG models, absorbs the zen of the model, and
writes code that supports the model.  The model describes the data
hierarchy and associated constraints, and the description and
reference material helps the developer understand how to transform the
models view into the device native implementation.
    </t>
</section>
<section title="Generic Content Support">
    <t>
The YANG model can be compiled into a YANG-based engine for either the
client or server side.  Incoming data can be validated, as can
outgoing data.  The complete configuration datastore may be validated
in accordance with the constraints described in the data model.
    </t>
    <t>
Serializers and deserializers for generating and receiving NETCONF
content can be driven by the meta-data in the model.  As data is
received, the meta-data is consulted to ensure the validity of
incoming XML elements.
    </t>
</section>
<section title="XML &quot;over the wire&quot; Definitions">
    <t>
The YANG module dictates the XML encoding sent &quot;over the wire&quot;, though
actual transmission should be encrypted so as not to appear as
readable text on the physical media.  The rules that define the
encoding are fixed, so the YANG module can be used to ascertain
whether a specific NETCONF payload is obeying the rules.
    </t>
</section>
<section title="Application Developer">
    <t>
The YANG module tells the application developer what data can be
modeled.  Developers can inspect the modules and take one of three
distinct views.  In this section, we will consider them and the impact
of YANG on their design.  In the real world, most applications are a
mixture of these approaches.
    </t>
<section title="Hard Coded">
    <t>
An application can be coded against the specific, well-known contents
of YANG modules, implementing their organization, rules, and logic
directly with explicit knowledge.  For example, a script could be
written to change the domain name of a set of devices using a standard
YANG module that includes such a leaf node.  This script takes the
new domain name as an argument and insert it into a string containing the
rest of the XML encoding as required by the YANG module.  This content
is then sent via NETCONF to the devices.
    </t>
    <t>
This type of application is useful for small, fixed problems where the
cost and complexity of flexibility is overwhelmed by the ease of hard
coding direct knowledge into the application.
    </t>
</section>
<section title="Bottom Up">
    <t>
An application may take a generic, bottom up approach to
configuration, concentrating on the device&apos;s data directly and
treating that data without specific understanding.
    </t>
    <t>
YANG modules may be used to drive the operation of the YANG equivalent
of a &quot;MIB Browser&quot;.  Such an application  manipulates the device&apos;s
configuration data based on the data organization contained in the
YANG module.  For example, a GUI may present a straight-forward
visualization where elements of the YANG hierarchy are depicted in a
hierarchy of folders or GUI panels.  Clicking on a line expands to the
contents of the matching content.
    </t>
    <t>
BL: GUI comments don&apos;t need to be here
    </t>
    <t>
This type of GUI can easily be built by generating XSLT stylesheets
from the YANG data models.  An XSLT engine can then be used to turn
configuration data into a set of web pages.
    </t>
    <t>
The YANG modules allows the application to enforce a set of
constraints without understanding the semantics of the YANG
module.  
    </t>
</section>
<section title="Top Down">
    <t>
In contrast to the bottom-up approach, the top-down approach allows
the application to take a view of the configuration data which is
distinct from the standard and/or proprietary YANG modules.  The
application is free to construct its own model for data organization
and to present this model to the user.  When the application needs to
transmit data to a device, the application transforms its data from
the problem-oriented view of the world into the data needed for that
particular device.  This transformation is under the control and
maintenance of the application, allowing the transformation to be
changed and updated without affecting the device.
    </t>
    <t>
For example, an application could be written that models VPNs in a
network-oriented view.  The application would need to transform these
high-level VPN definitions into the configuration data that would be
handed to any particular device within a VPN.
    </t>
</section>
</section>
</section>
<section title="Modeling Considerations">
    <t>
In developing good data models, there are many conflicting interests
the data modeler must keep in mind.  Modelers need to be aware of four
types of behavior in modeled device:
    </t>
    <t><list style="symbols">
	<t>
[strict compliance] behavior that follow the model completely
	</t>
	<t>
[modeled deviations] behavior that follows within deviations allowed
by the model 
	</t>
	<t>
[allowable deviations] behavior that falls outside the model, but
can still be handled
	</t>
	<t>
[unacceptable deviations] behavior that is not at all consistent
with the model
	</t>
    </list></t>
    <t>
Once the model is published, an implementer may decide to make a
particular data model node configurable, where the standard model
describes it a state data.  The implementation reports the value
normally and may have an &quot;out of band&quot; mechanism for reporting that
this device behaves in a different manner than the standard.
Applications capable of discovering such behavior can make allowances,
but applications that do not discover such behavior can continue
treating the implementation as if it were compliant.
    </t>
    <t>
Rarely, implementations may make decisions that prevent compliance
with the standard.  Such occasions are regrettable, but they remain a
part of reality, and modelers and application writers ignore them at
their own risk.  An implementation that emits an integer leaf as
&quot;cow&quot; would be difficult to manage, but applications must expect to
encounter such misbehaving devices in the field.
    </t>
    <t>
Despite this, both client and server should view the YANG module as a
contract, with both sides agreeing to abide by the terms.  The modeler
should be explicit about the terms of such a contract, and both client
and server implementations should strive to faithfully and accurately
implement the data model described in the YANG module.
    </t>
</section>
<section title="Security Considerations">
    <t>
This document defines a language with which to write and read
descriptions of management information.  The language itself has no
security impact on the Internet.
    </t>
</section>
</middle>
<back>
  <references title="Normative References">

    <reference anchor="YANG">
      <front>
        <title>YANG - A data modeling language for NETCONF</title>
        <author initials="M." surname="Bjorklund" fullname="Martin Bjorklund" role="editor">
          <organization>Tail-f Systems</organization>
        </author>
      </front>
      <seriesInfo name="internet-draft" value="draft-ietf-netmod-yang-05"/>
    </reference>

    <reference anchor="RFC2119">
      <front>
        <title>Key words for use in RFCs to Indicate Requirement Levels</title>
        <author initials="S." surname="Bradner" fullname="S.  Bradner">
          <organization>Harvard University</organization>
        </author>
        <date month="March" year="1997"/>
        <abstract>
          <t>

In many standards track documents several words are used to signify
the requirements in the specification.  These words are often
capitalized.  This document defines these words as they should be
interpreted in IETF documents.

          </t>
        </abstract>
      </front>
      <seriesInfo name="BCP" value="14"/>
      <seriesInfo name="RFC" value="2119"/>
      <format type="TXT" octets="4723" target="ftp://ftp.isi.edu/in-notes/rfc2119.txt"/>
    </reference>

    <reference anchor="RFC4741">
      <front>
        <title>NETCONF Configuration Protocol</title>
        <author initials="R." surname="Enns" fullname="R. Enns">
          <organization/>
        </author>
        <date year="2006" month="December"/>
        <abstract>
          <t>

The Network Configuration Protocol (NETCONF) defined in this document
provide s mechanisms to install, manipulate, and delete the
configuration of network devices. It u ses an Extensible Markup
Language (XML)-based data encoding for the configuration data as well
as the protocol messages. The NETCONF protocol operations are realized
on top of a si mple Remote Procedure Call (RPC) layer. [STANDARDS
TRACK]

          </t>
        </abstract>
      </front>
      <seriesInfo name="RFC" value="4741"/>
      <format type="TXT" octets="173914" target="ftp://ftp.isi.edu/in-notes/rfc4741.txt"/>
    </reference>



  </references>
</back></rfc>
