<?xml version="1.0" encoding="iso-8859-1" ?>
<!--<!DOCTYPE rfc SYSTEM "rfc4748.dtd"> -->
    <!DOCTYPE rfc SYSTEM 'rfc2629.dtd' [ 
    <!ENTITY rfc2119 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>  
    <!ENTITY rfc1195 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.1195.xml'> 
    <!ENTITY rfc2328 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2328.xml'> 
    <!ENTITY rfc2629 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml'> 
    <!ENTITY rfc3688 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3688.xml'> 
    <!ENTITY rfc4271 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4271.xml'> 
    <!ENTITY rfc4541 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4541.xml'> 
    <!ENTITY rfc4875 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4875.xml'>    
    <!ENTITY rfc5340 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5340.xml'>     
    <!ENTITY rfc6020 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6020.xml'>   
    <!ENTITY rfc6037 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6037.xml'>  
    <!ENTITY rfc6241 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6241.xml'>
    <!ENTITY rfc6242 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6242.xml'>
    <!ENTITY rfc6388 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6388.xml'> 
    <!ENTITY rfc6513 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6513.xml'> 
    <!ENTITY rfc6991 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6991.xml'>   
    <!ENTITY rfc7348 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7348.xml'>
    <!ENTITY rfc7432 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7432.xml'>    
    <!ENTITY rfc7637 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7637.xml'> 
    <!ENTITY rfc7716 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7716.xml'> 
    <!ENTITY rfc7761 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7761.xml'>  
    <!ENTITY rfc7950 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7950.xml'>    
    <!ENTITY rfc7951 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7951.xml'>     
    <!ENTITY rfc8040 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8040.xml'>    
    <!ENTITY rfc8174 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml'>    
    <!ENTITY rfc8279 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8279.xml'> 
    <!ENTITY rfc8294 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8294.xml'> 
    <!ENTITY rfc8296 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8296.xml'> 
    <!ENTITY rfc8340 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8340.xml'>   
    <!ENTITY rfc8341 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8341.xml'>   
    <!ENTITY rfc8342 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8342.xml'>   
    <!ENTITY rfc8343 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8343.xml'>   
    <!ENTITY rfc8344 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8344.xml'>   
    <!ENTITY rfc8344 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8344.xml'>   
    <!ENTITY rfc8349 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8349.xml'>  
    <!ENTITY rfc8407 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8407.xml'>       
    <!ENTITY rfc8446 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8446.xml'>   
    <!ENTITY rfc8639 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8639.xml'>   
    <!ENTITY rfc8641 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8641.xml'>   
    <!ENTITY rfc8926 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8926.xml'> 
    <!ENTITY rfc8966 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8966.xml'> 
    <!ENTITY rfc9128 PUBLIC '' 'https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9128.xml'>
    <!ENTITY rfc9129 PUBLIC '' 'https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9129.xml'>
    <!ENTITY rfc9130 PUBLIC '' 'https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9130.xml'>
    <!ENTITY rfc9262 PUBLIC '' 'https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9262.xml'>
    <!ENTITY I-D.ietf-bier-bierin6 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-bier-bierin6.xml'>
    <!ENTITY I-D.ietf-bier-bier-yang PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-bier-bier-yang.xml'>
    <!ENTITY I-D.ietf-bier-evpn PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-bier-evpn.xml'>
    <!ENTITY I-D.ietf-bess-evpn-bum-procedure-updates PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-bess-evpn-bum-procedure-updates.xml'>
    <!ENTITY I-D.ietf-bier-mld PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-bier-mld.xml'>
    <!ENTITY I-D.ietf-bier-pim-signaling PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-bier-pim-signaling.xml'>
    <!ENTITY I-D.ietf-rift-rift PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-rift-rift.xml'>
    <!ENTITY I-D.ietf-pim-sr-p2mp-policy PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-pim-sr-p2mp-policy.xml'>
    <!ENTITY I-D.ietf-mboned-redundant-ingress-failover PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-mboned-redundant-ingress-failover.xml'>
		]>

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>		

<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc disable-output-escaping="yes"?>

<rfc category="std"  docName="draft-ietf-mboned-multicast-yang-model-09"
     ipr="trust200902">
  <!-- ***** FRONT MATTER ***** -->
  <front>
    <title abbrev="Multicast YANG Data Model">Multicast YANG Data Model</title>
	
	<author fullname="Zheng Zhang" initials="Z" surname="Zhang">
      <organization>ZTE Corporation</organization>
      <address>
        <postal>
          <street></street>
          <city></city>
          <region></region>
          <code></code>
          <country>China</country>
        </postal>
        <email>zhang.zheng@zte.com.cn</email>
      </address>
    </author>
	
	 <author fullname="Cui(Linda) Wang" initials="C" surname="Wang">
      <organization>Individual</organization>
      <address>
        <postal>
          <street></street>
          <city></city>
          <region></region>
          <code></code>
          <country>Australia</country>
        </postal>
        <email>lindawangjoy@gmail.com</email>
      </address>
    </author>

	 <author fullname="Ying Cheng" initials="Y" surname="Cheng">
      <organization>China Unicom</organization>
      <address>
        <postal>
          <street></street>
          <city>Beijing</city>
          <region></region>
          <code></code>
          <country>China</country>
        </postal>
        <email>chengying10@chinaunicom.cn</email>
      </address>
    </author>

    <author fullname="Xufeng Liu" initials="X" surname="Liu">
      <organization>Alef Edge</organization>
      <address>
        <postal>
          <street></street>
          <city></city>
          <code></code>
          <country></country>
        </postal>
        <email>xufeng.liu.ietf@gmail.com</email>
      </address>
    </author>

	 <author fullname="Mahesh Sivakumar" initials="M" surname="Sivakumar">
      <organization>Juniper networks</organization>
      <address>
        <postal>
          <street>1133 Innovation Way</street>
          <city>Sunnyvale, CALIFORNIA 94089</city>
          <region></region>
          <code></code>
          <country>USA</country>
        </postal>
        <email>sivakumar.mahesh@gmail.com</email>
      </address>
    </author>

	<date year="2023"/>	
    <area>Ops</area>
    <workgroup>MBONED WG</workgroup>
    <keyword>MULTICAST, YANG, MODEL</keyword>
    <abstract>
     <t>This document provides a general multicast YANG data model, 
     which takes full advantages of existed multicast protocol models to control the multicast network, 
     and guides the deployment of multicast service. </t>
    </abstract>
  </front>

  <!-- ***** MIDDLE MATTER ***** -->

  <middle>
  
  <section title="Introduction">
    <t>Currently, there are many multicast protocol YANG models, such as PIM, MLD, and BIER and so on. 
     But all these models are distributed in different working groups as separate files and focus on the protocol itself. 
     Furthermore, they cannot describe a high-level multicast service required by network operators. </t>

    <t>This document provides a general and all-round multicast model, which stands at a high level to 
     take full advantages of these aforementioned models to control the multicast network, 
     and guide the deployment of multicast service.</t>
     
    <t>This document does not define any specific protocol model, instead, 
     it depends on many existing multicast protocol models and relates several multicast information together to fulfill multicast service. </t>

      <t>
	This model can be used along with other multicast
	YANG models such as PIM <xref target="RFC9128"/>, which are not covered in this document.
      </t>
	  
	<section title="Terminology">
	<t>The terminology for describing YANG data models is found in 
	<xref target="RFC6020"/> and <xref target="RFC7950"/>, 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>
	
	<t>The following abbreviations are used in this document and the defined
    model:</t>
	<t>BABEL: <xref target="RFC8966"/>.</t>
  <t>BGP: Border Gateway Protocol <xref target="RFC4271"/>.</t>
  <t>BIER: Bit Index Explicit Replication <xref target="RFC8279"/>.</t>
	<t>BIER-TE: Traffic Engineering for Bit Index Explicit Replication <xref target="RFC9262"/>.</t>
  <t>ISIS: Intermediate System to Intermediate System Routeing Exchange Protocol <xref target="RFC1195"/>.</t>
  <t>MLD: Multicast Listener Discovery <xref target="I-D.ietf-bier-mld"/>.</t>
  <t>MLDP: Label Distribution Protocol Extensions for Point-to-Multipoint and Multipoint-to-Multipoint Label Switched Paths <xref target="RFC6388"/>.</t>
  <t>MVPN: Multicast in MPLS/BGP IP VPNs <xref target="RFC6513"/>.</t>
  <t>OSPF: Open Shortest Path First <xref target="RFC2328"/>.</t>
  <t>P2MP-TE: Point-to-Multipoint Traffic Engineering <xref target="RFC4875"/>.</t>
  <t>PIM: Protocol Independent Multicast <xref target="RFC7761"/>.</t>
  <t>SR-P2MP: Segment Routing Point-to-Multipoint <xref target="I-D.ietf-pim-sr-p2mp-policy"/>.</t>
	</section>

	<section title="Conventions Used in This Document">
	<t>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 <xref target="RFC2119"/> <xref target="RFC8174"/> 
   when, and only when, they appear in all capitals, as shown here.</t>
	</section>
	
	<section title="Tree Diagrams">
	<t>Tree diagrams used in this document follow the notation defined in 
	   <xref target="RFC8340"/>.</t>
	</section>

	<section title="Prefixes in Data Node Names">
	<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 anchor="TABLE_1" title="">

     <ttcol align="left">Prefix</ttcol>
     <ttcol align="left">YANG module</ttcol>
     <ttcol align="left">Reference</ttcol>

     <c>inet</c>
     <c>ietf-inet-types</c>
     <c><xref target="RFC6991"/></c>

     <c>isis</c>
     <c>ietf-isis</c>
     <c><xref target="RFC9130"/></c>

     <c>ospf</c>
     <c>ietf-ospf</c>
     <c><xref target="RFC9129"/></c>
     
     <c>rt-types</c>
     <c>ietf-routing-types</c>
     <c><xref target="RFC8294"/></c>
  
     <c>rt</c>
     <c>ietf-routing</c>
     <c><xref target="RFC8349"/></c>
     
     <c>yang</c>
     <c>ietf-yang-types</c>
     <c><xref target="RFC6991"/></c>
	</texttable>
  </section> 

  <section title="Usage of Multicast Model">
    <t>This multicast YANG data model is mainly used by the management tools run by the network operators,  
     in order to manage, monitor and debug the network resources that are used to deliver multicast service. 
     This model is used for gathering data from the network as well. </t>
     
                                                               
    <figure anchor="fig1" title="Usage of Multicast Model">
     	   <artwork><![CDATA[       
     	   
               +------------------------+                    
               |    Multicast Model     |                    
               +------------------------+                    
                 |        |          |                                   
                 |        |          |                       
                 |  +---------+  +----------+                
                 |  | EMS/NMS |  |Controller|                
                 |  +---------+  +----------+                
                 |        |          |                       
                 |        |          |                       
        +------------------------------------------------+   
        |               Network Element1.....N           |   
        +------------------------------------------------+   
                            
          ]]></artwork></figure>
                                    
    <t> <xref target="fig1"/> illustrates example use cases for this multicast model. 
     Network operators can use this model in a controller which is responsible to implement specific multicast 
     flows with specific protocols and work with the corresponding
     protocols' model to configure the network elements through NETCONF/RESTCONF/CLI. Or network operators can use this model
     to the EMS (Element Management System)/ NMS (Network Management System) to manage or configure the network elements directly. </t>
     
    <t>On the other hand, when the network
     elements detect failure or some other changes, the network devices can send the affected multicast flows and the associated 
     overlay/ transport/ underlay information to the controller. Then the controller/ EMS/NMS can respond immediately due to the 
     failure and distribute new model for the flows to the network nodes quickly. Such as the changing of the failure overlay 
     protocol to another one, as well as transport and underlay protocol. </t>

     <t>Specifically, in section 3, it provides a human readability of the whole multicast network through UML like class diagram, 
     which frames different multicast components and correlates them in a readable fashion. 
     Then, based on this UML like class diagram, there is instantiated and detailed YANG model in Section 4. </t>
         
     <t>The usage of this model is flexible. The multicast-keys indicate the flow characters. The flow can be L3 multicast flow, or L2 flow which is also called BUM (Broadcast, Unknown unicast, Multicast) flow in EVPN (<xref target="RFC7432"/>) deployment.</t> 
     
     <t>Among the multicast-keys, the group-address of L3 multicast flow and the mac-address of BUM flow are the most important keys. 
     The other keys are optional, and need not be all set.
     For example, only group-address is set, this is (*,G) analogous. 
     If source-address and group-address are both set, this is (S,G) analogous. 
     In addition to the source-address and group-address, when vpn-rd is also set, this is MVPN use case. 
     If mac-address and vpn-rd are set, this is EVPN use case.
     In case vni-value is set with associated group-address, etc., this is NVO3 multicast use case.</t> 
     
    <t>
    <list style="symbols">
    <t>When the controller manages all the ingress and egress routers for the flow, it sends the model that is set with flow characters, ingress and egress nodes information to the ingress and egress nodes. Then the ingress and egress nodes can work without any other dynamic overlay protocols.</t>
     
     <t>When the controller manages the ingress nodes only for the flow, it sends the model that is set with the flow characters to the ingress nodes. The dynamic overlay protocol can be set or not. If the overlay protocol is set, the nodes use the protocol to signal the flow information with other nodes. If the overlay protocol is not set, the nodes use the local running overlay protocol to signal the flow information.</t>
     
     <t>When the transport protocol is set in the model, the nodes encapsulate the flow according to the transport protocol. When the transport protocol is not set in the model, the nodes use the local configured transport protocol for encapsulation.</t>
     
     <t>When the transport protocol is set in the model, the underlay protocol may be set in the model also. In case the underlay protocol is set, the nodes use the underlay protocol to signal and build the transport/forwarding layer. In case the underlay protocol is not set, the nodes use the local configured underlay protocol to signal and build the transport/forwarding layer.</t> 
     
     <t>More than one ingress node for a multicast flow can be set in the model. In this situation, two or more ingress nodes can used for a multicast flow forwarding, the ingress routers can be backup for each other. 
     More information can be found in <xref target="I-D.ietf-mboned-redundant-ingress-failover"/>.</t>
     </list>
     </t>
     
    <section title="Example"> 
    <figure anchor="fig2" title="Example">
     	   <artwork><![CDATA[       
                            +------------+
                            |            +---------------------------+
             +--------------+ Controller |                           |
             |              |            +-----------+               |
             |              +------------+           |               |
             |                                       |               |
             |     +-----------------------------+   |               |
             |     |                             |   |               |
             |     |                      +------+---+--+            |
             |     |                      |Egress router+--+ Receiver|
             |     |                      +------+------+            |
         +---+-----+----+                        |                   |
Source +-|Ingress router|     BIER domain        |                   |
         +---------+----+                        |                   |
                   |                      +------+------+            |
                   |                      |Egress router+--+ Receiver|
                   |                      +------+----+-+            |
                   |                             |    |              |
                   +-----------------------------+    +--------------+
          ]]></artwork></figure>
     
     <t>The network administrator can use the multicast model and associated models to deploy the multicast service. 
     For example, suppose that the flow for a multicast service is 233.252.0.0/16, 
     the flow should be forwarded by BIER <xref target="RFC8279"/> with MPLS encapsulation <xref target="RFC8296"/>. 
     Corresponding IGP protocol which is used to build BIER transport layer is OSPF <xref target="RFC2328"/>.</t>
     <t>In this model, the corresponding group-address that is in multicast-keys 
     is set to 233.252.0.0/16, the transport technology is set to BIER. The BIER underlay protocol is set to OSPF.
     The model is sent to every edge router from the controller.
     If the BIER transport layer which depends on OSPF has not been built in the network, the multicast YANG model may invoke the BIER YANG 
     model that is defined in <xref target="I-D.ietf-bier-bier-yang"/> generation in the controller. 
     After the BIER transport layer is built,
     the ingress router encapsulates the multicast flow with BIER header and sends it into the network. 
     Intermediate routers forward the flows to all the egress nodes by BIER forwarding.</t>
     <t>Another example for this figure is, the controller can act as the BIER overlay only. The routers in the domain build BIER forwarding plane beforehand. The controller sends the multicast group-address and/or the source-address to the edge routers in BIER domain only, without transport and underlay set in the model.  Then the ingres router can encapsulate the multicast flow with BIER encapsulation automatically.</t>
     </section>
     

	</section>  
  </section>  
	       
	<section title="Design of the multicast model"> 

  	<section title="Scope of Model">
	
	<t>This model can be used to configure and manage 
   Multicast service.  The operational state data 
   can be retrieved by this model. The subscription and push
   mechanism defined in <xref target="RFC8639"/> 
   and <xref target="RFC8641"/> can be 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 model. 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. 
   This model can be extended, and it has been structured in a way that
   such extensions can be conveniently made.</t>
	</section>

    <section title="Specification">
	<t>	
	   The configuration data nodes cover 
       configurations. The container "multicast-model" is the 
       top level container in this data model. The presence of 
       this container is expected to enable Multicast service functionality.
       The notification is used to notify the controller that there is error and the error reason.</t>
	</section>
	</section>
	
	<section title="Module Structure">
	 <t>
       This model imports and augments the ietf-routing YANG model 
       defined in <xref target="RFC8349"/>.  Both configuration 
       data nodes and state data nodes of <xref target="RFC8349"/>
       are augmented.
	 </t>
	 
	 <t>The YANG data model defined in this document conforms to the Network
   Management Datastore Architecture (NMDA) <xref target="RFC8342"/>.  
   The operational state data is combined with the associated configuration 
   data in the same hierarchy <xref target="RFC8407"/>.</t>
  
  <section title="UML like Class Diagram for Multicast YANG data Model">
  
    <t>The following is a UML like diagram for Multicast YANG data Model. </t>
     <figure anchor="fig3" title="UML like Class Diagram for Multicast YANG data Model">
	   <artwork><![CDATA[
               +-----------+
         +-----+Multi|keys |
         |     +-----------+
         |     |Group Addr |
         |     +-----------+
         |     |Source Addr|    +--------+-----------------+
         |     +-----------+    |        |                 |
         |     |VPN Info   |    |        |          +------+-------+
         |     +-----------+    |  +-----+------+   | Ing/Eg Nodes |
         |     |VNI Info   |    |  |Overlay Tech|   +--------------+
         |     +-----------+    |  +------------+   |Ingress Nodes |
         |                      |  |    EVPN    |   +--------------+
         |                      |  +------------+   |Egress Nodes  |
         |            Contain   |  |    MLD     |   +-------+------+
         |     +-----------+    |  +------------+           | relate
         |     | Multicast +----+  |MLD-Snooping|          \|/
         +-----+  Overlay  |       +------------+  +----------------+
         |     |           |       |    MVPN    |  | BIER Nodes Info|
         |     +-----------+       +------------+  +----------------+
         |                         |    PIM     |  |     BFR-ID     |
         |                         +------------+  +----------------+
         |
+--------+--+           +---------------+----------+----------+
| Multicast |Contain    |               |          |          |
|  Model    |           |            +--+---+  +---+----+  +--+---+
+--------+--+           |            | BIER |  |BIER-TE |  | MPLS |
         |    +---------+--+         +------+  +--------+  +------+
         |    | Multicast  |
         +----+ Transport  | invoke  +-----+  +----------+ +-------+
         |    |            |         | PIM |  |Cisco Mode| |SR-P2MP|
         |    +---------+--+         +--+--+  +----+-----+ +---+---+
         |              |               |          |           |
         |              |               |          |           |
         |              +---------------+----------+-----------+
         |
         |               +--------------+---------+---------+
         |               |              |         |         |
         |               |           +--+---+  +--+---+  +--+--+
         |    +----------+--         | BABEL|  | BGP  |  |ISIS |
         |    | Multicast  |         +------+  +------+  +-----+
         +----+ Underlay   | invoke
              |            |         +------+  +------+  +-----+
              +----------+--         | OSPF |  | PIM  |  |RIFT |
                         |           +--+---+  +--+---+  +--+--+
                         |              |         |         |
                         +--------------+---------+---------+
	    ]]></artwork></figure>
	    
   </section>
 
   <section title="Model Structure"> 
    <figure  align="center">
            <artwork align="center"><![CDATA[			
module: ietf-multicast-model
  +--rw multicast-model
     +--rw multicast-keys*
             [vpn-rd source-address group-address mac-address vni-value]
        +--rw vpn-rd                 rt-types:route-distinguisher
        +--rw source-address         ip-multicast-source-address
        +--rw group-address
        |       rt-types:ip-multicast-group-address
        +--rw mac-address            yang:mac-address
        +--rw vni-value              uint32
        +--rw multicast-overlay
        |  +--rw vni-type?          virtual-type
        |  +--rw ingress-egress
        |  |  +--rw ingress-nodes* [ingress-node]
        |  |  |  +--rw ingress-node    inet:ip-address
        |  |  +--rw egress-nodes* [egress-node]
        |  |     +--rw egress-node    inet:ip-address
        |  +--rw bier-ids {bier}?
        |  |  +--rw sub-domain?      uint16
        |  |  +--rw ingress-nodes* [ingress-node]
        |  |  |  +--rw ingress-node    uint16
        |  |  +--rw egress-nodes* [egress-node]
        |  |     +--rw egress-node    uint16
        |  +--rw dynamic-overlay
        |     +--rw type?   identityref
        |     +--rw mld
        |        +--rw mld-instance-group?
        |                rt-types:ip-multicast-group-address
        +--rw multicast-transport
        |  +--rw type?           identityref
        |  +--rw bier
        |  |  +--rw sub-domain?        uint16
        |  |  +--rw bitstringlength?   uint16
        |  |  +--rw set-identifier?    uint16
        |  |  +--rw (encap-type)?
        |  |     +--:(mpls)
        |  |     +--:(eth)
        |  |     +--:(ipv6)
        |  +--rw bier-te
        |  |  +--rw sub-domain?        uint16
        |  |  +--rw bitstringlength?   uint16
        |  |  +--rw set-identifier?    uint16
        |  |  +--rw (encap-type)?
        |  |  |  +--:(mpls)
        |  |  |  +--:(eth)
        |  |  |  +--:(ipv6)
        |  |  +--rw bitstring* [name]
        |  |     +--rw name           string
        |  |     +--rw bier-te-adj* [adj-id]
        |  |        +--rw adj-id    uint16
        |  +--rw cisco-mdt
        |  |  +--rw p-group?   rt-types:ip-multicast-group-address
        |  +--rw rsvp-te-p2mp
        |  |  +--rw template-name?   string
        |  +--rw pim
        |  |  +--rw source-address?   ip-multicast-source-address
        |  |  +--rw group-address
        |  |          rt-types:ip-multicast-group-address
        |  +--rw sr-p2mp
        |     +--rw ir-segment-lists* [name]
        |     |  +--rw name    string
        |     +--rw replication-segment* [replication-id node-id]
        |        +--rw replication-id    tree-sid
        |        +--rw node-id           inet:ip-address
        +--rw multicast-underlay
           +--rw type?   identityref
           +--rw ospf
           |  +--rw topology?   string
           +--rw isis
           |  +--rw topology?   string
           +--rw pim
              +--rw source-address?   ip-multicast-source-address
              +--rw group-address
                      rt-types:ip-multicast-group-address

  notifications:
    +---n ingress-egress-event
       +--ro event-type?        enumeration
       +--ro multicast-key
       |  +--ro vpn-rd?           rt-types:route-distinguisher
       |  +--ro source-address?   ip-multicast-source-address
       |  +--ro group-address?    rt-types:ip-multicast-group-address
       |  +--ro mac-address?      yang:mac-address
       |  +--ro vni-value?        uint32
       +--ro dynamic-overlay
       |  +--ro type?   identityref
       |  +--ro mld
       |     +--ro mld-instance-group?
       |             rt-types:ip-multicast-group-address
       +--ro transport-tech
       |  +--ro type?           identityref
       |  +--ro bier
       |  |  +--ro sub-domain?        uint16
       |  |  +--ro bitstringlength?   uint16
       |  |  +--ro set-identifier?    uint16
       |  |  +--ro (encap-type)?
       |  |     +--:(mpls)
       |  |     +--:(eth)
       |  |     +--:(ipv6)
       |  +--ro bier-te
       |  |  +--ro sub-domain?        uint16
       |  |  +--ro bitstringlength?   uint16
       |  |  +--ro set-identifier?    uint16
       |  |  +--ro (encap-type)?
       |  |  |  +--:(mpls)
       |  |  |  +--:(eth)
       |  |  |  +--:(ipv6)
       |  |  +--ro bitstring* [name]
       |  |     +--ro name           string
       |  |     +--ro bier-te-adj* [adj-id]
       |  |        +--ro adj-id    uint16
       |  +--ro cisco-mdt
       |  |  +--ro p-group?   rt-types:ip-multicast-group-address
       |  +--ro rsvp-te-p2mp
       |  |  +--ro template-name?   string
       |  +--ro pim
       |  |  +--ro source-address?   ip-multicast-source-address
       |  |  +--ro group-address
       |  |          rt-types:ip-multicast-group-address
       |  +--ro sr-p2mp
       |     +--ro ir-segment-lists* [name]
       |     |  +--ro name    string
       |     +--ro replication-segment* [replication-id node-id]
       |        +--ro replication-id    tree-sid
       |        +--ro node-id           inet:ip-address
       +--ro underlay-tech
          +--ro type?   identityref
          +--ro ospf
          |  +--ro topology?   string
          +--ro isis
          |  +--ro topology?   string
          +--ro pim
             +--ro source-address?   ip-multicast-source-address
             +--ro group-address
                     rt-types:ip-multicast-group-address
            ]]></artwork>
       <postamble></postamble>
      </figure>
     </section>
     
    <section title="Multicast YANG data model Configuration"> 
    <t>This model is used with other protocol data model to provide multicast service.</t>
    
	  <t> This model includes multicast service keys and three layers: the multicast overlay, 
    the transport layer and the multicast underlay information. Multicast keys include the 
    features of multicast flow, such as(vpnid, multicast source and multicast group) information. 
    In data center network, for fine-grained to gather the nodes belonging to the same virtual
     network, there may need VNI-related information to assist.</t>

     <t> Multicast overlay defines 
     (ingress-node, egress-nodes) nodes information. If the transport layer is BIER, 
     there may define BIER information including 
     (Subdomain, ingress-node BFR-id, egress-nodes BFR-id).   
     If no (ingress-node, egress-nodes) information are defined directly, 
     there may need overlay multicast signaling technology, such as MLD or MVPN, 
     to collect these nodes information.</t>
     
     <t>Multicast transport layer defines the type of transport technologies that can 
     be used to forward multicast flow, 
     including BIER forwarding type, MPLS forwarding type, or PIM forwarding type and 
     so on. One or several transport technologies
     could be defined at the same time. As for the detailed parameters 
     for each transport technology, this multicast YANG data model may invoke the 
     corresponding protocol model to define them.</t>
     
     <t>Multicast underlay defines the type of underlay technologies, such as OSPF, 
     ISIS, BGP, PIM or BABEL and so on. One or several 
     underlay technologies could be defined at the same time if there is protective requirement.
     As for the specific parameters for each underlay technology, this multicast YANG 
     data model can depend the corresponding protocol model to configure them as well.</t>

    <t>The configuration modeling branch is composed of the keys, overlay layer, transport layer and underlay layer.</t>
    </section>

	<section title="Multicast YANG data model State"> 
    <t>Multicast model states are the same with the configuration.</t>
    </section>
	
	<section title="Multicast YANG data model Notification"> 
    <t>The defined Notifications include the events of ingress or egress nodes. Like ingress node failure, 
    overlay/ transport/ underlay module loading/ unloading. And the potential failure about 
    some multicast flows and associated overlay/ transport/ underlay technologies.</t>
   </section> 
     
  </section>

	<section title="Multicast YANG data Model"> 
	<t>This module references <xref target="RFC1195"/>, <xref target="RFC2328"/>,
  <xref target="RFC4271"/>, <xref target="RFC4541"/>, <xref target="RFC4875"/>,
  <xref target="RFC5340"/>, <xref target="RFC6037"/>, <xref target="RFC6388"/>,
  <xref target="RFC6513"/>, 
  <xref target="RFC6991"/>, <xref target="RFC7348"/>,
  <xref target="RFC7432"/>, <xref target="RFC7637"/>, <xref target="RFC7716"/>, 
  <xref target="RFC7761"/>, <xref target="RFC8279"/>, <xref target="RFC8294"/>,
  <xref target="RFC8296"/>,
  <xref target="RFC8343"/>, <xref target="RFC8344"/>, 
	<xref target="RFC8349"/>, 
  <xref target="RFC8639"/>, <xref target="RFC8641"/>, <xref target="RFC8926"/>, <xref target="RFC8966"/>, 
  <xref target="RFC9128"/>, <xref target="RFC9262"/>, <xref target="RFC9130"/>, 
  <xref target="I-D.ietf-bier-bier-yang"/>,
  <xref target="I-D.ietf-bier-mld"/>,
  <xref target="I-D.ietf-bess-evpn-bum-procedure-updates"/>,
  <xref target="I-D.ietf-bier-evpn"/>,
  <xref target="I-D.ietf-bier-bierin6"/>,
  <xref target="I-D.ietf-bier-pim-signaling"/>, 
  <xref target="I-D.ietf-rift-rift"/>,
  </t>
  
     <figure  align="center">
            <artwork align="center"><![CDATA[			
<CODE BEGINS> file "ietf-multicast-model@2022-03-05.yang"
module ietf-multicast-model {

  yang-version 1.1;

  namespace "urn:ietf:params:xml:ns:yang:ietf-multicast-model";
  prefix ietf-multicast-model;

  import ietf-yang-types {
    prefix "yang";
    reference 
      "RFC 6991: Common YANG Data Types";
  }
  
  import ietf-inet-types {
    prefix "inet";
    reference 
      "RFC 6991: Common YANG Data Types";
  }
  import ietf-routing-types {
    prefix "rt-types";
    reference 
      "RFC 8294: Common YANG Data Types for the Routing Area";
  }
  import ietf-routing {
    prefix "rt";
    reference 
      "RFC 8349: A YANG Data Model for Routing Management 
                 (NMDA Version)";
  }

  organization " IETF MBONED (MBONE Deployment) Working Group";
  contact
    "WG List:  <mailto:mboned@ietf.org>

     Editor:   Zheng Zhang
               <mailto:zhang.zheng@zte.com.cn>
     Editor:   Cui Wang
               <mailto:lindawangjoy@gmail.com>
     Editor:   Ying Cheng
               <mailto:chengying10@chinaunicom.cn>
     Editor:   Xufeng Liu
               <mailto:xufeng.liu.ietf@gmail.com>
     Editor:   Mahesh Sivakumar
               <mailto:sivakumar.mahesh@gmail.com>
    ";

  // RFC Ed.: replace XXXX with actual RFC number and remove
  // this note
      
  description
    "The module defines the YANG definitions for multicast service
     management.

     Copyright (c) 2021 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject 
     to the license terms contained in, the Simplified BSD 
     License set forth in Section 4.c of the IETF Trust's Legal 
     Provisions Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX
     (https://www.rfc-editor.org/info/rfcXXXX); see the RFC 
     itself for full legal notices.

     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.";

  revision 2023-03-05 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: A YANG Data Model for multicast YANG.";
  }

  /*
   *feature
   */
  feature bier {
    description
      "Cooperation with BIER technology.";
    reference
      "RFC 8279: 
         Multicast Using Bit Index Explicit Replication (BIER).";
  }
    
  /*
   *typedef
   */
  typedef ip-multicast-source-address {
    type union {
      type enumeration {
        enum * {
          description
            "Any source address.";
        }
      }
      type inet:ipv4-address;
      type inet:ipv6-address;
    }
    description
      "Multicast source IP address type.";
  }
  typedef tree-sid {
    type union {
      type rt-types:mpls-label;
      type inet:ip-prefix;
    }
    description
      "The type of the Segment Identifier of a Replication segment 
       is a SR-MPLS label or a SRv6 SID.";
  }
  typedef virtual-type {
    type enumeration {
      enum vxlan {
        description 
          "The VXLAN encapsulation is used for flow encapsulation.";
        reference
          "RFC 7348: Virtual eXtensible Local Area Network (VXLAN): 
           A Framework for Overlaying Virtualized Layer 2 Networks 
           over Layer 3 Networks.";
      }
      enum nvgre {
        description 
          "The NVGRE encapsulation is used for flow encapsulation.";
        reference
          "RFC 7637: NVGRE: Network Virtualization Using Generic 
           Routing Encapsulation.";
      }
      enum geneve {
        description 
          "The GENEVE encapsulation is used for flow encapsulation.";
        reference
          "RFC 8926: Geneve: Generic Network 
           Virtualization Encapsulation.";
      }
    }
    description 
      "The encapsulation type used for the flow. 
       When this type is set, the associated vni-value 
       MUST be set.";
  } // virtual-type

  /*
   * Identities
   */

  identity multicast-model {
    base "rt:control-plane-protocol";
    description "Identity for the multicast model.";
  }
  identity overlay-type {
    description 
      "Base identity for the type of multicast overlay technology.";
  }
  identity transport-type {
    description "Identity for the multicast transport technology.";
  }
  identity underlay-type {
    description "Identity for the multicast underlay technology.";
  }
  identity overlay-pim {
    base overlay-type;
    description 
      "Using PIM as multicast overlay technology. 
       For example, as BIER overlay.";
    reference 
      "I-D.ietf-bier-pim-signaling: 
         PIM Signaling Through BIER Core.";
  }
  identity mld {
    base overlay-type;
    description 
      "Using MLD as multicast overlay technology. 
       For example, as BIER overlay.";
    reference
      "I-D.ietf-bier-mld: 
         BIER Ingress Multicast Flow Overlay 
         using Multicast Listener Discovery Protocols.";
  }
  identity mld-snooping {
    base overlay-type;
    description 
      "Using MLD as multicast overlay technology. 
       For example, as BIER overlay.";
    reference
      "RFC 4541: 
         Considerations for Internet Group Management 
         Protocol (IGMP) and Multicast Listener 
         Discovery (MLD) Snooping Switches.";
  }
  identity evpn {
    base overlay-type;
    description 
      "Using EVPN as multicast overlay technology.";
    reference
      "RFC 7432: BGP MPLS-Based Ethernet VPN.
       I-D.ietf-bess-evpn-bum-procedure-updates: 
         Updates on EVPN BUM Procedures.
       I-D.ietf-bier-evpn: EVPN BUM Using BIER.";
  }
  identity mvpn {
    base overlay-type;
    description 
      "Using MVPN as multicast overlay technology.";
    reference
      "RFC 6513: Multicast in MPLS/BGP IP VPNs. 
       RFC 7716: 
         Global Table Multicast with BGP Multicast VPN 
         (BGP-MVPN) Procedures.";
  }
  identity bier {
    base transport-type;
    description 
      "Using BIER as multicast transport technology.";
    reference
      "RFC 8279: 
         Multicast Using Bit Index Explicit Replication (BIER).";
  }
  identity bier-te {
    base transport-type;
    description 
      "Using BIER-TE as multicast transport technology.";
    reference
      "RFC 9262: 
         Traffic Engineering for Bit Index Explicit Replication 
         (BIER-TE)";
  }
  identity mldp {
    base transport-type;
    description 
      "Using mLDP as multicast transport technology.";
    reference
      "RFC 6388: 
         Label Distribution Protocol Extensions 
         for Point-to-Multipoint and Multipoint-to-Multipoint
         Label Switched Paths.
       I-D.ietf-mpls-mldp-yang: YANG Data Model for MPLS mLDP.";
  }
  identity rsvp-te-p2mp {
    base transport-type;
    description 
      "Using P2MP TE as multicast transport technology.";
    reference
      "RFC 4875: 
         Extensions to Resource Reservation Protocol 
         - Traffic Engineering (RSVP-TE) for Point-to-Multipoint 
         TE Label Switched Paths (LSPs).";
  }
  identity sr-p2mp {
    base transport-type;
    description 
      "Using Segment Routing  as multicast transport technology.";
    reference
      "I-D.ietf-pim-sr-p2mp-policy: 
         Segment Routing Point-to-Multipoint Policy.";
  }
  identity cisco-mdt {
    base transport-type;
    description 
      "Using cisco MDT for multicast transport technology.";
    reference
      "RFC 6037: 
         Cisco Systems' Solution for Multicast in BGP/MPLS IP VPNs";
  }
  identity pim {
    base transport-type;
    base underlay-type;
    description 
      "Using PIM as multicast transport technology.";
    reference
      "RFC 7761: 
         Protocol Independent Multicast - Sparse Mode 
         (PIM-SM): Protocol Specification (Revised).";
  }
  identity bgp {
    base underlay-type;
    description 
      "Using BGP as underlay technology to build the multicast 
       transport layer. For example, using BGP as BIER underlay.";
    reference
      "I-D.ietf-bier-idr-extensions: BGP Extensions for BIER.";
  }
  identity ospf  {
    base underlay-type;
    description 
      "Using OSPF as multicast underlay technology. 
       For example, using OSPF as BIER underlay.";
    reference
      "RFC 8444: 
         OSPFv2 Extensions for Bit Index Explicit Replication (BIER), 
       I-D.ietf-bier-ospfv3-extensions: 
         OSPFv3 Extensions for BIER.";
  }
  identity isis {
    base underlay-type;
    description 
      "Using ISIS as multicast underlay technology. 
       For example, using ISIS as BIER underlay.";
    reference
      "RFC 8401: 
         Bit Index Explicit Replication (BIER) Support via IS-IS";
  }
  identity babel {
    base underlay-type;
    description 
      "Using BABEL as multicast underlay technology. 
       For example, using BABEL as BIER underlay.";
    reference
      "RFC 8966: The Babel Routing Protocol 
       I-D.zhang-bier-babel-extensions: BIER in BABEL";
  }
  identity rift {
    base underlay-type;
    description 
      "Using RIFT as multicast underlay technology. 
       For example, using RIFT as BIER underlay.";
    reference
      "I-D.ietf-rift-rift: RIFT: Routing in Fat Trees. 
       I-D.zzhang-bier-rift: Supporting BIER with RIFT";
  }
  
  grouping general-multicast-key {
    description 
      "The general multicast keys. They are used to distinguish 
       different multicast service.";
    leaf vpn-rd {
      type rt-types:route-distinguisher;
      description 
        "A Route Distinguisher used to distinguish
         routes from different MVPNs.";
      reference
        "RFC 8294: Common YANG Data Types for the Routing Area.
         RFC 6513: Multicast in MPLS/BGP IP VPNs.";
    }
    leaf source-address {
      type ip-multicast-source-address;
      description
        "The IPv4/IPv6 source address of the multicast flow. The
         value set to zero means that the receiver interests
         in all source that relevant to one given group.";
    }
    leaf group-address {
      type rt-types:ip-multicast-group-address;
      description
        "The IPv4/IPv6 group address of multicast flow. This
         type represents a version-neutral IP multicast group
         address. The format of the textual representation
         implies the IP version.";
      reference
        "RFC 8294: Common YANG Data Types for the Routing Area.";
    }
    leaf mac-address {
      type yang:mac-address;
      description
        "The mac address of flow. In the EVPN situation, the L2 
         flow that is called 
         BUM (Broadcast, Unknown Unicast, Multicast) 
         can be sent to the other PEs that 
         are in a same broadcast domain.";
      reference
        "RFC 6991: Common YANG Data Types. 
         RFC 7432: BGP MPLS-Based Ethernet VPN.";
    }
    leaf vni-value {
      type uint32;
      description
        "The value of Vxlan network identifier, virtual subnet ID 
         or virtual net identifier. This value and vni-type is used 
         to indicate a specific virtual multicast service.";
    }
  } // general-multicast-key

  grouping encap-type {
    description
      "The encapsulation type used for flow forwarding. 
       This encapsulation acts as the inner encapsulation, 
       as compare to the outer multicast-transport encapsulation.";
    choice encap-type {
      case mpls {
        description "The BIER forwarding depends on mpls.";
        reference
          "RFC 8296: Encapsulation for Bit Index Explicit 
           Replication (BIER) in MPLS and Non-MPLS Networks.";
      }
      case eth {
        description "The BIER forwarding depends on ethernet.";
        reference
          "RFC 8296: Encapsulation for Bit Index Explicit 
           Replication (BIER) in MPLS and Non-MPLS Networks.";
      }
      case ipv6 {
        description "The BIER forwarding depends on IPv6.";
        reference
          "I-D.ietf-bier-bierin6: BIER in IPv6 (BIERin6)";
      }
      description "The encapsulation type in BIER.";
    }
  } // encap-type

  grouping bier-key {
    description
      "The key parameters set for BIER/BIER TE forwarding.";
    reference
      "RFC 8279: Multicast Using Bit Index Explicit Replication 
       (BIER).";
       
    leaf sub-domain {
      type uint16;
      description
        "The subdomain id that the multicast flow belongs to.";
    }
    leaf bitstringlength {
      type uint16;
      description 
        "The bitstringlength used by BIER forwarding.";
    }
    leaf set-identifier {
      type uint16;
      description 
        "The set identifier used by the multicast flow.";
    }
    uses encap-type;
  }
  
  grouping transport-tech {
    description 
      "The transport technology selected for the multicast service. 
       For one specific multicast flow, it's better to use only one 
       transport technology for forwarding.";

    leaf type {
      type identityref {
        base transport-type;
      }
      description "The type of transport technology";
    }
    container bier {
      when "../type = 'ietf-multicast-model:bier'" {
         description 
           "Only when BIER is used as transport technology.";
      }
      description
        "The transport technology is BIER. The BIER technology
         is introduced in RFC8279. The parameters are consistent
         with the definition in BIER YANG data model.";
      reference
        "I-D.ietf-bier-bier-yang: 
           YANG Data Model for BIER Protocol.";
      uses bier-key; 
    }
    container bier-te {
      when "../type = 'ietf-multicast-model:bier-te'" {
         description 
           "Only when BIER-TE is used as transport technology.";
      }
      description 
        "The BIER-TE parameter that may need to be set. 
         The parameters are consistent with the definition in 
         BIER and BIER TE YANG data model.";
      reference
        "I-D.ietf-bier-bier-yang: 
           YANG Data Model for BIER Protocol
         I-D.ietf-bier-te-yang: 
           A YANG data model for Traffic Engineering for Bit Index 
           Explicit Replication (BIER-TE)";
         
      uses bier-key; 
      
      list bitstring {
        key "name";
        leaf name {
          type string;
          description "The name of the bitstring";
        }
        list bier-te-adj {
          key "adj-id";
          leaf adj-id {
            type uint16;
            description
              "The link adjacency ID used for BIER TE forwarding.";
          }
          description 
            "The adjacencies ID used for BIER TE bitstring 
             encapsulation.";
        }
        description
          "The bitstring name and detail used for BIER TE 
           forwarding encapsulation. One or more bitstring can be 
           used for backup path.";
      }
    }
    container cisco-mdt {
      when "../type = 'ietf-multicast-model:cisco-mdt'" {
         description 
           "Only when cisco MDT is used as transport technology.";
      }
      description "The MDT parameter that may need to be set.";
      leaf p-group {
        type rt-types:ip-multicast-group-address;
        description
          "The address of p-group. It is used to encapsulate
           and forward flow according to multicast tree from
           ingress node to egress nodes.";
      }
    }
    container rsvp-te-p2mp {
      when "../type = 'ietf-multicast-model:rsvp-te-p2mp'" {
       description 
         "Only when RSVP TE P2MP is used as transport technology.";
      }
      description
        "The parameter that may be set. They are consistent with 
        the definition in TE data model.";
      reference
        "RFC 8776: Common YANG Data Types for Traffic Engineering";
      
      leaf template-name {
        type string {
          pattern '/?([a-zA-Z0-9\-_.]+)(/[a-zA-Z0-9\-_.]+)*';
        }
        description
          "A type for the name of a TE node template or TE link
           template.";
      }
    }
    container pim {
      when "../type = 'ietf-multicast-model:pim'" {
         description 
           "Only when PIM is used as transport technology.";
      }
      description "The PIM parameter that may need to be set.";
      uses pim;
    }
    container sr-p2mp {
      when "../type = 'ietf-multicast-model:sr-p2mp'" {
         description 
           "Only when segment routing P2MP is used as transport 
            technology.";
      }
      description "The SR-P2MP parameter that may need to be set.";
      list ir-segment-lists {
        key "name";
        leaf name {
          type string;
          description "Segment-list name";
        }
        description 
          "The segment lists used for ingress replication. 
           The name refers a segment list.";
      }
      
      list replication-segment {
        key "replication-id node-id";
        leaf replication-id {
          type tree-sid;
          description
            "The identifier for a Replication segment that is 
             unique in context of the Replication Node. 
             This is a SR-MPLS label or a SRv6 SID";
        }
        leaf node-id {
          type inet:ip-address;
          description
            "The address of the Replication Node that the 
             Replication segment is for.";
        }
        description 
          "A Multi-point service delivery could be realized via 
           P2MP trees in a Segment Routing domain. 
           It may consist of one or more Replication segment";
        reference
          "I-D.ietf-spring-sr-replication-segment: 
             SR Replication Segment for Multi-point Service 
             Delivery.";
      }
    } // sr-p2mp
  } // transport-tech
  
  grouping underlay-tech {
    description 
      "The underlay technology selected for the transport layer. 
       The underlay technology has no straight relationship with 
       the multicast overlay, it is used for transport path 
       building, for example BIER forwarding path building.";

    leaf type {
      type identityref {
        base underlay-type;
      }
      description "The type of underlay technology";
    }
    container ospf {
      when "../type = 'ietf-multicast-model:ospf'" {
         description 
           "Only when OSPF is used as underay technology.";
      }
      description 
        "If OSPF protocol supports multiple topology feature, 
         the associated topology name may be assigned.  
         In case the topology name is assigned, the specific 
         OSPF topology is used for underly to building the 
         transport layer.";
      reference
        "RFC 4915: Multi-Topology Routing";
      leaf topology {
        type string;
        description
          "The designed topology name of ospf protocol.";
      }
    }
    container isis {
      when "../type = 'ietf-multicast-model:isis'" {
         description 
           "Only when ISIS is used as underay technology.";
      }
      description 
        "If ISIS protocol supports multiple topology feature, 
         the associated topology name may be assigned.  
         In case the topology name is assigned, the specific 
         ISIS topology is used for underly to building the 
         transport layer.";
      reference
        "RFC 5120: M-IS-IS: Multi Topology Routing in IS-IS";
      leaf topology {
        type string;
        description
          "The designed topology name of isis protocol.";
      }
    }
    container pim {
      when "../type = 'ietf-multicast-model:pim'" {
         description 
           "Only when PIM is used as underay technology.";
      }
      description "The PIM parameter that may need to be set.";
      uses pim;
    }
  } // underlay-tech

  /*overlay*/

  grouping overlay-tech {
    container dynamic-overlay {
      leaf type {
        type identityref {
          base overlay-type;
        }
        description "The type of overlay technology";
      }
      container mld {
        when "../type = 'ietf-multicast-model:mld'" {
           description 
             "Only when MLD is used as overlay technology.";
        }
        description "The MLD parameter that may need to be set.";
        leaf mld-instance-group {
          type rt-types:ip-multicast-group-address;
          description
            "The multicast address used for multiple MLD instance
             support.";
        }
      }
      description 
        "The dynamic overlay technologies and associated parameter 
         that may be set.";
    }     
    description "The overlay technology used for multicast service.";
  } // overlay-tech

  /*transport*/

  grouping pim {
    description
      "The required information of pim transportion.";
    leaf source-address {
      type ip-multicast-source-address;
      description
        "The IPv4/IPv6 source address of the multicast flow. The
         value set to zero means that the receiver interests
         in all source that relevant to one given group.";
    }
    leaf group-address {
      type rt-types:ip-multicast-group-address;
      mandatory true;
      description
        "The IPv4/IPv6 group address of multicast flow. This
         type represents a version-neutral IP multicast group
         address. The format of the textual representation
         implies the IP version.";
    }
    reference
      "RFC 7761: Protocol Independent Multicast - Sparse Mode 
                 (PIM-SM): Protocol Specification (Revised).";
  } //pim

  /*underlay*/

  container multicast-model {
    description
      "The model of multicast YANG data. Include keys, overlay,
       transport and underlay.";

    list multicast-keys{
      key "vpn-rd source-address group-address mac-address 
           vni-value";
      uses general-multicast-key;

      container multicast-overlay {
        description
          "The overlay information of multicast service.
           Overlay technology is used to exchange multicast
           flows information. Overlay technology may not be
           used in SDN controlled completely situation, but
           it can be used in partial SDN controlled situation
           or non-SDN controlled situation. Different overlay
           technologies can be choosed according to different
           deploy consideration.";
                     
        leaf vni-type {
          type virtual-type;
          description
            "The encapsulated type for the multicast flow, 
             it is used to carry the virtual network identifier 
             for the multicast service.";
        }
        
        container ingress-egress {
          description 
            "The ingress and egress nodes address collection. 
             The ingress node may use the egress nodes set 
             directly to encapsulate the multicast flow by 
             transport technology.";
             
          list ingress-nodes {
            key "ingress-node";
            description
              "The egress nodes of multicast flow.";

            leaf ingress-node {
              type inet:ip-address;
              description
                "The ip address of ingress node for one or more
                 multicast flow. Or the ingress node of MVPN and
                 BIER. In MVPN, this is the address of ingress
                 PE; in BIER, this is the BFR-prefix of ingress
                 nodes.
                 Two or more ingress nodes may existed for the 
                 redundant ingress node protection.";
            }
          }
          
          list egress-nodes {
            key "egress-node";
            description
              "The egress multicast nodes of the multicast flow. 
               Or the egress node of MVPN and BIER. In MVPN, this
               is the address of egress PE; in BIER, this is the
               BFR-prefix of ingress nodes.";

            leaf egress-node {
              type inet:ip-address;
              description
                "The ip-address set of egress multicast nodes.";
            }
          }
        }
        
        container bier-ids {
          if-feature bier;
          description
            "The BFR-ids of ingress and egress BIER nodes for
             one or more multicast flows. This overlay is used 
             with BIER transport technology. The egress nodes 
             set can be used to encapsulate the multicast flow 
             directly in the ingress node.";
          reference
            "RFC 8279: Multicast Using Bit Index Explicit 
             Replication (BIER)";
          
          leaf sub-domain {
            type uint16;
            description
              "The sub-domain that this multicast flow belongs to.";
          }
          list ingress-nodes {
            key "ingress-node";
            description
              "The ingress nodes of multicast flow.";
            leaf ingress-node {
              type uint16;
              description
                "The ingress node of multicast flow. This is the 
                 BFR-id of ingress nodes.";
            }
          }
          list egress-nodes {
            key "egress-node";
            description
              "The egress nodes of multicast flow.";

            leaf egress-node {
              type uint16;
              description
                "The BFR-ids of egress multicast BIER nodes.";
            }
          }
        }
        uses overlay-tech;
      }
      
      container multicast-transport {
        description
          "The transportion of multicast service. Transport
           protocol is responsible for delivering multicast
           flows from ingress nodes to egress nodes with or
           without specific encapsulation. Different transport
           technology can be choosed according to different
           deploy consideration. Once a transport technology
           is choosed, associated protocol should be triggered
           to run.";
        
        uses transport-tech;
      }
      container multicast-underlay {
        description
          "The underlay of multicast service. Underlay protocol
           is used to build transport layer. Underlay protocol
           need not be assigned in ordinary network since
           existed underlay protocol fits well, but it can be
           assigned in particular networks for better
           controll. Once a underlay technology is choosed,
           associated protocol should be triggered to run.";

        uses underlay-tech;
      }
      description
        "The model of multicast YANG data. Include keys,
         overlay, transport and underlay.";
    }
  }

  /*Notifications*/

  notification ingress-egress-event {
    leaf event-type {
      type enumeration {
        enum down {
          description
            "There is something wrong with ingress or egress node, 
             and node can't work properlay.";
        }
        enum protocol-enabled {
          description
            "The protocol that is used for multicast
             flows have been enabled.";
        }
        enum protocol-disabled {
          description
            "The protocol that is used by multicast
             flows have been disabled.";
        }
      }
      description "Event type.";
    }
    container multicast-key {
      uses general-multicast-key;
      description
        "The associated multicast keys that are influenced by
         ingress or egress node failer.";
    }
    uses overlay-tech;

    container transport-tech {
      description 
        "The modules can be used to forward multicast flows.";
      uses transport-tech;
    }
    
    container underlay-tech {
      description 
        "There is something wrong with the module which is 
         used to build multicast transport layer.";
      uses underlay-tech;
    }
    description
      "Notification events for the ingress or egress nodes. Like 
       node failer, overlay/ transport/ underlay module
       loading/ unloading. And the potential failer about some
       multicast flows and associated
       overlay/ transport/ underlay technologies.";
  }
}
<CODE ENDS>
            ]]></artwork>
       <postamble></postamble>
      </figure>
    </section>
	
   <section title="Security Considerations"> 
	<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"/> or RESTCONF <xref target="RFC8040"/>. 
   The lowest NETCONF layer is the secure transport layer, and the 
   mandatory-to-implement secure transport is Secure Shell (SSH) <xref target="RFC6242"/>. 
   The lowest RESTCONF layer is HTTPS, and the mandatory-to-implement secure 
   transport is TLS <xref target="RFC8446"/>.</t>

   <t>The NETCONF access control model <xref target="RFC8341"/> 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 data nodes
   and their sensitivity/vulnerability:</t>
   
   <t>Under /rt:routing/rt:control-plane-protocols/multicast-model,</t>
   <t>multicast-model
      <list style="simblos">
      <t>These data nodes in this model specifies the configuration for the multicast service
      at the top level. Modifying the configuration can cause multicast service 
      to be deleted or reconstructed.</t>
      </list>
   </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 data
   nodes and their sensitivity/vulnerability:</t>

   <t>/rt:routing/rt:control-plane-protocols/multicast-model,</t>
   <t>Unauthorized access to any data node of the above tree can
   disclose the operational state information of multicast service on this
   device.
   </t>
  
   </section>

   <section title="IANA Considerations"> 
	<t>RFC Ed.: Please replace all occurrences of 'XXXX' with the
   actual RFC number (and remove this note).</t>
  
  <t> The IANA is requested to assign one new URI from the IETF XML
   registry <xref target="RFC3688"/>.  Authors are suggesting the following URI:</t>

       <t>URI: urn:ietf:params:xml:ns:yang:ietf-multicast-model</t>
       <t>Registrant Contact: The IESG</t>
       <t>XML: N/A, the requested URI is an XML namespace</t>

   <t>This document also requests one new YANG module name in the YANG
   Module Names registry <xref target="RFC6020"/> with the following suggestion:</t>

       <t>name: ietf-multicast-model</t>
       <t>namespace: urn:ietf:params:xml:ns:yang:ietf-multicast-model</t>
       <t>prefix: multicast-model</t>
       <t>reference: RFC XXXX</t>
   </section>
  
   <section title="Acknowledgements"> 
    <t>The authors would like to thank Stig Venaas, Jake Holland, Min Gu, Gyan Mishra for their valuable comments and suggestions.</t>
   </section>

  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
  
  <references title='Normative References'>
  &rfc1195;
  &rfc2119;
  &rfc2328;
  &rfc4271;
  &rfc4875; 
  &rfc5340;
  &rfc6020;
  &rfc6241;
  &rfc6242;
  &rfc6388;
  &rfc6513;  
  &rfc6991;
  &rfc7432;
  &rfc7716;
  &rfc7761;
  &rfc7950;
  &rfc7951;
  &rfc8040;  
  &rfc8174;
  &rfc8279;
  &rfc8294;
  &rfc8296;
  &rfc8340;
  &rfc8341;
  &rfc8342;
  &rfc8343;
  &rfc8344;
  &rfc8349; 
  &rfc8446;
  </references>

  <references title='Informative References'>
  &rfc3688;
  &rfc4541;
  &rfc6037;
  &rfc7348;
  &rfc7637;
  &rfc8407;
  &rfc8639;
  &rfc8641;
  &rfc8926;
  &rfc8966; 
  &rfc9128; 
  &rfc9129; 
  &rfc9130; 
  &rfc9262; 
  &I-D.ietf-bier-bier-yang;
  &I-D.ietf-bier-mld;
  &I-D.ietf-bess-evpn-bum-procedure-updates;
  &I-D.ietf-bier-evpn;
  &I-D.ietf-bier-bierin6;
  &I-D.ietf-bier-pim-signaling;
  &I-D.ietf-rift-rift;
  &I-D.ietf-pim-sr-p2mp-policy;
  &I-D.ietf-mboned-redundant-ingress-failover;
  </references>
  
  <section title="Data Tree Example"> 
	<t>This section contains an example of an instance data tree in JSON
   encoding <xref target="RFC7951"/>, containing configuration data.</t>
   <t>The configuration example:</t>
 
      <figure align="center">
     <artwork align="center"><![CDATA[
{
  "ietf-multicast-model:multicast-model":{
    "multicast-keys":[
      {
        "vpn-rd":"0:65532:4294967292",
        "source-address":"*",
        "group-address":"234.232.203.84",
        "mac-address": "00:00:5e:00:53:01",
        "vni-value":0,
        "multicast-overlay":{
          "vni-type":"nvgre",
          "ingress-egress":{
            "ingress-nodes":[
              {
                "ingress-node":"146.150.100.0"
              }
            ],
            "egress-nodes":[
              {
                "egress-node":"110.141.168.0"
              }
            ]
          }
        },
        "multicast-transport":{
          "type": "ietf-multicast-model:bier",
          "bier":{
            "sub-domain":0,
            "bitstringlength":256,
            "set-identifier":0
          }
        },
        "multicast-underlay":{
          "type": "ietf-multicast-model:ospf",
          "ospf":{
            "topology":"2"
          }
        }
      }
    ]
  }
}
            ]]></artwork>
       <postamble></postamble>
      </figure>
  </section>
	</back>
</rfc>
