<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC1112 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1112.xml">
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2236 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2236.xml">
<!ENTITY RFC2710 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2710.xml">
<!ENTITY RFC3376 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3376.xml">
<!ENTITY RFC3688 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3688.xml">
<!ENTITY RFC3810 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3810.xml">
<!ENTITY RFC4607 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4607.xml">
<!ENTITY RFC6020 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6020.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 RFC8174 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC8294 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8294.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 RFC8519 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8519.xml">
<!ENTITY RFC3569 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3569.xml">
<!ENTITY RFC4541 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4541.xml">
<!ENTITY RFC4605 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4605.xml">
<!ENTITY RFC5790 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5790.xml">
<!ENTITY RFC6636 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6636.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">
]> "rfc2629-xhtml.ent">

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" submissionType="IETF" docName="draft-ietf-pim-igmp-mld-yang-15" category="std">
     category="std" consensus="yes" number="8652" ipr="trust200902"
     obsoletes="" updates="" xml:lang="en" sortRefs="true" symRefs="true"
     tocInclude="true" version="3" docName="draft-ietf-pim-igmp-mld-yang-15">
  <!-- xml2rfc v2v3 conversion 2.28.0 -->
  <!-- Generated by id2xml 1.4.4 on 2019-07-08T17:40:23Z -->
	<?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="IGMP &amp; MLD Yang Model">A YANG Module">A YANG Data Model for the Internet Group Management Protocol (IGMP) and Multicast and&nbsp;Multicast Listener Discovery (MLD)</title>
    <seriesInfo name="RFC" value="8652"/>
    <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="Feng Guo" initials="F." surname="Guo">
      <organization abbrev="Huawei">Huawei Technologies</organization>
	<address><postal><street>Huawei
      <address>
        <postal>
          <street>Huawei Bldg., No.156 No. 156 Beiqing Rd.</street>
	<street>Beijing  100095</street>
	<street>China</street>
	  <street>Haidian District</street>
          <city>Beijing</city><code>100095</code>
          <country>China</country>
        </postal>
        <email>guofeng@huawei.com</email>
      </address>
    </author>
    <author fullname="Mahesh Sivakumar" initials="M." surname="Sivakumar">
      <organization abbrev="Juniper">Juniper Networks</organization>
	<address><postal><street>1133
      <address>
        <postal>
          <street>1133 Innovation Way</street>
	<street>Sunnyvale, California</street>
	<street>USA</street>
          <city>Sunnyvale</city> <region>California</region>
          <country>United States of America</country>
        </postal>
        <email>sivakumar.mahesh@gmail.com</email>
      </address>
    </author>
    <author fullname="Pete McAllister" initials="P." surname="McAllister">
      <organization>Metaswitch Networks</organization>
	<address><postal><street>100
      <address>
        <postal>
          <street>100 Church Street</street>
	<street>Enfield  EN2 6BQ</street>
	<street>UK</street>
          <city>Enfield</city> <code>EN2 6BQ</code>
          <country>United Kingdom</country>
        </postal>
        <email>pete.mcallister@metaswitch.com</email>
      </address>
    </author>
    <author fullname="Anish Peter" initials="A." surname="Peter">
	<organization>Individual</organization>
	<address><email>anish.ietf@gmail.com</email>
      <organization>IP Infusion India</organization>
      <address>
        <postal>
          <extaddr>RMZ Centennial, Block D 401</extaddr>
          <street>Kundanahalli Main Road, Mahadevapura Post</street>
          <city>Bangalore</city>
          <country>India</country>
        </postal>
        <email>anish.ietf@gmail.com</email>
      </address>
    </author>
    <date month="July" month="November" year="2019"/>
    <workgroup>PIM Working Group</workgroup>
	<abstract><t>

    <keyword>YANG, IGMP, MLD, multicast, data model, ietf-igmp-mld, network management, routing</keyword>
    <abstract>
      <t>

   This document defines a YANG data model that can be used to
   configure and manage Internet Group Management Protocol (IGMP) and
   Multicast Listener Discovery (MLD) devices.</t>
    </abstract>
  </front>
  <middle>
    <section title="Introduction" anchor="section-1"><t> anchor="s-1" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
   YANG <xref target="RFC6020"/> target="RFC6020" format="default"/> <xref target="RFC7950"/> target="RFC7950" format="default"/> is a data definition language that was
   introduced to model the configuration and running state of a device
   managed using network management protocols such as NETCONF <xref target="RFC6241"/> target="RFC6241" format="default"/>
   or RESTCONF <xref target="RFC8040"/>. target="RFC8040" format="default"/>. YANG is now also being used as a component of
   wider management interfaces, such as command line command-line interfaces (CLIs).</t>
      <t>
   This document defines a YANG data model that can be used to
   configure and manage Internet Group Management Protocol (IGMP) and
   Multicast Listener Discovery (MLD) devices. The protocol versions
   include IGMPv1 <xref target="RFC1112"/>, target="RFC1112" format="default"/>, IGMPv2 <xref target="RFC2236"/>, target="RFC2236" format="default"/>, IGMPv3 <xref target="RFC3376"/>, target="RFC3376" format="default"/>, MLDv1
   <xref target="RFC2710"/>, target="RFC2710" format="default"/>, and MLDv2 <xref target="RFC3810"/>. target="RFC3810" format="default"/>. The core features of the IGMP and
   MLD protocols are defined as required.  Non-core features are
   defined as optional in the provided data model.</t>

      <t>
   The YANG data model in this document conforms to the Network Management
   Datastore Architecture (NMDA) <xref target="RFC8342"/>.</t> target="RFC8342" format="default"/>.</t>
      <section title="Terminology" anchor="section-1.1"><t> anchor="s-1.1" numbered="true" toc="default">
        <name>Terminology</name>
        <t>
   The terminology for describing YANG data models is found in
   <xref target="RFC6020"/> target="RFC6020" format="default"/> and <xref target="RFC7950"/>, target="RFC7950" format="default"/>, including:</t>

	<t><list style="symbols"><t>augment</t>

	<t>data model</t>

	<t>data node</t>

	<t>identity</t>

	<t>module</t>

	</list>
	</t>
        <ul spacing="normal">
          <li>augment</li>
          <li>data model</li>
          <li>data node</li>
          <li>identity</li>
          <li>module</li>
        </ul>
        <t>
   The following abbreviations are used in this document and the
   defined model:</t>

	<t><list style="hanging" hangIndent="3"><t hangText="IGMP:">
	<vspace blankLines="1"/>
        <dl newline="false" spacing="normal" indent="3">
          <dt>IGMP:</dt>
          <dd>

	Internet Group Management Protocol <xref target="RFC3376"/>.
	</t>

	<t hangText="MLD:">
	<vspace blankLines="1"/> target="RFC3376" format="default"/>.
	</dd>
          <dt>MLD:</dt>
          <dd>

	Multicast Listener Discovery <xref target="RFC3810"/>.
	</t>

	<t hangText="SSM:">
	<vspace blankLines="1"/> target="RFC3810" format="default"/>.
	</dd>
          <dt>SSM:</dt>
          <dd>

	Source-Specific Multicast service model <xref target="RFC3569"/> target="RFC3569" format="default"/> <xref target="RFC4607"/>.
	</t>

	</list>
	</t> target="RFC4607" format="default"/>.
	</dd>
        </dl>
      </section>

<!-- [rfced] Conventions section moved from original doc.  Please review -->
      <section title="Conventions used anchor="s-1.2" numbered="true" toc="default">
        <name>Conventions Used in this document" anchor="section-1.2"><t> This Document</name>
        <t>
    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "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 14 BCP 14 <xref target="RFC2119"/> target="RFC2119" format="default"/> <xref target="RFC8174"/> target="RFC8174" format="default"/>
    when, and only when, they appear in all capitals, as shown here.</t> here.
        </t>
      </section>
      <section title="Tree Diagrams" anchor="section-1.2.a"><t> anchor="s-1.2.a" numbered="true" toc="default">
        <name>Tree Diagrams</name>
        <t>
   Tree diagrams used in this document follow the notation defined in
   <xref target="RFC8340"/>.</t> target="RFC8340" format="default"/>.</t>
      </section>
      <section title="Prefixes anchor="s-1.3" numbered="true" toc="default">
        <name>Prefixes in Data Node Names" anchor="section-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
        <table anchor="ref-prefixes-and-corresponding-yang-modules" align="center">
          <name>Prefixes and Corresponding YANG Modules" anchor="ref-prefixes-and-corresponding-yang-modules" style="full"><ttcol> Prefix</ttcol>
	<ttcol> Modules</name>
          <thead>
            <tr>
              <th align="left"> Prefix</th>
              <th align="left"> 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>rt-types</c>
	<c>ietf-routing-types</c>
	<c>[RFC8294]</c>
	<c>acl</c>
	<c>ietf-access-control-list</c>
	<c>[RFC8519]</c>
	</texttable> 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"/></td>
            </tr>
            <tr>
              <td align="left">inet</td>
              <td align="left">ietf-inet-types</td>
              <td align="left"><xref target="RFC6991"/></td>
            </tr>
            <tr>
              <td align="left">if</td>
              <td align="left">ietf-interfaces</td>
              <td align="left"><xref target="RFC8343"/></td>
            </tr>
            <tr>
              <td align="left">ip</td>
              <td align="left">ietf-ip</td>
              <td align="left"><xref target="RFC8344"/></td>
            </tr>
            <tr>
              <td align="left">rt</td>
              <td align="left">ietf-routing</td>
              <td align="left"><xref target="RFC8349"/></td>
            </tr>
            <tr>
              <td align="left">rt-types</td>
              <td align="left">ietf-routing-types</td>
              <td align="left"><xref target="RFC8294"/></td>
            </tr>
            <tr>
              <td align="left">acl</td>
              <td align="left">ietf-access-control-list</td>
              <td align="left"><xref target="RFC8519"/></td>
            </tr>
          </tbody>
        </table>
      </section>
    </section>
    <section title="Design anchor="s-2" numbered="true" toc="default">
      <name>Design of the Data model" anchor="section-2"><section title="Scope Model</name>
      <section anchor="s-2.1" numbered="true" toc="default">
        <name>Scope of Model" anchor="section-2.1"><t> Model</name>
        <t>
   The model covers IGMPv1 <xref target="RFC1112"/>, target="RFC1112" format="default"/>, IGMPv2 <xref target="RFC2236"/>, target="RFC2236" format="default"/>, IGMPv3
   <xref target="RFC3376"/>, target="RFC3376" format="default"/>, MLDv1 <xref target="RFC2710"/>, target="RFC2710" format="default"/>, and MLDv2 <xref target="RFC3810"/>.</t> target="RFC3810" format="default"/>.</t>
        <t>
   This model does not cover other IGMP IGMP- and MLD related MLD-related protocols such
   as IGMP/MLD Proxy <xref target="RFC4605"/> target="RFC4605" format="default"/> or IGMP/MLD Snooping <xref target="RFC4541"/> target="RFC4541" format="default"/> etc.,
   which will be specified in separate documents.</t>
        <t>
   This model can be used to configure and manage various versions of
   IGMP and MLD protocols. The operational state data and statistics
   can be retrieved by this model. Even though no protocol specific protocol-specific
   notifications are defined in this model, the subscription and push
   mechanism defined in <xref target="I-D.ietf-netconf-subscribed-notifications"/> target="RFC8639" format="default"/> and
   <xref target="I-D.ietf-netconf-yang-push"/> target="RFC8641" format="default"/> can be used implemented by the user to subscribe to
   notifications on the data nodes in this model.</t>
        <t>
   The model contains all the basic configuration parameters to operate
   the protocols listed above. Depending on the implementation choices,
   some systems may not allow some of the advanced parameters to be
   configurable. The occasionally implemented parameters are modeled as
   optional features in this model, while the rarely implemented
   parameters are not included in this model and left for augmentation.
   This model can be extended, and it has been structured in a way that
   such extensions can be conveniently made.</t>
        <t>
   The protocol parameters covered in this model can been seen from the
   model structure described in <xref target="section-3"/>.</t> target="s-3" format="default"/>.</t>
        <t>
   The protocol parameters that were considered but are not covered in
   this model are described in the following sections.</t>
        <section title="Parameters anchor="s-2.1.1" numbered="true" toc="default">
          <name>Parameters Not Covered at the Global Level" anchor="section-2.1.1"><t> Level</name>
          <t>
   The configuration parameters and operational states not covered on
   an IGMP instance or an MLD instance are:</t>

	<t><list style="symbols"><t>Explicit tracking</t>

	<t>Maximum
          <ul spacing="normal">
            <li>Explicit tracking</li>
            <li>Maximum transmit rate</t>

	<t>Last rate</li>
            <li>Last member query count</t>

	<t>Other count</li>
            <li>Other querier present time</t>

	<t>Send time</li>
            <li>Send router alert</t>

	<t>Startup alert</li>
            <li>Startup query interval</t>

	<t>Startup interval</li>
            <li>Startup query count</t>

	</list>
	</t> count</li>
          </ul>
        </section>
        <section title="Parameters anchor="s-2.1.2" numbered="true" toc="default">
          <name>Parameters Not Covered at the Interface Level" anchor="section-2.1.2"><t> Level</name>
          <t>
   The configuration parameters and operational states not covered on
   an IGMP interface or an MLD interface are:</t>

	<t><list style="symbols"><t>Disable
          <ul spacing="normal">
            <li>Disable router alert check</t>

	<t>Drop check</li>
            <li>Drop IGMP version 1, IGMP version 2, or MLD version 1</t>

	<t>Last 1</li>
            <li>Last member query count</t>

	<t>Maximum count</li>
            <li>Maximum number of sources</t>

	<t>Other sources</li>
            <li>Other querier present time</t>

	<t>Passive mode</t>

	<t>Promiscuous mode</t>

	<t>Query time</li>
            <li>Passive mode</li>
            <li>Promiscuous mode</li>
            <li>Query before immediate leave</t>

	<t>Send leave</li>
            <li>Send router alert</t>

	</list>
	</t> alert</li>
          </ul>
        </section>
      </section>
      <section title="Optional Capabilities" anchor="section-2.2"><t> anchor="s-2.2" numbered="true" toc="default">
        <name>Optional Capabilities</name>
        <t>
   This model is designed to represent the capabilities of IGMP and MLD
   devices with various specifications, including the basic capability
   subsets of the IGMP and MLD protocols.  The main design goals of
   this document are that the basic capabilities described in the model
   are supported by any major now-existing implementation, and that the
   configuration of all implementations meeting the specifications is
   easy to express through some combination of the optional features in
   the model and simple vendor augmentations.</t>
        <t>
   There is also value in widely-supported widely supported features being standardized,
   to provide a standardized way to access these features, to save work
   for individual vendors, and so that mapping between different
   vendors' configuration is not needlessly complicated. Therefore Therefore, this
   model declares a number of features representing capabilities that
   not all deployed devices support.</t>
        <t>
   The extensive use of feature declarations should also substantially
   simplify the capability negotiation process for a vendor's IGMP and
   MLD implementations.</t>
        <t>
   On the other hand, operational state parameters are not so widely
   designated as features, as there are many cases where the defaulting
   of an operational state parameter would not cause any harm to the
   system, and it is much more likely that an implementation without
   native support for a piece of operational state would be able to
   derive a suitable value for a state variable that is not natively
   supported.</t>
      </section>
      <section title="Position anchor="s-2.3" numbered="true" toc="default">
        <name>Position of Address Family in Hierarchy" anchor="section-2.3"><t> Hierarchy</name>
        <t>
   The protocol IGMP only supports IPv4, while the protocol MLD only
   supports IPv6. The data model defined in this document can be used
   for both IPv4 and IPv6 address families.</t>
        <t>
   This document defines IGMP and MLD as separate schema branches in
   the structure. The benefits are:</t>

	<t><list style="symbols"><t>The
        <ul spacing="normal">
          <li>The model can support IGMP (IPv4), MLD (IPv6), or both
       optionally and independently. Such flexibility cannot be
       achieved cleanly with a combined branch.</t>

	<t>The branch.</li>
          <li>The structure is consistent with other YANG data models such as RFC
       8344, which uses separate branches for IPv4 and IPv6.</t>

	<t>The IPv6.</li>
          <li>The separate branches for IGMP and MLD can accommodate their
       differences better and cleaner.  The two branches can better
       support different features and node types.</t>

	</list>
	</t> types.</li>
        </ul>
      </section>
    </section>
    <section title="Module Structure" anchor="section-3"><t> anchor="s-3" numbered="true" toc="default">
      <name>Module Structure</name>
      <t>
   This model augments the core routing data model 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 igmp     <= Augmented by this Model
                     ...
         |     +--rw mld      <= Augmented by this Model
                     ...
]]></artwork>
	</figure>
]]></sourcecode>
      <t>
   The "igmp" container instantiates an IGMP protocol of version
   IGMPv1, IGMPv2, or IGMPv3. The "mld" container instantiates an MLD
   protocol of version MLDv1 or MLDv2.</t>
      <t>
   The YANG data model defined in this document 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"/>.</t> target="RFC8407" format="default"/>.</t>
      <t>
   A configuration data node is marked as mandatory only when its value
   must be provided by the user. Where nodes are not essential to
   protocol operation, they are marked as optional. Some other nodes
   are essential but have a default specified, so that they are also
   optional and need not be configured explicitly.</t>
      <section title="IGMP anchor="s-3.1" numbered="true" toc="default">
        <name>IGMP Configuration and Operational State" anchor="section-3.1"><t> State</name>
        <t>

	  The IGMP data is modeled as a schema subtree augmenting the
	  "control-plane-protocol" data node under
	  "/rt:routing/rt:control-plane-protocols" in the module
	  ietf-routing, following the convention described in <xref target="RFC8349"/>. target="RFC8349" format="default"/>. The augmentation to the module
	  ietf-routing allows this model to support multiple instances
	  of IGMP, but a restriction MAY <bcp14>MAY</bcp14> be added depending on the
	  implementation and the device. The identity "igmp" is
	  derived from the "rt:control-plane-protocol" base identity
	  and indicates that a control-plane-protocol instance is
	  IGMP.</t>
        <t>
   The IGMP subtree is a three-level hierarchy structure as listed
   below:</t>

	<t><list style="hanging" hangIndent="3"><t hangText="Global level: Including
        <dl newline="false" spacing="normal" indent="3">
          <dt>Global level:</dt>
          <dd>Including IGMP configuration and operational state"> state attributes for the entire IGMP protocol instance in this router.
	</t>

	<t hangText="Interface-global level: router.</dd>
          <dt>Interface-global level:</dt>
          <dd> Including configuration data nodes that"> that
 	 are applicable to all the interfaces whose corresponding nodes are
         not defined or not configured at the interface level. For such a
         node at the interface level, the system uses the same value of the
         corresponding node at the interface-global level.
	</t>

	<t hangText="Interface level:
	</dd>
          <dt>Interface level:</dt>
          <dd> Including IGMP configuration and operational"> operational
     	 state attributes specific to the given interface. For a
         configuration node at the interface level, there may exist a
         corresponding configuration node with the same name at the
         interface-global level. The value configured on a node at the
         interface level overrides the value configured on the corresponding
         node at the interface-global level.
	</t>

	</list>
	</t>

	<figure><artwork><![CDATA[
	</dd>
        </dl>
	<sourcecode type="yangtree"><![CDATA[
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol:
    +--rw igmp {feature-igmp}?
       +--rw global
       |  +--rw enable? enabled?         boolean {global-admin-enable}?
       |  +--rw max-entries?     uint32 {global-max-entries}?
       |  +--rw max-groups?      uint32 {global-max-groups}?
       |  +--ro entries-count?   uint32
       |  +--ro groups-count?    uint32
       |  +--ro statistics
       |     +--ro discontinuity-time?   yang:date-and-time
       |     +--ro error
       |     |  +--ro total?       yang:counter64
       |     |  +--ro query?       yang:counter64
       |     |  +--ro report?      yang:counter64
       |     |  +--ro leave?       yang:counter64
       |     |  +--ro checksum?    yang:counter64
       |     |  +--ro too-short?   yang:counter64
       |     +--ro received
       |     |  +--ro total?    yang:counter64
       |     |  +--ro query?    yang:counter64
       |     |  +--ro report?   yang:counter64
       |     |  +--ro leave?    yang:counter64
       |     +--ro sent
       |        +--ro total?    yang:counter64
       |        +--ro query?    yang:counter64
       |        +--ro report?   yang:counter64
       |        +--ro leave?    yang:counter64
       +--rw interfaces
          +--rw last-member-query-interval?   uint16
          +--rw query-interval?               uint16
          +--rw query-max-response-time?      uint16
          +--rw require-router-alert?         boolean
          |       {intf-require-router-alert}?
          +--rw robustness-variable?          uint8
          +--rw version?                      uint8
          +--rw max-groups-per-interface?     uint32
          |       {intf-max-groups}?
          +--rw interface* [interface-name]
             +--rw interface-name                if:interface-ref
             +--rw last-member-query-interval?   uint16
             +--rw query-interval?               uint16
             +--rw query-max-response-time?      uint16
             +--rw require-router-alert?         boolean
             |       {intf-require-router-alert}?
             +--rw robustness-variable?          uint8
             +--rw version?                      uint8
             +--rw enable? enabled?                      boolean
             |       {intf-admin-enable}?
             +--rw group-policy?
             |       -> /acl:acls/acl/name
             +--rw immediate-leave?              empty
             |       {intf-immediate-leave}?
             +--rw max-groups?                   uint32
             |       {intf-max-groups}?
             +--rw max-group-sources?            uint32
             |       {intf-max-group-sources}?
             +--rw source-policy?
             |       -> /acl:acls/acl/name {intf-source-policy}?
             +--rw verify-source-subnet?         empty
             |       {intf-verify-source-subnet}?
             +--rw explicit-tracking?            empty
             |       {intf-explicit-tracking}?
             +--rw exclude-lite? lite-exclude-filter?          empty
             |       {intf-exclude-lite}?       {intf-lite-exclude-filter}?
             +--rw join-group*
             |       rt-types:ipv4-multicast-group-address
             |       {intf-join-group}?
             +--rw ssm-map*
             |  |       [ssm-map-source-addr ssm-map-group-policy]
             |  |       {intf-ssm-map}?
             |  +--rw ssm-map-source-addr     ssm-map-ipv4-addr-type
             |  +--rw ssm-map-group-policy    string
             +--rw static-group* [group-addr source-addr]
             |  |       {intf-static-group}?
             |  +--rw group-addr
             |  |       rt-types:ipv4-multicast-group-address
             |  +--rw source-addr
             |          rt-types:ipv4-multicast-source-address
             +--ro oper-status                   enumeration
             +--ro querier                       inet:ipv4-address
             +--ro joined-group*
             |       rt-types:ipv4-multicast-group-address
             |       {intf-join-group}?
             +--ro group* [group-address]
                +--ro group-address
                |       rt-types:ipv4-multicast-group-address
                +--ro expire           uint32
                +--ro filter-mode      enumeration
                +--ro up-time          uint32
                +--ro last-reporter?   inet:ipv4-address
                +--ro source* [source-address]
                   +--ro source-address    inet:ipv4-address
                   +--ro expire            uint32
                   +--ro up-time           uint32
                   +--ro host-count?       uint32
                   |       {intf-explicit-tracking}?
                   +--ro last-reporter?    inet:ipv4-address
                   +--ro host* [host-address]
                      |
                           {intf-explicit-tracking}?
                      +--ro host-address        inet:ipv4-address
                      +--ro host-filter-mode    enumeration
]]></artwork>
	</figure>
]]></sourcecode>
      </section>
      <section title="MLD anchor="s-3.2" numbered="true" toc="default">
        <name>MLD Configuration and Operational State" anchor="section-3.2"><t> State</name>
        <t>
   The MLD data is modeled as a schema subtree augmenting the "control-plane-protocol" data node under "/rt:routing/rt:control-plane-protocols" in the module ietf-routing, following the convention
   described in <xref target="RFC8349"/>. target="RFC8349" format="default"/>. The augmentation to the module ietf-routing
   allows this model to support multiple instances of MLD, but a
   restriction MAY <bcp14>MAY</bcp14> be added depending on the implementation and the
   device. The identity "mld" is derived from the "rt:control-plane-protocol" base identity and indicates that a control-plane-protocol
   instance is MLD.</t>
        <t>
   The MLD subtree is a three-level hierarchy structure as listed
   below:</t>

	<t><list style="hanging" hangIndent="3"><t hangText="Global level: Including
        <dl newline="false" spacing="normal" indent="3">
          <dt>Global level:</dt>
	  <dd>Including MLD configuration and operational state"> state
	  attributes for the entire MLD protocol instance in this router.
	</t>

	<t hangText="Interface-global level: Including
	</dd>
          <dt>Interface-global level:</dt>
          <dd>Including configuration data nodes that"> that
	are applicable to all the interfaces whose corresponding nodes are
         not defined or not configured at the interface level. For such a
         node at the interface level, the system uses the same value of the
         corresponding node at the interface-global level.
	</t>

	<t hangText="Interface level: Including
	</dd>
          <dt>Interface level:</dt>
          <dd>Including MLD configuration and operational"> operational
	state attributes specific to the given interface. For a
         configuration node at the interface level, there may exist a
         corresponding configuration node with the same name at the
         interface-global level. The value configured on a node at the
         interface level overrides the value configured on the corresponding
         node at the interface-global level.
	</t>

	</list>
	</t>

	<figure><artwork><![CDATA[
	</dd>
        </dl>
<sourcecode type="yangtree"><![CDATA[
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol:
    +--rw mld {feature-mld}?
       +--rw global
       |  +--rw enable? enabled?         boolean {global-admin-enable}?
       |  +--rw max-entries?     uint32 {global-max-entries}?
       |  +--rw max-groups?      uint32 {global-max-groups}?
       |  +--ro entries-count?   uint32
       |  +--ro groups-count?    uint32
       |  +--ro statistics
       |     +--ro discontinuity-time?   yang:date-and-time
       |     +--ro error
       |     |  +--ro total?       yang:counter64
       |     |  +--ro query?       yang:counter64
       |     |  +--ro report?      yang:counter64
       |     |  +--ro leave?       yang:counter64
       |     |  +--ro checksum?    yang:counter64
       |     |  +--ro too-short?   yang:counter64
       |     +--ro received
       |     |  +--ro total?    yang:counter64
       |     |  +--ro query?    yang:counter64
       |     |  +--ro report?   yang:counter64
       |     |  +--ro leave?    yang:counter64
       |     +--ro sent
       |        +--ro total?    yang:counter64
       |        +--ro query?    yang:counter64
       |        +--ro report?   yang:counter64
       |        +--ro leave?    yang:counter64
       +--rw interfaces
          +--rw last-member-query-interval?   uint16
          +--rw query-interval?               uint16
          +--rw query-max-response-time?      uint16
          +--rw require-router-alert?         boolean
          |       {intf-require-router-alert}?
          +--rw robustness-variable?          uint8
          +--rw version?                      uint8
          +--rw max-groups-per-interface?     uint32
          |       {intf-max-groups}?
          +--rw interface* [interface-name]
             +--rw interface-name                if:interface-ref
             +--rw last-member-query-interval?   uint16
             +--rw query-interval?               uint16
             +--rw query-max-response-time?      uint16
             +--rw require-router-alert?         boolean
             |       {intf-require-router-alert}?
             +--rw robustness-variable?          uint8
             +--rw version?                      uint8
             +--rw enable? enabled?                      boolean
             |       {intf-admin-enable}?
             +--rw group-policy?
             |       -> /acl:acls/acl/name
             +--rw immediate-leave?              empty
             |       {intf-immediate-leave}?
             +--rw max-groups?                   uint32
             |       {intf-max-groups}?
             +--rw max-group-sources?            uint32
             |       {intf-max-group-sources}?
             +--rw source-policy?
             |       -> /acl:acls/acl/name {intf-source-policy}?
             +--rw verify-source-subnet?         empty
             |       {intf-verify-source-subnet}?
             +--rw explicit-tracking?            empty
             |       {intf-explicit-tracking}?
             +--rw exclude-lite? lite-exclude-filter?          empty
             |       {intf-exclude-lite}?       {intf-lite-exclude-filter}?
             +--rw join-group*
             |       rt-types:ipv6-multicast-group-address
             |       {intf-join-group}?
             +--rw ssm-map*
             |  |       [ssm-map-source-addr ssm-map-group-policy]
             |  |       {intf-ssm-map}?
             |  +--rw ssm-map-source-addr     ssm-map-ipv6-addr-type
             |  +--rw ssm-map-group-policy    string
             +--rw static-group* [group-addr source-addr]
             |  |       {intf-static-group}?
             |  +--rw group-addr
             |  |       rt-types:ipv6-multicast-group-address
             |  +--rw source-addr
             |          rt-types:ipv6-multicast-source-address
             +--ro oper-status                   enumeration
             +--ro querier                       inet:ipv6-address
             +--ro joined-group*
             |       rt-types:ipv6-multicast-group-address
             |       {intf-join-group}?
             +--ro group* [group-address]
                +--ro group-address
                |       rt-types:ipv6-multicast-group-address
                +--ro expire           uint32
                +--ro filter-mode      enumeration
                +--ro up-time          uint32
                +--ro last-reporter?   inet:ipv6-address
                +--ro source* [source-address]
                   +--ro source-address    inet:ipv6-address
                   +--ro expire            uint32
                   +--ro up-time           uint32
                   +--ro host-count?       uint32
                   |       {intf-explicit-tracking}?
                   +--ro last-reporter?    inet:ipv6-address
                   +--ro host* [host-address]
                      |
                           {intf-explicit-tracking}?
                      +--ro host-address        inet:ipv6-address
                      +--ro host-filter-mode    enumeration
]]></artwork>
	</figure>
]]></sourcecode>
      </section>
      <section title="IGMP anchor="s-3.3" numbered="true" toc="default">
        <name>IGMP and MLD Actions" anchor="section-3.3"><t> Actions</name>
        <t>
   IGMP and MLD each have one action which that clears the group membership
	cache entries for that protocol.</t>

	<figure><artwork><![CDATA[
	<sourcecode type="yangtree"><![CDATA[
  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol:
    +--rw igmp {feature-igmp}?
       +---x clear-groups {action-clear-groups}?
          +---w input
             +---w (interface)
             |  +--:(name)
             |  |  +---w interface-name?   leafref
             |  +--:(all)
             |     +---w all-interfaces?   empty
             +---w group-address           union
             +---w source-address
                     rt-types:ipv4-multicast-source-address

  augment /rt:routing/rt:control-plane-protocols
            /rt:control-plane-protocol:
    +--rw mld {feature-mld}?
       +---x clear-groups {action-clear-groups}?
          +---w input
             +---w (interface)
             |  +--:(name)
             |  |  +---w interface-name?   leafref
             |  +--:(all)
             |     +---w all-interfaces?   empty
             +---w group-address?          union
             +---w source-address?
                     rt-types:ipv6-multicast-source-address
]]></artwork>
	</figure>
]]></sourcecode>
      </section>
    </section>
    <section title="IGMP anchor="s-4" numbered="true" toc="default">
      <name>IGMP and MLD YANG Module" anchor="section-4"> Module</name>
      <t>This module references <xref target="RFC1112"/>, target="RFC1112" format="default"/>, <xref target="RFC2236"/>, target="RFC2236" format="default"/>,
<xref target="RFC2710"/>, target="RFC2710" format="default"/>, <xref target="RFC3376"/>, target="RFC3376" format="default"/>, <xref target="RFC3810"/>, target="RFC3810" format="default"/>,
<xref target="RFC5790"/>, target="RFC5790" format="default"/>, <xref target="RFC6636"/>, target="RFC6636" format="default"/>, <xref target="RFC6991"/>, target="RFC6991" format="default"/>,
<xref target="RFC8294"/>, target="RFC8294" format="default"/>, <xref target="RFC8343"/>, target="RFC8343" format="default"/>, <xref target="RFC8344"/>, target="RFC8344" format="default"/>,
<xref target="RFC8349"/>, target="RFC8349" format="default"/>, and <xref target="RFC8519"/>.</t>

<figure><artwork><![CDATA[
<CODE BEGINS> file "ietf-igmp-mld@2019-06-12.yang" target="RFC8519" format="default"/>.</t>

      <sourcecode name="ietf-igmp-mld@2019-11-01.yang" type="yang" markers="true"><![CDATA[
module ietf-igmp-mld {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-igmp-mld";
  prefix igmp-mld;

  import ietf-inet-types {
    prefix "inet"; inet;
    reference
      "RFC 6991: Common YANG Data Types";
  }
  import ietf-yang-types {
    prefix "yang"; yang;
    reference
      "RFC 6991: Common YANG Data Types";
  }
  import ietf-routing-types {
    prefix "rt-types"; rt-types;
    reference
      "RFC 8294: Common YANG Data Types for the Routing Area";
  }
  import ietf-access-control-list {
    prefix "acl"; acl;
    reference
      "RFC 8519: YANG Data Model for Network Access Control Lists
       (ACLs)";
  }
  import ietf-routing {
    prefix "rt"; rt;
    reference
      "RFC 8349: A YANG Data Model for Routing Management (NMDA
       Version)";
  }
  import ietf-interfaces {
    prefix "if"; if;
    reference
      "RFC 8343: A YANG Data Model for Interface Management";
  }
  import ietf-ip {
    prefix ip;
    reference
      "RFC 8344: A YANG Data Model for IP Management";
  }

  organization
    "IETF PIM Working Group";
  contact
    "WG Web:   <http://tools.ietf.org/wg/pim/>   <http://datatracker.ietf.org/wg/pim/>
     WG List:  <mailto:pim@ietf.org>

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

     Editor:   Feng Guo
               <mailto:guofeng@huawei.com>

     Editor:   Mahesh Sivakumar
               <mailto:sivakumar.mahesh@gmail.com>

     Editor:   Pete McAllister
               <mailto:pete.mcallister@metaswitch.com>

     Editor:   Anish Peter
               <mailto:anish.ietf@gmail.com>";
  description
    "The module defines the configuration and operational state for
     the Internet Group Management Protocol (IGMP) and Multicast
     Listener Discovery (MLD) protocols.

     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) 2019 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; 8652; see the
     RFC itself for full legal notices.";

  // RFC Ed.: replace XXXX with actual RFC number and remove
  // this note

  revision 2019-06-12 2019-11-01 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: 8652: A YANG Data Model for IGMP the Internet Group Management
       Protocol (IGMP) and MLD"; Multicast Listener Discovery (MLD)";
  }

  /*
   * Features
   */

  feature feature-igmp {
    description
      "Support IGMP protocol for IPv4 group membership record.";
  }

  feature feature-mld {
    description
      "Support MLD protocol for IPv6 group membership record.";
  }

  feature global-admin-enable {
    description
      "Support global configuration to enable or disable protocol.";
  }

  feature global-max-entries {
    description
      "Support configuration of global max-entries.";
  }

  feature global-max-groups {
    description
      "Support configuration of global max-groups.";
  }

  feature interface-global-config {
    description
      "Support global configuration applied for all interfaces.";
  }

  feature intf-admin-enable {
    description
      "Support configuration of interface administrative enabling.";
  }

  feature intf-immediate-leave {
    description
      "Support configuration of interface immediate-leave.";
  }

  feature intf-join-group {
    description
      "Support configuration of interface join-group.";
  }

  feature intf-max-groups {
    description
      "Support configuration of interface max-groups.";
  }

  feature intf-max-group-sources {
    description
      "Support configuration of interface max-group-sources.";
  }

  feature intf-require-router-alert {
    description
      "Support configuration of interface require-router-alert.";
  }

  feature intf-source-policy {
    description
      "Support configuration of interface source policy.";
  }

  feature intf-ssm-map {
    description
      "Support configuration of interface ssm-map.";
  }

  feature intf-static-group {
    description
      "Support configuration of interface static-group.";
  }

  feature intf-verify-source-subnet {
    description
      "Support configuration of interface verify-source-subnet.";
  }

  feature intf-explicit-tracking {
    description
      "Support configuration of interface explicit-tracking hosts.";
  }

  feature intf-lite-exclude-filter {
    description
      "Support configuration of interface lite-exclude-filter.";
  }

  feature per-interface-config {
    description
      "Support per interface per-interface configuration.";
  }

  feature action-clear-groups {
    description
      "Support actions to clear groups.";
  }

  /*
   * Typedefs
   */

  typedef ssm-map-ipv4-addr-type {
    type union {
      type enumeration {
        enum 'policy' policy {
          description
            "Source address is specified in SSM map policy.";
        }
      }
      type inet:ipv4-address;
    }
    description
      "Multicast source IP address type for SSM map.";
  }

  // source-ipv4-addr-type

  typedef ssm-map-ipv6-addr-type {
    type union {
      type enumeration {
        enum 'policy' policy {
          description
            "Source address is specified in SSM map policy.";
        }
      }
      type inet:ipv6-address;
    }
    description
      "Multicast source IP address type for SSM map.";
  }
  // source-ipv6-addr-type

  /*
   * Identities
   */

  identity igmp {
    base "rt:control-plane-protocol"; rt:control-plane-protocol;
    if-feature "feature-igmp";
    description
      "IGMP protocol.";
    reference
      "RFC 3376: Internet Group Management Protocol, Version 3."; 3";
  }

  identity mld {
    base "rt:control-plane-protocol"; rt:control-plane-protocol;
    if-feature "feature-mld";
    description
      "MLD protocol.";
    reference
      "RFC 3810: Multicast Listener Discovery Version 2 (MLDv2) for
       IPv6.";
       IPv6";
  }

  /*
   * Groupings
   */

  grouping global-config-attributes {
    description
      "This grouping is used in either IGMP schema or MLD schema.
       When used in IGMP schema, this grouping contains the global
       configuration for IGMP;
       when used in MLD schema, this grouping contains the global
       configuration for MLD.";
    leaf enable enabled {
      if-feature global-admin-enable; "global-admin-enable";
      type boolean;
      default true; "true";
      description
        "When this grouping is used for IGMP, this leaf indicates
         whether IGMP is enabled ('true') or disabled ('false')
         in the routing instance.
         When this grouping is used for MLD, this leaf indicates
         whether MLD is enabled ('true') or disabled ('false')
         in the routing instance.";
    }
    leaf max-entries {
      if-feature global-max-entries; "global-max-entries";
      type uint32;
      description
        "When this grouping is used for IGMP, this leaf indicates
         the maximum number of entries in the IGMP instance.
         When this grouping is used for MLD, this leaf indicates
         the maximum number of entries in the MLD instance.
         If this leaf is not specified, the number of entries is not
         limited.";
    }
    leaf max-groups {
      if-feature global-max-groups; "global-max-groups";
      type uint32;
      description
        "When this grouping is used for IGMP, this leaf indicates
         the maximum number of groups in the IGMP instance.
         When this grouping is used for MLD, this leaf indicates
         the maximum number of groups in the MLD instance.
         If this leaf is not specified, the number of groups is not
         limited.";
    }
  }

  // global-config-attributes

  grouping global-state-attributes {
    description
      "This grouping is used in either IGMP schema or MLD schema.
       When used in IGMP schema, this grouping contains the global
       IGMP state attributes;
       when used in MLD schema, this grouping contains the global
       MLD state attributes;"; attributes.";
    leaf entries-count {
      type uint32;
      config false;
      description
        "When this grouping is used for IGMP, this leaf indicates
         the number of entries in the IGMP instance.
         When this grouping is used for MLD, this leaf indicates
         the number of entries in the MLD instance.";
    }
    leaf groups-count {
      type uint32;
      config false;
      description
        "When this grouping is used for IGMP, this leaf indicates
         the number of existing groups in the IGMP instance.
         When this grouping is used for MLD, this leaf indicates
         the number of existing groups in the MLD instance.";
    }
    container statistics {
      config false;
      description
        "When this grouping is used for IGMP, this container contains
         the statistics for the IGMP instance.
         When this grouping is used for MLD, this leaf indicates
         the statistics for the MLD instance.";
      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 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.";
      }
      container error {
        description
          "Statistics of errors.";
        uses global-statistics-error;
      }
      container received {
        description
          "Statistics of received messages.";
        uses global-statistics-sent-received;
      }
      container sent {
        description
          "Statistics of sent messages.";
        uses global-statistics-sent-received;
      }
    }
    // statistics
  }

  // global-state-attributes

  grouping global-statistics-error {
    description
      "A grouping defining statistics attributes for errors.";
    uses global-statistics-sent-received;
    leaf checksum {
      type yang:counter64;
      description
        "The number of checksum errors.";
    }
    leaf too-short {
      type yang:counter64;
      description
        "The number of messages that are too short.";
    }
  }

  // global-statistics-error

  grouping global-statistics-sent-received {
    description
      "A grouping defining statistics attributes.";
    leaf total {
      type yang:counter64;
      description
        "The number of total messages.";
    }
    leaf query {
      type yang:counter64;
      description
        "The number of query messages.";
    }
    leaf report {
      type yang:counter64;
      description
        "The number of report messages.";
    }
    leaf leave {
      type yang:counter64;
      description
        "The number of leave messages.";
    }
  }

  // global-statistics-sent-received

  grouping interface-global-config-attributes {
    description
      "Configuration attributes applied to the interface-global level
       whose per interface per-interface attributes are not configured.";
    leaf max-groups-per-interface {
      if-feature intf-max-groups; "intf-max-groups";
      type uint32;
      description
        "The maximum number of groups associated with each interface.
         If this leaf is not specified, the number of groups is not
         limited.";
    }
  }

  //interface-global-config-attributes

  grouping interface-common-config-attributes {
    description
      "Configuration attributes applied to both the interface-global
       level and interface level.";
    leaf last-member-query-interval {
      type uint16 {
        range "1..1023";
      }
      units seconds; "seconds";
      description
        "When used in IGMP schema, this leaf indicates the Last
         Member Query Interval, which may be tuned to modify the
         leave latency of the network;
         when used in MLD schema, this leaf indicates the Last
         Listener Query Interval, which may be tuned to modify the
         leave latency of the network.
         This leaf is not applicable for version 1 of the IGMP.  For
         version 2 and version 3 of the IGMP, and for all versions of
         the MLD, the default value of this leaf is 1.
         This leaf may be configured at the interface level or the
         interface-global level, with precedence given to the value
         at the interface level.  If the leaf is not configured at
         either level, the default value is used.";
      reference
        "RFC 2236. Sec. 8.8.
        "Section 8.8 of RFC 3376. Sec. 8.8. 2236: Internet Group Management Protocol,
         Version 2.
         Section 8.8 of RFC 2710. Sec. 7.8. 3376: Internet Group Management Protocol,
         Version 3.
         Section 7.8 of RFC 3810. Sec. 9.8."; 2710: Multicast Listener Discovery (MLD)
         for IPv6.
         Section 9.8 of RFC 3810: Multicast Listener Discovery
         Version 2 (MLDv2) for IPv6.";
    }
    leaf query-interval {
      type uint16 {
        range "1..31744";
      }
      units seconds; "seconds";
      description
        "The Query Interval is the interval between General Queries
         sent by the Querier.  In RFC 3376, the Querier's Query
         Interval(QQI)
         Interval (QQI) is represented from the Querier's Query
         Interval Code (QQIC) in query message as follows:
         If QQIC < 128, QQI = QQIC.
         If QQIC >= 128, QQIC represents a floating-point value as
         follows:
          0 1 2 3 4 5 6 7
         +-+-+-+-+-+-+-+-+
         |1| exp | mant  |
         +-+-+-+-+-+-+-+-+
         QQI = (mant | 0x10) << (exp + 3).
         The maximum value of QQI is 31744.
         The default value is 125.
         This leaf may be configured at the interface level or the
         interface-global level, with precedence given to the value
         at the interface level.  If the leaf is not configured at
         either level, the default value is used.";
      reference "RFC 3376. Sec.
        "Sections 4.1.7, 8.2, 8.14.2."; and 8.14.2 of RFC 3376: Internet Group
         Management Protocol, Version 3";
    }
    leaf query-max-response-time {
      type uint16 {
        range "1..1023";
      }
      units seconds; "seconds";
      description
        "Query maximum response time specifies the maximum time
         allowed before sending a responding report.
         The default value is 10.
         This leaf may be configured at the interface level or the
         interface-global level, with precedence given to the value
         at the interface level.  If the leaf is not configured at
         either level, the default value is used.";
      reference "RFC 3376. Sec.
        "Sections 4.1.1, 8.3, 8.14.3."; and 8.14.3 of RFC 3376: Internet Group
         Management Protocol, Version 3";
    }
    leaf require-router-alert {
      if-feature intf-require-router-alert; "intf-require-router-alert";
      type boolean;
      description
        "Protocol packets should contain the router alert IP option.
         When this leaf is not configured, the server uses the
         following rules to determine the operational value of this
         leaf:
         if this grouping is used in IGMP schema and the value of the
         leaf 'version' is 1, the value 'false' is operationally used
         by the server;
         if this grouping is used in IGMP schema and the value of the
         leaf 'version' is 2 or 3, the value 'true' is operationally
         used by the server;
         if this grouping is used in MLD schema, the value 'true' is
         operationally used by the server.
         This leaf may be configured at the interface level or the
         interface-global level, with precedence given to the value
         at the interface level.  If the leaf is not configured at
         either level, the default value is used.";
    }
    leaf robustness-variable {
      type uint8 {
        range "1..7";
      }
      description
        "Querier's
        "The Querier's Robustness Variable allows tuning for the
         expected packet loss on a network.
         The default value is 2.
         This leaf may be configured at the interface level or the
         interface-global level, with precedence given to the value
         at the interface level.  If the leaf is not configured at
         either level, the default value is used.";
      reference "RFC 3376. Sec.
        "Sections 4.1.6, 8.1, 8.14.1."; and 8.14.1 of RFC 3376: Internet Group
         Management Protocol, Version 3";
    }
  }

  // interface-common-config-attributes

  grouping interface-common-config-attributes-igmp {
    description
      "Configuration attributes applied to both the interface-global
       level and interface level for IGMP.";
    uses interface-common-config-attributes;
    leaf version {
      type uint8 {
        range "1..3";
      }
      description
        "IGMP version.
         The default value is 2.
         This leaf may be configured at the interface level or the
         interface-global level, with precedence given to the value
         at the interface level.  If the leaf is not configured at
         either level, the default value is used.";
      reference
        "RFC 1112, 1112: Host Extensions for IP Multicasting,
         RFC 2236, 2236: Internet Group Management Protocol, Version 2,
         RFC 3376."; 3376: Internet Group Management Protocol, Version 3.";
    }
  }

  grouping interface-common-config-attributes-mld {
    description
      "Configuration attributes applied to both the interface-global
       level and interface level for MLD.";
    uses interface-common-config-attributes;
    leaf version {
      type uint8 {
        range "1..2";
      }
      description
        "MLD version.
         The default value is 2.
         This leaf may be configured at the interface level or the
         interface-global level, with precedence given to the value
         at the interface level.  If the leaf is not configured at
         either level, the default value is used.";
      reference
        "RFC 2710, 2710: Multicast Listener Discovery (MLD) for IPv6,
         RFC 3810."; 3810: Multicast Listener Discovery Version 2 (MLDv2)
         for IPv6.";
    }
  }

  grouping interfaces-config-attributes-igmp {
    description
      "Configuration attributes applied to the interface-global
       level for IGMP.";
    uses interface-common-config-attributes-igmp;
    uses interface-global-config-attributes;
  }

  grouping interfaces-config-attributes-mld {
    description
      "Configuration attributes applied to the interface-global
       level for MLD.";
    uses interface-common-config-attributes-mld;
    uses interface-global-config-attributes;
  }

  grouping interface-level-config-attributes {
    description
      "This grouping is used in either IGMP schema or MLD schema.
       When used in IGMP schema, this grouping contains the IGMP
       configuration attributes that are defined at the interface
       level but are not defined at the interface-global level;
       when used in MLD schema, this grouping contains the MLD
       configuration attributes that are defined at the interface
       level but are not defined at the interface-global level.";
    leaf enable enabled {
      if-feature intf-admin-enable; "intf-admin-enable";
      type boolean;
      default true; "true";
      description
        "When this grouping is used for IGMP, this leaf indicates
         whether IGMP is enabled ('true') or disabled ('false')
         on the interface.
         When this grouping is used for MLD, this leaf indicates
         whether MLD is enabled ('true') or disabled ('false')
         on the interface.";
    }
    leaf group-policy {
      type leafref {
        path "/acl:acls/acl:acl/acl:name";
      }
      description
        "When this grouping is used for IGMP, this leaf specifies
         the name of the access policy used to filter the
         IGMP membership.
         When this grouping is used for MLD, this leaf specifies
         the name of the access policy used to filter the
         MLD membership.
         The value space of this leaf is restricted to the existing
         policy instances defined by the referenced schema in
         RFC 8519.
         As specified by RFC 8519, the length of the name is between
         1 and 64; a device MAY further restrict the length of this
         name; space and special characters are not allowed.
         If this leaf is not specified, no policy is applied, and
         all packets received from this interface are accepted.";
      reference
        "RFC 8519: YANG Data Model for Network Access Control Lists
         (ACLs)";
    }
    leaf immediate-leave {
      if-feature intf-immediate-leave; "intf-immediate-leave";
      type empty;
      description
        "When this grouping is used for IGMP, the presence of this
         leaf requests IGMP to perform an immediate leave upon
         receiving an IGMPv2 leave message.
         If the router is IGMP-enabled, it sends an IGMP last member
         query with a last member query response time.  However, the
         router does not wait for the response time before it prunes
         the group.
         When this grouping is used for MLD, the presence of this
         leaf requests MLD to perform an immediate leave upon
         receiving an MLDv1 leave message.
         If the router is MLD-enabled, it sends an MLD last member
         query with a last member query response time.  However, the
         router does not wait for the response time before it prunes
         the group.";
    }
    leaf max-groups {
      if-feature intf-max-groups; "intf-max-groups";
      type uint32;
      description
        "When this grouping is used for IGMP, this leaf indicates
         the maximum number of groups associated with the IGMP
         interface.
         When this grouping is used for MLD, this leaf indicates
         the maximum number of groups associated with the MLD
         interface.
         If this leaf is not specified, the number of groups is not
         limited.";
    }
    leaf max-group-sources {
      if-feature intf-max-group-sources; "intf-max-group-sources";
      type uint32;
      description
        "The maximum number of group sources.
         If this leaf is not specified, the number of group sources
         is not limited.";
    }
    leaf source-policy {
      if-feature intf-source-policy; "intf-source-policy";
      type leafref {
        path "/acl:acls/acl:acl/acl:name";
      }
      description
        "Name of the access policy used to filter sources.
         The value space of this leaf is restricted to the existing
         policy instances defined by the referenced schema in
         RFC 8519.
         As specified by RFC 8519, the length of the name is between
         1 and 64; a device MAY further restrict the length of this
         name; space and special characters are not allowed.
         If this leaf is not specified, no policy is applied, and
         all packets received from this interface are accepted.";
    }
    leaf verify-source-subnet {
      if-feature intf-verify-source-subnet; "intf-verify-source-subnet";
      type empty;
      description
        "If present, the interface accepts packets with matching
         source IP subnet only.";
    }
    leaf explicit-tracking {
      if-feature intf-explicit-tracking; "intf-explicit-tracking";
      type empty;
      description
        "When this grouping is used for IGMP, the presence of this
         leaf enables an IGMP-based explicit membership tracking
         function for multicast routers and IGMP proxy devices
         supporting IGMPv3.
         When this grouping is used for MLD, the presence of this
         leaf enables an MLD-based explicit membership tracking
         function for multicast routers and MLD proxy devices
         supporting MLDv2.
         The explicit membership tracking function contributes to
         saving network resources and shortening leave latency.";
      reference
        "RFC 6636. Sec 3.";
        "Section 3 of RFC 6636: Tuning the Behavior of the Internet
         Group Management Protocol (IGMP) and Multicast Listener
         Discovery (MLD) for Routers in Mobile and Wireless
         Networks";
    }
    leaf lite-exclude-filter {
      if-feature intf-lite-exclude-filter; "intf-lite-exclude-filter";
      type empty;
      description
        "When this grouping is used for IGMP, the presence of this
         leaf enables the support of the simplified EXCLUDE filter
         in the Lightweight IGMPv3 protocol, which simplifies the
         standard versions of IGMPv3.
         When this grouping is used for MLD, the presence of this
         leaf enables the support of the simplified EXCLUDE filter
         in the Lightweight MLDv2 protocol, which simplifies the
         standard versions of MLDv2.";
      reference
        "RFC 5790"; 5790: Lightweight Internet Group Management Protocol
         Version 3 (IGMPv3) and Multicast Listener Discovery
         Version 2 (MLDv2) Protocols";
    }
  }

  // interface-level-config-attributes

  grouping interface-config-attributes-igmp {
    description
      "Per interface
      "Per-interface configuration attributes for IGMP.";
    uses interface-common-config-attributes-igmp;
    uses interface-level-config-attributes;
    leaf-list join-group {
      if-feature intf-join-group; "intf-join-group";
      type rt-types:ipv4-multicast-group-address;
      description
        "The router joins this multicast group on the interface.";
    }
    list ssm-map {
      if-feature intf-ssm-map; "intf-ssm-map";
      key "ssm-map-source-addr ssm-map-group-policy";
      description
        "The policy for (*,G) mapping to (S,G).";
      leaf ssm-map-source-addr {
        type ssm-map-ipv4-addr-type;
        description
          "Multicast source IPv4 address.";
      }
      leaf ssm-map-group-policy {
        type string;
        description
          "Name of the policy used to define ssm-map rules.
           A device can restrict the length
           and value of this name, possibly space and special
           characters are not allowed. "; allowed.";
      }
    }
    list static-group {
      if-feature intf-static-group; "intf-static-group";
      key "group-addr source-addr";
      description
        "A static multicast route, (*,G) or (S,G).
         The version of IGMP must be 3 to support (S,G).";
      leaf group-addr {
        type rt-types:ipv4-multicast-group-address;
        description
          "Multicast group IPv4 address.";
      }
      leaf source-addr {
        type rt-types:ipv4-multicast-source-address;
        description
          "Multicast source IPv4 address.";
      }
    }
  }

  // interface-config-attributes-igmp

  grouping interface-config-attributes-mld {
    description
      "Per interface
      "Per-interface configuration attributes for MLD.";
    uses interface-common-config-attributes-mld;
    uses interface-level-config-attributes;
    leaf-list join-group {
      if-feature intf-join-group; "intf-join-group";
      type rt-types:ipv6-multicast-group-address;
      description
        "The router joins this multicast group on the interface.";
    }
    list ssm-map {
      if-feature intf-ssm-map; "intf-ssm-map";
      key "ssm-map-source-addr ssm-map-group-policy";
      description
        "The policy for (*,G) mapping to (S,G).";
      leaf ssm-map-source-addr {
        type ssm-map-ipv6-addr-type;
        description
          "Multicast source IPv6 address.";
      }
      leaf ssm-map-group-policy {
        type string;
        description
          "Name of the policy used to define ssm-map rules.
           A device can restrict the length
           and value of this name, possibly space and special
           characters are not allowed.";
      }
    }
    list static-group {
      if-feature intf-static-group; "intf-static-group";
      key "group-addr source-addr";
      description
        "A static multicast route, (*,G) or (S,G).
         The version of MLD must be 2 to support (S,G).";
      leaf group-addr {
        type rt-types:ipv6-multicast-group-address;
        description
          "Multicast group IPv6 address.";
      }
      leaf source-addr {
        type rt-types:ipv6-multicast-source-address;
        description
          "Multicast source IPv6 address.";
      }
    }
  }

  // interface-config-attributes-mld

  grouping interface-state-attributes {
    description
      "Per interface
      "Per-interface state attributes for both IGMP and MLD.";
    leaf oper-status {
      type enumeration {
        enum up {
          description
            "Ready to pass packets.";
        }
        enum down {
          description
            "The interface does not pass any packets.";
        }
      }
      config false;
      mandatory true;
      description
        "Indicates whether the operational state of the interface
         is up or down.";
    }
  }

  // interface-state-attributes

  grouping interface-state-attributes-igmp {
    description
      "Per interface
      "Per-interface state attributes for IGMP.";
    uses interface-state-attributes;
    leaf querier {
      type inet:ipv4-address;
      config false;
      mandatory true;
      description
        "The querier address in the subnet"; subnet.";
    }
    leaf-list joined-group {
      if-feature intf-join-group; "intf-join-group";
      type rt-types:ipv4-multicast-group-address;
      config false;
      description
        "The routers that joined this multicast group.";
    }
    list group {
      key "group-address";
      config false;
      description
        "Multicast group membership information
         that joined on the interface.";
      leaf group-address {
        type rt-types:ipv4-multicast-group-address;
        description
          "Multicast group address.";
      }
      uses interface-state-group-attributes;
      leaf last-reporter {
        type inet:ipv4-address;
        description
          "The IPv4 address of the last host which that has sent the
           report to join the multicast group.";
      }
      list source {
        key "source-address";
        description
          "List of multicast source information
           of the multicast group.";
        leaf source-address {
          type inet:ipv4-address;
          description
            "Multicast source address in group record.";
        }
        uses interface-state-source-attributes;
        leaf last-reporter {
          type inet:ipv4-address;
          description
            "The IPv4 address of the last host which that has sent the
             report to join the multicast source and group.";
        }
        list host {
          if-feature intf-explicit-tracking; "intf-explicit-tracking";
          key "host-address";
          description
            "List of hosts with the membership for the specific
             multicast source-group.";
          leaf host-address {
            type inet:ipv4-address;
            description
              "The IPv4 address of the host.";
          }
          uses interface-state-host-attributes;
        }//
        }
        // list host
      }
      // list source
    }
    // list group
  }

  // interface-state-attributes-igmp

  grouping interface-state-attributes-mld {
    description
      "Per interface
      "Per-interface state attributes for MLD.";
    uses interface-state-attributes;
    leaf querier {
      type inet:ipv6-address;
      config false;
      mandatory true;
      description
        "The querier address in the subnet.";
    }
    leaf-list joined-group {
      if-feature intf-join-group; "intf-join-group";
      type rt-types:ipv6-multicast-group-address;
      config false;
      description
        "The routers that joined this multicast group.";
    }
    list group {
      key "group-address";
      config false;
      description
        "Multicast group membership information
         that joined on the interface.";
      leaf group-address {
        type rt-types:ipv6-multicast-group-address;
        description
          "Multicast group address.";
      }
      uses interface-state-group-attributes;
      leaf last-reporter {
        type inet:ipv6-address;
        description
          "The IPv6 address of the last host which that has sent the
           report to join the multicast group.";
      }
      list source {
        key "source-address";
        description
          "List of multicast sources of the multicast group.";
        leaf source-address {
          type inet:ipv6-address;
          description
            "Multicast source address in group record"; record.";
        }
        uses interface-state-source-attributes;
        leaf last-reporter {
          type inet:ipv6-address;
          description
            "The IPv6 address of the last host which that has sent the
             report to join the multicast source and group.";
        }
        list host {
          if-feature intf-explicit-tracking; "intf-explicit-tracking";
          key "host-address";
          description
            "List of hosts with the membership for the specific
             multicast source-group.";
          leaf host-address {
            type inet:ipv6-address;
            description
              "The IPv6 address of the host.";
          }
          uses interface-state-host-attributes;
        }//
        }
        // list host
      }
      // list source
    }
    // list group
  }

  // interface-state-attributes-mld

  grouping interface-state-group-attributes {
    description
      "Per interface
      "Per-interface state attributes for both IGMP and MLD
       groups.";
    leaf expire {
      type uint32;
      units seconds; "seconds";
      mandatory true;
      description
        "The time left before the multicast group state expires.";
    }
    leaf filter-mode {
      type enumeration {
        enum "include" include {
          description
            "In include mode, reception of packets sent
             to the specified multicast address is requested
             only from those IP source addresses listed in the
             source-list parameter";
        }
        enum "exclude" exclude {
          description
            "In exclude mode, reception of packets sent
             to the given multicast address is requested
             from all IP source addresses except those
             listed in the source-list parameter.";
        }
      }
      mandatory true;
      description
        "Filter mode for a multicast group,
         may be either include or exclude.";
    }
    leaf up-time {
      type uint32;
      units seconds; "seconds";
      mandatory true;
      description
        "The elapsed time since the device created multicast group
         record.";
    }
  }

  // interface-state-group-attributes

  grouping interface-state-source-attributes {
    description
      "Per interface
      "Per-interface state attributes for both IGMP and MLD
       source-group records.";
    leaf expire {
      type uint32;
      units seconds; "seconds";
      mandatory true;
      description
        "The time left before multicast source-group state expires.";
    }
    leaf up-time {
      type uint32;
      units seconds; "seconds";
      mandatory true;
      description
        "The elapsed time since the device created multicast
         source-group record.";
    }
    leaf host-count {
      if-feature intf-explicit-tracking; "intf-explicit-tracking";
      type uint32;
      description
        "The number of host addresses.";
    }
  }

  // interface-state-source-attributes

  grouping interface-state-host-attributes {
    description
      "Per interface
      "Per-interface state attributes for both IGMP and MLD
       hosts of source-group records.";
    leaf host-filter-mode {
      type enumeration {
        enum "include" include {
          description
            "In include mode"; mode.";
        }
        enum "exclude" exclude {
          description
            "In exclude mode.";
        }
      }
      mandatory true;
      description
        "Filter mode for a multicast membership
         host may be either include or exclude.";
    }
  }
  // interface-state-host-attributes

  /*
   * Configuration and Operational state data nodes (NMDA version)
   */

  augment "/rt:routing/rt:control-plane-protocols/"
        + "rt:control-plane-protocol" {
    when "derived-from-or-self(rt:type, 'igmp-mld:igmp')" {
      description
        "This augmentation is only valid for a control-plane
         protocol instance of IGMP (type 'igmp').";
    }
    description
      "IGMP augmentation to routing control plane control-plane protocol
       configuration and state.";
    container igmp {
      if-feature feature-igmp; "feature-igmp";
      description
        "IGMP configuration and operational state data.";
      container global {
        description
          "Global attributes.";
        uses global-config-attributes;
        uses global-state-attributes;
      }
      container interfaces {
        description
          "Containing a list of interfaces.";
        uses interfaces-config-attributes-igmp {
          if-feature interface-global-config; "interface-global-config";
          refine query-interval "query-interval" {
            default 125; "125";
          }
          refine query-max-response-time "query-max-response-time" {
            default 10; "10";
          }
          refine robustness-variable "robustness-variable" {
            default 2; "2";
          }
          refine version "version" {
            default 2; "2";
          }
        }
        list interface {
          key "interface-name";
          description
            "List of IGMP interfaces.";
          leaf interface-name {
            type if:interface-ref;
            must "/if:interfaces/if:interface[if:name
              '/if:interfaces/if:interface[if:name = current()]/" current()]/'
            + "ip:ipv4" 'ip:ipv4' {
              error-message
                "The interface must have IPv4 configured, either "
              + "enabled or disabled.";
            }
            description
              "Reference to an entry in the global interface list.";
          }
          uses interface-config-attributes-igmp {
            if-feature per-interface-config; "per-interface-config";
            refine last-member-query-interval "last-member-query-interval" {
              must "../version '../version != 1 or " '
                 + "(not(../version) '(not(../version) and " '
                 + "(../../version '(../../version != 1 or not(../../version)))" not(../../version)))' {
                error-message "IGMPv1 does not support "
                            + "last-member-query-interval.";
              }
            }
            refine max-group-sources "max-group-sources" {
              must "../version '../version = 3 or " '
                 + "(not(../version) '(not(../version) and (../../version = 3))" 3))' {
                error-message
                  "The version of IGMP must be 3 to support the "
                + "source specific "source-specific parameters.";
              }
            }
            refine source-policy "source-policy" {
              must "../version '../version = 3 or " '
                 + "(not(../version) '(not(../version) and (../../version = 3))" 3))' {
                error-message
                  "The version of IGMP must be 3 to support the "
                + "source specific "source-specific parameters.";
              }
            }
            refine explicit-tracking "explicit-tracking" {
              must "../version '../version = 3 or " '
                 + "(not(../version) '(not(../version) and (../../version = 3))" 3))' {
                error-message
                  "The version of IGMP must be 3 to support the "
                + "explicit tracking function.";
              }
            }
            refine lite-exclude-filter "lite-exclude-filter" {
              must "../version '../version = 3 or " '
                 + "(not(../version) '(not(../version) and (../../version = 3))" 3))' {
                error-message
                  "The version of IGMP must be 3 to support the "
                + "simplified EXCLUDE filter in the Lightweight "
                + "IGMPv3 protocol.";
              }
            }
          }
          uses interface-state-attributes-igmp;
        }
        // interface
      }
      // interfaces

      /*
       * Actions
       */
      action clear-groups {
        if-feature action-clear-groups; "action-clear-groups";
        description
          "Clears the specified IGMP cache entries.";
        input {
          choice interface {
            mandatory true;
            description
              "Indicates the interface(s) from which the cache
               entries are cleared.";
            case name {
              leaf interface-name {
                type leafref {
                  path "/rt:routing/rt:control-plane-protocols/"
                     + "rt:control-plane-protocol/"
                     + "igmp-mld:igmp/igmp-mld:interfaces/"
                     + "igmp-mld:interface/igmp-mld:interface-name";
                }
                description
                  "Name of the IGMP interface.";
              }
            }
            case all {
              leaf all-interfaces {
                type empty;
                description
                  "IGMP groups from all interfaces are cleared.";
              }
            }
          }
          leaf group-address {
            type union {
              type enumeration {
                enum '*' * {
                  description
                    "Any group address.";
                }
              }
              type rt-types:ipv4-multicast-group-address;
            }
            mandatory true;
            description
              "Multicast group IPv4 address.
               If the value '*' is specified, all IGMP group entries
               are cleared.";
          }
          leaf source-address {
            type rt-types:ipv4-multicast-source-address;
            mandatory true;
            description
              "Multicast source IPv4 address.
               If the value '*' is specified, all IGMP source-group
               entries are cleared.";
          }
        }
      }
      // action clear-groups
    }
    // igmp
  }

  //augment

  augment "/rt:routing/rt:control-plane-protocols/"
        + "rt:control-plane-protocol" {
    when "derived-from-or-self(rt:type, 'igmp-mld:mld')" {
      description
        "This augmentation is only valid for a control-plane
         protocol instance of IGMP (type 'mld').";
    }
    description
      "MLD augmentation to routing control plane control-plane protocol
       configuration and state.";
    container mld {
      if-feature feature-mld; "feature-mld";
      description
        "MLD configuration and operational state data.";
      container global {
        description
          "Global attributes.";
        uses global-config-attributes;
        uses global-state-attributes;
      }
      container interfaces {
        description
          "Containing a list of interfaces.";
        uses interfaces-config-attributes-mld {
          if-feature interface-global-config; "interface-global-config";
          refine last-member-query-interval "last-member-query-interval" {
            default 1; "1";
          }
          refine query-interval "query-interval" {
            default 125; "125";
          }
          refine query-max-response-time "query-max-response-time" {
            default 10; "10";
          }
          refine require-router-alert "require-router-alert" {
            default true; "true";
          }
          refine robustness-variable "robustness-variable" {
            default 2; "2";
          }
          refine version "version" {
            default 2; "2";
          }
        }
        list interface {
          key "interface-name";
          description
            "List of MLD interfaces.";
          leaf interface-name {
            type if:interface-ref;
            must "/if:interfaces/if:interface[if:name
              '/if:interfaces/if:interface[if:name = current()]/" current()]/'
            + "ip:ipv6" 'ip:ipv6' {
              error-message
                "The interface must have IPv6 configured, either "
              + "enabled or disabled.";
            }
            description
              "Reference to an entry in the global interface list.";
          }
          uses interface-config-attributes-mld {
            if-feature per-interface-config; "per-interface-config";
            refine max-group-sources "max-group-sources" {
              must "../version '../version = 2 or " '
                 + "(not(../version) '(not(../version) and " '
                 + "(../../version '(../../version = 2 or not(../../version)))" not(../../version)))' {
                error-message
                  "The version of MLD must be 2 to support the "
                + "source specific "source-specific parameters.";
              }
            }
            refine source-policy "source-policy" {
              must "../version '../version = 2 or " '
                 + "(not(../version) '(not(../version) and " '
                 + "(../../version '(../../version = 2 or not(../../version)))" not(../../version)))' {
                error-message
                  "The version of MLD must be 2 to support the "
                + "source specific "source-specific parameters.";
              }
            }
            refine explicit-tracking "explicit-tracking" {
              must "../version '../version = 2 or " '
                 + "(not(../version) '(not(../version) and " '
                 + "(../../version '(../../version = 2 or not(../../version)))" not(../../version)))' {
                error-message
                  "The version of MLD must be 2 to support the "
                + "explicit tracking function.";
              }
            }
            refine lite-exclude-filter "lite-exclude-filter" {
              must "../version '../version = 2 or " '
                 + "(not(../version) '(not(../version) and " '
                 + "(../../version '(../../version = 2 or not(../../version)))" not(../../version)))' {
                error-message
                  "The version of MLD must be 2 to support the "
                + "simplified EXCLUDE filter in the Lightweight "
                + "MLDv2 protocol.";
              }
            }
          }
          uses interface-state-attributes-mld;
        }
        // interface
      }
      // interfaces

      /*
       * Actions
       */
      action clear-groups {
        if-feature action-clear-groups; "action-clear-groups";
        description
          "Clears the specified MLD cache entries.";
        input {
          choice interface {
            mandatory true;
            description
              "Indicates the interface(s) from which the cache
               entries are cleared.";
            case name {
              leaf interface-name {
                type leafref {
                  path "/rt:routing/rt:control-plane-protocols/"
                     + "rt:control-plane-protocol/"
                     + "igmp-mld:mld/igmp-mld:interfaces/"
                     + "igmp-mld:interface/igmp-mld:interface-name";
                }
                description
                  "Name of the MLD interface.";
              }
            }
            case all {
              leaf all-interfaces {
                type empty;
                description
                  "MLD groups from all interfaces are cleared.";
              }
            }
          }
          leaf group-address {
            type union {
              type enumeration {
                enum '*' * {
                  description
                    "Any group address.";
                }
              }
              type rt-types:ipv6-multicast-group-address;
            }
            description
              "Multicast group IPv6 address.
               If the value '*' is specified, all MLD group entries
               are cleared.";
          }
          leaf source-address {
            type rt-types:ipv6-multicast-source-address;
            description
              "Multicast source IPv6 address.
               If the value '*' is specified, all MLD source-group
               entries are cleared.";
          }
        }
      }
      // action clear-mld-groups
    }
    // mld
  }

  // augment
}
<CODE ENDS>
]]></artwork>
	</figure>
]]></sourcecode>
    </section>
    <section title="Security Considerations" anchor="section-5"><t> anchor="s-5" 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 Network Configuration 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>

	<figure><artwork><![CDATA[

      <artwork name="" type="" align="left" alt=""><![CDATA[
Under /rt:routing/rt:control-plane-protocols
/rt:control-plane-protocol/igmp-mld:igmp,
]]></artwork>
	</figure>

     <t>igmp-mld:global
     <list><t>

      <dl newline="true">
      <dt>igmp-mld:global
      </dt>
      <dd>
     This subtree specifies the configuration for the IGMP attributes
     at the global level on an IGMP instance.  Modifying the
     configuration can cause IGMP membership to be deleted or
     reconstructed on all the interfaces of an IGMP instance.</t></list></t>

     <t>igmp-mld:interfaces
     <list><t> instance.</dd>

      <dt>igmp-mld:interfaces
      </dt>
        <dd>
     This subtree specifies the configuration for the IGMP attributes
     at the interface-global level on a an IGMP instance.  Modifying the
     configuration can cause IGMP membership to be deleted or
     reconstructed on all the interfaces of an IGMP instance.</t></list></t>

     <t>igmp-mld:interfaces/interface
     <list><t> instance.</dd>

      <dt>igmp-mld:interfaces/interface
      </dt>
        <dd>
     This subtree specifies the configuration for the IGMP attributes
     at the interface level on an IGMP instance.  Modifying the
     configuration can cause IGMP membership to be deleted or
     reconstructed on a specific interface of an IGMP instance.</t></list></t>

	<figure><artwork><![CDATA[ instance.</dd>
      </dl>

      <artwork name="" type="" align="left" alt=""><![CDATA[
Under /rt:routing/rt:control-plane-protocols
/rt:control-plane-protocol/igmp-mld:mld,
]]></artwork>
	</figure>

     <t>igmp-mld:global
     <list><t>

      <dl newline="true">
      <dt>igmp-mld:global
      </dt>
        <dd>
     This subtree specifies the configuration for the MLD attributes at
     the global level on an MLD instance.  Modifying the configuration
     can cause MLD membership to be deleted or reconstructed on all the
     interfaces of an MLD instance.</t></list></t>

     <t>igmp-mld:interfaces
     <list><t> instance.</dd>

      <dt>igmp-mld:interfaces
      </dt>
        <dd>
     This subtree specifies the configuration for the MLD attributes at
     the interface-global level on an MLD instance.  Modifying the
     configuration can cause MLD membership to be deleted or
     reconstructed on all the interfaces of an MLD instance.</t></list></t>

     <t>igmp-mld:interfaces/interface
     <list><t> instance.</dd>

      <dt>igmp-mld:interfaces/interface
      </dt>
        <dd>
     This subtree specifies the configuration for the MLD attributes at
     the interface level on a device.  Modifying the configuration can
     cause MLD membership to be deleted or reconstructed on a specific
     interface of an MLD instance.</t></list></t> instance.</dd>
      </dl>
      <t>
   Unauthorized access to any data node of these subtrees can adversely
   affect the membership records of multicast routing subsystem on the
   local device.  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>

	<figure><artwork><![CDATA[
      <artwork name="" type="" align="left" alt=""><![CDATA[
/rt:routing/rt:control-plane-protocols
/rt:control-plane-protocol/igmmp-mld:igmp

/rt:routing/rt:control-plane-protocols
/rt:control-plane-protocol/igmp-mld:mld
]]></artwork>
	</figure>
      <t>
   Unauthorized access to any data node of the above subtree can
   disclose the operational state information of IGMP or MLD on this
   device.</t>
      <t>
   Some of the action 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>

	<figure><artwork><![CDATA[
      <artwork name="" type="" align="left" alt=""><![CDATA[
/rt:routing/rt:control-plane-protocols
/rt:control-plane-protocol/igmmp-mld:igmp/igmmp-mld:clear-groups

/rt:routing/rt:control-plane-protocols
/rt:control-plane-protocol/igmp-mld:mld/igmp-mld:clear-groups
]]></artwork>
	</figure>
      <t>
   Unauthorized access to any of the above action operations can delete
   the IGMP or MLD membership records on this device.</t>
    </section>
    <section title="IANA Considerations" anchor="section-6"><t>
   RFC Ed.: In this section, replace all occurrences of 'XXXX' with the
   actual RFC number (and remove this note).</t> anchor="s-6" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>
   This document registers the following namespace URIs in the IETF XML
   registry <xref target="RFC3688"/>:</t>

        <figure><artwork><![CDATA[
 --------------------------------------------------------------------

 URI: urn:ietf:params:xml:ns:yang:ietf-igmp-mld

 Registrant Contact: The IESG.

 XML: N/A, target="RFC3688" format="default"/>:</t>
 <dl newline="false" spacing="normal">
   <dt>URI:</dt> <dd>urn:ietf:params:xml:ns:yang:ietf-igmp-mld</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 Module
   Names registry <xref target="RFC6020"/>:</t>

        <figure><artwork><![CDATA[

   --------------------------------------------------------------------

   name:  ietf-igmp-mld

   namespace:  urn:ietf:params:xml:ns:yang:ietf-igmp-mld

   prefix:  igmp-mld

   reference:    RFC XXXX
   --------------------------------------------------------------------

]]></artwork>
        </figure> target="RFC6020" format="default"/>:</t>
 <dl newline="false" spacing="normal">
   <dt>Name:</dt><dd>ietf-igmp-mld</dd>
   <dt>Namespace:</dt><dd>urn:ietf:params:xml:ns:yang:ietf-igmp-mld</dd>
   <dt>Prefix:</dt><dd>igmp-mld</dd>
   <dt>Reference:</dt><dd>RFC 8652</dd></dl>

    </section>
  </middle>
  <back>

    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.1112.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.2236.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2710.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3376.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.3810.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4607.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.8294.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"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8519.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3569.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4541.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4605.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5790.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6636.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"/>
        <!-- &I-D.ietf-netconf-subscribed-notifications became RFC 8639-->
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8639.xml"/>
        <!-- &I-D.ietf-netconf-yang-push; became RFC 8641 -->
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8641.xml"/>
      </references>
    </references>

    <section title="Acknowledgments" anchor="section-7"><t> numbered="false" toc="default">
      <name>Acknowledgments</name>
      <t>
   The authors would like to thank Steve Baillargeon, Hu Fangwei,
   Robert Kebler, Tanmoy Kundu, and Stig Venaas for their valuable
   contributions.</t>
    </section>
    <section title="Contributing Authors" anchor="section-8"><figure><artwork><![CDATA[ numbered="false" toc="default">

      <name>Contributors</name>
      <artwork name="" type="" align="left" alt=""><![CDATA[
Yisong Liu
Huawei Technologies
Huawei Bldg., No.156 Beiqing Rd.
Beijing  100095
China

Email: liuyisong@huawei.com
]]></artwork>
	</figure>
    </section>

	</middle>

	<back>
	<references title="Normative References">
	&RFC1112;
	&RFC2119;
	&RFC2236;
	&RFC2710;
	&RFC3376;
	&RFC3688;
	&RFC3810;
	&RFC4607;
	&RFC6020;
	&RFC6241;
	&RFC6242;
	&RFC6991;
	&RFC7950;
	&RFC8040;
	&RFC8174;
	&RFC8294;
	&RFC8341;
	&RFC8342;
	&RFC8343;
	&RFC8344;
	&RFC8349;
	&RFC8446;
	&RFC8519;
	</references>
	<references title="Informative References">
	&RFC3569;
	&RFC4541;
	&RFC4605;
	&RFC5790;
	&RFC6636;
	&RFC8340;
	&RFC8407;
	&I-D.ietf-netconf-subscribed-notifications;
	&I-D.ietf-netconf-yang-push;
	</references>
  </back>
</rfc>