<?xml version="1.0" encoding="iso-8859-1"?>
<!--<!DOCTYPE rfc SYSTEM "rfc4748.dtd"> -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc5880 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5880.xml">
<!ENTITY rfc5881 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5881.xml">
<!ENTITY rfc7348 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7348.xml">
<!ENTITY rfc2119 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY rfc7365 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7365.xml">
<!ENTITY rfc8014 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8014.xml">
<!ENTITY rfc8174 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY rfc8926 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8926.xml">
<!ENTITY rfc8971 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8971.xml">
<!ENTITY I-D.ietf-nvo3-geneve-oam PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-nvo3-geneve-oam.xml">
]>
<rfc category="std" ipr="trust200902" docName="draft-ietf-nvo3-bfd-geneve-02">

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<?rfc toc="yes"?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>

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

  <author fullname="Xiao Min" initials="X" surname="Min">
      <organization>ZTE Corp.</organization>
     <address>
       <postal>
         <street/>

         <!-- Reorder these if your country does things differently -->

         <city>Nanjing</city>

         <region/>

         <code/>

         <country>China</country>
       </postal>

       <phone>+86 25 88013062</phone>

       <email>xiao.min2@zte.com.cn</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
    </author>

  <author fullname="Greg Mirsky" initials="G" surname="Mirsky">
      <organization>ZTE Corp.</organization>
     <address>
       <postal>
         <street/>

         <!-- Reorder these if your country does things differently -->

         <city/>

         <region/>

         <code/>

         <country>USA</country>
       </postal>

       <phone/>

       <email>gregimirsky@gmail.com</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
    </author>

  <author fullname="Santosh Pallagatti" initials="S" surname="Pallagatti">
      <organization>VMware</organization>
     <address>
       <postal>
         <street/>

         <!-- Reorder these if your country does things differently -->

         <city></city>

         <region/>

         <code/>

         <country></country>
       </postal>

       <phone></phone>

       <email>santosh.pallagatti@gmail.com</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
    </author>
	
  <author fullname="Jeff Tantsura" initials="J" surname="Tantsura">
      <organization>Juniper Networks</organization>
     <address>
       <postal>
         <street/>

         <!-- Reorder these if your country does things differently -->

         <city></city>

         <region/>

         <code/>

         <country></country>
       </postal>

       <phone></phone>

       <email>jefftant.ietf@gmail.com</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
    </author>
	
    <date year="2021"/>
  
    <area>Routing</area>
    <workgroup>NVO3 Working Group</workgroup>

    <keyword>Request for Comments</keyword>
    <keyword>RFC</keyword>
    <keyword>Internet Draft</keyword>
    <keyword>I-D</keyword>

    <abstract>
  <t> This document describes the use of the Bidirectional Forwarding Detection (BFD) protocol in point-to-point 
  Generic Network Virtualization Encapsulation (Geneve) tunnels used to make up an overlay network. </t>
    </abstract>
    
</front>
  
<middle>

  <section title="Introduction">
  
  <t> "Generic Network Virtualization Encapsulation" (Geneve) <xref target="RFC8926"/> 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> This document describes the use of Bidirectional Forwarding Detection (BFD) protocol <xref target="RFC5880"/>
  to enable monitoring continuity of the path between two Geneve tunnel endpoints, which may be NVE (Network 
  Virtualization Edge) or other device acting as a Geneve tunnel endpoint. Specifically, the asynchronous mode of BFD, 
  as defined in <xref target="RFC5880"/>, is used to monitor a p2p Geneve tunnel, and support for BFD Echo function is outside 
  the scope of this document. For simplicity, in this document, NVE is used to represent Geneve tunnel endpoint, 
  TS (Tenant System) is used to represent the physical or virtual device attached to a Geneve tunnel endpoint from the 
  outside. VAP (Virtual Access Point) is the NVE side of the interface between the NVE and the TS, and a VAP is a 
  logical network port (virtual or physical) into a specific virtual network. For detailed definitions and descriptions 
  of NVE, TS and VAP, please refer to <xref target="RFC7365"/> and <xref target="RFC8014"/>. </t>
  
  <t> The use cases and the deployment of BFD for Geneve are consistent with what's described in Section 1 and 3 of 
  <xref target="RFC8971"/> ("Bidirectional Forwarding Detection (BFD) for Virtual eXtensible Local Area Network (VXLAN)"), 
  except for the usage of Management VNI, which in the case of Geneve is described in <xref target="I-D.ietf-nvo3-geneve-oam"/>, 
  and outside the scope of this document. The major difference between Geneve and VXLAN <xref target="RFC7348"/> is that 
  Geneve supports multi-protocol payload and variable length options. </t>
  
  </section>
  
  <section title="Conventions Used in This Document">
   
    <section title="Abbreviations">
    <t> BFD: Bidirectional Forwarding Detection</t>
    <t> EVPN: Ethernet Virtual Private Networks</t>
    <t> Geneve: Generic Network Virtualization Encapsulation</t>
    <t> NVE: Network Virtualization Edge</t>
    <t> TS: Tenant System</t>
    <t> VAP: Virtual Access Point</t>
	<t> VNI: Virtual Network Identifier</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="BFD Packet Transmission over Geneve Tunnel">

  <t> Concerning whether the Geneve data packets include an Ethernet frame or an IP packet, this document defines two 
  formats of BFD packet encapsulation in Geneve. BFD session is originated and terminated at VAP of an NVE, selection 
  of the BFD packet encapsulation is based on how the VAP encapsulates the data packets. </t>
  
  <section anchor="ethernet-ip-encaps-section" title="BFD Encapsulation With Inner Ethernet/IP/UDP Header">
	
  <t> If the VAP that originates the BFD packets is used to encapsulate Ethernet data frames, then BFD packets are 
  encapsulated in Geneve as described below. The Geneve packet format over IPv4 is defined in Section 3.1 of 
  <xref target="RFC8926"/>. The Geneve packet format over IPv6 is defined in Section 3.2 of <xref target="RFC8926"/>. 
  The Outer IP/UDP and Geneve headers MUST be encoded by the sender as defined in <xref target="RFC8926"/>. Note that 
  the outer IP header and the inner IP header may not be of the same address family, in other words, outer IPv6 header 
  accompanied with inner IPv4 header and outer IPv4 header accompanied with inner IPv6 header are both possible. </t>
	
     <figure anchor="Figure_1" title="Geneve Encapsulation of BFD Control Packet With the Inner Ethernet/IP/UDP Header">
     <artwork align="left">     <![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                       ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                          Geneve Header                        ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                      Inner Ethernet Header                    ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                        Inner IPvX Header                      ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                         Inner UDP Header                      ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                        BFD Control Packet                     ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Outer Ethernet FCS                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     ]]>     </artwork>
     </figure>
	 
     <t> The BFD packet MUST be carried inside the inner Ethernet frame of the Geneve packet.
	      The inner Ethernet frame carrying the BFD Control packet has the following format:
		   <list>
			   <t>Ethernet Header:
				   <list>
					   <t>Source MAC: MAC address of a VAP of the originating NVE.</t>
					   <t>Destination MAC: MAC address of a VAP of the terminating NVE.</t>
				   </list>
			   </t>
			   
			   <t>IP Header:
				   <list>
					   <t>Source IP: IP address of a VAP of the originating NVE. If the VAP of the originating NVE 
					   has no IP address, then the IP address 0.0.0.0 for IPv4 or ::/128 for IPv6 MUST be used.</t>
					   <t>Destination IP: IP address of a VAP of the terminating NVE. If the VAP of the terminating 
					   NVE has no IP address, then the IP address 127.0.0.1 for IPv4 or ::1/128 for IPv6 MUST be used.</t>
					   <t>TTL or Hop Limit: MUST be set to 255 in accordance with <xref target="RFC5881"/>.</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>
	 
     <t> When the BFD packets are encapsulated in Geneve in this way, the Geneve header defined in <xref target="RFC8926"/> 
	 follows the value set below.</t>	
	 
	<!-- 
     <figure anchor="" title="Geneve Header">
     <artwork align="left">
     <![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Ver|  Opt Len  |O|C|    Rsvd.  |          Protocol Type        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|        Virtual Network Identifier (VNI)       |    Reserved   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Variable Length Options                    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     ]]>
     </artwork>
     </figure>
-->
	 
    <t> 
	<list>
     <t> Opt Len field SHOULD be set to 0, which indicates there isn't any variable length option.</t>
	 
	 <t> O bit MUST be set to 1, which indicates this packet contains a control message.</t>
	 
     <t> C bit MUST be set to 0, which indicates there isn't any critical option.</t>
	 
     <t> Protocol Type field MUST be set to 0x6558 (Ethernet frame).</t>
	 
     <t> Virtual Network Identifier (VNI) field SHOULD be set to the VNI number that the originating VAP is mapped to.</t>
	</list>
    </t> 
  </section>
  
  <section anchor="ip-encaps-section" title="BFD Encapsulation With Inner IP/UDP Header">
	
  <t> If the VAP that originates the BFD packets is used to encapsulate IP data packets, then BFD packets are 
  encapsulated in Geneve as described below. The Geneve packet format over IPv4 is defined in Section 3.1 of 
  <xref target="RFC8926"/>. The Geneve packet format over IPv6 is defined in Section 3.2 of <xref target="RFC8926"/>. 
  The Outer IP/UDP and Geneve headers MUST be encoded by the sender as defined in <xref target="RFC8926"/>. Note that 
  the outer IP header and the inner IP header may not be of the same address family, in other words, outer IPv6 header 
  accompanied with inner IPv4 header and outer IPv4 header accompanied with inner IPv6 header are both possible. </t>
	
     <figure anchor="Figure_2" title="Geneve Encapsulation of BFD Control Packet With the Inner IP/UDP Header">
     <artwork align="left">     <![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                         Ethernet Header                       ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                        Outer IPvX Header                      ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                        Outer UDP Header                       ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                          Geneve Header                        ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                        Inner IPvX Header                      ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                         Inner UDP Header                      ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                        BFD Control Packet                     ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               FCS                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     ]]>     </artwork>
     </figure>
	 
     <t> The BFD packet MUST be carried inside the inner IP packet of the Geneve packet.
     The inner IP packet carrying the BFD Control packet has the following format:
		   <list>
			   <t>IP header:
				   <list>
					   <t>Source IP: IP address of a VAP of the originating NVE.</t>
					   <t>Destination IP: IP address of a VAP of the terminating NVE.</t>
					   <t>TTL or Hop Limit: MUST be set to 255 in accordance with <xref target="RFC5881"/>.</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>
	 
     <t> When the BFD packets are encapsulated in Geneve in this way, the Geneve header defined in <xref target="RFC8926"/> 
	 follows the value set below.</t>	
	 
	<!-- 
     <figure anchor="" title="Geneve Header">
     <artwork align="left">
     <![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Ver|  Opt Len  |O|C|    Rsvd.  |          Protocol Type        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|        Virtual Network Identifier (VNI)       |    Reserved   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Variable Length Options                    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     ]]>
     </artwork>
     </figure>
-->

    <t> 
	<list>
     <t> Opt Len field SHOULD be set to 0, which indicates there isn't any variable length option.</t>
	 
	 <t> O bit MUST be set to 1, which indicates this packet contains a control message.</t>
	 
     <t> C bit MUST be set to 0, which indicates there isn't any critical option.</t>
	 
     <t> Protocol Type field MUST be set to 0x0800 (IPv4) or 0x86DD (IPv6), depending on the address family 
	 of the inner IP packet.</t>
	 
     <t> Virtual Network Identifier (VNI) field SHOULD be set to the VNI number that the originating VAP is mapped to.</t>
	</list>
    </t> 
  </section>
	 
  </section> 

  <section title="Reception of BFD packet from Geneve Tunnel"> 
  
  <t> Once a packet is received, the NVE MUST validate the packet as described in <xref target="RFC8926"/>.
   <list>
      <t> If the Protocol Type field equals 0x6558 (Ethernet frame), and the Destination MAC of the 
	  inner Ethernet frame matches the MAC address of a VAP which is mapped to the same as received 
	  VNI, then the Destination IP, the UDP destination port and the TTL or Hop Limit of the inner 
	  IP packet MUST be validated to determine whether the received packet can be processed by BFD. </t>
      
      <t> If the Protocol Type field equals 0x0800 (IPv4) or 0x86DD (IPv6), and the Destination IP 
	  of the inner IP packet matches the IP address of a VAP which is mapped to the same as received 
	  VNI, then the UDP destination port and the TTL or Hop Limit of the inner IP packet MUST be validated 
	  to determine whether the received packet can be processed by BFD. </t>
   </list>
  </t>
  <section title="Demultiplexing of the BFD packet"> 
    
  <t> In BFD over Geneve, a BFD session is originated and terminated at VAP, usually one NVE owns 
  multiple VAPs, so multiple BFD sessions may be running between two NVEs, there needs to be a mechanism 
  for demultiplexing received BFD packets to the proper session. Furthermore, due to the fact that 
  <xref target="RFC8014"/> allows for N-to-1 mapping between VAP and VNI at one NVE, multiple BFD sessions 
  between two NVEs for the same VNI are allowed. Also note that a BFD session can only be established between 
  two VAPs that are mapped to the same VNI and use the same way to encapsulate data packets. </t>
  
  <t> If the BFD packet is received with Your Discriminator equals to 0, for different BFD encapsulation, 
  the procedure for demultiplexing the received BFD packets is different.
   <list>
      <t> When the BFD Encapsulation With Inner Ethernet/IP/UDP Header is used, the BFD session MUST be 
	  identified using the VNI number, and the inner Ethernet/IP/UDP Header, i.e., the source MAC, the 
	  source IP, the destination MAC, the destination IP, and the source UDP port number present in the 
	  inner Ethernet/IP/UDP header.</t>
	  
      <t> When the BFD Encapsulation With Inner IP/UDP Header is used, the BFD session MUST be identified 
	  using the VNI number, and the inner IP/UDP header, i.e., the source IP, the destination IP, and the 
	  source UDP port number present in the inner IP/UDP header.</t>
   </list>
  </t>
  
  <t> If the BFD packet is received with non-zero Your Discriminator, then the BFD session MUST be demultiplexed 
  only with Your Discriminator as the key. The exchange of BFD discriminators may be achieved by echo request/reply, 
  EVPN, etc. The detailed mechanism on how to exchange the BFD discriminators is outside the scope of this document.</t>
    
  </section>
	
  </section>

  <section title="Security Considerations">
  <t> This document does not raise any additional security issues beyond those of the specifications referred 
  to in the list of references.</t>
  </section>
  
  <section title="IANA Considerations"> 
  <t> This document has no IANA action requested.</t>
  </section>

  <section title="Acknowledgements">
  <t> The authors would like to acknowledge Reshad Rahman, Jeffrey Haas and Matthew Bocci for their guidance 
  on this work.</t>
  <t> The authors would like to acknowledge David Black for his explanation on the mapping relation between VAP 
  and VNI.</t>
  </section>  
  
</middle>
  
<back>

    <references title="Normative References">
	 &rfc5880;
	 &rfc5881;
	 &rfc2119;
	 &rfc7365;
	 &rfc8014;
     &rfc8174;
     &rfc8926;
    </references>
    <references title="Informative References">
	 &rfc7348;
     &rfc8971;
	 &I-D.ietf-nvo3-geneve-oam;
    </references>
	
</back>
</rfc>
