<?xml version='1.0'?>   
  <!DOCTYPE rfc SYSTEM 'rfc2629.dtd' [ 
  <!ENTITY rfc2629 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml'> 
  <!ENTITY rfc2328 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2328.xml'> 
  <!ENTITY rfc7761 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7761.xml'> 
  <!ENTITY rfc2119 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'> 
  <!ENTITY rfc8174 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml'> 
  <!ENTITY rfc5880 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5880.xml'> 
  <!ENTITY rfc8775 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8775.xml'> 
  <!ENTITY rfc9186 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.9186.xml'>
  <!ENTITY I-D.ietf-pim-bdr PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-pim-bdr.xml'>
		]>
<?rfc strict="yes"?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-ietf-pim-dr-improvement-15"
     ipr="trust200902">
  <!-- ***** FRONT MATTER ***** -->
  <front>
    <title abbrev="PIM DR Improvement">Protocol Independent Multicast - Sparse Mode (PIM-SM) Designated Router (DR) Improvement</title>
	
	<author fullname="Zheng(Sandy) Zhang" initials="Z" surname="Zhang">
      <organization>ZTE Corporation</organization>

      <address>
        <postal>
          <street>No. 50 Software Ave, Yuhuatai Distinct</street>
          
          <city>Nanjing</city>
          
          <region></region>
  
          <code></code>

          <country>China</country>
        </postal>

        <phone></phone>

        <email>zhang.zheng@zte.com.cn</email>
      </address>
    </author>
	
	 <author fullname="Fangwei Hu" initials="F" surname="Hu">
      <organization>Individual</organization>

      <address>
        <postal>
          <street></street>
          
          <city>Shanghai</city>
          
          <region></region>
  
          <code></code>

          <country>China</country>
        </postal>

        <phone></phone>

        <email>hufwei@gmail.com</email>
      </address>
    </author>
	
	<author initials="B" surname="Xu" fullname="Benchong Xu">
      <organization>ZTE Corporation</organization>
    
      <address>
	   <postal>
	     <street>No. 68 Zijinghua Road, Yuhuatai Distinct </street>
		 
        <region>Nanjing</region>
	    
		<country>China</country>
	   </postal>
	   
	   <phone></phone>
	   <email>xu.benchong@zte.com.cn</email>
      </address>
    </author>

	<author initials="M" surname="Mishra" fullname="Mankamana Mishra">
      <organization>Cisco Systems</organization>
    
      <address>
	   <postal>
	     <street>821 Alder Drive,</street>
		 
        <region>MILPITAS, CALIFORNIA 95035</region>
	    
		<country>UNITED STATES</country>
	   </postal>
	   
	   <phone></phone>
	   <email>mankamis@cisco.com</email>
      </address>
    </author>
	
	<date year="2025"/>	
    <area>Routing</area>
    <workgroup>PIM WG</workgroup>
    <keyword>PIM, DR, stability</keyword>
    <abstract>
     <t>Protocol Independent Multicast - Sparse Mode (PIM-SM) is a widely
   deployed multicast protocol.  As deployment for the PIM protocol is
   growing day by day, a user expects lower packet loss and faster
   convergence regardless of the cause of the network failure.  
   This document defines an extension to the existing protocol, which improves 
   the PIM's stability with respect to packet loss and convergence 
   time when the PIM Designated Router (DR) role changes.</t>
    </abstract>
  </front>

  <!-- ***** MIDDLE MATTER ***** -->

  <middle>
    <section title="Introduction">
      <t>Multicast technology, with PIM-SM (<xref target="RFC7761"/>), is used widely in Modern
   services. Some events, such as changes in
   unicast routes, or a change in the PIM-SM DR, may cause the loss of
   multicast packets.
 </t> 
 
 <t>The PIM DR has two
   responsibilities in the PIM-SM protocol. For any active sources on a
   LAN, the PIM DR is responsible for registering with the Rendezvous
   Point (RP). Also, the PIM DR is
   responsible for tracking local multicast listeners and forwarding
   data to these listeners.</t>
   
    <figure  align="center">
      <artwork align="center"><![CDATA[			
          +                  +
          |                  |
    +-----+----+       +-----+----+
    | RouterA  |       | RouterB  |
    +-----+----+       +-----+----+
          |                  |
+----+----+--------+---------+---+----+
     |             |             |
     +             +             +
 Receiver1     Receiver2     Receiver3
Figure 1: An example of multicast network
            ]]></artwork>
      <postamble></postamble>
    </figure>	 
      
	  <t>The simple network in Figure 1 presents two routers (A and B) connected to
   a shared-media LAN segment.  Two different scenarios are described to
   illustrate potential issues.
	  </t>
	  
      <t>(a) Both routers are on the network, and RouterB is elected as the DR.
   If RouterB then fails, multicast packets are discarded until RouterA is
   elected as DR, and it assumes the multicast flows on the LAN.  As
   detailed in <xref target="RFC7761"/>, a DR's election is triggered after the current
   DR's Hello_Holdtime expires.  The failure detection and election
   procedures may take several seconds.  That is too long for modern
   multicast services.</t>

   <t>(b) Only RouterA is initially on the network, making it the DR.  If
   RouterB joins the network with a higher DR Priority. 
   Then it will be elected as DR.  
   RouterA will stop forwarding multicast packets, and 
   the flows will not recover until RouterB assumes them.</t>

      <t>In either of the situations listed, many multicast packets may be lost,
   and the quality of the services noticeably affected.  To increase the
   stability of the network this document introduces the Designated DR (DR)
   and Backup Designated Router (BDR) options, and specifies how the
   identity of these nodes is explicitly advertised.</t>
   
    <section title="Keywords">
    <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>	 
	 
	<section title="Terminology">
	  <t>Modern services: The real time multicast services, such like IPTV, Net-meeting, etc.</t>
   
    <t>Backup Designated Router (BDR):  Immediately takes over all DR functions
    (<xref target="RFC7761"/>) on an interface once the DR is no longer present.  A single
    BDR SHOULD be elected per interface.</t>
    <t>Designated Router Other (DROther): A router which is neither a DR nor a BDR.</t>
    <t>0x0: 0.0.0.0 if IPv4 addresses are in use or 0:0:0:0:0:0:0:0/128 if IPv6 addresses are in use. 
          To simplify, 0x0 is used in abbreviation in this draft.</t>
    <t>Sticky: The DR doesn't change unnecessarily when routers, even with higher priority, go down or come up.</t>
	</section>
	
	<section title="Protocol Specification">
    <t>The router follows the following procedures, 
     these steps are to be used when a router starts, or the interface is enabled:</t>
    <t>(a). When a router first starts or its interface is enabled, it includes
  the DR and BDR Address options with the OptionValue set to 0x0 in its
  Hello messages (Section 4).  At this point the router considers itself a
  DROther, and starts a timer set to Default_Hello_Holdtime <xref target="RFC7761"/>.</t>
  
	  <t>(b). When the router receives Hello messages from other routers on the same 
	shared-media LAN, the router checks the value of DR/BDR address option. 
	If the value is filled with a non-zero IP address, the router stores the IP address.</t>
	
	<t>(c). After the timer expires, the router first executes
   the algorithm defined in section 3.1.  After that, the router acts as one of 
   the roles in the LAN: DR, BDR, or DROther.</t>
	
  <t> If the router is elected the BDR, it takes on all the functions of a DR
   as specified in <xref target="RFC7761"/>, but it SHOULD NOT actively forward
   multicast flows or send a register message to avoid duplication.</t>
   
  <t>If the DR becomes unreachable on the LAN, the BDR MUST take over all the
   DR functions, including multicast flow forwarding and sending the
   Register messages.  Mechanisms outside the scope of this specification,
   such as <xref target="RFC9186"/> or BFD Asynchronous mode
   <xref target="RFC5880"/> can be used for faster failure detection.</t>
    
  <t> For example, there are three routers: A, B, and C.  If all three were
   in the LAN, then their DR preference would be A, B, and C, in that
   order. Initially, only C is on the LAN, so C is DR. Later, B
   joins; C is still the DR, and B is the BDR. Later A joins, 
   then A becomes the BDR, and B is simply DROther.</t>

    <section title="Election Algorithm">
    <t>The DR and BDR election refers the DR election algorithm 
    defined in section 9.4 in <xref target="RFC2328"/>, 
    and updates the election function defined in section 4.3.2 in <xref target="RFC7761"/>.</t>
    
    <t>
    <list style="symbols">
    <t>The DR is elected among the DR candidates directly. 
     If there is no DR candidates, i.e., all the routers advertise 
     the DR Address options with zero OptionValue, the elected BDR will be the DR. 
     And then the BDR is elected again from the other routers in the LAN.</t>
     <t>The BDR election is not sticky. 
     Whatever there is a router that advertise the BDR Address option, the router which has the highest 
     priority, expect for the elected DR, is elected as the BDR. That is the BDR may be the router which has 
     the highest priority in the LAN.</t>
     <t>The advertisement is through PIM Hello message.</t>
     </list>
     </t>

    <t>Except for the information recorded in section 4.3.2 in <xref target="RFC7761"/>, 
    the DR/BDR OptionValue from the neighbor is also recorded:</t>
    <t>
    <list style="symbols">
    <t>neighbor.dr: The DR Address OptionValue that presents in the Hello message from the PIM neighbor.</t>
    <t>neighbor.bdr: The BDR Address OptionValue that presents in the Hello message from the PIM neighbor.</t>
    </list>
    </t>
    
    <t>The pseudocode is shown below: A BDR election function is added, and the DR function is updated. 
    The validneighbor function means that a valid Hello message has been received from this neighbor.</t>
    <figure  align="center">
      <artwork align="center"><![CDATA[			
      BDR(I) {
        bdr = NULL
        for each neighbor on interface I {
          if ( neighbor.bdr != NULL ) {
            if (validneighbor (neighbor.bdr) == TRUE) {
              if bdr == NULL
                bdr = neighbor.bdr
              else (dr_is_better( neighbor.bdr, bdr, I ) 
                == TRUE ) {
                bdr = neighbor.bdr
              }
            }
          }
        }
        return bdr
      }
            ]]></artwork>
      <postamble></postamble>
    </figure>

    <figure  align="center">
      <artwork align="center"><![CDATA[			
      DR(I) {
        dr = NULL
        for each neighbor on interface I {
          if ( neighbor.dr != NULL ) {
            if (validneighbor (neighbor.dr) == TRUE) {
              if (dr == NULL)
                dr = neighbor.dr
              else (dr_is_better( neighbor.dr, dr, I ) 
                == TRUE ) {
                dr = neighbor.dr
              }
            }
          }
        }
        if (dr == NULL) {
          dr = bdr
        }
        if (dr == NULL) {
          dr = me
        }
        return dr
      }
            ]]></artwork>
      <postamble></postamble>
    </figure>
    
  <t>Compare to the DR election function defined in section 4.3.2 in
   [RFC7761] the differences include:</t>
  
  <t>
  <list style="symbols">
  <t>The router, that can be elected as DR, has the highest priority
      among the DR candidates.  The elected DR may not be the one that
      has the highest priority in the LAN.</t>
  <t>The router that supports the election algorithm defined in
      section 3.1 MUST advertise the DR Address option defined in
      section 4.1 in PIM Hello message, and SHOULD advertise the BDR
      Address option defined in section 4.2 in PIM Hello message.  In
      case a DR is elected and no BDR is elected, only the DR
      Address option is advertised in the LAN.</t>
  </list>
  </t>
    </section>
	
	<section title="Sending Hello Messages">
    <t>When PIM is enabled on an interface or a router first starts, Hello messages
MUST be sent with the OptionValue of the DR Address option set to 0x0.
The BDR Address option SHOULD also be sent, the OptionValue MUST be set to 0x0.
Then the interface starts a timer which value is set to Default_Hello_Holdtime.
When the timer expires, the DR and BDR will be elected on the interface
according to the DR election algorithm (Section 3.1).</t>
  <t>After the election, if there is one existed DR in the LAN, the DR remains unchanged.
  If there is no existed DR in the LAN, a new DR is elected, 
  the routers in the LAN MUST send the Hello message with the OptionValue of DR Address option set to the elected DR.   
  If there are more than one routers with non-zero DR priority in the LAN, a BDR is also elected.
  Then the routers in the LAN MUST send the Hello message with the OptionValue of BDR Address option set to the elected BDR. 
  Any DROther router MUST NOT use its IP addresses in the DR/BDR Address option.</t>

    <figure  align="center">
            <artwork align="center"><![CDATA[			
    DR                                newcomer
     \                                  /
      -----       -----           -----
      | A |       | B |           | C |
      -----       -----           -----
        |           |               |
        |           |               |
------------------------------------------- LAN
                 Figure 2
            ]]></artwork>
       <postamble></postamble>
      </figure>	 
    <t>For example, there is a stable LAN that includes RouterA and RouterB. RouterA is the 
DR that has the highest priority. RouterC is a newcomer. RouterC sends a Hello message with the 
OptionValue of DR/BDR Address option set to zero. RouterA and RouterB sends the Hello message with 
the DR OptionValue set to RouterA, the BDR OptionValue set to RouterB.</t>
	
	<t>In case RouterC has a higher priority than RouterB, RouterC elects itself as the BDR after 
  it runs the election algorithm, 
	then RouterC sends Hello messages with the DR OptionValue set to the IP address of 
	current DR (RouterA), and the BDR OptionValue set to RouterC.</t>
	
	<t>In case RouterB has a higher priority than RouterC, 
  RouterC finds that it can not be the BDR after it runs the election algorithm, 
  it sets the status to DROther. 
  Then RouterC sends Hello messages with the DR OptionValue set 
	to RouterA and the BDR OptionValue set to RouterB.</t>
	</section>
	
	<section title="Receiving Hello Messages">
    <t>When a Hello message is received, the OptionValue of DR/BDR is checked.
    If the OptionValue of DR is not zero and it isn't the same with local stored values, 
    or the OptionValue of DR is zero but the advertising router is the stored DR, 
    the interface timer of election MAY be set/reset.</t>
    <t>Before the election algorithm runs, the validity check MUST be done. 
    The DR/BDR OptionValue in the Hello message MUST match with a known neighbor, 
    otherwise the DR/BDR OptionValue can not become the DR/BDR candidates.</t>
    <t>If there is one or more candidates which are different from the stored DR/BDR value after 
    the validity check, the election MUST be taken. The new DR/BDR will be elected according to the rules defined in section 3.1.</t>
	</section>
  
  <section title="Working with the DRLB function">
  <t>A network can use the enhancement described in this document with the DR
   Load Balancing (DRLB) mechanism <xref target="RFC8775"/>. 
   The DR MUST send the DRLB-List Hello Option defined in <xref target="RFC8775"/>.
   If the DR becomes 
   unreachable, the BDR will take over all the multicast flows on the link,
   which may result in duplicated traffic as it may not have been a Group DR
   (GDR). The new DR MUST then follow the procedures in <xref target="RFC8775"/>.</t>

  <t>In case the DR, or the BDR which becomes DR after the DR failure, 
  doesn't support the mechanism defined in <xref target="RFC8775"/>, 
  the DRLB-List Hello Option can not be advertised, then the DRLB mechanism takes no effection.</t>
  </section>
  
	</section>
  
  <section title="PIM Hello message format">
	<t>Two new PIM Hello Options are defined, which conform to the format defined
   in <xref target="RFC7761"/>.</t>
   
    <figure  align="center">
            <artwork align="center"><![CDATA[			
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |          OptionType           |         OptionLength          |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                          OptionValue                          |
   |                              ...                              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                  Figure 3: Hello Option Format
            ]]></artwork>
       <postamble></postamble>
      </figure>	 
   
	<section title="DR Address Option format">
    <figure  align="center">
            <artwork align="center"><![CDATA[			
       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          Type = 37            |      Length = <Variable>      |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |             DR Address  (Encoded-Unicast format)              |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                  Figure 4: DR Address Option
            ]]></artwork>
       <postamble></postamble>
      </figure>	 

  <t>
    <list style="symbols">
	<t>OptionType : The value is 37.</t>
	
	<t>OptionLength: 4 bytes if using IPv4 and 16 bytes if using IPv6.</t>
	
  <t>DR Address: If the IP version of the PIM message is IPv4, 
    the value MUST be the IPv4 address of the DR. If the IP version of the PIM message is IPv6, 
    the value MUST be the link-local address of the DR.</t>
	</list>
	</t>
	</section>
	
	<section title="BDR Address Option format">
    <figure  align="center">
            <artwork align="center"><![CDATA[			
       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          Type = 38            |      Length = <Variable>      |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |             BDR Address  (Encoded-Unicast format)             |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                  Figure 5: BDR Address Option
            ]]></artwork>
        <postamble></postamble>
      </figure>	 

  <t>
    <list style="symbols">
	
	<t>OptionType : The value is 38.</t>

	<t>OptionLength: 4 bytes if using IPv4 and 16 bytes if using IPv6.</t>
	
	<t>BDR Address: If the IP version of the PIM message is IPv4, 
    the value MUST be the IPv4 address of the BDR. If the IP version of the PIM message is IPv6, 
    the value MUST be the link-local address of the BDR.</t>
	
	</list>
	</t>
	</section>
  
  <section title="Error handling">
  <t>The DR and BDR addresses MUST correspond to an address used to send PIM
   Hello messages by one of the PIM neighbors on the interface. If that is
   not the case then the OptionValue of DR/BDR MUST be ignored as described in section 3.3.</t>
   
  <t>An option with unexpected values MUST be ignored. For example, a DR
   Address option with an IPv4 address received while the interface only
   supports IPv6 is ignored.</t>
  
	</section>
	
	</section>

    <section title="Backwards Compatibility">
    <t>Any router using the DR and BDR Address Options MUST set the corresponding OptionValues.
    If at least one router on a LAN doesn't send a Hello message, 
   including the DR Address Option, then the specification in this
   document MUST NOT be used.  
   For example, the routers in a LAN all support the options defined in this document, 
   the DR/BDR is elected. 
   A new router which doesn't support the options joins, when the hello message without DR Address Option 
   is received, all the router MUST switch the election function back immediately.    
   This action
   results in all routers using the DR election function defined in
   <xref target="RFC7761"/> or <xref target="I-D.ietf-pim-bdr"/>. 
   Both this draft and the draft <xref target="I-D.ietf-pim-bdr"/>, introduce a backup DR. 
   The later draft does this without introducing new options but does not consider the sticky behavior. 
   In case there is router which doesn't support the DR/BDR Address Option defined in this document, 
   the routers SHOULD take the function defined in <xref target="I-D.ietf-pim-bdr"/> if all the routers support it, 
   otherwise the router SHOULD used the function defined in  <xref target="RFC7761"/>.</t>

  <t>A router that does not support this specification ignores unknown options 
according to section 4.9.2 defined in <xref target="RFC7761"/>.
So the new extension defined in this draft will not influence the stability of neighbors.</t>
    </section>
	
    <section anchor="Security" title="Security Considerations">
      <t><xref target="RFC7761"/> describes the security concerns related to PIM-SM. 
      A rogue router can become the DR/BDR by appropriately crafting the
   Address options to include a more desirable IP address or priority.
   Because the election algorithm makes the DR role be non-preemptive, an
   attacker can then take control for long periods of time.  The effect of
   these actions can result in multicast flows not being forwarded (already
   considered in <xref target="RFC7761"/>).</t>
      
      <t>Some security measures, such as IP address filtering for the election, 
      may be taken to avoid these situations. For example, the Hello message received 
      from an untrusted neighbor is ignored by the election process.</t>
   </section>
	
	<section title="IANA Considerations"> 
     <t>IANA is requested to allocate two new code points from the "PIM-Hello Options" registry.</t>
     <texttable anchor="TABLE_1" title="">

         <ttcol align="left">Type</ttcol>

         <ttcol align="left">Description</ttcol>
		 
         <ttcol align="left">Reference</ttcol>

         <c>37</c>

         <c>DR Address Option</c>

         <c>This Document</c>

         <c>38</c>

         <c>BDR Address Option</c>

         <c>This Document</c>
		 
     </texttable>
  </section>
	 
    <section title="Acknowledgements"> 
    <t>The authors would like to thank Alvaro Retana, Greg Mirsky, Jake Holland, Stig Venaas for their valuable 
    comments and suggestions.</t>
   </section>

  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
  
    <references title='Normative References'>
    &rfc2328;
	  &rfc7761;
    &rfc2119;
    &rfc8174;
    &rfc8775;
    </references>

    <references title='Informative References'>
    &rfc5880;
    &rfc9186;
    <?rfc include="reference.I-D.ietf-pim-bdr"?>
    </references>

  </back>
</rfc>
