<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-arokiarajseda-ipfix-data-export-yang-model-01" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" consensus="true">

<front>
<title abbrev="IPFIX Data Export Data Models">YANG model for Data Export over IP Flow Information Export (IPFIX) Protocol</title><seriesInfo value="draft-arokiarajseda-ipfix-data-export-yang-model-01" stream="IETF" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="A." surname="Arokiaraj" fullname="Anand Arokiaraj"><organization abbrev="Nokia">Nokia</organization><address><postal><street></street>
</postal><email>anand.arokiaraj@nokia.com</email>
</address></author>
<author initials="M." surname="Seda" fullname="Marta Seda"><organization abbrev="Calix">Calix</organization><address><postal><street></street>
</postal><email>marta.seda@calix.com</email>
</address></author>
<date/>
<area>Internet</area>
<workgroup></workgroup>

<abstract>
<t>This document defines a flexible, modular YANG model for data export via the IPFIX protocol.  The YANG models in this document conform to the Network Management Datastore Architecture (NMDA) defined in RFC 8342.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>A device may be exporting statistics and other data for the consumption of a collector.  The IPFIX protocol may be used to transport data such as:</t>

<ul>
<li><t>Statistics from interfaces and sessions: YANG models define statistics that can be retrieved via protocols such as NETCONF <xref target="RFC6241"></xref> or RESTCONF <xref target="RFC8040"></xref>.</t>
</li>
<li><t>State data that can be used to correlate the statisticis.</t>
</li>
</ul>
<t>These statistics and state information can be streamed using an IPFIX transport to an IPFIX collector that supports analytics tools.  An operator may wish to take the data and analyze it for trend analysis purposes or other usages (e.g., collect octet counts every 5 minutes for service level agreement purposes or collect reported device temperature for network health purposes).</t>

<section anchor="terminology"><name>Terminology</name>
<t>The key words &quot;<bcp14>MUST</bcp14>&quot;, &quot;<bcp14>MUST NOT</bcp14>&quot;, &quot;<bcp14>REQUIRED</bcp14>&quot;, &quot;<bcp14>SHALL</bcp14>&quot;, &quot;<bcp14>SHALL NOT</bcp14>&quot;, &quot;<bcp14>SHOULD</bcp14>&quot;, &quot;<bcp14>SHOULD NOT</bcp14>&quot;, &quot;<bcp14>RECOMMENDED</bcp14>&quot;, &quot;<bcp14>NOT RECOMMENDED</bcp14>&quot;, &quot;<bcp14>MAY</bcp14>&quot;, and &quot;<bcp14>OPTIONAL</bcp14>&quot; in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"></xref> <xref target="RFC8174"></xref> when, and only when, they appear in all capitals, as shown here.</t>
<t>The following terms that are defined in RFC7011 are not redefined here:<br />
Observation Domain
Exporting Process
Exporter
IPFIX Device
Collecting Process
Collector
Template
IPFIX Message
Template Record
Data Record
Options Template Record
Set
Template Set
Options Template Set
Data Set
Information Element
Transport Session</t>
</section>

<section anchor="tree-diagrams"><name>Tree Diagrams</name>
<t>Tree diagrams used in this document follow the notation defined in <xref target="RFC8340"></xref>.</t>
</section>
</section>

<section anchor="objectives"><name>Objectives</name>
<t>This section describes some of the design objectives for the model presented in this RFC.</t>

<ul>
<li><t>The model should focus purely on the requirements for a data export mechanism and not involve packet sampling, selection or collection process.</t>
</li>
<li><t>References to physical and logical interface should be as simple as possible (e.g., through a leafref).</t>
</li>
<li><t>The model should support a reliable and secure transport mechanism.</t>
</li>
<li><t>The data model should provide suffient state and statistic information for a network operator to determine the state of the individual transport sessions.</t>
</li>
<li><t>The data model should provide reference in the template and IE id state information to correlate it to the configuration.</t>
</li>
</ul>
</section>

<section anchor="structure-of-the-configuration-data-model"><name>Structure of the Configuration Data Model</name>

<section anchor="data-exporter-decomposition"><name>Data Exporter Decomposition</name>
<t><xref target="datamodel"></xref> shows the main classes of the configuration model that are involved in data export.  In a device that has a resource instance capable of reporting data through IPFIX, a data template is created and applied to that resource instance.</t>
<t>The Exporting Process class contains configuration and state parameters of an exporting-process.  It includes various TCP-specific parameters and the export destinations.  The data-template may refer to multiple instances of the Exporting Process class.</t>
<figure anchor="datamodel"><name>Data Exporter Model </name>
<artwork> +--------------------------------+
 | module:ietf-ipfix--data-export |
 |--------------------------------|
 +--------------------------------+
              ^
              |
            1 |
 +------------+-------+              +---------------+
 | list:template-set  |              | list:resource |
 |--------------------|-------------&gt;+---------------|
 +------------+-------+         0..* +---------------+
              |
         0..* | exporting-process-ref
              v
 +-------------------------+
 | list:exporting-process  |
 |-------------------------|
 +-------------------------+
</artwork>
</figure>
</section>
</section>

<section anchor="configuration-and-state-parameters"><name>Configuration and State Parameters</name>
<t>This section specifies the configuration and state parameters of the configuration data model separately for each class.</t>

<section anchor="exporting-process-class"><name>Exporting Process Class</name>
<t>The Exporting Process class in <xref target="exportingprocess"></xref>) specifies destinations to which the incoming packet reports and flow records are exported using objects of the destination class.  The destination class includes tcp-exporter.</t>
<t>The Exporting Process class contains the identifier of the exporting process (exporting-process-id).  This parameter corresponds to the information element exportingProcessId <xref target="IANA-IPFIX"></xref>.  Its occurrence helps to associate exporting process reliability statistics exported according to the IPFIX protocol specification <xref target="RFC7011"></xref> with the corresponding object of the Exporting Process class.</t>
<t>The order in which destination instances appear has a specific meaning only if the export-mode parameter is set to &quot;fallback&quot;.</t>
<figure anchor="exportingprocess"><name>Exporting Process Class </name>
<artwork>     +--rw exporting-process* [name] {exporter}?
        +--rw name                    string
        +--rw enabled?                boolean
        +--rw export-mode?            identityref
        +--rw destination* [name]
        |  +--rw name                   string
        |  +--rw exporter
        |         ...
        +--rw options* [name]
        |  +--rw name               string
        |  +--rw options-type       identityref
        |  +--rw options-timeout?   uint32
        +--ro exporting-process-id?   uint32
</artwork>
</figure>
<t>The Exporting Process parameters are defined as follows:</t>

<dl>
<dt>enabled</dt>
<dd><t>Enables the exporting-process to begin exporting data.  The default is &quot;enabled&quot;.</t>
</dd>
<dt>export-mode</dt>
<dd><t>Determines to which configured destination(s) the incoming data records are exported.  The following parameter values are specified by the configuration data model:</t>

<ul>
<li>parallel: every data record is exported to all configured destinations in parallel</li>
<li>load-balancing: every data record is exported to exactly one configured destination according to a device-specific load-balancing policy</li>
<li>fallback: every data record is exported to exactly one configured destination according to the fallback policy described below</li>
</ul></dd>
</dl>
<t>If export-mode is set to &quot;fallback&quot;, the first destination instance defines the primary destination, the second destination instance defines the secondary destination, and so on.  If the exporting process fails to export data records to the primary destination, it tries to export them to the secondary one.  If the secondary destination fails as well, it continues with the tertiary, etc. &quot;parallel&quot; is the default value if export-mode is not configured.</t>
<t>The reporting of information with options templates is defined with objects of the Options class.</t>
<t>The exporting process may modify the packet reports and flow records to enable a more efficient transmission or storage under the condition that no information is changed or suppressed.  For example, the exporting process may shorten the length of a field according to the rules of reduced size encoding <xref target="RFC7011"></xref>.  The exporting process may also export certain fields in a separate data record as described in <xref target="RFC5476"></xref>.</t>

<section anchor="exporter-class"><name>Exporter Class</name>
<t>The Exporter class shown in <xref target="tcpexporter"></xref> contains the configuration parameters of a TCP export destination.</t>
<t>Using the &quot;ietf-tls-client&quot; Module described in <xref target="I-D.ietf-netconf-tls-client-server"></xref>, Transport Layer Security (TLS) is enabled and configured for this export destination.</t>
<t>The Transport Session class is specified in <xref target="transportsession"></xref>.</t>
<figure anchor="tcpexporter"><name>Exporter Class </name>
<artwork>        +--rw exporter
           +--rw ipfix-version?               uint16
           +--rw destination-port?
           |       inet:port-number
           +--rw send-buffer-size?            uint32
           +--rw rate-limit?                  uint32
           +--rw security
           |     ...
           +--rw source
           |  +--rw (source-method)?
           |     +--:(source-address)
           |     |  +--rw source-address?   inet:host
           |     +--:(interface-ref)
           |     |  +--rw interface-ref?    if:interface-ref
           |     +--:(if-name) {if-mib}?
           |        +--rw if-name?          string
           +--rw destination
           |  +--rw (destination-method)
           |     +--:(destination-address)
           |        +--rw destination-address?   inet:host
           +--ro transport-session
</artwork>
</figure>
</section>

<section anchor="options-class"><name>Options Class</name>
<t>The Options class in <xref target="options"></xref> defines the type of specific information to be reported, such as statistics and filtering parameters, etc.  <xref target="RFC7011"></xref> and <xref target="RFC5476"></xref> specify several types of reporting information that may be exported.</t>
<figure anchor="options"><name>Options Class </name>
<artwork>     +--rw options* [name]
        +--rw name               string
        +--rw options-type       identityref
        +--rw options-timeout?   uint32
</artwork>
</figure>
<t>The following parameter values are specified by the configuration data model:</t>

<dl>
<dt>exporting-reliability</dt>
<dd><t>Export of exporting process reliability statistics using the exporting process reliability statistics options template <xref target="RFC7011"></xref>.</t>
</dd>
<dt>accuracy</dt>
<dd><t>Export of accuracy report interpretation <xref target="RFC5476"></xref>.</t>
</dd>
<dt>reducing-redundancy</dt>
<dd><t>Enables the utilization of options templates to reduce redundancy in the exported data records according to <xref target="RFC5473"></xref>.  The exporting process decides when to apply these options templates.</t>
</dd>
<dt>extended-type-information</dt>
<dd><t>Export of extended type information for enterprise-specific information elements used in the exported templates <xref target="RFC5610"></xref>.</t>
</dd>
</dl>
<t>The exporting process must choose a template definition according to the options type and available options data.  The options-timeout parameter specifies the reporting interval (in milliseconds) for periodic export of the option data.  A parameter value of zero means that the export of the option data is not triggered periodically,  but whenever the available option data has changed.  this is the typical setting for options types accuracy and reducing-redundancy.  If options-timeout is not configured by the user, it is set by the monitoring device.</t>
</section>
</section>

<section anchor="security-class"><name>Security Class</name>
<t><xref target="security"></xref> shows the Security class which is used in the exporting process's class to enable and configure TLS for IPFIX.  If TLS is enabled, the endpoint must use TLS <xref target="RFC8446"></xref> since the transport protocol is TCP.</t>
<t><xref target="RFC7011"></xref> mandates strong mutual authentication of exporting processes as follows. To prevent man-in-the-middle attacks from impostor collecting processes, the export of data to an unauthorized collecting process, strong mutual authentication via asymmetric keys must be used for TLS.  Each of the IPFIX exporting processes must verify the identity of its peer against its authorized certificates, and must verify that the peer's certificate matches its fully qualified domain name.</t>
<figure anchor="security"><name>Security Class </name>
<artwork>          +--rw security
             +--rw client-identity!
             |  +--rw (auth-type)
             |     +--:(certificate) {client-ident-x509-cert}?
             |     |  +--rw certificate
             |     +--:(raw-public-key) {client-ident-raw-public-key}?
             |     |  +--rw raw-private-key
             |     +--:(tls12-psk) {client-ident-tls12-psk}?
             |     |  +--rw tls12-psk
             |     |     +--rw id?   string
             |     +--:(tls13-epsk) {client-ident-tls13-epsk}?
             |        +--rw tls13-epsk
             |           +--rw external-identity    string
             |           +--rw hash                 tlscmn:epsk-supported-hash
             |           +--rw context?             string
             |           +--rw target-protocol?     uint16
             |           +--rw target-kdf?          uint16
             +--rw server-authentication
             |  +--rw ca-certs! {server-auth-x509-cert}?
             |  +--rw ee-certs! {server-auth-x509-cert}?
             |  +--rw raw-public-keys! {server-auth-raw-public-key}?
             |  +--rw tls12-psks?        empty {server-auth-tls12-psk}?
             |  +--rw tls13-epsks?       empty {server-auth-tls13-epsk}?
             +--rw hello-params {tlscmn:hello-params}?
             |  +--rw tls-versions
             |  |  +--rw tls-version*   identityref
             |  +--rw cipher-suites
             |     +--rw cipher-suite*   identityref
             +--rw keepalives {tls-client-keepalives}?
                +--rw peer-allowed-to-send?   empty
                +--rw test-peer-aliveness!
                   +--rw max-wait?       uint16
                   +--rw max-attempts?   uint8
</artwork>
</figure>
</section>

<section anchor="transport-session-class"><name>Transport Session Class</name>
<t>The Transport Session class contains state data about transport sessions originating from an exporting process or terminating at a collecting process.</t>
<t>The following attributes are supported:</t>

<dl>
<dt>ipfix-version</dt>
<dd><t>Used for exporting processes, this parameter contains the version number of the IPFIX protocol that the exporter uses to export its data in this transport session.  Hence, it is identical to the value of the configuration parameter ipfix-version of the sctp-exporter, udp-exporter, or tcp-exporter object.</t>
</dd>
<dt>source-address, destination-address</dt>
<dd><t>Source-address contains the IP address of the exporter, and destination-address contains the IP addresses of the collector.</t>
</dd>
<dt>source-port, destination-port</dt>
<dd><t>These state parameters contain the transport-protocol port numbers of the exporter and the collector of the transport session.</t>
</dd>
<dt>status</dt>
<dd><t>Status of the transport session, which can be one of the following:</t>

<ul>
<li>inactive: transport session is established, but no IPFIX messages are currently transferred (e.g., because this is a backup (secondary) session)</li>
<li>active: transport session is established and transfers IPFIX messages</li>
<li>unknown: transport session status cannot be determined;</li>
</ul></dd>
<dt>rate</dt>
<dd><t>The number of bytes per second transmitted by the exporting process or received by the collecting process.  This parameter is updated every second.</t>
</dd>
<dt>bytes, messages, records, templates, options-templates</dt>
<dd><t>The number of bytes, IPFIX messages, data records, template records, and options template records transmitted by the exporting process or received by the collecting process.  Discontinuities in the values of these counters can occur at re-initialization of the management system, and at other times as indicated by the value of transport-session-discontinuity-time.</t>
</dd>
<dt>discarded-messages</dt>
<dd><t>Used for exporting processes, this parameter indicates the number of messages that could not be sent due to internal buffer overflows, network congestion, routing issues, etc.  Used for collecting process, this parameter indicates the number of received IPFIX messages that are malformed, cannot be decoded, are received in the wrong order or are missing according to the sequence number.  Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of transport-session-discontinuity-time.</t>
</dd>
<dt>transport-session-start-time</dt>
<dd><t>Timestamp of the start of the given transport session.</t>
</dd>
<dt>transport-session-discontinuity-time</dt>
<dd><t>Timestamp of the most recent occasion at which one or more of the transport session counters suffered a discontinuity.  The time is absolute and not relative to sysUpTime.  Note that the values of the state parameters destination-address and destination-port match the values of the configuration parameters destination-address and destination-port of the exporter.</t>
</dd>
</dl>
<t>The Transport Session class includes Template class information and statistics about the templates transmitted or received on the given transport session.  The Template class is specified in <xref target="template-class"></xref>.</t>
<figure anchor="transportsession"><name>Transport Session Class </name>
<artwork>          +--ro transport-session
             +--ro ipfix-version?                          uint16
             +--ro source-address?                         inet:host
             +--ro destination-address?                    inet:host
             +--ro source-port?                            inet:port-number
             +--ro destination-port?                       inet:port-number
             +--ro status?                                 transport-session-status
             +--ro rate?                                   yang:gauge32
             +--ro bytes?                                  yang:counter64
             +--ro messages?                               yang:counter64
             +--ro discarded-messages?                     yang:counter64
             +--ro records?                                yang:counter64
             +--ro templates?                              yang:counter32
             +--ro options-templates?                      yang:counter32
             +--ro transport-session-start-time?           yang:date-and-time
             +--ro transport-session-discontinuity-time?   yang:date-and-time
             +--ro template* [name]
...
</artwork>
</figure>
</section>

<section anchor="template-class"><name>Template Class</name>
<t><xref target="templateclass"></xref> shows the Template class which contains state data about templates used by an exporting process in a specific transport session.  The field class defines one field of the template.</t>
<figure anchor="templateclass"><name>Template Class </name>
<artwork>        +--ro template* [name]
           +--ro name                           string
           +--ro observation-domain-id?         uint32
           +--ro template-id?                   uint16
           +--ro set-id?                        uint16
           +--ro access-time?                   yang:date-and-time
           +--ro template-data-records?         yang:counter64
           +--ro template-discontinuity-time?   yang:date-and-time
           +--ro field* [name]
              +--ro name                    string
              +--ro ie-id?                  ie-id-type
              +--ro ie-length?              uint16
              +--ro ie-enterprise-number?   uint32
              +--ro is-scope?               empty
</artwork>
</figure>

<dl>
<dt>observation-domain-id</dt>
<dd><t>The identifier of the observation domain for which this template is defined.</t>
</dd>
<dt>template-id</dt>
<dd><t>This number indicates the template identifier in the IPFIX Message.</t>
</dd>
<dt>set-id</dt>
<dd><t>This number indicates the set identifier of this template.  Currently, there are two values defined <xref target="RFC7011"></xref>.  The value 2 is used for sets containing template definitions.  The value 3 is used for sets containing options template definitions.</t>
</dd>
<dt>access-time</dt>
<dd><t>This parameter contains the time when this (Options) Template was last sent to the Collector.</t>
</dd>
<dt>template-data-records</dt>
<dd><t>The number of transmitted data records defined by this (options) template since the point in time indicated by template-definition-time.</t>
</dd>
<dt>template-discontinuity-time</dt>
<dd><t>Timestamp of the most recent occasion at which the counter template-data-records suffered a discontinuity.  The time is absolute and not relative to sysUpTime.</t>
</dd>
<dt>ie-id, ie-length, ie-enterprise-number</dt>
<dd><t>Information Element identifier, length, and enterprise number of a field in the template.  If this is not an enterprise-specific Information Element, ie-enterprise-number is zero.</t>
</dd>
<dt>is-scope</dt>
<dd><t>If this state parameter is present, this is a scope field.  This parameter is only available for options templates (i.e., if setId is 3).</t>
</dd>
</dl>
</section>

<section anchor="data-export-class"><name>Data Export Class</name>
<t>The Data Export class in <xref target="data"></xref> specifies the data template to be applied to resource or set of resources and provides state information about the template records.</t>
<figure anchor="data"><name>Data Export Class </name>
<artwork>     +--rw data-export
        +--rw template* [name]
           +--rw name                       string
           +--rw enabled?                   boolean
           +--rw export-interval?           uint32
           +--rw observation-domain-id?     uint32
           +--rw field-layout
           |  +--rw field* [name]
           |     +--rw name                    string
           |     +--rw (identifier)
           |     |  +--:(ie-name)
           |     |  |  +--rw ie-name?          string
           |     |  +--:(ie-id)
           |     |     +--rw ie-id?            ie-id-type
           |     +--rw ie-length?              uint16
           |     +--rw ie-enterprise-number?   uint32
           +--rw exporting-process*         -&gt; /ipfix-data-export/exporting-process/name {exporter}?
           +--rw (resource-identifier)?
           |  +--:(resource-instance)
           |     +--rw resource-instance*   resource
           +--ro data-records?              yang:counter64
           +--ro discontinuity-time?        yang:date-and-time
</artwork>
</figure>
<t>The following attributes are supported:</t>

<dl>
<dt>enabled</dt>
<dd><t>Enables the template so that specified data may be exported.  The default is &quot;enabled&quot;.</t>
</dd>
<dt>export-interval</dt>
<dd><t>The interval (in seconds) for periodical export of data records.</t>
</dd>
<dt>observation-domain-id</dt>
<dd><t>The Observation Domain that is locally unique to an Exporting Process</t>
</dd>
<dt>field-layout</dt>
<dd><t>The IPFIX template to be applied to the resource.  The following attributes are configurable:</t>

<ul>
<li>ie-id: Identifies the Information Element identifier.</li>
<li>ie-enterprise-number: Identifies the enterprise identifier of the Information Element.  If 0, the enterprise ID is an IANA based Information Element.</li>
<li>ie-length: Identifies the length of the Information Element.<br />
</li>
</ul></dd>
<dt>exporting-process</dt>
<dd><t>A template may be mapped to one or more exporting-process instances.</t>
</dd>
<dt>resource</dt>
<dd><t>A template may be applied to one or more resource instances (e.g., different interface instances on a line card)</t>
</dd>
</dl>
<t>The following state information is available:</t>

<dl>
<dt>data-records</dt>
<dd><t>Reports the number of data records generated for this bulk data template.</t>
</dd>
<dt>discontinuity-time</dt>
<dd><t>Timestamp of the most recent occasion at which the counter data records suffered a discontinuity.</t>
</dd>
</dl>
</section>
</section>

<section anchor="yang-modules"><name>YANG Modules</name>
<t>This document defines the ietf-ipfix-data-export YANG module.</t>

<section anchor="ietf-ipfix-data-export"><name>ietf-ipfix-data-export</name>
<t>The ietf-ipfix-data-export YANG module defines an exporting-process based on TCP and a data-export template list.</t>

<section anchor="ietf-ipfix-data-export-module-structure"><name>ietf-ipfix-data-export Module Structure</name>
<t>This document defines the YANG module &quot;ietf-ipfix-data-export&quot;, which has the following tentative structure:</t>

<sourcecode type="tree">module: ietf-ipfix-data-export
  +--rw ipfix-data-export
     +--rw exporting-process* [name] {exporter}?
     |  +--rw name                    string
     |  +--rw enabled?                boolean
     |  +--rw export-mode?            identityref
     |  +--rw destination* [name]
     |  |  +--rw name        string
     |  |  +--rw exporter
     |  |     +--rw ipfix-version?        uint16
     |  |     +--rw source
     |  |     |  +--rw (source-method)?
     |  |     |     +--:(interface-ref)
     |  |     |     |  +--rw interface-ref?    if:interface-ref
     |  |     |     +--:(if-name) {if-mib}?
     |  |     |     |  +--rw if-name?          string
     |  |     |     +--:(source-address)
     |  |     |        +--rw source-address?   inet:host
     |  |     +--rw destination
     |  |     |  +--rw (destination-method)
     |  |     |     +--:(destination-address)
     |  |     |        +--rw destination-address?   inet:host
     |  |     +--rw destination-port?     inet:port-number
     |  |     +--rw send-buffer-size?     uint32
     |  |     +--rw rate-limit?           uint32
     |  |     +--rw connection-timeout?   uint32
     |  |     +--rw retry-schedule?       uint32
     |  |     +--rw security
     |  |     +--ro transport-session
     |  |        +--ro ipfix-version?                          uint16
     |  |        +--ro source-address?                         inet:host
     |  |        +--ro destination-address?                    inet:host
     |  |        +--ro source-port?                            inet:port-number
     |  |        +--ro destination-port?                       inet:port-number
     |  |        +--ro status?                                 transport-session-status
     |  |        +--ro rate?                                   yang:gauge32
     |  |        +--ro bytes?                                  yang:counter64
     |  |        +--ro messages?                               yang:counter64
     |  |        +--ro discarded-messages?                     yang:counter64
     |  |        +--ro records?                                yang:counter64
     |  |        +--ro templates?                              yang:counter32
     |  |        +--ro options-templates?                      yang:counter32
     |  |        +--ro transport-session-start-time?           yang:date-and-time
     |  |        +--ro transport-session-discontinuity-time?   yang:date-and-time
     |  |        +--ro template* [name]
     |  |           +--ro name                           string
     |  |           +--ro observation-domain-id?         uint32
     |  |           +--ro template-id?                   uint16
     |  |           +--ro set-id?                        uint16
     |  |           +--ro access-time?                   yang:date-and-time
     |  |           +--ro template-data-records?         yang:counter64
     |  |           +--ro template-discontinuity-time?   yang:date-and-time
     |  |           +--ro field* [name]
     |  |              +--ro name                    string
     |  |              +--ro ie-id?                  ie-id-type
     |  |              +--ro ie-length?              uint16
     |  |              +--ro ie-enterprise-number?   uint32
     |  |              +--ro is-scope?               empty
     |  +--rw options* [name]
     |  |  +--rw name               string
     |  |  +--rw options-type       identityref
     |  |  +--rw options-timeout?   uint32
     |  +--ro exporting-process-id?   uint32
     +--rw data-export
        +--rw template* [name]
           +--rw name                       string
           +--rw enabled?                   boolean
           +--rw export-interval?           uint32
           +--rw observation-domain-id?     uint32
           +--rw field-layout
           |  +--rw field* [name]
           |     +--rw name                    string
           |     +--rw (identifier)
           |     |  +--:(ie-name)
           |     |  |  +--rw ie-name?          string
           |     |  +--:(ie-id)
           |     |     +--rw ie-id?            ie-id-type
           |     +--rw ie-length?              uint16
           |     +--rw ie-enterprise-number?   uint32
           +--rw exporting-process*         -&gt; /ipfix-data-export/exporting-process/name {exporter}?
           +--rw (resource-identifier)?
           |  +--:(resource-instance)
           |     +--rw resource-instance*   resource
           +--ro data-records?              yang:counter64
           +--ro discontinuity-time?        yang:date-and-time
</sourcecode>
</section>

<section anchor="ietf-ipfix-data-export-yang-module"><name>ietf-ipfix-data-export YANG module</name>
<t>This YANG Module imports typedefs from <xref target="RFC6991"></xref>.</t>

<artwork>&lt;CODE BEGINS&gt; file &quot;ietf-ipfix-data-export@2018-11-15.yang&quot;
</artwork>

<sourcecode type="yang">module ietf-ipfix-data-export {
  yang-version 1.1;

  namespace
    &quot;urn:ietf:params:xml:ns:yang:ietf-ipfix-data-export&quot;;

  prefix ipfixde;

  import ietf-inet-types {
    prefix inet;
    reference
      &quot;RFC 6991: Common YANG Data Types&quot;;
  }

  import ietf-yang-types {
    prefix yang;
    reference
      &quot;RFC 6991: Common YANG Data Types&quot;;
  }

  import ietf-interfaces {
    prefix if;
    reference
      &quot;RFC 8343: A YANG Model for Interface Management&quot;;
  }

  import ietf-tls-client {
    prefix tlsc;
    reference
      &quot;I-D.ietf-netconf-tls-client-server:
       YANG Groupings for TLS Clients and TLS Servers&quot;;
  }

  organization
    &quot;IETF&quot;;

  contact
    &quot;Web:      TBD
     List:     TBD

     Editor:   Marta Seda
               &lt;mailto:marta.seda@calix.com&gt;

     Editor:   Anand Arokiaraj
               &lt;mailto:anand.arokiaraj@nokia.com&gt;&quot;;

  // RFC Ed.: replace XXXX with actual RFC numbers and
  // remove this note.

  description
    &quot;This module contains a collection of YANG definitions for the
     management exporting data over IPFIX.

     This data model is designed for the Network Management Datastore
     Architecture defined in RFC 8342.

     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 14 (RFC 2119) (RFC 8174) when, and only when,
     they appear in all capitals, as shown here.

     Copyright (c) 2021 IETF Trust and the persons identified as
     authors of the code.  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
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX
     (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself
     for full legal notices.&quot;;

  revision 2022-04-11 {
    description
      &quot;Initial revision.&quot;;
    reference
      &quot;RFC XXXX: YANG Data Model for the IP Flow Information Export
                 (IPFIX) Data Export&quot;;
  }

  feature exporter {
    description
      &quot;If supported, the Exporting Device can be used as
       an Exporter. Exporting Processes can be configured.&quot;;
  }

  feature if-mib {
    description
      &quot;This feature indicates that the device implements
       the IF-MIB.&quot;;
    reference
      &quot;RFC 2863: The Interfaces Group MIB&quot;;
  }

  identity export-mode {
    description
      &quot;Base identity for different usages of export
       destinations configured for an Exporting Process.&quot;;
    reference
      &quot;RFC 6728, Section 4.4 (exportMode)&quot;;
  }

  identity parallel {
    base export-mode;
    description
      &quot;Parallel export of Data Records to all destinations configured
       for the Exporting Process.&quot;;
    reference
      &quot;RFC 6728, Section 4.4 (exportMode)&quot;;
  }

  identity load-balancing {
    base export-mode;
    description
      &quot;Load-balancing between the different destinations
       configured for the Exporting Process.&quot;;
    reference
      &quot;RFC 6728, Section 4.4 (exportMode)&quot;;
  }

  identity fallback {
    base export-mode;
    description
      &quot;Export to the primary destination (i.e., the first
       destination configured for the Exporting Process). If the
       export to the primary destination fails, the Exporting Process
       tries to export to the secondary destination.  If the
       secondary destination fails as well, it continues with the
       tertiary, etc.&quot;;
    reference
      &quot;RFC 6728, Section 4.4 (exportMode)&quot;;
  }

  identity options-type {
    description
      &quot;Base identity for report types exported with
       options templates.&quot;;
  }

  identity exporting-reliability {
    base options-type;
    description
      &quot;Exporting Process Reliability Statistics.&quot;;
    reference
      &quot;RFC 7011, Section 4.3&quot;;
  }

  identity reducing-redundancy {
    base options-type;
    description
      &quot;Enables the utilization of Options Templates to reduce
       redundancy in the exported Data Records.&quot;;
    reference
      &quot;RFC 5473&quot;;
  }

  identity extended-type-information {
    base options-type;
    description
      &quot;Export of extended type information for enterprise-specific
       Information Elements used in the exported Templates.&quot;;
    reference
      &quot;RFC 5610&quot;;
  }

  typedef ie-id-type {
    type uint16 {
      range &quot;1..32767&quot;;
    }
    description
      &quot;Type for Information Element identifiers.&quot;;
  }

  typedef transport-session-status {
    type enumeration {
      enum &quot;inactive&quot; {
        value 0;
        description
          &quot;This value MUST be used for Transport Sessions that are
           specified in the system but currently not active.

           The value can be used for Transport Sessions that are
           backup (secondary) sessions.&quot;;
      }
      enum &quot;active&quot; {
        value 1;
        description
          &quot;This value MUST be used for Transport Sessions that are
           currently active and transmitting or receiving data.&quot;;
      }
      enum &quot;unknown&quot; {
        value 2;
        description
          &quot;This value MUST be used if the status of the Transport
           Sessions cannot be detected by the device.

           This value should be avoided as far as possible.&quot;;
      }
    }
    description
      &quot;Status of a Transport Session.&quot;;
    reference
      &quot;RFC 6728, Section 4.7 (status)&quot;;
  }

  typedef resource {
    type instance-identifier {
      require-instance false;
    }
    description
      &quot;A resource from which data will be exported.&quot;;
  }

  grouping transport-session-state-parameters {
    description
      &quot;State parameters of a Transport Session originating from an
       Exporting Process or terminating at a Collecting Process.&quot;;
    reference
      &quot;RFC 7011; RFC 6615, Section 8 (ipfixTransportSessionEntry,
       ipfixTransportSessionStatsEntry)&quot;;

    leaf ipfix-version {
      type uint16;
      description
        &quot;Used for Exporting Processes, this parameter contains the
         version number of the IPFIX protocol that the Exporter uses
         to export its data in this Transport Session.

         Used for Collecting Processes, this parameter contains the
         version number of the IPFIX protocol it receives for this
         Transport Session. If IPFIX Messages of different IPFIX
         protocol versions are received, this parameter contains the
         maximum version number.&quot;;
      reference
        &quot;RFC 6728, Section 4.7 (ipfixVersion)&quot;;
    }

    leaf source-address {
      type inet:host;
      description
        &quot;The source address of the Exporter of the IPFIX Transport
         Session.&quot;;
      reference
        &quot;RFC 6728, Section 4.7 (sourceAddress);
         RFC 4960, Section 6.4&quot;;
    }

    leaf destination-address {
      type inet:host;
      description
        &quot;The destination address of the path that is selected by the
         Exporter to send IPFIX messages to the Collector.

         It is possible that if an FQDN address
         is configured it resolves into many addresses.&quot;;
      reference
        &quot;RFC 6728, Section 4.7 (destinationAddress);
         RFC 4960, Section 6.4&quot;;
    }

    leaf source-port {
      type inet:port-number;
      description
        &quot;The transport-protocol port number of the Exporter of the
         IPFIX Transport Session.&quot;;
      reference
        &quot;RFC 6728, Section 4.7 (sourcePort).&quot;;
    }

    leaf destination-port {
      type inet:port-number;
      description
        &quot;The transport-protocol port number of the Collector of the
         IPFIX Transport Session.&quot;;
      reference
        &quot;RFC 6728, Section 4.7 (destinationPort)&quot;;
    }

    leaf status {
      type transport-session-status;
      description
        &quot;Status of the Transport Session.&quot;;
        reference
         &quot;RFC 6728, Section 4.7 (status)&quot;;
    }

    leaf rate {
      type yang:gauge32;
      units &quot;bytes per second&quot;;
      description
        &quot;The number of bytes per second transmitted by the
         Exporting Process or received by the Collecting Process.
         This parameter is updated every second.&quot;;
      reference
        &quot;RFC 6728, Section 4.7 (rate)&quot;;
    }

    leaf bytes {
      type yang:counter64;
      units &quot;bytes&quot;;
      description
        &quot;The number of bytes transmitted by the Exporting Process or
         received by the Collecting Process.

         Discontinuities in the value of this counter can occur at
         re-initialization of the management system, and at other
         times as indicated by the value of
         transport-session-discontinuity-time.&quot;;
      reference
        &quot;RFC 6728, Section 4.7 (bytes)&quot;;
    }

    leaf messages {
       type yang:counter64;
       units &quot;IPFIX Messages&quot;;
       description
         &quot;The number of messages transmitted by the Exporting Process
          or received by the Collecting Process.

          Discontinuities in the value of this counter can occur at
          re-initialization of the management system, and at other
          times as indicated by the value of
          transport-session-discontinuity-time.&quot;;
       reference
         &quot;RFC 6728, Section 4.7 (messages)&quot;;
    }

    leaf discarded-messages {
      type yang:counter64;
      units &quot;IPFIX Messages&quot;;
      description
        &quot;Used for Exporting Processes, this parameter indicates the
         number of messages that could not be sent due to internal
         buffer overflows, network congestion, routing issues, etc.
         Used for Collecting Process, this parameter indicates the
         number of received IPFIX Message that are malformed, cannot
         be decoded, are received in the wrong order or are missing
         according to the sequence number.

         Discontinuities in the value of this counter can occur at
         re-initialization of the management system, and at other
         times as indicated by the value of
         transport-session-discontinuity-time.&quot;;
      reference
        &quot;RFC 6728, Section 4.7 (discardedMessages)&quot;;
    }

    leaf records {
      type yang:counter64;
      units &quot;Data Records&quot;;
      description
        &quot;The number of Data Records transmitted by the Exporting
         Process or received by the Collecting Process.

         Discontinuities in the value of this counter can occur at
         re-initialization of the management system, and at other
         times as indicated by the value of
         transport-session-discontinuity-time.&quot;;
      reference
        &quot;RFC 6728, Section 4.7 (records)&quot;;
    }

    leaf templates {
      type yang:counter32;
      units &quot;Templates&quot;;
      description
        &quot;The number of Templates transmitted by the Exporting Process
         or received by the Collecting Process.

         Discontinuities in the value of this counter can occur at
         re-initialization of the management system, and at other
         times as indicated by the value of
         transport-session-discontinuity-time.&quot;;
      reference
        &quot;RFC 6728, Section 4.7 (templates)&quot;;
    }

    leaf options-templates {
      type yang:counter32;
      units &quot;Options Templates&quot;;
      description
        &quot;The number of Option Templates transmitted by the Exporting
         Process or received by the Collecting Process.

         Discontinuities in the value of this counter can occur at
         re-initialization of the management system, and at other
         times as indicated by the value of
         transport-session-discontinuity-time.&quot;;
      reference
        &quot;RFC 6728, Section 4.7 (optionsTemplates   )&quot;;
    }

    leaf transport-session-start-time {
      type yang:date-and-time;
      description
        &quot;Timestamp of the start of the given Transport Session.&quot;;
    }

    leaf transport-session-discontinuity-time {
      type yang:date-and-time;
      description
        &quot;Timestamp of the most recent occasion at which one or more
         of the Transport Session counters suffered a discontinuity.&quot;;
      reference
        &quot;RFC 6728, Section 4.7 (transportSessionDiscontinuityTime)&quot;;
    }
  }

  grouping export-template-state-parameters {
    description
      &quot;State parameters of a (Options) Template used by an Exporting
       Process in a specific Transport Session or by a File Writer.&quot;;
    reference
      &quot;RFC 7011; RFC 6728, Section 4.8 (Template Class)&quot;;

    list template {
      key &quot;name&quot;;
      description
        &quot;This list contains the Templates and Options Templates that
         are transmitted by the Exporting Process or written by the
         File Writer.

         Withdrawn or invalidated (Options) Templates MUST be removed
         from this list.&quot;;

      leaf name {
        type string;
        description
          &quot;An arbitrary string which uniquely identifies the
           template.&quot;;
      }

      leaf observation-domain-id {
        type uint32;
        description
          &quot;The ID of the Observation Domain for which this Template
           is defined.&quot;;
        reference
          &quot;RFC 6728, Section 4.8 (observationDomainId).&quot;;
      }

      leaf template-id {
        type uint16 {
          range &quot;256..65535&quot;;
        }
        description
          &quot;This number indicates the Template ID in the IPFIX
           message.&quot;;
        reference
          &quot;RFC 6728, Section 4.8 (templateId).&quot;;
      }

      leaf set-id {
        type uint16 {
          range &quot;2..3 | 256..65535&quot;;
        }
        description
          &quot;This number indicates the Set ID of the Template.
           A value of 2 is reserved for Template Sets.  A value of 3
           is reserved for Options Template Sets.  Values from 4 to
           255 are reserved for future use.  Values 256 and above
           are used for Data Sets.  The Set ID values of 0 and 1 are
           not used for historical reasons.&quot;;
        reference
          &quot;RFC 7011, Section 3.3.2;
           RFC 6728, Section 4.8 (setId)&quot;;
      }

      leaf access-time {
        type yang:date-and-time;
        description
          &quot;This parameter contains the time when this (Options)
           Template was last sent to the Collector(s) or written to
           the file.&quot;;
        reference
          &quot;RFC 6728, Section 4.8 (accessTime).&quot;;
      }

      leaf template-data-records {
        type yang:counter64;
        description
          &quot;The number of transmitted Data Records defined by this
           (Options) Template.

           Discontinuities in the value of this counter can occur at
           re-initialization of the management system, and at other
           times as indicated by the value of
           template-discontinuity-time.&quot;;
        reference
          &quot;RFC 6728, Section 4.8 (templateDataRecords).&quot;;
      }

      leaf template-discontinuity-time {
        type yang:date-and-time;
        description
          &quot;Timestamp of the most recent occasion at which the counter
           template-data-records suffered a discontinuity.&quot;;
        reference
          &quot;RRFC 6728, Section 4.8 (templateDiscontinuityTime).&quot;;
      }

      list field {
        key &quot;name&quot;;
        description
          &quot;This list contains the (Options) Template fields of which
           the (Options) Template is defined.

           The order of the list corresponds to the order
           of the fields in the (Option) Template Record.&quot;;

        leaf name {
          type string;
          description
            &quot;An arbitrary string which uniquely identifies the
             template field.&quot;;
        }

        leaf ie-id {
          type ie-id-type;
          description
            &quot;This parameter indicates the Information Element
             identifier of the field.&quot;;
          reference
            &quot;RFC 7011; RFC 6728, Section 4.8 (ieId).&quot;;
        }

        leaf ie-length {
          type uint16;
          units &quot;octets&quot;;
          description
            &quot;This parameter indicates the length of the Information
             Element of the field.&quot;;
          reference
            &quot;RFC 7011; RFC 6728, Section 4.8 (ieLength).&quot;;
        }

        leaf ie-enterprise-number {
          type uint32;
          description
            &quot;This parameter indicates the IANA enterprise number of
             the authority defining the Information Element
             identifier.

             If the Information Element is not enterprise-specific,
             this state parameter is zero.&quot;;
          reference
            &quot;RFC 6728, Section 4.8 (ieEnterpriseNumber);
             IANA registry for Private Enterprise Numbers,
             http://www.iana.org/assignments/enterprise-numbers.&quot;;
        }

        leaf is-scope {
          when &quot;../../set-id = 3&quot; {
          description
            &quot;This parameter is available for Options Templates
             (Set ID is 3).&quot;;
          }
          type empty;
          description
            &quot;If present, this is a scope field.

             Note that this corresponds to scope(0) being set in
             ipfixTemplateDefinitionFlags.&quot;;
          reference
            &quot;RFC 6728, Section 4.8 (isScope).&quot;;
        }
      }
    }
  }

  grouping exporter-parameters {
    description
      &quot;Parameters of an exporter.&quot;;

    leaf ipfix-version {
      type uint16;
      default '10';
      description
        &quot;IPFIX version number.&quot;;
      reference
        &quot;RFC 7011.&quot;;
    }

    container source {
      description
        &quot;Configuration corresponding to how exporter's source IP
         address is specified.&quot;;

      choice source-method {
        description
          &quot;Method to configure the source address of the exporter
           or the interface to be used by the exporter.

           Note that it is expected that other methods be available.
           Those methods can augment this choice.&quot;;

        case interface-ref {
          leaf interface-ref {
            type if:interface-ref;
            description
              &quot;The interface to be used by the Exporting Process.&quot;;
          }
        }

        case if-name {
          if-feature if-mib;
          leaf if-name {
            type string;
            description
              &quot;Name of an interface as stored in the ifTable
               of IF-MIB.&quot;;
            reference
              &quot;RFC 2863.&quot;;
          }
        }

        case source-address {
          leaf source-address {
            type inet:host;
            description
              &quot;The source IP address or hostname used by the
               Exporting Process.&quot;;
          }
        }
      }
    }

    container destination {
      description
        &quot;Configuration corresponding to how exporter's destination IP
         address is specified.&quot;;

      choice destination-method {
        mandatory true;
        description
          &quot;Method to configuring the destination address of the
           Collection Process to which IPFIX Messages are sent.

           Note it is expected that if other methods are available
           that they would augment from this statement.&quot;;

        case destination-address {
          leaf destination-address {
            type inet:host;
            description
              &quot;The destination IP address or hostname of the
               Collecting Process to which IPFIX Messages are sent.
               A hostname may resolve to one or more IP
               addresses.&quot;;
          }
        }
      }
    }

    leaf destination-port {
      type inet:port-number;
      description
        &quot;If not configured by the user, the Exporting Device uses
         the default port number for IPFIX, which is 4739 without TLS
         or DTLS and 4740 if TLS or DTLS is activated.&quot;;
    }

    leaf send-buffer-size {
      type uint32;
      units &quot;bytes&quot;;
      description
        &quot;Size of the socket send buffer.

         If not configured by the user, this parameter is set by
         the Exporting Device.&quot;;
      reference
        &quot;RFC 6728, Section 4.4.3 (sendBufferSize).&quot;;
    }

    leaf rate-limit {
      type uint32;
      units &quot;bytes per second&quot;;
      description
        &quot;Maximum number of bytes per second the Exporting Process may
         export to the given destination.  The number of bytes is
         calculated from the lengths of the IPFIX Messages exported.
         If not configured, no rate limiting is performed.&quot;;
      reference
        &quot;RFC 6728, Section 4.4.3 (rateLimit).&quot;;
    }

    leaf connection-timeout {
      type uint32;
      units seconds;
      description
        &quot;Time after which the exporting process deems the TCP
         connection to have failed.&quot;;
      reference
        &quot;RFC 7011, Sections 10.4.4 and 10.4.5.&quot;;
    }

    leaf retry-schedule {
      type uint32 {
      range &quot;60..max&quot;;
      }
      units seconds;
      description
        &quot;Time after which the exporting process retries the TCP
         connection to a collector.&quot;;
      reference
        &quot;RFC 7011, Section 10.4.4.&quot;;
    }

    container security {
      description
        &quot;Security related parameters.&quot;;

      uses tlsc:tls-client-grouping;
    }
  }

  grouping exporting-process-parameters {
    description
      &quot;Parameters of an Exporting Process.&quot;;

    leaf export-mode {
      type identityref {
        base export-mode;
      }
      default 'fallback';
      description
        &quot;This parameter determines to which configured destination(s)
         the incoming Data Records are exported.&quot;;
    }

    list destination {
      key &quot;name&quot;;
      min-elements 1;
      description
        &quot;List of export destinations.&quot;;

      leaf name {
        type string;
        description
          &quot;An arbitrary string which uniquely identifies the export
           destination.&quot;;
      }

      container exporter {
        description
          &quot;Exporter parameters.&quot;;

        uses exporter-parameters;

        container transport-session {
          config false;
          description
            &quot;Transport session state data.&quot;;

          uses transport-session-state-parameters;
          uses export-template-state-parameters;
        }
      }
    }

    list options {
      key &quot;name&quot;;
      description
        &quot;List of options reported by the Exporting Process.&quot;;

      leaf name {
        type string;
        description
          &quot;An arbitrary string which uniquely identifies the
           option.&quot;;
      }
      uses options-parameters;
    }
  }

  grouping options-parameters {
    description
      &quot;Parameters specifying the data export using an Options
       Template.&quot;;

    leaf options-type {
      type identityref {
        base options-type;
      }
      mandatory true;
      description
        &quot;Type of the exported options data.&quot;;
    }

    leaf options-timeout {
      type uint32;
      units &quot;milliseconds&quot;;
      description
        &quot;Time interval for periodic export of the options data. If
         set to zero, the export is triggered when the options data
         has changed.

         If not configured by the user, this parameter is set by the
         Exporting Device.&quot;;
    }
  }

  grouping data-template-parameters {
    description
      &quot;Field Layout parameters.&quot;;

    leaf observation-domain-id {
      type uint32;
      default 0;
      description
        &quot;An identifier of an Observation Domain that is locally
         unique to an Exporting Process (see RFC 7011 Section 3.1).

         Typically, this Information Element is for limiting the
         scope of other Information Elements.

         A value of 0 indicates that no specific Observation Domain
         is identified by this Information Element.&quot;;
    }

    container field-layout {
      description
        &quot;Field Layout parameters.&quot;;

      list field {
        key name;
        min-elements 1;
        description
          &quot;Superset of statistics field names or special field-names
           (e.g., timestamps, etc) for interpreting statistics that
           are included in the Packet Reports or Flow Records
           generated by the device.&quot;;

        leaf name {
          type string;
          description
            &quot;An arbitrary string which uniquely identifies the
             field.&quot;;
        }

        choice identifier {
          mandatory true;
          description
            &quot;The Information Element to be added to the template.&quot;;

          case ie-name {
            leaf ie-name {
              type string;
              description
                &quot;Name of the Information Element.&quot;;
            }
          }

          case ie-id {
            leaf ie-id {
              type ie-id-type;
              description
                &quot;ID of the Information Element.&quot;;
            }
          }
        }

        leaf ie-length {
          type uint16;
          units octets;
          description
            &quot;Length of the field in which the Information Element is
             encoded.  A value of 65535 specifies a variable-length
             Information Element.  For Information Elements of
             integer and float type, the field length MAY be set to a
             smaller value than the standard length of the abstract
             data type if the rules of reduced size encoding are
             fulfilled.

             If not configured by the user, this parameter is set by
             the Exporting Device.&quot;;
          reference
            &quot;RFC 7011, Section 6.2&quot;;
        }

        leaf ie-enterprise-number {
          type uint32;
          default 0;
          description
            &quot;If this parameter is zero, the Information Element is
             registered in the IANA registry of IPFIX Information
             Elements or unspecified (if the Informational Element is
             not IANA registered).

             If this parameter is configured with a non-zero private
             enterprise number, the Information Element is
             enterprise-specific.&quot;;
          reference
            &quot;RFC 7011; RFC 5103;
             IANA registry for Private Enterprise Numbers,
             http://www.iana.org/assignments/enterprise-numbers;
             IANA registry for IPFIX Entities,
             http://www.iana.org/assignments/ipfix&quot;;
        }
      }
    }
  }

  container ipfix-data-export {
    description
      &quot;IPFIX data export node.&quot;;

    list exporting-process {
      if-feature exporter;
      key &quot;name&quot;;
      description
        &quot;List of Exporting Processes of the IPFIX Exporting Device
         for which configuration will be applied.&quot;;

      leaf name {
        type string;
        description
          &quot;An arbitrary string which uniquely identifies the
           Exporting Process.&quot;;
      }

      leaf enabled {
        type boolean;
        default &quot;true&quot;;
        description
          &quot;If true, this Exporting Process is enabled for
           exporting.&quot;;
      }

      uses exporting-process-parameters;

      leaf exporting-process-id {
        type uint32;
        config false;
        description
          &quot;The identifier of the Exporting Process.  This parameter
           corresponds to the Information Element exportingProcessId.
           Its occurrence helps to associate Exporting Process
           parameters with Exporing Process statistics exported by
           the Exporting Device using the Exporting Process
           Reliability Statistics Template as defined by the IPFIX
           protocol specification.&quot;;
        reference
          &quot;RFC 7011, Section 4.3; IANA registry for IPFIX
           Entities, http://www.iana.org/assignments/ipfix.&quot;;
      }
    }

    container data-export {
      description
        &quot;Container for data export nodes.&quot;;

      list template {
        key name;
        description
          &quot;List of data templates of the Exporting Device.&quot;;

        leaf name {
          type string;
          description
            &quot;An arbitrary string which uniquely identifies the
             data template.&quot;;
        }

        leaf enabled {
          type boolean;
          default &quot;true&quot;;
          description
            &quot;If true, this template is enabled and the specified
             data is able to be exported.&quot;;
        }

        leaf export-interval {
          type uint32;
          units &quot;seconds&quot;;
          description
            &quot;This parameter configures the interval (in seconds) for
             periodical export of Flow Records.

             If not configured by the user, the Exporting Device
             sets this parameter.&quot;;
        }

        uses data-template-parameters;

        leaf-list exporting-process {
          if-feature exporter;
          type leafref {
            path &quot;/ipfix-data-export&quot;
               + &quot;/exporting-process/name&quot;;
          }
          description
            &quot;Records are exported by all Exporting Processes in the
             list.&quot;;
        }

        choice resource-identifier {
          description
            &quot;Method to select the resources from which the records
             are to be exported.

             Note that it is expected that other methods be available.
             Those methods can augment this choice.&quot;;

          case resource-instance {
            leaf-list resource-instance {
              type resource;
              description
                &quot;Records are sourced from all the resources in
                 this list.&quot;;
            }
          }
        }

        leaf data-records {
          type yang:counter64;
          units &quot;Data Records&quot;;
          config false;
          description
            &quot;The number of Data Records generated for this sampling
             template.

             Discontinuities in the value of this counter can occur
             at re-initialization of the management system, and at
             other times as indicated by the value of Discontinuity
             Time.&quot;;
        }

        leaf discontinuity-time {
          type yang:date-and-time;
          config false;
          description
            &quot;Timestamp of the most recent occasion at which the
             counter data records suffered a discontinuity.&quot;;
        }
      }
    }
  }
}

</sourcecode>

<artwork>&lt;CODE ENDS&gt;
</artwork>
</section>
</section>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>
<t>This document registers 1 URI in the &quot;IETF XML Registry&quot;. <xref target="RFC3688"></xref>. Following the format in RFC 3688, the following registrations have been made.</t>

<artwork>URI: urn:ietf:params:xml:ns:yang:ietf-ipfix-data-export
Registrant Contact: The IESG.
XML: N/A, the requested URI is an XML namespace.
</artwork>
<t>This document registers 1 YANG module in the &quot;YANG Module Names&quot; registry.  Following the format in <xref target="RFC7950"></xref>, the following have been registered.</t>

<artwork>Name: ietf-ipfix-data-export
Namespace: urn:ietf:params:xml:ns:yang:ietf-ipfix-data-export
Prefix: ipfixde
Reference: RFC XXXX: YANG Data Model for the IP Flow Information
           Export (IPFIX) Protocol Data Export
</artwork>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>
<t>The YANG module specified in this document defines a schema for data that is designed to be accessed via network management protocols such as NETCONF <xref target="RFC6241"></xref> or RESTCONF <xref target="RFC8040"></xref>.  The lowest NETCONF layer is the secure transport layer, and the mandatory-to-implement secure transport is Secure Shell (SSH) <xref target="RFC6242"></xref>.  The lowest RESTCONF layer is HTTPS, and the mandatory-to-implement secure transport is TLS <xref target="RFC8446"></xref>.</t>
<t>The NETCONF access control model <xref target="RFC8341"></xref> provides the means to restrict access for particular NETCONF or RESTCONF users to a preconfigured subset of all available NETCONF or RESTCONF protocol operations and content.</t>
<t>There are a number of data nodes defined in this YANG module that are writable/creatable/deletable (i.e., config true, which is the default).  These data nodes may be considered sensitive or vulnerable in some network environments.  Write operations (e.g., NETCONF edit-config) to these data nodes without proper protection can have a negative effect on network operations.  These are the subtrees and data nodes and their sensitivity/vulnerability:</t>

<ul>
<li><t>/ipfix-data-export/exporting-process:  The configuration parameters in this subtree specify to which Collectors Data Records are exported. Write access to this subtree allows exporting potentially sensitive information to illegitimate Collectors. Furthermore, TLS parameters can be changed, which may affect the mutual authentication between Exporters and Collectors as well as the encrypted transport of the data.</t>
</li>
<li><t>/ipfix-data-export/data-export/template: The configuration parameters in this subtree specify the fields included in the bulk data export. Write access to this subtree allows adding fields which may cause export of sensitive configuration and/or statistics.</t>
</li>
</ul>
<t>Some of the readable data nodes in this YANG module may be considered sensitive or vulnerable in some network environments. It is thus important to control read access (e.g., via get, get-config, or notification) to these data nodes. These are the subtrees and data nodes and their sensitivity/vulnerability:</t>

<ul>
<li><t>/ipfix-data-export/exporting-process: Parameters in this subtree may be sensitive because they reveal information about the network infrastructure and the outgoing IPFIX Transport Sessions. For example, it discloses the IP addresses of Collectors as well as the deployed TLS configuration, which may facilitate the interception of outgoing IPFIX Messages.</t>
</li>
<li><t>/ipfix-data-export/data-export/template: Parameters in this subtree may be sensitive because they reveal information about the Monitoring Device itself and the observed traffic. For example, the counters data-records allow inferring the number of packets.</t>
</li>
</ul>
</section>

<section anchor="acknowledgments"><name>Acknowledgments</name>
<t>The authors would like to thank Joey Boyd and William Lupton for their contributions towards creation of this document and associated YANG data models.</t>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-netconf-tls-client-server.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3688.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5476.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5610.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6991.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7011.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7950.xml"/>
</references>
<references><name>Informative References</name>
<reference anchor="IANA-IPFIX" target="https://www.iana.org/assignments/ipfix">
  <front>
    <title>IP Flow Information Export (IPFIX) Entities</title>
    <author>
      <organization>IANA</organization>
    </author>
    <date></date>
  </front>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5473.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6241.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6242.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8040.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8340.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8341.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml"/>
</references>

<section anchor="example-ietf-ipfix-data-export-usage"><name>Example: ietf-ipfix-data-export Usage</name>
<t>The configuration example configures a field-layout template to
export Ethernet statistics from eth0 and eth1.</t>

<sourcecode type="xml">&lt;ipfix-data-export xmlns=&quot;urn:ietf:params:xml:ns:yang:ietf-ipfix-data-export&quot;&gt;
  &lt;exporting-process&gt;
    &lt;name&gt;ipfix data exporter&lt;/name&gt;
    &lt;enabled&gt;true&lt;/enabled&gt;
    &lt;destination&gt;
      &lt;name&gt;ipfix-collector&lt;/name&gt;
      &lt;exporter&gt;
        &lt;source&gt;
          &lt;source-address&gt;192.100.2.1&lt;/source-address&gt;
        &lt;/source&gt;
        &lt;destination&gt;
          &lt;destination-address&gt;proxy1.sys.com&lt;/destination-address&gt;
        &lt;/destination&gt;
      &lt;/exporter&gt;
    &lt;/destination&gt;
    &lt;options&gt;
      &lt;name&gt;Options 1&lt;/name&gt;
      &lt;options-type&gt;extended-type-information&lt;/options-type&gt;
      &lt;options-timeout&gt;0&lt;/options-timeout&gt;
    &lt;/options&gt;
  &lt;/exporting-process&gt;
&lt;/ipfix-data-export&gt;
</sourcecode>
</section>

<section anchor="tree-diagrams-1"><name>Tree diagrams</name>

<section anchor="ietf-ipfix-data-export-1"><name>ietf-ipfix-data-export</name>
<t>The complete tree diagram for ietf-ipfix-bulk-data-export:</t>

<sourcecode type="tree">module: ietf-ipfix-data-export
  +--rw ipfix-data-export
     +--rw exporting-process* [name] {exporter}?
     |  +--rw name                    string
     |  +--rw enabled?                boolean
     |  +--rw export-mode?            identityref
     |  +--rw destination* [name]
     |  |  +--rw name        string
     |  |  +--rw exporter
     |  |     +--rw ipfix-version?        uint16
     |  |     +--rw source
     |  |     |  +--rw (source-method)?
     |  |     |     +--:(interface-ref)
     |  |     |     |  +--rw interface-ref?    if:interface-ref
     |  |     |     +--:(if-name) {if-mib}?
     |  |     |     |  +--rw if-name?          string
     |  |     |     +--:(source-address)
     |  |     |        +--rw source-address?   inet:host
     |  |     +--rw destination
     |  |     |  +--rw (destination-method)
     |  |     |     +--:(destination-address)
     |  |     |        +--rw destination-address?   inet:host
     |  |     +--rw destination-port?     inet:port-number
     |  |     +--rw send-buffer-size?     uint32
     |  |     +--rw rate-limit?           uint32
     |  |     +--rw connection-timeout?   uint32
     |  |     +--rw retry-schedule?       uint32
     |  |     +--rw security
     |  |     +--ro transport-session
     |  |        +--ro ipfix-version?                          uint16
     |  |        +--ro source-address?                         inet:host
     |  |        +--ro destination-address?                    inet:host
     |  |        +--ro source-port?                            inet:port-number
     |  |        +--ro destination-port?                       inet:port-number
     |  |        +--ro status?                                 transport-session-status
     |  |        +--ro rate?                                   yang:gauge32
     |  |        +--ro bytes?                                  yang:counter64
     |  |        +--ro messages?                               yang:counter64
     |  |        +--ro discarded-messages?                     yang:counter64
     |  |        +--ro records?                                yang:counter64
     |  |        +--ro templates?                              yang:counter32
     |  |        +--ro options-templates?                      yang:counter32
     |  |        +--ro transport-session-start-time?           yang:date-and-time
     |  |        +--ro transport-session-discontinuity-time?   yang:date-and-time
     |  |        +--ro template* [name]
     |  |           +--ro name                           string
     |  |           +--ro observation-domain-id?         uint32
     |  |           +--ro template-id?                   uint16
     |  |           +--ro set-id?                        uint16
     |  |           +--ro access-time?                   yang:date-and-time
     |  |           +--ro template-data-records?         yang:counter64
     |  |           +--ro template-discontinuity-time?   yang:date-and-time
     |  |           +--ro field* [name]
     |  |              +--ro name                    string
     |  |              +--ro ie-id?                  ie-id-type
     |  |              +--ro ie-length?              uint16
     |  |              +--ro ie-enterprise-number?   uint32
     |  |              +--ro is-scope?               empty
     |  +--rw options* [name]
     |  |  +--rw name               string
     |  |  +--rw options-type       identityref
     |  |  +--rw options-timeout?   uint32
     |  +--ro exporting-process-id?   uint32
     +--rw data-export
        +--rw template* [name]
           +--rw name                       string
           +--rw enabled?                   boolean
           +--rw export-interval?           uint32
           +--rw observation-domain-id?     uint32
           +--rw field-layout
           |  +--rw field* [name]
           |     +--rw name                    string
           |     +--rw (identifier)
           |     |  +--:(ie-name)
           |     |  |  +--rw ie-name?          string
           |     |  +--:(ie-id)
           |     |     +--rw ie-id?            ie-id-type
           |     +--rw ie-length?              uint16
           |     +--rw ie-enterprise-number?   uint32
           +--rw exporting-process*         -&gt; /ipfix-data-export/exporting-process/name {exporter}?
           +--rw (resource-identifier)?
           |  +--:(resource-instance)
           |     +--rw resource-instance*   resource
           +--ro data-records?              yang:counter64
           +--ro discontinuity-time?        yang:date-and-time
</sourcecode>
</section>
</section>

</back>

</rfc>
