<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="info" docName="draft-ietf-bfd-vxlan-16" ipr="trust200902">
  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN" 
     they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <title abbrev="BFD for VXLAN">
    BFD for VXLAN
    </title>

    <!-- add 'role="editor"' below for the editors if appropriate -->
    <!-- Another author who claims to be an editor -->


     <author fullname="Santosh Pallagatti" role="editor" initials="S." surname="Pallagatti">
      <organization>VMware</organization>
      <address>
        <email>santosh.pallagatti@gmail.com</email>
      </address>
    </author>
   
   	<author fullname="Greg Mirsky" role="editor" initials="G." surname="Mirsky">
      <organization>ZTE Corp.</organization>
      <address>
        <email>gregimirsky@gmail.com</email>
      </address>
    </author>
    
<!--
    <author fullname="Basil Saji" initials="B."
            surname="Saji">
      <organization>Juniper Networks</organization>
      <address>
        <postal>
        <street>Embassy Business Park</street>
        <city>Bangalore</city>
        <region>KA</region>
        <code>560093</code>
        <country>India</country>
        </postal>
        <email>sbasil@juniper.net</email>
      </address>
    </author>
-->	
	<author fullname="Sudarsan Paragiri " initials="S." surname="Paragiri">
      <organization>Individual Contributor</organization>
      <address>
        <email>sudarsan.225@gmail.com</email>
      </address>
    </author>
	
	<author fullname="Vengada Prasad Govindan" initials="V." surname="Govindan">
      <organization>Cisco</organization>
      <address>
        <email>venggovi@cisco.com</email>
      </address>
    </author>
	
	<author fullname="Mallik Mudigonda" initials="M." surname="Mudigonda">
      <organization>Cisco</organization>
      <address>
        <email>mmudigon@cisco.com</email>
      </address>
    </author>
    


	
    <date year="2020"/>

    <area>Routing</area>
    <workgroup>BFD</workgroup>

    <!-- WG name at the upperleft corner of the doc,
    IETF is fine for individual submissions.  
    If this element is not present, the default is "Network Working Group",
    which is used by the RFC Editor as a nod to the history of the IETF. -->

    <keyword>BFD</keyword>
    <keyword>BFD for VXLAN</keyword>

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
        <t>This document describes the use of the Bidirectional Forwarding Detection (BFD) protocol
        in point-to-point Virtual eXtensible Local Area Network (VXLAN) tunnels
        used to form an overlay network.</t>

    </abstract>
    
    
  </front>

  <middle>
    <section title="Introduction" anchor="Intro">
    
    <t>
    "Virtual eXtensible Local Area Network" (VXLAN) <xref target="RFC7348"/> provides
   an encapsulation scheme that allows building an overlay network by 
  decoupling the address space of the attached virtual hosts from that of the network.
  </t>
        
    <t>
One use of VXLAN is in data centers interconnecting virtual machines (VMs)
of a tenant. VXLAN addresses requirements of the Layer 2 and 
Layer 3 data center network infrastructure in the presence of VMs in a multi-tenant environment by
 providing a Layer 2 overlay scheme on a Layer 3 network <xref target="RFC7348"/>.
 Another use is as an encapsulation for Ethernet VPN <xref target="RFC8365"/>.
 </t>
 <t>
 This document is written assuming the use of VXLAN for virtualized
hosts and refers to VMs and VXLAN Tunnel End Points (VTEPs) in hypervisors.  However, the
concepts are equally applicable to non-virtualized hosts attached to
VTEPs in switches.
</t>
       
     <t>In the absence of a router in the overlay, a VM can communicate with another VM only if they are on the same VXLAN segment.
        VMs are unaware of VXLAN tunnels as a VXLAN tunnel is terminated on a VTEP.
        VTEPs are responsible for encapsulating and decapsulating frames exchanged among
        VMs. </t>
        
    <t>
    The ability to monitor path continuity, i.e., perform proactive continuity check (CC) for point-to-point (p2p) VXLAN tunnels, is important. 
       The asynchronous mode of BFD, as defined in <xref target="RFC5880"/>, is used to monitor a p2p VXLAN tunnel. 
</t>
	   	   
	   <t>
In the case where a Multicast Service Node (MSN) (as described in Section 3.3 
of <xref target="RFC8293"/>) participates in VXLAN, the mechanisms described in this 
document apply and can, therefore, be used to test the continuity of the path between 
the source NVE and the MSN.
	   </t>

    <t>
    This document describes the use of Bidirectional Forwarding Detection (BFD) protocol
        to enable monitoring continuity of the path between VXLAN VTEPs that are
        performing as Network Virtualization Endpoints,
        and/or between the source NVE and a replicator MSN using a Management VNI (<xref target="management-vni-sec"/>).
        All other uses of the specification to test toward other VXLAN endpoints are out of the scope.
  </t>
        
    </section>
    
      <section title="Conventions Used in this Document">
         <section title="Acronyms">
         <t>BFD       Bidirectional Forwarding Detection </t>
         <t>CC         Continuity Check</t>
         <!--<t>GTSM    Generalized TTL Security Mechanism</t>-->
         <t>p2p         Point-to-point</t>
         <t>MSN       Multicast Service Node</t>
         <t>NVE        Network Virtualization Endpoint</t>
         <t>VFI         Virtual Forwarding Instance</t>
         <t>VM          Virtual Machine</t>
         <t>VNI       VXLAN Network Identifier (or VXLAN Segment ID)</t>
         <t>VTEP     VXLAN Tunnel End Point</t>
         <t>VXLAN   Virtual eXtensible Local Area Network</t>
         
         </section>
         
             <section title="Requirements Language">
             <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="Deployment">
    <t>
    <xref target="ref-vxlan-fig"/> illustrates the scenario with two servers, each of them hosting two VMs. 
       The servers host VTEPs that terminate two VXLAN tunnels with VXLAN Network Identifier (VNI) number 100
       and 200 respectively. Separate BFD sessions can be
       established between the VTEPs (IP1 and IP2) for monitoring
       each of the VXLAN tunnels (VNI 100 and 200). Using a BFD session to monitor a set of VXLAN VNIs
       between the same pair of VTEPs might help to detect and localize problems caused by misconfiguration.
An implementation that supports this specification MUST
be able to control the number of BFD sessions 
			that can be created between the same pair of VTEPs.
       This method is applicable whether  the VTEP is a virtual or physical device.
       </t>
  
      <figure anchor="ref-vxlan-fig" align="left" title="Reference VXLAN Domain">
    <preamble/>
    <artwork align="left">
    <![CDATA[                 
   +------------+-------------+
   |        Server 1          |
   | +----+----+  +----+----+ |
   | |VM1-1    |  |VM1-2    | |
   | |VNI 100  |  |VNI 200  | |
   | |         |  |         | |
   | +---------+  +---------+ |
   |        VTEP (IP1)        |
   +--------------------------+
                         |
                         |   +-------------+
                         |   |   Layer 3   |
                         +---|   Network   |
                             +-------------+
                                 |
                                 +-----------+
                                             |
                                      +------------+-------------+
                                      |         VTEP (IP2)       |
                                      | +----+----+  +----+----+ |
                                      | |VM2-1    |  |VM2-2    | |
                                      | |VNI 100  |  |VNI 200  | |
                                      | |         |  |         | |
                                      | +---------+  +---------+ |
                                      |      Server 2            |
                                      +--------------------------+
  ]]>
 </artwork>
 </figure>

<t>
       At the same time, a service layer BFD session may be used between the tenants of VTEPs IP1 and IP2
       to provide end-to-end fault management (this use case is outside the scope of this document). In
       such a case, for VTEPs, the BFD Control packets of that session are indistinguishable from data packets.
       </t>
       <t>
       For BFD Control packets encapsulated in VXLAN (<xref target="vxlan-bfd-encap-fig"/>),
       the inner destination IP address
       SHOULD be set to one of the loopback addresses from 
       127/8 range for IPv4 or to one of IPv4-mapped IPv6 loopback addresses from ::ffff:127.0.0.0/104 range for IPv6.
       </t>
    </section>
    
	<section anchor="management-vni-sec" title="Use of the Management VNI">
  <t>
In most cases, a single BFD session is sufficient for the given VTEP to monitor
the reachability of a remote VTEP, regardless of the number of VNIs.
    BFD control messages MUST be sent using the Management VNI which acts
    as the as control and management channel between VTEPs.
    An implementation MAY support operating BFD on another
    (non-Management) VNI although the implications of this are outside
    the scope of this document. The selection of the VNI number
of the Management VNI MUST be controlled through a management plane. An implementation MAY use VNI number 1 as
the default value for the Management VNI. All VXLAN packets received on the Management VNI MUST be processed locally
and MUST NOT be forwarded to a tenant.
</t>
	</section>
	
	<section anchor="bfd-transmit-vxlan-sec" title="BFD Packet Transmission over VXLAN Tunnel">
	<t>
	BFD packets MUST be encapsulated and sent to a remote VTEP as explained in this section. 
	Implementations SHOULD ensure that the BFD packets follow the same 
	forwarding path as VXLAN data packets within the sender system.
	</t>
	
		<!--
		<section title="BFD Packet Encapsulation in VXLAN" anchor="encap">
		-->
			<t>
			BFD packets are encapsulated in VXLAN as described below. 
			The VXLAN packet format is defined in Section 5 of <xref target="RFC7348"/>. 
			The value in the VNI field of the VXLAN header MUST
			be set to the value selected as the Management VNI.
			The Outer IP/UDP and VXLAN headers MUST
				be encoded by the sender as defined in <xref target="RFC7348"/>.</t> 
				
             <t>
          <figure align="left" anchor="vxlan-bfd-encap-fig" title="VXLAN Encapsulation of BFD Control Packet">
          <artwork><![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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 ~                      Outer Ethernet Header                    ~
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 ~                        Outer IPvX Header                      ~
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 ~                        Outer UDP Header                       ~
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 ~                           VXLAN Header                        ~
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 ~                    Inner Ethernet Header                      ~
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 ~                        Inner IPvX Header                      ~
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 ~                         Inner UDP Header                      ~
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 ~                       BFD Control Packet                     ~
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                   Outer Ethernet FCS                          |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>
            </t> 

		   
		   <t>
		   The BFD packet MUST be carried inside the inner Ethernet frame of the VXLAN packet.
		   The choice of Destination MAC and Destination IP addresses for the inner Ethernet frame MUST
		   ensure that the BFD Control packet is not forwarded to a tenant but is processed locally at the remote VTEP.
		   The inner Ethernet frame carrying the BFD Control packet- has the following format:
		   <list>
			   <t> Ethernet Header: 
				   <list style="hanging">
					   <t>Destination MAC: A Management VNI, which does not have any tenants, will
have no dedicated MAC address for decapsulated traffic.&#160; The value (TBD1)
SHOULD be used in this field.</t>
					   <t>Source MAC: MAC address associated with the originating VTEP.</t>
					   <t>Ethertype: is set to 0x0800 if the inner IP header is IPv4, and is set to 0x86DD if the inner IP header is IPv6.</t>
				   </list>
			   </t>

			   <t>IP header:
				   <list style="hanging">
					   <t>Destination IP: IP address MUST NOT be of one of tenant's IP addresses.
					   The IP address SHOULD be selected
					   from the range 127/8 for IPv4, for IPv6 - from the range ::ffff:127.0.0.0/104.
					   Alternatively, the destination IP address MAY be set to VTEP's IP address.</t>
					   <t>Source IP: IP address of the originating VTEP.</t>
					   <t>TTL or Hop Limit: MUST be set to 255 in accordance with <xref target="RFC5881"/>.
					   </t>
					   <!--
					   <t>[Ed.Note]:Use of inner source and destination IP 
					   addresses needs more discussion by the WG.</t>
					   -->
				   </list>
			</t>

		   <t>
		   The fields of the UDP header and the BFD Control packet are encoded as specified 
		   in <xref target="RFC5881"/>.
		   </t>

		   </list></t>
		<!--
		</section>
		-->
<!--
		<section title="BFD Packet Encapsulation in VXLAN-GPE" anchor="encap-gpe">
			<t> If VTEP suppors Generic Protocol Extension (GPE) header capabilities then VXLAN-GPE MAY be used. 
			The VXLAN-GPE header MUST be encoded as per Section 3.3 of <xref target="I-D.ietf-nvo3-vxlan-gpe"/>. Next Protocol Field in  
			VXLAN-GPE header MAY be set to indicate IPv4or IPv6 payload. Then BFD control packet MUST be encapsulated 
			using IP/UDP format per <xref target="RFC5881"/>. Next Protocol Field in VXLAN-GPE header MAY be set to indicate
			that payload is OAM packet. Then OOAM Common Header 
			<xref target="I-D.ooamdt-rtgwg-ooam-header"/> immediately follows the VXLAN-GPE header and
			defines encapsulation of the BFD control packet. Theencapsulation MAY use IP/UDP form or 
			PW-ACH encapsulation  <xref target="RFC5885"/>.</t>
			
			<t>Details of how the VTEP is instructed to choose VXLAN or GPE header are outside the scope of this document.</t>
		
		</section>
-->
    </section>

        <section title="Reception of BFD Packet from VXLAN Tunnel">
        <t>
        Once a packet is received, the VTEP MUST validate the packet.
        If the packet is received on the management VNI and is identified as BFD control packet addressed to the VTEP,
        and then the packet can be processed further. Processing of BFD control packets received on non-management VNI
        is outside the scope of this specification.
          </t>
		  
        <t>
        The received packet's inner IP payload is then validated according to
Sections 4 and 5 in <xref target="RFC5881"/>.
        </t>
		
		<!--
		<t> To ensure that the BFD session monitors the intended VXLAN Network Identifier (VNI)
		in a remote VTEP, a lookup SHOULD be performed with the MAC-DA and VNI as key in the 
		Virtual Forwarding Instance (VFI) table of the originating/terminating VTEP to exercise the  VFI associated with the VNI.</t>
		-->
 <!--           
        <section title="Demultiplexing of the BFD Packet">
        <t>Demultiplexing of IP BFD packet has been defined in Section 3 of <xref target="RFC5881"/>.  
          Since multiple BFD sessions may be running between two VTEPs, there
          needs to be a mechanism for demultiplexing received BFD packets to
          the proper session. For demultiplexing packets with
          Your Discriminator equal to 0, a BFD session MUST be identified using
		  the logical link over which the BFD Control packet is received. In the case of VXLAN, the VNI number
		  identifies that logical link.
      If BFD packet is received with non-zero Your Discriminator, then the BFD session MUST 
		  be demultiplexed only with Your Discriminator as the key.</t>
        </section>
        -->
    </section>

<!--
         <section title="Reception of BFD packet from VXLAN-GPE Tunnel">
         <t>TBD</t>
                 <section title="Demultiplexing of the BFD packet">
         <t>TBD</t>
                          </section>
         </section>
-->         	
	
    <section title="Echo BFD">
        <t>Support for echo BFD is outside the scope of this document.</t>
    </section>
   
    <section anchor="iana-consideration" title="IANA Considerations">
        <t>
IANA is requested to assign a single MAC address to the value TBD1 from the
"IANA Unicast 48-bit MAC Address" registry from the "Unassigned (small allocations)" block.
The Usage field will be "BFD for VXLAN" with a Reference field of this document.
        </t>
    </section>
    
    <section title="Security Considerations">
        <!--
        <t>
        The document requires setting the inner IP TTL or Hop Limit to 1, which could be used as a DDoS attack vector.
        Thus the implementation MUST have throttling in place to control the rate of BFD Control packets sent to the control plane.
        On the other hand, over-aggressive throttling of BFD Control packets may become the cause of the inability to form and maintain
        BFD session at scale. Hence, throttling of BFD Control packets SHOULD be adjusted to permit BFD to work according to its
        procedures.
        </t>
        -->
                <t> 
        Security issues discussed in <xref target="RFC5880"/>, <xref target="RFC5881"/>, and <xref target="RFC7348"/>
        apply to this document.
        </t>
        <t>
        
        This document recommends using an address from the Internal host loopback addresses
       127/8 range for IPv4 or an IP4-mapped IPv6 loopback address from ::ffff:127.0.0.0/104 range for IPv6
        as the destination IP address in the inner IP header. Using such an address prevents
        the forwarding of the encapsulated BFD control message by a transient node in case the VXLAN tunnel is broken as
        according to <xref target="RFC1812"/>.
        <list>
        <t>
      A router SHOULD NOT forward, except over a loopback interface, any
      packet that has a destination address on network 127.  A router
      MAY have a switch that allows the network manager to disable these
      checks.  If such a switch is provided, it MUST default to
      performing the checks.
        </t>
        </list>
        
        The use of IPv4-mapped IPv6 addresses
        has the same property as using the IPv4 network 127/8, moreover, the IPv4-mapped
        IPv6 addresses prefix is not advertised in any routing protocol.</t>
        
        <t>
        If the implementation supports establishing multiple BFD sessions
        between the same pair of VTEPs, there SHOULD be a mechanism
        to control the maximum number of such sessions that can be active
        at the same time.
</t>

    </section>
    
	 <section title="Contributors">
<t>
<figure>
<artwork>
<![CDATA[
Reshad Rahman
rrahman@cisco.com
Cisco
]]>
</artwork>
</figure>
			
</t>
	 </section>
	
    <section title="Acknowledgments">
     <t>Authors would like to thank Jeff Haas of Juniper Networks for his reviews and feedback on this material.</t>
	 <t>Authors would also like to thank Nobo Akiya, Marc Binderberger, Shahram Davari,
	 Donald E. Eastlake 3rd, Anoop Ghanwani, Dinesh Dutt, Joel Halpern, and Carlos Pignataro for the extensive reviews
	 and the most detailed and constructive comments.</t>
    </section>
    
  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <references title="Normative References">
      <?rfc include="reference.RFC.5880"?>
      <?rfc include="reference.RFC.5881"?>

      <?rfc include="reference.RFC.7348"?>
      <?rfc include="reference.RFC.2119"?>
        <?rfc include="reference.RFC.8174"?>
        <?rfc include="reference.RFC.1812"?>
        <!-- <?rfc include="reference.RFC.5082"?> -->
 <!--  
  <?rfc include="reference.I-D.ietf-bfd-seamless-base"?>
 -->
<!--
<?rfc include="reference.I-D.ashwood-nvo3-operational-requirement"?>
-->
<!--	  
<?rfc include="reference.I-D.ietf-nvo3-vxlan-gpe"?>
 -->
 <!--
	  <?rfc include="reference.I-D.ietf-bfd-multipoint"?>
	  -->
<!--	  
<?rfc include="reference.I-D.ooamdt-rtgwg-ooam-header"?>
 -->
    </references>
    
    <references title="Informational References">
    
    <?rfc include="reference.RFC.8293"?>
    <?rfc include="reference.RFC.8365"?>

    </references>
  </back>
</rfc>
