<?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. -->
<?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="3"?>
<!-- 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="std" docName="draft-li-rtgwg-generalized-ipv6-tunnel-01"
     ipr="trust200902">
  <front>
    <title abbrev="Generalized IPv6 Tunnel">Generalized IPv6 Tunnel
    (GIP6)</title>

    <author fullname="Zhenbin Li" initials="Z." surname="Li">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>156 Beiqing Road</street>

          <city>Beijing,100095</city>

          <country>P.R. China</country>
        </postal>

        <email>lizhenbin@huawei.com</email>
      </address>
    </author>

    <author fullname="Shuanglong Chen" initials="S." surname="Chen">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>156 Beiqing Road</street>

          <city>Beijing, 100095</city>

          <country>P.R. China</country>
        </postal>

        <email>chenshuanglong@huawei.com</email>
      </address>
    </author>

    <author fullname="Haibo Wang" initials="H." surname="Wang">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>156 Beiqing Road</street>

          <city>Beijing, 100095</city>

          <country>P.R. China</country>
        </postal>

        <email>rainsword.wang@huawei.com</email>
      </address>
    </author>

    <date day="21" month="October" year="2022"/>

    <!---->

    <abstract>
      <t>This document defines the generalized IPv6 tunnel based on the
      analysis of challenges of the existing problems of IP tunnels.</t>

      <t/>
    </abstract>

    <note title="Requirements Language">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
      document are to be interpreted as described in <xref
      target="RFC2119"/>.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t>Currently there are many types of IP tunnels, such as VXLAN and GRE.
      On IPv6 networks, it is hard to define extensions for all these tunnels
      to support new features. On the other hand it is not recommended to
      extend new features based on the IPv4 data plane for these tunnels [].
      This document analyzes the problems of IP tunnels and defines a
      generalized IPv6 tunnel to support the new features.</t>

      <t/>
    </section>

    <section title="Terminology">
      <t>APN: Application-aware Networking</t>

      <t>GRE: Generic Routing Encapsulation</t>

      <t>IPv4: Internet Protocol version 4</t>

      <t>IPv6: Internet Protocol version 6</t>

      <t>IOAM: In-situ Operations, Administration, and Maintenance</t>

      <t>ISATAP: Intra-Site Automatic Tunnel Addressing Protocol</t>

      <t>L2TPv3: Layer Two Tunneling Protocol Version 3</t>

      <t>MPLS: Multiprotocol Label Switching</t>

      <t>NVO3: Network Virtualization Overlays</t>

      <t>SRv6: Segment Routing IPv6</t>

      <t>SID: SR Identification</t>

      <t>VNI: VXLAN Network Identifier</t>

      <t>VXLAN: Virtual eXtensible Local Area Network</t>

      <t/>
    </section>

    <section title="Problem Statement">
      <t>There have been many types of IP tunnels, including:</t>

      <t>- GRE Tunnels: it is defined in <xref target="RFC2784"/>.</t>

      <t>- IP in IP Tunnels: it is defined in <xref target="RFC1853"/>.</t>

      <t>- L2TPv3 Tunnels: it is defined in <xref target="RFC3931"/>.</t>

      <t>- ISATAP Tunnels: it is defined in <xref target="RFC4214"/>.</t>

      <t>- IPv4/IPv6 over IPv6 (4over6) Tunnels: it is defined in<xref
      target="RFC2473"/>.</t>

      <t>- VXLAN Tunnels: it is defined in <xref target="RFC7348"/>.</t>

      <t>- NVGRE Tunnels: it is defined in <xref target="RFC7637"/>.</t>

      <t>- MPLS over UDP: it is defined in <xref target="RFC7510"/>.</t>

      <t>- VXLAN-GPE (Generic Protocol Extension for VXLAN) Tunnels: it is
      defined in <xref target="I-D.ietf-nvo3-vxlan-gpe"/>.</t>

      <t/>

      <t>Currently many new features are emerging and the corresponding
      encapsulations over the IPv6 are defined:</t>

      <t>- <xref target="I-D.ietf-6man-ipv6-alt-mark"/> defines IPv6
      encapsulation for Alternate Marking.</t>

      <t>- <xref target="I-D.ietf-ippm-ioam-ipv6-options"/> defines IPv6
      encapsulation for IOAM.</t>

      <t>- <xref target="I-D.dong-6man-enhanced-vpn-vtn-id"/> defines the IPv6
      encapsulation used to determine resource isolation.</t>

      <t>- <xref target="I-D.li-apn-ipv6-encap"/> defines the IPv6
      encapsulation of an APN.</t>

      <t/>

      <t>If the existing IP tunnels need to support new features such as
      Alternate Marking, IOAM, resource isolation, and APN, the following
      problems exist:</t>

      <t>- All of the IP tunnels mentioned above need to be extended
      accordingly, resulting in a lot of standardization work.</t>

      <t>- It is hard to keep the consistency between IPv4 and IPv6 for these
      IP tunnels (except IPv4 transition tunnels) since the possible
      extensions are recommended to be only done over the IPv6.</t>

      <t>- IPv6 can directly support some functions of these IP tunnels which
      cannot be done over the IPv4. This means such functions becomes
      redundant over the IPv6. For example, VXLAN takes use of the UDP to
      support ECMP. However for the IPv6 VXLAN, the Flow Label in the IPv6
      header can also be used to support ECMP.</t>

      <t>- Some IP tunnels such as VXLAN and GRE have their own headers. If
      these tunnels need to support new features over the IPv6, there will
      face the challenge of the choice between reusing the exiting IPv6
      encapsulations for these new features based on the IPv6 extension header
      and define new extensions based on their own tunnel headers.</t>

      <t>-- If the tunnel header is extended, it will be redundant with the
      existing IPv6 encapsulation for the new features based on the IPv6
      extension header.</t>

      <t>-- For some existing IP tunnels (such as IP in IP) that do not have
      their own headers, they have to reuse the IPv6 encapsulations for these
      new features based the IPv6 header. extensions need to be redefined in
      the IPv6 extension header. As a result, their extensions may be
      different from that of the IP tunnels which have their own headers.</t>

      <t/>
    </section>

    <section title="Design Consideration">
      <t>In order to solve the above problems, the following choice can be
      taken into account:</t>

      <t>1. It is not recommended to support the new features over the IPv4
      for these IP tunnels.</t>

      <t>2. It is to reuse the existing IPv6 encapsulations based on the IPv6
      extension header when support the new features for these IP tunnels over
      the IPv6.</t>

      <t>If these IP tunnels takes use of the existing encapsulations based on
      the IPv6 extension header, for the IP tunnels which have their own
      headers, there are two possible options to cope with their own
      headers:</t>

      <t>Option 1: They use the IPv6 extension headers to support new features
      and their own headers are retained.</t>

      <t>Option 2: Define a generalized IPv6 tunnel that contains the IPv6
      extension header which not only reuses the existing IPv6 encapsulations
      to support new features, but also introduces the new extensions to
      support the necessary functions of their own headers.</t>

      <t/>

      <t>But the Option 1 has the following problems:</t>

      <t>1. Redundant Functions: For example, the UDP-based IP tunnel can
      directly use IPv6 flow label to implement ECMP.</t>

      <t>2. Separated process of tunnel functions: Some functions use IPv6
      extension headers and some functions use headers of tunnels. As a
      result, tunnel processing is separated and complex. If the IPSec
      extension header is used, the tunnel's own header maybe encrypted and
      unable to be parsed when necessary process is needed.</t>

      <t>According to the above design consideration, Option 2 is recommended
      in this document.</t>

      <t/>
    </section>

    <section title="Structure of a GIP6 Encapsulated Packet">
      <t>The Generalized IPv6 (GIP6) tunnel is defined to use the IPv6 header
      and IPv6 extension header to support both existing IP tunnels functions
      and new features.</t>

      <t>A GIP6 encapsulated packet has the following format:</t>

      <t><figure>
          <artwork><![CDATA[+ - - - - - - - - - - - - - - - - - - - - - - - - - -+     ----
|                IPv6 Header                         |      |
+ - - - - - - - - - - - - - - - - - - - - - - - - - -+     GIP6   
|               IPv6 Extension Header                | Encapsulation
|       (Encapsulations of new features +            |      |
| Encapsulations of functions of existing IP tunnels)|      |
+ - - - - - - - - - - - - - - - - - - - - - - - - - -+     ----
|                Payload packet                      |
+ - - - - - - - - - - - - - - - - - - - - - - - - - -+
               Figure 1. GIP6 Encapsulation]]></artwork>
        </figure></t>

      <t/>

      <t>Different types of tunneled payloads, such as IPv4, IPv6, MPLS,
      Ethernet, etc., can be indicated by the IPv6 Next Header.</t>

      <t>Packets encapsulated with the GIP6 tunnel can directly support new
      functions based on existing encapsulation, including Alternate-Marking,
      IOAM, Resource-Isolation, and APN.</t>

      <t/>
    </section>

    <section title="GIP6 for VXLAN">
      <t>To support existing VXLAN functions, the GIP6 tunnel is extended as
      follows:</t>

      <t/>

      <t>1. The function of the UDP is replaced by the flow label of the IPv6
      header in the GIP6 tunnel. To ensure compatibility, the value of the
      flow label calculated for the purpose of ECMP SHOULD be the same as that
      of the source port of the UDP.</t>

      <t>2. Definition of the VN Option</t>

      <t>A new option called VN Option is defined to carry the VXLAN header
      information. The VN Option MUST only be encapsulated in the Destination
      Options Header (DOH).</t>

      <t/>

      <t>The following figure shows the data fields format of the VN
      option:</t>

      <t><figure>
          <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 
                              +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                              |  Option Type  |  Opt Data Len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     
|                                                             |
|                VXLAN Header (8 Bytes)                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                      Figure 2. VN Option]]></artwork>
        </figure></t>

      <t>The VN Option contains the following fields:</t>

      <t>* Option Type: 8-bit selector. VN option. Value TBD by IANA.</t>

      <t>* Opt Data Len: 8-bit unsigned integer. Length of the option, in
      octets, excluding the Option Type and Option Length fields. This field
      MUST be set to 8.</t>

      <t>* Option Data: 64-bits VXLAN Header Information.</t>

      <t/>

      <t>The following figure shows the definition of VXLAN headers in <xref
      target="RFC7358"/>. For the detailed definition of the data fields,
      please refer to <xref target="RFC7358"/>.</t>

      <t><figure>
          <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 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     
| VXLAN Flags |                  Reserved                     |   
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|       VXLAN Network Identifier(VNI)           |  Reserved   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                       Figure 3. VXLAN headers]]></artwork>
        </figure></t>
    </section>

    <section title="GIP6 for GRE">
      <t/>

      <t>A new option called GRE Option is defined to carry the GRE header
      information. The GRE Option MUST only be encapsulated in the Destination
      Options header (DOH).</t>

      <t>The definition of a new TLV for the Options Extension Headers,
      carrying the data fields dedicated to the GRE information, is reported
      below.</t>

      <t>The following figure shows the data fields format of the GRE
      option.</t>

      <t><figure>
          <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 
                              +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                              |  Option Type  |  Opt Data Len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     
|                                                             |
|                GRE Header (16 Bytes)                        | 
|                                                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                    Figure 4. GRE Option]]></artwork>
        </figure></t>

      <t/>

      <t>The GRE Option contains the following fields:</t>

      <t>* Option Type: 8-bit selector. GRE option. Value TBD by IANA.</t>

      <t>* Opt Data Len: 8-bit unsigned integer. Length of the option, in
      octets, excluding the Option Type and Option Length fields. This field
      MUST be set to 16.</t>

      <t>* Option Data: 128-bits GRE Header Information.</t>

      <t>The following figure shows the definition of the GRE header in <xref
      target="RFC2890"/>. For the detailed definition of the data fields,
      please refer to <xref target="RFC2784"/> and <xref
      target="RFC2890"/>.</t>

      <t><figure>
          <artwork><![CDATA[     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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |C| |K|S| Reserved0       | Ver |         Protocol Type         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |      Checksum (optional)      |       Reserved1 (Optional)    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                         Key (optional)                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                 Sequence Number (Optional)                    |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                      Figure 5. GRE Header]]></artwork>
        </figure></t>

      <t>Note: The function of the Protocol Type in the GRE header can be
      replaced by that of the NH in the IPv6 header or IPv6 extension
      header.</t>

      <t/>
    </section>

    <section title="GIP6 for Other Existing IP Tunnels">
      <t>They will be defined in the future version.</t>

      <t/>
    </section>

    <section title="Security Considerations">
      <t>TBD.</t>

      <t/>
    </section>

    <section title="IANA Considerations">
      <t>The Option Type should be assigned in IANA's "Destination Options"
      registry.</t>

      <t>This draft requests the following IPv6 Option Type assignment from
      the Destination Options sub-registry of Internet Protocol Version 6
      (IPv6) Parameters
      (https://www.iana.org/assignments/ipv6-parameters/).</t>

      <t><figure>
          <artwork><![CDATA[Hex Value     Binary Value        Description           Reference
             act  chg  rest
----------------------------------------------------------------
 TBD         00    0   TBD          VN               [This draft]
 TBD         00    0   TBD          GRE              [This draft]
                  Figure 6. IANA Considerations]]></artwork>
        </figure></t>
    </section>
  </middle>

  <back>
    <references title="References">
      <?rfc include='reference.RFC.2119'?>

      <?rfc include='reference.RFC.2784'?>

      <?rfc include='reference.RFC.2890'?>

      <?rfc include='reference.RFC.7348'?>

      <?rfc include='reference.RFC.1853'?>

      <?rfc include='reference.RFC.4214'?>

      <?rfc include='reference.RFC.2473'?>

      <?rfc include='reference.RFC.7637'?>

      <?rfc include='reference.RFC.3931'?>

      <?rfc include='reference.RFC.7510'?>

      <?rfc include='reference.RFC.7358'?>

      <?rfc include='reference.I-D.ietf-6man-ipv6-alt-mark'?>

      <?rfc include='reference.I-D.ietf-nvo3-vxlan-gpe'?>

      <?rfc include='reference.I-D.ietf-ippm-ioam-ipv6-options'?>

      <?rfc include='reference.I-D.li-apn-ipv6-encap'?>

      <?rfc include='reference.I-D.dong-6man-enhanced-vpn-vtn-id'?>
    </references>
  </back>
</rfc>
