<?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 rfc8174 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY I-D.ietf-nvo3-geneve PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-nvo3-geneve.xml">
<!ENTITY I-D.ietf-bfd-vxlan PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-bfd-vxlan.xml">
]>
<rfc category="std" ipr="trust200902" docName="draft-xiao-bfd-geneve-00">

<?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</organization>
     <address>
       <postal>
         <street/>

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

         <city>Nanjing</city>

         <region/>

         <code/>

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

       <phone>+86 25 88016574</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</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>

    <date year="2018"/>
  
    <area>Routing</area>
    <workgroup>BFD 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 Generic Network Virtualization Encapsulation (Geneve) overlay networks.</t>
    </abstract>
    
</front>
  
<middle>

  <section title="Introduction">

  <t> "Generic Network Virtualization Encapsulation" (Geneve) <xref target="I-D.ietf-nvo3-geneve"/> provides a generic tunneling protocol that is applicable to many scenarios, including an encapsulation scheme that allows virtual machines (VMs) to communicate in a data center network.</t>
  
  <t> This document describes the use of Bidirectional Forwarding Detection (BFD) protocol for Geneve to enable monitoring continuity of the path between Network Virtualization Edges (NVEs) and/or availability of a replicator service node using BFD.</t>
  
  <t> The use cases and the deployment of BFD for Geneve are consistent with what's described in Section 3 and Section 4 of <xref target="I-D.ietf-bfd-vxlan"/>. The main difference between Geneve and "Virtual eXtensible Local Area Network" (VXLAN) <xref target="RFC7348"/> encapsulation is that Geneve supports multi-protocol payload and variable length options. </t>
  
   <section title="Conventions Used in This Document">
   
    <section title="Terminology">
    <t> BFD: Bidirectional Forwarding Detection</t>
    <t> Geneve: Generic Network Virtualization Encapsulation</t>
    <t> NVE: Network Virtualization Edge</t>
    <t> VFI: Virtual Forwarding Instance</t>
    <t> VM: Virtual Machine</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>

  <section title="BFD Packet Transmission over Geneve Tunnel">

  <t> BFD packet MUST be encapsulated and sent to a remote NVE using one of
  the options described  in <xref target="bfd-geneve-encaps-section"/>. Implementations SHOULD ensure that the BFD
  packets follow the same lookup path as Geneve data packets within the sender system.</t>
  
    <section anchor="bfd-geneve-encaps-section" title="BFD Packet Encapsulation in Geneve">

  <t> Concerning whether or not the Geneve data packets include an 
  IP protocol data unit, this document defines three options of BFD packet encapsulation in Geneve.</t>
  
  <section anchor="ip-encaps-section" title="BFD Encapsulation With IP/UDP Header">
	
  <t> If the Protocol Type field (as defined in Section 3.4 of <xref target="I-D.ietf-nvo3-geneve"/>) 
  of data packets indicates that there exists an inner IP header, i.e., the Protocol Type equals to 0x6558 (Ethernet frame),
  or 0x0800 (IPv4), or 0x86DD (IPv6), or 0x8847 (MPLS), or 0x8848 (MPLS with the upstream-assigned label), 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="I-D.ietf-nvo3-geneve"/>. The Geneve packet format over IPv6 is
  defined in Section 3.2 of <xref target="I-D.ietf-nvo3-geneve"/>. The Outer IP/UDP and Geneve headers
  MUST be encoded by the sender as defined in <xref target="I-D.ietf-nvo3-geneve"/>. 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 Message 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                      Outer Ethernet Header                    ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                        Outer IPvX Header                      ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                        Outer UDP Header                       ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                          Geneve Header                        ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                        Inner IPvX Header                      ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                         Inner UDP Header                      ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                       BFD Control Message                     ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               FCS                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     ]]>
     </artwork>
     </figure>
	 
     <t> When the BFD packets are encapsulated in Geneve in this way,
     the BFD packet MUST be carried inside the inner IP packet of the Geneve packet.
     The inner IP packet carrying the BFD payload has the following format:
		   <list>
			   <t>IP header:
				   <list>
					   <t>Source IP: IP address of the originating NVE.</t>
					   <t>Destination IP: IP address of the terminating NVE.</t>
					   <t>TTL: MUST be set to 1 to ensure that the BFD packet is not routed within the L3 underlay network.</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 SHOULD follow the value set below.</t>	
	 
     <figure anchor="Figure_2" 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> Opt Len field SHOULD be set to 0, which indicates there isn't any variable length option.</t>
	 
			<t>[Ed.Note]: Use of O bit is still being discussed in the NVO3 WG, so the value is undetermined.</t>
	 
     <t> C bit SHOULD be set to 0.</t>
	 
     <t> Protocol Type field SHOULD be set to 0x0800 (IPv4) or 0x86DD (IPv6).</t>
	 </section>
	 
	 <section anchor="non-ip-encaps-section" title="BFD Encapsulation Without IP/UDP Header">
	 
     <t>Alternatively to the use of the inner IP/UDP header to demultiplex BFD
     control packet by the value of the destination UDP port, BFD control packet MAY
     be encapsulated without the inner IP/UDP header. The BFD control packet MAY be identified directly
     in the Geneve header or through Geneve OAM shim. In either case, the Outer IP/UDP and Geneve headers
     MUST be encoded by the sender as defined in <xref target="I-D.ietf-nvo3-geneve"/>.</t>
	 
	 <t> <xref target="Figure_3"/> displays the layout of the Ethernet frame with BFD control packet encapsulated in Geneve without
	 the use of IP/UDP header and identified by the value TBA1 (to be assigned by IANA) of the Protocol Type field.</t>
	 
     <figure anchor="Figure_3" title="Geneve Encapsulation of BFD Control Message Without 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                      Outer Ethernet Header                    ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                        Outer IPvX Header                      ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                        Outer UDP Header                       ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                          Geneve Header                        ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                       BFD Control Message                     ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               FCS                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     ]]>
     </artwork>
     </figure>
     	 
     <t> When the BFD packets are encapsulated in Geneve in this way,
     the BFD packet MUST immediately follow the Geneve header,
     and the Geneve header SHOULD follow the value set below.</t>	
	
	<!-- 
     <figure anchor="Figure_4" 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> Opt Len field SHOULD be set to 0, which indicates there isn't any variable length option.</t>
     <t>[Ed.Note]: Use of O bit is still being discussed in the NVO3 WG, so the value is undetermined.</t>
     <t> C bit SHOULD be set to 0.</t>
	 
     <t>Also, if BFD control packet is encapsulated in Geneve without the use
     of IP/UDP header, the BFD control packet MAY be identified through the Geneve OAM shim.
     The layout of the Ethernet frame is shown in <xref target="Figure_5"/>.
    Protocol Type field MUST be set to the value TBA2 (to be assigned by IANA) which indicates a Geneve OAM shim that will have a
     field to indicate the inner BFD control packet. Definition of the format of the Geneve OAM shim is outside the scope
     of this document. The Geneve OAM shim immediately follows the Geneve header, and the BFD control packet immediately follows the Geneve OAM shim.</t>
     
        <figure anchor="Figure_5" title="Geneve Encapsulation of BFD Control Message With Geneve OAM Shim">
     <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                        ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Geneve OAM Shim                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                       BFD Control Message                     ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               FCS                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     ]]>
     </artwork>
     </figure>
     
     </section>
	 
    </section>
  </section> 

  <section title="Reception of BFD packet from Geneve Tunnel"> 
  
  <t> Once a packet is received, NVE MUST validate the packet as described in <xref target="I-D.ietf-nvo3-geneve"/>.</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
  the NVE, the UDP destination port and the TTL of the inner IP packet MUST
  be validated to determine whether BFD can process the received packet.
  BFD packet with inner IP set to NVE MUST NOT be forwarded to VMs.</t>
  
  <t> If the Protocol Type field equals the value TBA1 (to be assigned by IANA)
  which indicates an inner BFD control message, the received packet MUST
  be processed by BFD and MUST NOT be forwarded to VMs.</t>

  <t> If the Protocol Type field equals the value TBA2 (to be assigned by IANA)
  which indicates a Geneve OAM shim that will have a field to indicate
  the inner BFD control message, the received packet MUST be processed
  by BFD and MUST NOT be forwarded to VMs. This case is for further study.</t>

  <t> To ensure BFD detects the proper configuration of Virtual Network Identifier (VNI)
  in a remote NVE, a lookup SHOULD be performed with the MAC-DA/IP-DA/MPLS-Label
  and VNI as key in the Virtual Forwarding Instance (VFI) table of the originating/terminating
  NVE to exercise the VFI associated with the VNI.</t>
  
	<section title="Demultiplexing of the BFD packet"> 
  
	<t> If the Protocol Type field equals 0x0800 (IPv4) or 0x86DD (IPv6), demultiplexing
	of IP BFD packet has been defined in Section 3 of <xref target="RFC5881"/>.
	Since multiple BFD sessions may be running between two NVEs, there needs to
	be a mechanism for demultiplexing received BFD packets to the proper session.
	The procedure for demultiplexing packets with Your Discriminator equal to 0 is different
	from <xref target="RFC5880"/>.  For such packets, the BFD session MUST be identified
	using the inner headers, i.e., the source IP and the destination IP present in the IP header
	carried by the payload of the Geneve encapsulated packet.  The VNI of the packet
	SHOULD be used to derive interface-related information for demultiplexing the packet.
	If BFD packet is received with non-zero Your Discriminator, then BFD session MUST be
	demultiplexed only with Your Discriminator as the key.</t>
  
	<t> If the Protocol Type field equals the value TBA1 (to be assigned by IANA) which
	indicates an inner BFD control message, or the value TBA2 (to be assigned by IANA) which indicates 
	a Geneve OAM shim that will have a field to indicate the inner BFD control message, the VNI of the packet
	SHOULD be used to derive interface-related information for demultiplexing the 
	packet, demultiplexing of BFD packet MUST rely on non-zero Your Discriminator as the key.</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 normative references.</t>
  </section>
  
  <section title="IANA Considerations"> 
  <t> In the Geneve Protocol Type registry defined in <xref target="ETYPES"/>, a new BFD Control Message or Geneve OAM Shim is requested from IANA as follows:</t>
     <texttable anchor="Table_1" title="New BFD Control Message or Geneve OAM shim Ethertype">

         <ttcol align="left">Geneve Protocol Type</ttcol>

         <ttcol align="left">Description</ttcol>
		 
         <ttcol align="left">Semantics Definition</ttcol>

         <ttcol align="left">Reference</ttcol>

         <c>TBA1</c>

         <c>BFD Control Message</c>

         <c>Section 3.1</c>

         <c>This Document</c>

         <c>TBA2</c>

         <c>Geneve OAM Shim</c>

         <c>Section 3.1</c>

         <c>This Document</c>
              </texttable>
  </section>

  <section title="Acknowledgements">
  <t> To be added.</t>
  </section>  
  
</middle>
  
<back>

    <references title="Normative References">
     &rfc5880;
	 &rfc5881;
	 &rfc7348;	 
	 &rfc2119;
     &rfc8174;
	 &I-D.ietf-nvo3-geneve;
	 &I-D.ietf-bfd-vxlan;
      <reference anchor="ETYPES" target="http://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xml">
        <front>
          <title>IEEE 802 Numbers</title>

          <author>
            <organization>The IEEE Registration Authority</organization>
          </author>

          <date year="2013"/>
        </front>
      </reference>
    </references>

</back>
</rfc>
