<?xml version='1.0' encoding='utf-8'?> version="1.0" encoding="utf-8"?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC1724 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1724.xml">
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2453 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2453.xml">
<!ENTITY RFC2080 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2080.xml">
<!ENTITY RFC3688 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3688.xml">
<!ENTITY RFC6241 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6241.xml">
<!ENTITY RFC6242 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6242.xml">
<!ENTITY RFC6991 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6991.xml">
<!ENTITY RFC7950 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7950.xml">
<!ENTITY RFC8040 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8040.xml">
<!ENTITY RFC8177 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8177.xml">
<!ENTITY RFC8341 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8341.xml">
<!ENTITY RFC8342 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8342.xml">
<!ENTITY RFC8343 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8343.xml">
<!ENTITY RFC8344 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8344.xml">
<!ENTITY RFC8349 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8349.xml">
<!ENTITY RFC8446 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml">
<!ENTITY RFC7951 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7951.xml">
<!ENTITY RFC8340 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8340.xml">
<!ENTITY RFC8407 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8407.xml">
<!ENTITY I-D.ietf-netconf-subscribed-notifications SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-netconf-subscribed-notifications-26.xml">
<!ENTITY I-D.ietf-netconf-yang-push SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-netconf-yang-push-25.xml">
<!ENTITY I-D.ietf-bfd-yang SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-bfd-yang-17.xml">
<!ENTITY I-D.ietf-isis-yang-isis-cfg SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-isis-yang-isis-cfg-35.xml">
<!ENTITY I-D.ietf-ospf-yang SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-ospf-yang-28.xml">
]> "rfc2629-xhtml.ent">

<rfc
xmlns:xi="http://www.w3.org/2001/XInclude"
submissionType="IETF" docName="draft-ietf-rtgwg-yang-rip-11"
category="std" ipr="trust200902">
consensus="true"
docName="draft-ietf-rtgwg-yang-rip-11"
number="8695"
ipr="trust200902"
obsoletes=""
updates=""
xml:lang="en"
sortRefs="false"
symRefs="true"
tocInclude="true"
version="3">

  <!-- xml2rfc v2v3 conversion 2.30.0 -->
  <!-- Generated by id2xml 1.5.0 on 2019-09-19T15:48:20Z -->
	<?rfc compact="yes"?>
	<?rfc text-list-symbols="o*+-"?>
	<?rfc subcompact="no"?>
	<?rfc sortrefs="no"?>
	<?rfc symrefs="yes"?>
	<?rfc strict="yes"?>
	<?rfc toc="yes"?>
  <front>
    <title abbrev="A YANG Data Model for Routing Informatio">A RIP">A YANG Data Model for the Routing Information Protocol (RIP)</title>
    <seriesInfo name="RFC" value="8695" />

    <author fullname="Xufeng Liu" initials="X." surname="Liu">
      <organization>Volta Networks</organization>
	<address><email>xufeng.liu.ietf@gmail.com</email>
      <address>
        <email>xufeng.liu.ietf@gmail.com</email>
      </address>
    </author>
    <author fullname="Prateek Sarda" initials="P." surname="Sarda">
      <organization>Ericsson</organization>
	<address><postal><street>Fern
      <address>
        <postal>
          <street>Fern Icon, Survey No 28 and 36/5, Doddanakundi Village</street>
	<street>Bangalore  Karnataka 560037</street>
	<street>India</street>
          <city>Bangalore</city>
          <region>Karnataka</region>
          <code>560037</code>
          <country>India</country>
        </postal>
        <email>prateek.sarda@ericsson.com</email>
      </address>
    </author>
    <author fullname="Vikram Choudhary" initials="V." surname="Choudhary">
      <organization>Individual</organization>
	<address><postal><street>Bangalore  560066</street>
	<street>India</street>
      <address>
        <postal>
          <city>Bangalore</city>
          <code>560066</code>
          <country>India</country>
        </postal>
        <email>vikschw@gmail.com</email>
      </address>
    </author>
    <date month="September" year="2019"/>
	<abstract><t> month="February" year="2020"/>

<keyword>YANG</keyword>
<keyword>RIP</keyword>
<keyword>RIPng</keyword>
<keyword>data model</keyword>
<keyword>ietf-rip</keyword>
<keyword>network management</keyword>
<keyword>routing</keyword>

    <abstract>
      <t>
   This document describes a data model for the management of the
   Routing Information Protocol (RIP).  Both RIP version 2 and RIPng are
   covered.  The data model includes definitions for configuration,
   operational state, and Remote Procedure Calls (RPCs).</t>
      <t>
   The YANG data model in this document conforms to the Network Management
   Datastore Architecture (NMDA).</t>
    </abstract>
  </front>
  <middle>
    <section title="Introduction" anchor="sect-1"><t> anchor="sect-1" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
   This document introduces a YANG <xref target="RFC7950"/> target="RFC7950" format="default"/> data model for the Routing
   Information Protocol (RIP) <xref target="RFC2453"/><xref target="RFC2080"/>. target="RFC2453" format="default"/><xref target="RFC2080" format="default"/>.  RIP was designed to
   work as an Interior Gateway Protocol (IGP) in moderate-size
   Autonomous Systems (AS).</t>
      <t>
   This YANG data model supports both RIP version 2 and RIPng.  RIP version 2
   (defined in <xref target="RFC2453"/>) target="RFC2453" format="default"/>) supports IPv4.  RIPng (defined in <xref target="RFC2080"/>) target="RFC2080" format="default"/>)
   supports IPv6.</t>
      <section title="Terminology" anchor="sect-1.1"><t> anchor="sect-1.1" numbered="true" toc="default">
        <name>Terminology</name>
        <t>
    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
    NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "OPTIONAL" "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP&nbsp;14 <xref target="RFC2119"/>.</t> target="RFC2119"/> <xref target="RFC8174"/>
    when, and only when, they appear in all capitals, as shown here.
        </t>
        <t>
   The following terms are defined in <xref target="RFC7950"/> target="RFC7950" format="default"/> and are not redefined
   here:</t>

	<t><list style="symbols">

        <t>augment</t>
	<t>data model</t>
	<t>data node</t>

	</list>
	</t>
        <ul spacing="normal">
          <li>augment</li>
          <li>data model</li>
          <li>data node</li>
        </ul>
      </section>
      <section title="Tree Diagrams" anchor="sect-1.2"><t> anchor="sect-1.2" numbered="true" toc="default">
        <name>Tree Diagrams</name>
        <t>
   A simplified graphical representation of the data model is used in
   this document.  The meaning of the symbols in these diagrams is
   defined in <xref target="RFC8340"/>.</t> target="RFC8340" format="default"/>.</t>
      </section>
      <section title="Prefixes anchor="sect-1.3" numbered="true" toc="default">
        <name>Prefixes in Data Node Names" anchor="sect-1.3"><t> Names</name>
        <t>
   In this document, names of data nodes, actions, and other data model
   objects are often used without a prefix, as long as it is clear from
   the context in which YANG module each name is defined.  Otherwise,
   names are prefixed using the standard prefix associated with the
   corresponding YANG module, as shown in Table 1.</t>

	<texttable title="Prefixes <xref target="tab-prefixes-and-corresponding-yang-modules" format="default"/>.</t>
        <table anchor="tab-prefixes-and-corresponding-yang-modules" align="center">
          <name>Prefixes and Corresponding YANG Modules" anchor="tab-prefixes-and-corresponding-yang-modules" style="full"><ttcol> Prefix</ttcol>
	<ttcol> YANG module</ttcol>
	<ttcol> Reference</ttcol>
	<c>yang</c>
	<c>ietf-yang-types</c>
	<c>[RFC6991]</c>
	<c>inet</c>
	<c>ietf-inet-types</c>
	<c>[RFC6991]</c>
	<c>if</c>
	<c>ietf-interfaces</c>
	<c>[RFC8343]</c>
	<c>ip</c>
	<c>ietf-ip</c>
	<c>[RFC8344]</c>
	<c>rt</c>
	<c>ietf-routing</c>
	<c>[RFC8349]</c>
	<c>bfd-types</c>
	<c>ietf-bfd-types</c>
	<c>[I-D.ietf-bfd-yang]</c>
	<c>isis</c>
	<c>ietf-isis</c>
	<c>[I-D.ietf-isis-yang-isis-cfg]</c>
	<c>key-chain</c>
	<c>ietf-key-chain</c>
	<c>[RFC8177]</c>
	<c>ospf</c>
	<c>ietf-ospf</c>
	<c>[I-D.ietf-ospf-yang]</c>
	</texttable> Modules</name>
          <thead>
            <tr>
              <th align="left">Prefix</th>
              <th align="left">YANG module</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">yang</td>
              <td align="left">ietf-yang-types</td>
              <td align="left"><xref target="RFC6991" format="default"/></td>
            </tr>
            <tr>
              <td align="left">inet</td>
              <td align="left">ietf-inet-types</td>
              <td align="left"><xref target="RFC6991" format="default"/></td>
            </tr>
            <tr>
              <td align="left">if</td>
              <td align="left">ietf-interfaces</td>
              <td align="left"><xref target="RFC8343" format="default"/></td>
            </tr>
            <tr>
              <td align="left">ip</td>
              <td align="left">ietf-ip</td>
              <td align="left"><xref target="RFC8344" format="default"/></td>
            </tr>
            <tr>
              <td align="left">rt</td>
              <td align="left">ietf-routing</td>
              <td align="left"><xref target="RFC8349" format="default"/></td>
            </tr>
            <tr>
              <td align="left">bfd-types</td>
              <td align="left">ietf-bfd-types</td>
              <td align="left"><xref target="I-D.ietf-bfd-yang" format="default"/></td>
            </tr>
            <tr>
              <td align="left">isis</td>
              <td align="left">ietf-isis</td>
              <td align="left"><xref target="I-D.ietf-isis-yang-isis-cfg" format="default"/></td>
            </tr>
            <tr>
              <td align="left">key-chain</td>
              <td align="left">ietf-key-chain</td>
              <td align="left"><xref target="RFC8177" format="default"/></td>
            </tr>
            <tr>
              <td align="left">ospf</td>
              <td align="left">ietf-ospf</td>
              <td align="left"><xref target="I-D.ietf-ospf-yang" format="default"/></td>
            </tr>
          </tbody>
        </table>
      </section>
    </section>
    <section title="Design anchor="sect-2" numbered="true" toc="default">
      <name>Design of the Data Model" anchor="sect-2"><section title="Scope Model</name>

      <section anchor="sect-2.1" numbered="true" toc="default">
        <name>Scope of the Model" anchor="sect-2.1"><t> Data Model</name>
        <t>
   The data model covers RIP version 2 <xref target="RFC2453"/> target="RFC2453" format="default"/> and RIPng <xref target="RFC2080"/> target="RFC2080" format="default"/>
   protocols.  The model is designed to be implemented on a device where
   RIP version 2 or RIPng is implemented, and can be used to:</t>

	<t><list style="symbols">

        <t>Configure
        <ul spacing="normal">
          <li>Configure the RIP version 2 or RIPng protocol.</t>
	<t>Manage protocol.</li>
          <li>Manage the protocol operational behaviors.</t>
	<t>Retrieve behaviors.</li>
          <li>Retrieve the protocol operational status.</t>

	</list>
	</t> status.</li>
        </ul>
        <t>
   The capabilities describe described in <xref target="RFC1724"/> target="RFC1724" format="default"/> are covered.</t>
      </section>
      <section title="Relation with anchor="sect-2.2" numbered="true" toc="default">
        <name>Relation to the Core Routing Framework" anchor="sect-2.2"><t> Framework</name>
        <t>
   This data model augments the core routing data model "ietf-routing"
   specified in <xref target="RFC8349"/>.</t>

	<figure><artwork><![CDATA[ target="RFC8349" format="default"/>.</t>

        <sourcecode type="yangtree"><![CDATA[
  +--rw routing
     +--rw router-id?
     +--rw control-plane-protocols
     |  +--rw control-plane-protocol* [type name]
     |     +--rw type
     |     +--rw name
     |     +--rw rip     <= Augmented by this Model
                 ...
]]></artwork>
	</figure>
]]></sourcecode>
        <t>
   The "rip" container instantiates a RIP protocol entity that supports
   RIP version 2 or RIPng.  Depending on the implementation of "ietf-routing", a RIP instance MAY <bcp14>MAY</bcp14> belong to a logical router or network
   instance.</t>
      </section>
      <section title="Protocol Configuration" anchor="sect-2.3"><t> anchor="sect-2.3" numbered="true" toc="default">
        <name>Protocol Configuration</name>
        <t>
   The data model structure for the protocol configuration is as shown below:</t>

	<figure><artwork><![CDATA[

        <sourcecode type="yangtree"><![CDATA[
  augment /rt:routing/rt:control-plane-protocols/
  rt:control-plane-protocol:
    +--rw rip
       +--rw <per instance configuration>
       +--rw interface* [interface]
          +--rw interface                  if:interface-ref
          +--rw <per interface configuration>
          +--rw neighbors {explicit-neighbors}?
          |  +--rw neighbor* [address]
          |     +--rw address    inet:ip-address
          |     +--rw <per neighbor configuration>

]]></artwork>
	</figure>
]]></sourcecode>
        <t>The data model allows to configure the configuration of the following protocol entities:</t>

	<t><list style="symbols">

	<t>Protocol
        <ul spacing="normal">
          <li>Protocol instance (RIP version 2 or RIPng)</t>
	<t>Interface</t>
	<t>Neighbor</t>

	</list>
	</t> RIPng)</li>
          <li>Interface</li>
          <li>Neighbor</li>
        </ul>
      </section>
      <section title="Protocol States" anchor="sect-2.4"><t> anchor="sect-2.4" numbered="true" toc="default">
        <name>Protocol States</name>
        <t>
   The data model structure for the protocol states is as shown below:</t>

	<figure><artwork><![CDATA[

        <sourcecode type="yangtree"><![CDATA[
  augment /rt:routing/rt:control-plane-protocols/
  rt:control-plane-protocol:
    +--rw rip
       +--ro <per instance operational states>
       +--rw interface* [interface]
       |  +--rw interface                  if:interface-ref
       |  +--ro <per instance operational states>
       |  +--ro statistics {interface-statistics}?
       |     +--ro <per instance statistics>
       +--ro ipv4
       |  +--ro neighbors
       |  |  +--ro neighbor* [ipv4-address]
       |  |     +--ro <per neighbor IPv4 operational states>
       |  +--ro routes
       |     +--ro route* [ipv4-prefix]
       |        +--ro <IPv4 RIP route states>
       +--ro ipv6
       |  +--ro neighbors
       |  |  +--ro neighbor* [ipv6-address]
       |  |     +--ro <per neighbor IPv6 operational states>
       |  +--ro routes
       |     +--ro route* [ipv6-prefix]
       |        +--ro ipv6-prefix                    inet:ipv6-prefix
       |        +--ro <IPv4 RIP route states>
       +--ro statistics {global-statistics}?
          +--ro <per instance statistics>
]]></artwork>
	</figure>
]]></sourcecode>
        <t>
   This model conforms to the Network Management Datastore Architecture
   (NMDA) <xref target="RFC8342"/>. target="RFC8342" format="default"/>.  The operational state data is combined with the
   associated configuration data in the same hierarchy <xref target="RFC8407"/>. target="RFC8407" format="default"/>.  When
   protocol states are retrieved from the NMDA operational state
   datastore, the returned states cover all "config true" (rw) and
   "config false" (ro) nodes defined in the schema.</t>
        <t>The model allows to retrieve the retrieval of protocol states at the following levels:</t>

	<t><list style="symbols">

        <t>Protocol
        <ul spacing="normal">
          <li>Protocol instance (RIP version 2 or RIPng)</t>
	<t>Interface</t>
	<t>Neighbor</t>
	<t>Route</t>

	</list>
	</t> RIPng)</li>
          <li>Interface</li>
          <li>Neighbor</li>
          <li>Route</li>
        </ul>
      </section>
      <section title="RPC Operations" anchor="sect-2.5"><t> anchor="sect-2.5" numbered="true" toc="default">
        <name>RPC Operations</name>
        <t>
   This model defines one RPC "clear-rip-route" that can be used to
   clear RIP routes from the routing table.</t>
      </section>
      <section title="Notifications" anchor="sect-2.6"><t> anchor="sect-2.6" numbered="true" toc="default">
        <name>Notifications</name>
        <t>
   This model does not define RIP specific RIP-specific notifications.  To enable
   notifications, the mechanism mechanisms defined in
   [I-D.ietf-netconf-subscribed-notifications]
   <xref target="RFC8639" format="default"/> and
   [I-D.ietf-netconf-yang-push]
   <xref target="RFC8641" format="default"/> can be used.  This mechanism currently
   allows the user to: to do the following: </t>

	<t><list style="symbols">

        <t>Subscribe
        <ul spacing="normal">
          <li>Subscribe to notifications on a per client basis.</t>
	<t>Specify per-client basis.</li>
          <li>Specify subtree filters or xpath XML Path Language (XPath) filters so that only interested
        contents will be sent.</t>
	<t>Specify sent.</li>
          <li>Specify either periodic or on-demand notifications.</t>

	</list>
	</t> notifications.</li>
        </ul>
      </section>
      <section title="Optional Features" anchor="sect-2.7"><t> anchor="sect-2.7" numbered="true" toc="default">
        <name>Optional Features</name>
        <t>
   This model defines several features that are beyond the basic RIP
   configuration
   configuration, and it is the responsibility of each vendor to decide
   whether to support a given feature on a device.</t>
      </section>
    </section>
    <section title="Tree Structure" anchor="sect-3"><t> anchor="sect-3" numbered="true" toc="default">
      <name>Tree Structure</name>
      <t>
   This document defines the YANG module "ietf-rip", which has the
   following tree structure:</t>

	<figure><artwork><![CDATA[

        <sourcecode type="yangtree"><![CDATA[
module: ietf-rip
  augment /rt:routing/rt:control-plane-protocols
/rt:control-plane-protocol:
    +--rw rip
       +--rw originate-default-route
       |  +--rw enabled?        boolean
       |  +--rw route-policy?   route-policy-ref
       +--rw default-metric?               uint8
       +--rw distance?                     uint8
       +--rw triggered-update-threshold?   uint8
       +--rw maximum-paths?                uint8
       +--rw output-delay?                 uint8
       +--rw distribute-list* [prefix-set-name direction]
       |  +--rw prefix-set-name    prefix-set-ref
       |  +--rw direction          enumeration
       |  +--rw if-name?           if:interface-ref
       +--rw redistribute
       |  +--rw bgp* [asn]
       |  |  +--rw asn             inet:as-number
       |  |  +--rw metric?         uint8
       |  |  +--rw route-policy?   route-policy-ref
       |  +--rw cg-nat!
       |  |  +--rw metric?         uint8
       |  |  +--rw route-policy?   route-policy-ref
       |  +--rw connected!
       |  |  +--rw metric?         uint8
       |  |  +--rw route-policy?   route-policy-ref
       |  +--rw ipsec!
       |  |  +--rw metric?         uint8
       |  |  +--rw route-policy?   route-policy-ref
       |  +--rw isis* [instance]
       |  |  +--rw instance
       |  |  |       -> ../../../../../rt:control-plane-protocol/name
       |  |  +--rw level?          enumeration
       |  |  +--rw metric?         uint8
       |  |  +--rw route-policy?   route-policy-ref
       |  +--rw nat!
       |  |  +--rw metric?         uint8
       |  |  +--rw route-policy?   route-policy-ref
       |  +--rw ospfv2* [instance]
       |  |  +--rw instance
       |  |  |       -> ../../../../../rt:control-plane-protocol/name
       |  |  +--rw route-type?     ospf:route-type
       |  |  +--rw metric?         uint8
       |  |  +--rw route-policy?   route-policy-ref
       |  +--rw ospfv3* [instance]
       |  |  +--rw instance
       |  |  |       -> ../../../../../rt:control-plane-protocol/name
       |  |  +--rw route-type?     ospf:route-type
       |  |  +--rw metric?         uint8
       |  |  +--rw route-policy?   route-policy-ref
       |  +--rw ripv2* [instance]
       |  |  +--rw instance
       |  |  |       -> ../../../../../rt:control-plane-protocol/name
       |  |  +--rw metric?         uint8
       |  |  +--rw route-policy?   route-policy-ref
       |  +--rw ripng* [instance]
       |  |  +--rw instance
       |  |  |       -> ../../../../../rt:control-plane-protocol/name
       |  |  +--rw metric?         uint8
       |  |  +--rw route-policy?   route-policy-ref
       |  +--rw static!
       |     +--rw metric?         uint8
       |     +--rw route-policy?   route-policy-ref
       +--rw timers
       |  +--rw update-interval?     uint16
       |  +--rw invalid-interval?    uint16
       |  +--rw holddown-interval?   uint16
       |  +--rw flush-interval?      uint16
       +--rw interfaces
       |  +--rw interface* [interface]
       |     +--rw interface                  if:interface-ref
       |     +--rw authentication
       |     |  +--rw (auth-type-selection)?
       |     |     +--:(auth-key-chain)
       |     |     |  +--rw key-chain?
 key-chain:key-chain-ref
       |     |     +--:(auth-key)
       |     |        +--rw key?                string
       |     |        +--rw crypto-algorithm?   identityref
       |     +--rw bfd {bfd}?
       |     |  +--rw enable?                     boolean
       |     |  +--rw local-multiplier?           multiplier
       |     |  +--rw (interval-config-type)?
       |     |     +--:(tx-rx-intervals)
       |     |     |  +--rw desired-min-tx-interval?    uint32
       |     |     |  +--rw required-min-rx-interval?   uint32
       |     |     +--:(single-interval)
       |     |        +--rw min-interval?               uint32
       |     +--rw cost?                      uint8
       |     +--rw neighbors {explicit-neighbors}?
       |     |  +--rw neighbor* [address]
       |     |     +--rw address    inet:ip-address
       |     +--rw no-listen?                 empty
       |     +--rw originate-default-route
       |     |  +--rw enabled?        boolean
       |     |  +--rw route-policy?   route-policy-ref
       |     +--rw passive?                   empty
       |     +--rw split-horizon?             enumeration
       |     +--rw summary-address
       |     |  +--rw address?   inet:ip-prefix
       |     |  +--rw metric?    uint8
       |     +--rw timers
       |     |  +--rw update-interval?     uint16
       |     |  +--rw invalid-interval?    uint16
       |     |  +--rw holddown-interval?   uint16
       |     |  +--rw flush-interval?      uint16
       |     +--ro oper-status?               enumeration
       |     +--ro next-full-update?          uint32
       |     +--ro valid-address?             boolean
       |     +--ro statistics {interface-statistics}?
       |        +--ro discontinuity-time?   yang:date-and-time
       |        +--ro bad-packets-rcvd?     yang:counter32
       |        +--ro bad-routes-rcvd?      yang:counter32
       |        +--ro updates-sent?         yang:counter32
       +--ro next-triggered-update?        uint32
       +--ro num-of-routes?                uint32
       +--ro ipv4
       |  +--ro neighbors
       |  |  +--ro neighbor* [ipv4-address]
       |  |     +--ro ipv4-address        inet:ipv4-address
       |  |     +--ro last-update?        yang:date-and-time
       |  |     +--ro bad-packets-rcvd?   yang:counter32
       |  |     +--ro bad-routes-rcvd?    yang:counter32
       |  +--ro routes
       |     +--ro route* [ipv4-prefix]
       |        +--ro ipv4-prefix
 inet:ipv4-prefix
       |        +--ro next-hop?
 inet:ipv4-address
       |        +--ro interface?
 if:interface-ref
       |        +--ro redistributed?                  boolean
       |        +--ro route-type?                     enumeration
       |        +--ro metric?                         uint8
       |        +--ro expire-time?                    uint16
       |        +--ro deleted?                        boolean
       |        +--ro holddown?                       boolean
       |        +--ro need-triggered-update?          boolean
       |        +--ro inactive?                       boolean
       |        +--ro flush-expire-before-holddown?   boolean
       +--ro ipv6
       |  +--ro neighbors
       |  |  +--ro neighbor* [ipv6-address]
       |  |     +--ro ipv6-address        inet:ipv6-address
       |  |     +--ro last-update?        yang:date-and-time
       |  |     +--ro bad-packets-rcvd?   yang:counter32
       |  |     +--ro bad-routes-rcvd?    yang:counter32
       |  +--ro routes
       |     +--ro route* [ipv6-prefix]
       |        +--ro ipv6-prefix
 inet:ipv6-prefix
       |        +--ro next-hop?
 inet:ipv6-address
       |        +--ro interface?
 if:interface-ref
       |        +--ro redistributed?                  boolean
       |        +--ro route-type?                     enumeration
       |        +--ro metric?                         uint8
       |        +--ro expire-time?                    uint16
       |        +--ro deleted?                        boolean
       |        +--ro holddown?                       boolean
       |        +--ro need-triggered-update?          boolean
       |        +--ro inactive?                       boolean
       |        +--ro flush-expire-before-holddown?   boolean
       +--ro statistics {global-statistics}?
          +--ro discontinuity-time?   yang:date-and-time
          +--ro requests-rcvd?        yang:counter32
          +--ro requests-sent?        yang:counter32
          +--ro responses-rcvd?       yang:counter32
          +--ro responses-sent?       yang:counter32

  rpcs:
    +---x clear-rip-route
       +---w input
          +---w rip-instance?   leafref
]]></artwork>
	</figure>
]]></sourcecode>
    </section>
    <section title="YANG Module" anchor="sect-4"><figure><artwork><![CDATA[
<CODE BEGINS> file "ietf-rip@2018-02-03.yang" anchor="sect-4" numbered="true" toc="default">
      <name>YANG Module</name>

      <sourcecode name="ietf-rip@2020-02-20.yang" type="yang"
		  markers="true"><![CDATA[
module ietf-rip {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-rip";
  prefix rip;

  import ietf-inet-types {
    prefix "inet"; inet;
  }
  import ietf-yang-types {
    prefix "yang"; yang;
  }
  import ietf-interfaces {
    prefix "if"; if;
  }
  import ietf-ip {
    prefix "ip"; ip;
  }
  import ietf-routing {
    prefix "rt"; rt;
  }
  import ietf-key-chain {
    prefix "key-chain"; key-chain;
  }
  import ietf-bfd-types {
    prefix "bfd-types"; bfd-types;
  }
  import ietf-ospf {
    prefix "ospf"; ospf;
  }
  import ietf-isis {
    prefix "isis"; isis;
  }

  organization
    "IETF Routing Area Working Group (rtgwg)";
  contact
    "WG Web:   <http://tools.ietf.org/wg/rgtwg/>   <https://datatracker.ietf.org/wg/rtgwg/>
     WG List:  <mailto:rgtwg@ietf.org>

     Editor:   Xufeng Liu
               <mailto:xufeng_liu@jabil.com>
               <mailto:xufeng.liu.ietf@gmail.com>

     Editor:   Prateek Sarda
               <mailto:prateek.sarda@ericsson.com>

     Editor:   Vikram Choudhary
               <mailto:vikschw@gmail.com>";
  description
    "This YANG module defines a model for managing Routing
     Information Protocol (RIP), including RIP version 2 and RIPng.

     Copyright (c) 2018 2020 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
     (http://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX; 8695; see the
     RFC itself for full legal notices.";

  revision 2018-02-03 2020-02-20 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: 8695: A YANG Data Model for Routing Information Protocol
       (RIP).
       RFC 2453: RIP Version 2.
       RFC 2080: RIPng for IPv6.
       RFC 1724: RIP Version 2 MIB Extension.";
  }

  /*
   * Features
   */

  feature bfd {
    description
      "This feature indicates that the RIP implementation on the
       system supports BFD (Bidirectional Forwarding Detection).";
  }

  feature explicit-neighbors {
    description
      "This feature indicates that the system supports explicit
       neighbor configuration on a RIP interface.";
  }

  feature global-statistics {
    description
      "This feature indicates that the system supports collecting
       global statistic statistics data related to RIP.";
  }

  feature interface-statistics {
    description
      "This feature indicates that the system supports collecting
       per-interface statistic statistics data related to RIP.";
  }

  /*
   * Typedefs
   */

  typedef prefix-set-ref {
    type string;
    description
      "A type for a reference to a prefix set.
       The string value is the name identifier for uniquely
       identifying the referenced prefix set, which contains a list
       of prefixes that a routing policy can applied.  The definition
       of such a prefix set is outside the scope of this document.";
  }

  typedef route-policy-ref {
    type string;
    description
      "A type for a reference to a route policy.
       The string value is the name identifier for uniquely
       identifying the referenced routing policy, which contains one
       or more policy rules that can be used for a routing decision.
       The definition of such a routing policy is outside the scope
       of this document.";
  }

  /*
   * Identities
   */

  identity rip {
    base rt:routing-protocol;
    description
      "Identity for the RIP routing protocol."; Routing Information Protocol.";
  }

  identity ripv2 {
    base rip:rip;
    description
      "Identity for RIPv2 (RIP version 2).";
  }

  identity ripng {
    base rip:rip;
    description
      "Identity for RIPng.";
  }

  /*
   * Groupings
   */

  grouping originate-default-route-container {
    description
      "Containing
      "Container for settings on whether to originate the default
       route in RIP routing instance.";
    container originate-default-route {
      description
        "Injects the default route into the RIP (RIPv2 or RIPng)
         routing instance.";
      leaf enabled {
        type boolean;
        default false; "false";
        description
          "'true' if originating default route is enabled.";
      }
      leaf route-policy {
        type route-policy-ref;
        description
          "The conditions of the route policy are applied to the
           default route.";
      }
    }
  }

  grouping redistribute-container {
    description
      "Container of redistribute attributes.";
    container redistribute {
      description
        "Redistributes routes learned from other routing protocols
         into the RIP routing instance.";
      list bgp {
        key "asn";
        description
          "Redistributes routes from the specified BGP (Border
           Gateway Protocol) autonomous system (AS) into the RIP
           routing instance.";
        leaf asn {
          type inet:as-number;
          description
            "BGP autonomous system (AS) number.";
        }
        uses redistribute-route-policy-attributes;
      }
      container cg-nat {
        presence "Present if Carrier Grade Carrier-Grade Network Address
                  Translation (CGNAT) routes are redistributed.";
        description
          "Carrier Grade
          "Carrier-Grade Network Address Translation (CGNAT)
           routes.";
        uses redistribute-route-policy-attributes;
      }
      container connected {
        presence "Present if directly attached network routes are
                  redistributed.";
        description
          "Redistributes directly attached networks into the RIP
           routing instance.";
        uses redistribute-route-policy-attributes;
      }
      container ipsec {
        presence "Present if IP security routing instance routes
                  are redistributed.";
        description
          "Redistributes routes from the IP security routing
           instance into the RIP routing instance.";
        uses redistribute-route-policy-attributes;
      }
      list isis {
        key "instance";
        description
          "Redistributes IS-IS routes.";
        leaf instance {
          type leafref {
            path "../../../../../rt:control-plane-protocol/rt:name";
          }
          must "derived-from-or-self("
             + "../../../../../rt:control-plane-protocol"
             + "[rt:name = current()]/rt:type, 'isis:isis')" {
            description
              "The type of the routing protocol must be 'isis'"; 'isis'.";
          }
          description
            "Redistributes routes from the specified IS-IS routing
             instance into the RIP routing instance.";
        }
        leaf level {
          type enumeration {
            enum 1 {
              description
                "IS-IS level 1 routes.";
            }
            enum 2 {
              description
                "IS-IS level 2 routes.";
            }
            enum 1-2 {
              description
                "IS-IS level 1-2 routes.";
            }
          }
          description
            "IS-IS level.";
        }
        uses redistribute-route-policy-attributes;
      }
      container nat {
        presence "Present if Network Address Translation (NAT) routes
                  are redistributed.";
        description
          "Redistributes Network Address Translation (NAT)
           routes into the RIP routing instance.";
        uses redistribute-route-policy-attributes;
      }
      list ospfv2 {
        when "derived-from-or-self(../../../rt:type, 'rip:ripv2')" {
          description
            "Applicable to RIPv2.";
        }
        key "instance";
        description
          "Redistributes routes from the specified OSPFv2 routing
           instance into the RIPv2 routing instance.";
        leaf instance {
          type leafref {
            path "../../../../../rt:control-plane-protocol/rt:name";
          }
          must "derived-from-or-self("
             + "../../../../../rt:control-plane-protocol"
             + "[rt:name = current()]/rt:type, 'ospf:ospfv2')" {
            description
              "The type of the routing protocol must be 'ospfv2'"; 'ospfv2'.";
          }
          description
            "OSPFv2 instance ID. Redistributes routes from the
             specified OSPFv2 routing instance into the RIPv2 routing
             instance. ";
             instance.";
        }
        leaf route-type {
          type ospf:route-type;
          description
            "Redistributes only those OSPFv2 routes matching the
             specified route type into the RIPv2 routing instance.";
        }
        uses redistribute-route-policy-attributes;
      }
      list ospfv3 {
        when "derived-from-or-self(../../../rt:type, 'rip:ripng')" {
          description
            "Applicable to RIPng.";
        }
        key "instance";
        description
          "Redistributes routes from the specified OSPFv3 routing
           instance into the RIPng routing instance.";
        leaf instance {
          type leafref {
            path "../../../../../rt:control-plane-protocol/rt:name";
          }
          must "derived-from-or-self("
             + "../../../../../rt:control-plane-protocol"
             + "[rt:name = current()]/rt:type, 'ospf:ospfv3')" {
            description
              "The type of the routing protocol must be 'ospfv3'"; 'ospfv3'.";
          }
          description
            "OSPFv3 instance ID. Redistributes routes from the
             specified OSPFv3 routing instance into the RIPng routing
             instance. ";
             instance.";
        }
        leaf route-type {
          type ospf:route-type;
          description
            "Redistributes only those OSPFv3 routes matching the
             specified route type into the RIPng routing instance.";
        }
        uses redistribute-route-policy-attributes;
      }
      list ripv2 {
        when "derived-from-or-self(../../../rt:type, 'rip:ripv2')" {
          description
            "Applicable to RIPv2.";
        }
        key "instance";
        description
          "Redistributes routes from another RIPv2 routing instance
           into the current RIPv2 routing instance.";
        leaf instance {
          type leafref {
            path "../../../../../rt:control-plane-protocol/rt:name";
          }
          must "derived-from-or-self("
             + "../../../../../rt:control-plane-protocol"
             + "[rt:name = current()]/rt:type, 'rip:ripv2')" {
            description
              "The type of the routing protocol must be 'ripv2'"; 'ripv2'.";
          }
          description
            "Redistributes routes from the specified RIPv2 routing
             instance into the RIPv2 routing instance.";
        }
        uses redistribute-route-policy-attributes;
      }
      list ripng {
        when "derived-from-or-self(../../../rt:type, 'rip:ripng')" {
          description
            "Applicable to RIPng.";
        }
        key "instance";
        description
          "Redistributes routes from another RIPng routing instance
           into the current RIPng routing instance.";
        leaf instance {
          type leafref {
            path "../../../../../rt:control-plane-protocol/rt:name";
          }
          must "derived-from-or-self("
             + "../../../../../rt:control-plane-protocol"
             + "[rt:name = current()]/rt:type, 'rip:ripng')" {
            description
              "The type of the routing protocol must be 'ripng'"; 'ripng'.";
          }
          description
            "Redistributes routes from the specified RIPng routing
             instance into the RIPng routing instance.";
        }
        uses redistribute-route-policy-attributes;
      }
      container static {
        presence "Present if redistributing static routes.";
        description
          "Redistributes static routes into the RIP routing
           instance.";
        uses redistribute-route-policy-attributes;
      }
    }
    // redistribute
  }
  // redistribute-container

  grouping redistribute-route-policy-attributes {
    description
      "Attributes for redistributing a route policy.";
    leaf metric {
      type uint8 {
        range 0..16; "0..16";
      }
      description
        "Metric used for the redistributed route. If a metric is
         not specified, the metric configured with the
         default-metric attribute in RIP router configuration is
         used.  If the default-metric attribute has not been
         configured, the default metric for redistributed routes
         is 1.";
    }
    leaf route-policy {
      type route-policy-ref;
      description
        "Applies the conditions of the specified route policy to
         routes that are redistributed into the RIP routing
         instance.";
    }
  }
  // redistribute-route-policy-attributes

  grouping timers-container {
    description
      "Container for settings of basic timers";
    container timers {
      must "invalid-interval 'invalid-interval >= (update-interval * 3)" 3)' {
        description
          "invalid-interval must be at least three times the value
           for the update-interval argument.";
      }
      must "flush-interval 'flush-interval > invalid-interval" invalid-interval' {
        description
          "flush-interval must be larger than the value for the
           invalid-interval argument"; argument.";
      }
      description
        "Timers for the specified RIPv2 or RIPng instance or
         interface.";
      leaf update-interval {
        type uint16 {
          range  1..32767; "1..32767";
        }
        units seconds; "seconds";
        default 30; "30";
        description
          "Interval at which RIPv2 or RIPng updates are sent.";
      }
      leaf invalid-interval {
        type uint16 {
          range 1..32767; "1..32767";
        }
        units seconds; "seconds";
        default 180; "180";
        description
          "Interval before a route is declared invalid after no
           updates are received.  This value is at least three times
           the value for the update-interval argument.";
      }
      leaf holddown-interval {
        type uint16 {
          range 1..32767; "1..32767";
        }
        units seconds; "seconds";
        default 180; "180";
        description
          "Interval before better routes are released.";
      }
      leaf flush-interval {
        type uint16 {
          range 1..32767; "1..32767";
        }
        units seconds; "seconds";
        default 240; "240";
        description
          "Interval before a route is flushed from the routing
           table. This value must be larger than the value for the
           invalid-interval argument.";
      }
    }
    // timers
  }
  // timers-container

  grouping global-attributes {
    description
      "Global configuration and state attributes.";
    uses originate-default-route-container;
    leaf default-metric {
      type uint8 {
        range 0..16; "0..16";
      }
      default 1; "1";
      description
        "Set the default metric.";
    }
    leaf distance {
      type uint8 {
        range 1..255; "1..255";
      }
      default 120; "120";
      description
        "The administrative distance of the RIPv2 or RIPng for the
         current RIPv2 or RIPng instance.";
    }
    leaf triggered-update-threshold {
      type uint8 {
        range 1..30; "1..30";
      }
      units seconds; "seconds";
      default 5; "5";
      description
        "This attribute is used to suppress triggered updates.
         When the arrival of a regularly scheduled update matches the
         number of seconds or is less than the number seconds
         configured with this attribute, the triggered update is
         suppressed.";
    }
    leaf maximum-paths {
      type uint8 {
        range 1..16; "1..16";
      }
      default 8; "8";
      description
        "The number of multiple equal-cost RIPv2 or RIPng routes
         that can be used as the best paths for balancing the load
         of outgoing traffic packets.";
    }
    leaf output-delay {
      type uint8 {
        range 1..50; "1..50";
      }
      units milliseconds; "milliseconds";
      description
        "A delay time between packets sent in multipacket
         RIPv2 or RIPng updates.";
    }
  }
  // global-attributes

  grouping distribute-lists {
    description
      "Grouping for distribute lists.";
    list distribute-list {
      key "prefix-set-name direction";
      description
        "List of distribute-lists, which are used to filter in-coming incoming
         or out-going outgoing routing updates.";
      leaf prefix-set-name {
        type prefix-set-ref;
        description
          "Reference to a prefix list to be applied to RIPv2 or
           RIPng packets.";
      }
      leaf direction {
        type enumeration {
          enum "in" in {
            description
              "Apply the distribute-list to in-coming incoming routes.";
          }
          enum "out" out {
            description
              "Apply the distribute-list to out-going outgoing routes.";
          }
        }
        description
          "Direction of the routing updates.";
      }
      leaf if-name {
        type if:interface-ref;
        description
          "Reference to an interface to which the prefix list is
           applied.";
      }
    }
    // distribute-list
  }
  // distribute-lists

  grouping route-attributes {
    description
      "Grouping for route attributes.";
    leaf redistributed {
      type boolean;
      description
        "Redistributed routes"; routes.";
    }
    leaf route-type {
      type enumeration {
        enum connected {
          description
            "Connected route.";
        }
        enum external {
          description
            "External route.";
        }
        enum external-backup {
          description
            "External backup route.";
        }
        enum rip {
          description
            "RIP route.";
        }
      }
      description
        "Route type.";
    }
    leaf metric {
      type uint8 {
        range 0..16; "0..16";
      }
      description
        "Route metric.";
    }
    leaf expire-time {
      type uint16;
      description
        "Expiration time.";
    }
    leaf deleted {
      type boolean;
      description
        "Deleted route.";
    }
    leaf holddown {
      type boolean;
      description
        "Holddown route.";
    }
    leaf need-triggered-update {
      type boolean;
      description
        "The route needs triggered update.";
    }
    leaf inactive {
      type boolean;
      description
        "The route is inactive.";
    }
    leaf flush-expire-before-holddown {
      type boolean;
      description
        "The flush timer expired before holddown time.";
    }
  }
  // route-attribute route-attributes

  /*
   * Configuration data and operational state data nodes
   */

  augment "/rt:routing/rt:control-plane-protocols/"
        + "rt:control-plane-protocol" {
    when "derived-from(rt:type, 'rip:rip')" {
      description
        "This augment is only valid for a routing protocol instance
         of RIP (type 'ripv2' or 'ripng').";
    }
    description
      "RIP augmentation.";
    container rip {
      description
        "RIP data.";
      uses global-attributes;
      uses distribute-lists;
      uses redistribute-container;
      uses timers-container;
      container interfaces {
        description
          "Containing a list of RIP interfaces.";
        list interface {
          key "interface";
          description
            "List of RIP interfaces.";
          leaf interface {
            type if:interface-ref;
            must "(derived-from-or-self("
               + "../../../../rt:type, 'rip:ripv2') and "
               + "/if:interfaces/if:interface[if:name=current()]/"
               + "ip:ipv4) or "
               + "(derived-from-or-self("
               + "../../../../rt:type, 'rip:ripng') and "
               + "/if:interfaces/if:interface[if:name=current()]/"
               + "ip:ipv6)" {
              error-message "Invalid interface type.";
              description
                "RIPv2 can be enabled on IPv4 interfae, interface, and
                 RIPng can be enabled on IPv6 interface.";
            }
            description
              "Enable RIP on this interface.";
          }
          container authentication {
            when "derived-from-or-self("
               + "../../../../rt:type, 'rip:ripv2')" {
              description
                "Only applicable to RIPv2.";
            }
            description
              "Enables authentication and specifies the
               authentication scheme for the RIP interface"; interface.";
            choice auth-type-selection {
              description
                "Specify the authentication scheme.";
              reference
                "RFC8177: YANG Data Model for Key Chains.";
              case auth-key-chain {
                leaf key-chain {
                  type key-chain:key-chain-ref;
                  description
                    "key-chain name.";
                }
              }
              case auth-key {
                leaf key {
                  type string;
                  description
                    "Key string in ASCII format.";
                }
                leaf crypto-algorithm {
                  type identityref {
                    base key-chain:crypto-algorithm;
                  }
                  description
                    "Cryptographic algorithm associated with the
                     key.";
                }
              }
            }
          }
          container bfd {
            if-feature bfd; "bfd";
            description
              "BFD configuration.";
            uses bfd-types:client-cfg-parms;
          }
          leaf cost {
            type uint8 {
              range  1..16; "1..16";
            }
            default 1; "1";
            description
              "Interface cost.";
          }
          container neighbors {
            if-feature explicit-neighbors; "explicit-neighbors";
            description
              "Specifies the RIP neighbors.  Useful for a
               non-broadcast multiple access (NBMA) network.";
            list neighbor {
              key "address";
              description
                "Specify a RIP neighbor on a non-broadcast network.";
              leaf address {
                type inet:ip-address;
                description
                  "Neighbor IP address.";
              }
            }
          }
          leaf no-listen {
            type empty;
            description
              "Disables listening to to, and processing of of, RIPv2 or
               RIPng packets on the specified interface.";
          }
          uses originate-default-route-container;
          leaf passive {
            type empty;
            description
              "Disables sending of RIPv2 or RIPng packets on the
               specified interface.";
          }
          leaf split-horizon {
            type enumeration {
              enum disabled {
                description
                  "Disables split-horizon processing.";
              }
              enum simple {
                description
                  "Enables simple split-horizon processing.";
              }
              enum poison-reverse {
                description
                  "Enables split-horizon processing with poison
                   reverse.";
              }
            }
            default simple; "simple";
            description
              "Controls RIPv2 or RIPng split-horizon processing on
               the specified interface.";
          }
          container summary-address {
            description
              "Summarizes information about RIPv2 or RIPng routes
               sent over the specified interface in RIPv2 or RIPng
               update packets.";
            leaf address {
              type inet:ip-prefix;
              description
                "Specifies the IP address and the prefix length that
                 identify the routes to be summarized.  The IP
                 address can be specified in either IPv4 or IPv6
                 format, as specified in RFC6991.";
            }
            leaf metric {
              type uint8 {
                range 0..16; "0..16";
              }
              description
                "Metric used for the route.  If this attribute is not
                 used, the value set through the default-metric
                 attribute in RIPv2 or RIPng router configuration is
                 used for the route. "; route.";
            }
          }
          uses timers-container;

          /* Operational state */
          leaf oper-status {
            type enumeration {
              enum up {
                description
                  "RIPv2 or RIPng is operational on this interface.";
              }
              enum down {
                description
                  "RIPv2 or RIPng is not operational on this
                   interface.";
              }
            }
            config false;
            description
              "Operational state.";
          }
          leaf next-full-update {
            type uint32;
            config false;
            description
              "Next full update time.";
          }
          leaf valid-address {
            type boolean;
            config false;
            description
              "The interface has a valid address.";
          }
          container statistics {
            if-feature interface-statistics; "interface-statistics";
            config false;
            description
              "Interface statistic statistics counters.";
            leaf discontinuity-time {
              type yang:date-and-time;
              description
                "The time on the most recent occasion at which any
                 one or more of the statistic statistics counters suffered a
                 discontinuity.  If no such discontinuities have
                 occurred since the last re-initialization of the
                 local management subsystem, then this node contains
                 the time the local management subsystem
                 re-initialized itself.";
            }
            leaf bad-packets-rcvd {
              type yang:counter32;
              description
                "The number of RIP invalid packets received by
                 the RIP process which that were subsequently discarded
                 for any reason (e.g. (e.g., a version 0 packet, or an
                 unknown command type).";
            }
            leaf bad-routes-rcvd {
              type yang:counter32;
              description
                "The number of routes, in valid RIP packets,
                 which were ignored for any reason (e.g. (e.g., unknown
                 address family, or invalid metric).";
            }
            leaf updates-sent {
              type yang:counter32;
              description
                "The number of triggered RIP updates actually
                 sent on this interface.  This explicitly does
                 NOT include full updates sent containing new
                 information.";
            }
          }
        }
        // interface
      }
      // interfaces

      /* Operational state */
      leaf next-triggered-update {
        type uint32;
        config false;
        description
          "Next triggered update.";
      }
      leaf num-of-routes {
        type uint32;
        config false;
        description
          "The number of routes.";
      }
      container ipv4 {
        when "derived-from-or-self(../../rt:type, 'rip:ripv2')" {
          description
            "IPv4 address family is supported by RIPv2.";
        }
        config false;
        description
          "IPv4 address family information.";
        container neighbors {
          description
            "IPv4 neighbor information.";
          list neighbor {
            key "ipv4-address";
            description
              "A RIPv2 neighbor.";
            leaf ipv4-address {
              type inet:ipv4-address;
              description
                "IP address that a RIP neighbor is using as its
                 source address.";
            }
            leaf last-update {
              type yang:date-and-time;
              description
                "The time when the most recent RIP update was
                 received from this neighbor.";
            }
            leaf bad-packets-rcvd {
              type yang:counter32;
              description
                "The number of RIP invalid packets received from
                 this neighbor which that were subsequently discarded
                 for any reason (e.g. (e.g., a version 0 packet, or an
                 unknown command type).";
            }
            leaf bad-routes-rcvd {
              type yang:counter32;
              description
                "The number of routes received from this neighbor,
                 in valid RIP packets, which packets that were ignored for any
                 reason (e.g. (e.g., unknown address family, or invalid
                 metric).";
            }
          }
          // neighbor
        }
        // neighbors

        container routes {
          description
            "IPv4 route information.";
          list route {
            key "ipv4-prefix";
            description
              "A RIPv2 IPv4 route.";
            leaf ipv4-prefix {
              type inet:ipv4-prefix;
              description
                "IPv4 address and prefix length, in the format
                 specified in RFC6991.";
            }
            leaf next-hop {
              type inet:ipv4-address;
              description
                "Next hop IPv4 address.";
            }
            leaf interface {
              type if:interface-ref;
              description
                "The interface that the route uses.";
            }
            uses route-attributes;
          }
          // route
        }
        // routes
      }
      // ipv4

      container ipv6 {
        when "derived-from-or-self(../../rt:type, 'rip:ripng')" {
          description
            "IPv6 address family is supported by RIPng.";
        }
        config false;
        description
          "IPv6 address family information.";
        container neighbors {
          description
            "IPv6 neighbor information.";
          list neighbor {
            key "ipv6-address";
            description
              "A RIPng neighbor.";
            leaf ipv6-address {
              type inet:ipv6-address;
              description
                "IP address that a RIP neighbor is using as its
                 source address.";
            }
            leaf last-update {
              type yang:date-and-time;
              description
                "The time when the most recent RIP update was
                 received from this neighbor.";
            }
            leaf bad-packets-rcvd {
              type yang:counter32;
              description
                "The number of RIP invalid packets received from
                 this neighbor which that were subsequently discarded
                 for any reason (e.g. (e.g., a version 0 packet, or an
                 unknown command type).";
            }
            leaf bad-routes-rcvd {
              type yang:counter32;
              description
                "The number of routes received from this neighbor,
                 in valid RIP packets, which packets that were ignored for any
                 reason (e.g. (e.g., unknown address family, or invalid
                 metric).";
            }
          }
          // neighbor
        }
        // neighbors

        container routes {
          description
            "IPv6 route information.";
          list route {
            key "ipv6-prefix";
            description
              "A RIPng IPv6 route.";
            leaf ipv6-prefix {
              type inet:ipv6-prefix;
              description
                "IPv6 address and prefix length, in the format
                 specified in RFC6991.";
            }
            leaf next-hop {
              type inet:ipv6-address;
              description
                "Next hop IPv6 address.";
            }
            leaf interface {
              type if:interface-ref;
              description
                "The interface that the route uses.";
            }
            uses route-attributes;
          }
          // route
        }
        // routes
      }
      // ipv6

      container statistics {
        if-feature global-statistics; "global-statistics";
        config false;
        description
          "Global statistic statistics counters.";
        leaf discontinuity-time {
          type yang:date-and-time;
          description
            "The time on the most recent occasion at which any one
             or more of the statistic statistics counters suffered a
             discontinuity.  If no such discontinuities have occurred
             since the last re-initialization of the local
             management subsystem, then this node contains the time
             the local management subsystem re-initialized itself.";
        }
        leaf requests-rcvd {
          type yang:counter32;
          description
            "The number of requests received by RIP.";
        }
        leaf requests-sent {
          type yang:counter32;
          description
            "The number of requests sent by RIP.";
        }
        leaf responses-rcvd {
          type yang:counter32;
          description
            "The number of responses received by RIP.";
        }
        leaf responses-sent {
          type yang:counter32;
          description
            "The number of responses sent by RIP.";
        }
      }
      // statistics
    }
    // container rip
  }

  /*
   * RPCs
   */

  rpc clear-rip-route {
    description
      "Clears RIP routes from the IP routing table and routes
       redistributed into the RIP protocol for the specified RIP instance
       or for all RIP instances in the current context.";
    input {
      leaf rip-instance {
        type leafref {
          path "/rt:routing/rt:control-plane-protocols/"
             + "rt:control-plane-protocol/rt:name";
        }
        description
          "Instance name identifying a specific RIP instance.
           This leaf is optional for the rpc. RPC.
           If it is specified, the rpc RPC will clear all routes in the
           specified RIP instance;
           if it is not specified, the rpc RPC will clear all routes in
           all RIP instances.";
      }
    }
  }
  // rcp clear-rip-route

}
<CODE ENDS>
]]></artwork>
	</figure>
]]></sourcecode>

    </section>
    <section title="IANA Considerations" anchor="sect-5"><t>
   RFC Ed.: In this section, replace all occurrences of 'XXXX' with the
   actual RFC number (and remove this note).</t> anchor="sect-5" numbered="true" toc="default">

      <name>IANA Considerations</name>

     <t>
   This document registers the following namespace URIs in the IETF "IETF XML
   registry
   Registry" <xref target="RFC3688"/>:</t>

	<figure><artwork><![CDATA[
   --------------------------------------------------------------------
   URI: urn:ietf:params:xml:ns:yang:ietf-rip
   Registrant Contact: The IESG.
   XML: N/A, target="RFC3688" format="default"/>:</t>
<dl newline="false" spacing="compact">
  <dt>URI:</dt> <dd>urn:ietf:params:xml:ns:yang:ietf-rip</dd>
  <dt>Registrant Contact:</dt> <dd>The IESG.</dd>
  <dt>XML:</dt> <dd>N/A; the requested URI is an XML namespace.
   --------------------------------------------------------------------
]]></artwork>
	</figure> namespace.</dd>
</dl>

      <t>
   This document registers the following YANG modules in the YANG "YANG Module
   Names
   Names" registry <xref target="RFC7950"/>:</t>

        <figure><artwork><![CDATA[

   --------------------------------------------------------------------
   name:         ietf-rip
   namespace:    urn:ietf:params:xml:ns:yang:ietf-rip
   prefix:       rip
   reference:    RFC XXXX
   --------------------------------------------------------------------

]]></artwork>
        </figure> target="RFC6020" format="default"/>:</t>
<dl newline="false" spacing="compact">
  <dt>Name:</dt> <dd>ietf-rip</dd>
  <dt>Namespace:</dt> <dd>urn:ietf:params:xml:ns:yang:ietf-rip</dd>
  <dt>Prefix:</dt> <dd>rip</dd>
  <dt>Reference:</dt> <dd>RFC 8695</dd>
</dl>
    </section>
    <section title="Security Considerations" anchor="sect-6"><t> anchor="sect-6" numbered="true" toc="default">
      <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"/> target="RFC6241" format="default"/> or RESTCONF <xref target="RFC8040"/>. target="RFC8040" format="default"/>.  The lowest NETCONF layer
   is the secure transport layer, and the mandatory-to-implement secure
   transport is Secure Shell (SSH) <xref target="RFC6242"/>. target="RFC6242" format="default"/>.  The lowest RESTCONF layer
   is HTTPS, and the mandatory-to-implement secure transport is TLS
   <xref target="RFC8446"/>.</t> target="RFC8446" format="default"/>.</t>
      <t>
   The NETCONF access control model Access Control Model (NACM) <xref target="RFC8341"/> target="RFC8341" format="default"/> 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., 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>

	<t>
      <artwork>
   /rt:routing/rt:control-plane-protocols/rt:control-plane-protocol/
   rip:rip</t>
   rip:rip
</artwork>
      <t>
   Unauthorized access to any data node of these subtrees can adversely
   affect the routing subsystem of both the local device and the
   network.  This may lead to network malfunctions, delivery of packets
   to inappropriate destinations, and other problems.</t>
      <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>

	<t>
      <artwork>
   /rt:routing/rt:control-plane-protocols/rt:control-plane-protocol/
   rip:rip</t>
   rip:rip
</artwork>
      <t>
   Unauthorized access to any data node of these subtrees can disclose
   the operational state information of RIP on this device.</t>
      <t>
   Some of the RPC operations in this YANG module may be considered
   sensitive or vulnerable in some network environments.  It is thus
   important to control access to these operations.  These are the
   operations and their sensitivity/vulnerability:</t>
      <t>
   RPC clear-rip-route:</t>
      <t>
   Unauthorized access to the RPC above can adversely affect the routing
   subsystem of both the local device and the network.  This may lead to
   network malfunctions, delivery of packets to inappropriate
   destinations, and other problems.</t>
    </section>
  </middle>
  <back>
	<references title="Normative References">
	&RFC1724;
	&RFC2119;
	&RFC2453;
	&RFC2080;
	&RFC3688;
	&RFC6241;
	&RFC6242;
	&RFC6991;
	&RFC7950;
	&RFC8040;
	&RFC8177;
	&RFC8341;
	&RFC8342;
	&RFC8343;
	&RFC8344;
	&RFC8349;
	&RFC8446;

<displayreference target="I-D.ietf-bfd-yang" to="YANG-BFD"/>
<displayreference target="I-D.ietf-isis-yang-isis-cfg" to="YANG-ISIS"/>
<displayreference target="I-D.ietf-ospf-yang" to="YANG-OSPF"/>

    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.1724.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2453.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2080.xml"/>
        <xi:include
	    href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3688.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6020.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6241.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6242.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6991.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7950.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8040.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8177.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8341.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8342.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8343.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8344.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8349.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7951.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8340.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8407.xml"/>

        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8639.xml"/>

        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8641.xml"/>

<!-- I-D.draft-ietf-bfd-yang-17; in MISSREF state as of 2/18/20 -->

<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-bfd-yang.xml"/>

<!-- I-D.draft-ietf-isis-yang-isis-cfg-35; in MISSREF state as of 2/18/20 -->

<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-isis-yang-isis-cfg.xml"/>

<!-- I-D.draft-ietf-ospf-yang-28; in MISSREF state as of 2/18/20 -->

<xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-ospf-yang.xml"/>

      </references>
	<references title="Informative References">
	&RFC7951;
	&RFC8340;
	&RFC8407;
	&I-D.ietf-netconf-subscribed-notifications;
	&I-D.ietf-netconf-yang-push;
	&I-D.ietf-bfd-yang;
	&I-D.ietf-isis-yang-isis-cfg;
	&I-D.ietf-ospf-yang;
    </references>
    <section title="Data anchor="sect-a" numbered="true" toc="default">
      <name>Data Tree Example" anchor="sect-a"><t> Example</name>
      <t>
   This section contains an example of an instance data tree in the JSON
   encoding <xref target="RFC7951"/>, target="RFC7951" format="default"/>, containing both configuration and state data.</t>

	<figure><artwork><![CDATA[

<figure anchor="router-example">
<name>RIPng Example</name>
      <artwork name="" type="" align="left" alt=""><![CDATA[
                  +---------------------+
                  |                     |
                  | Router 203.0.113.1  |
                  |                     |
                  +----------+----------+
                             |eth1
                             |2001:db8:0:1::1/64
                             |
                             |
                             |2001:db8:0:1::2/64
                  +----------+----------+
                  |                     |         |
                  |   Another Router    +---------| 2001:db8:0:2::/64
                  |                     |         |
                  +---------------------+
]]></artwork>
</figure>
      <t>
   The configuration instance data tree for Router 203.0.113.1 in the
   above figure
   <xref target="router-example"/> could be as follows:</t>

	<figure><artwork><![CDATA[
      <sourcecode type="yang"><![CDATA[
{
  "ietf-interfaces:interfaces": {
    "interface": [
      {
        "name": "eth1",
        "description": "An interface with RIPng enabled.",
        "type": "iana-if-type:ethernetCsmacd",
        "ietf-ip:ipv6": {
          "address": [
            {
              "ip": "2001:db8:0:1::1",
              "prefix-length": 64
            }
          ],
          "forwarding": true
        }
      }
    ]
  },
  "ietf-routing:routing": {
    "router-id": "203.0.113.1",
    "control-plane-protocols": {
      "control-plane-protocol": [
        {
          "type": "ietf-rip:ripng",
          "name": "ripng-1",
          "description": "RIPng instance ripng-1.",
          "ietf-rip:rip": {
            "redistribute": {
              "connected": {
              }
            }
            },
            "interfaces": {
              "interface": [
                {
                  "interface": "eth1",
                  "split-horizon": "poison-reverse"
                }
              ]
            }
          }
        }
      ]
    }
  }
}
The cooresponding corresponding operational state data for Router 203.0.113.1 could
be as follows:

{
  "ietf-interfaces:interfaces": {
    "interface": [
      {
        "name": "eth1",
        "description": "An interface with RIPng enabled.",
        "type": "iana-if-type:ethernetCsmacd",
        "phys-address": "00:00:5e:00:53:01",
        "oper-status": "up",
        "statistics": {
          "discontinuity-time": "2016-10-24T17:11:27+02:00"
        },
        "ietf-ip:ipv6": {
          "forwarding": true,
          "mtu": 1500,
          "address": [
            {
              "ip": "2001:db8:0:1::1",
              "prefix-length": 64,
              "origin": "static",
              "status": "preferred"
            },
            {
              "ip": "fe80::200:5eff:fe00:5301",
              "prefix-length": 64,
              "origin": "link-layer",
              "status": "preferred"
            }
          ],
          "neighbor": [
            {
              "ip": "2001:db8:0:1::2",
              "link-layer-address": "00:00:5e:00:53:02",
              "origin": "dynamic",
              "is-router": [null],
              "state": "reachable"
            },
            {
              "ip": "fe80::200:5eff:fe00:5302",
              "link-layer-address": "00:00:5e:00:53:02",
              "origin": "dynamic",
              "is-router": [null],
              "state": "reachable"
            }
          ]
        }
      }
    ]
  },
  "ietf-routing:routing": {
    "router-id": "203.0.113.1",
    "interfaces": {
      "interface": [
        "eth1"
      ]
    },
    "control-plane-protocols": {
      "control-plane-protocol": [
        {
          "type": "ietf-rip:ripng",
          "name": "ripng-1",
          "description": "RIPng instance ripng-1.",
          "ietf-rip:rip": {
            "default-metric": 1,
            "next-triggered-update": 5 5,
            "interfaces": {
              "interface": [
                {
                  "interface": "eth1",
                  "oper-status": "up",
                  "cost": 1,
                  "split-horizon": "poison-reverse",
                  "valid-address": true
                }
              ]
            },
            "ipv6"
            "ipv6": {
              "neighbors": {
                "neighbor": [
                  {
                    "address":
                    "ipv6-address": "fe80::200:5eff:fe00:5302",
                    "last-update": "2017-01-02T10:34:55+02:00"
                  }
                ]
              }
              },
              "routes": {
                "route": [
                  {
                    "ipv6-prefix": "2001:db8:0:1::/64",
                    "interface": "eth1",
                    "redistributed": true,
                    "route-type": "connected",
                    "metric": 1,
                    "expire-time": 22
                  },
                  {
                    "ipv6-prefix": "2001:db8:0:2::/64",
                    "next-hop": "fe80::200:5eff:fe00:5302",
                    "interface": "eth1",
                    "redistributed": false,
                    "route-type": "rip",
                    "metric": 2,
                    "expire-time": 82
                  }
                ]
              }
            },
            "statistics": {
              "discontinuity-time": "2016-10-24T17:11:27+02:00",
              "requests-rcvd": 523,
              "requests-sent": 262,
              "responses-rcvd": 261,
              "responses-sent": 523
            }
          }
        }
      ]
    }
  }
}
]]></artwork>
	</figure>
]]></sourcecode>
    </section>
  </back>
</rfc>