<?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" [
<!-- One method to get references from the online citation libraries.
    There has to be one entity for each item to be referenced. 
    An alternate method (rfc include) is described in the references. -->
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY I-D.narten-iana-considerations-rfc2434bis SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.narten-iana-considerations-rfc2434bis.xml">
]>
<?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="std" docName="draft-xu-ipsecme-esp-in-udp-lb-15"
     ipr="trust200902">
  <front>
    <title abbrev="Encapsulating ESP in UDP for Load-balancing">Encapsulating
    IPsec ESP in UDP for Load-balancing</title>

    <author fullname="Xiaohu Xu" initials="X." surname="Xu">
      <organization>China Mobile</organization>

      <address>
        <email>xuxiaohu_ietf@hotmail.com</email>
      </address>
    </author>

    <author fullname="Shraddha Hegde" initials="S." surname="Hegde">
      <organization>Juniper Networks</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

        <email>shraddha@juniper.net</email>

        <uri/>
      </address>
    </author>

    <author fullname="Boris Pismenny" initials="B." surname="Pismenny">
      <organization>Nvidia</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

        <email>borisp@nvidia.com</email>

        <uri/>
      </address>
    </author>

    <author fullname="Dacheng Zhang" initials="D." surname="Zhang">
      <organization>Huawei</organization>

      <address>
        <email>dacheng.zhang@huawei.com</email>
      </address>
    </author>

    <author fullname="Liang Xia" initials="L." surname="Xia">
      <organization>Huawei</organization>

      <address>
        <email>frank.xialiang@huawei.com</email>
      </address>
    </author>

    <author fullname="Mahendra Puttaswamy" initials="M." surname="Puttaswamy">
      <organization>Juniper Networks</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

        <email>mpmahendra@juniper.net</email>

        <uri/>
      </address>
    </author>

    <!--
-->

    <date day="26" month="February" year="2026"/>

    <abstract>
      <t>IPsec Virtual Private Network (VPN) is widely used by enterprises to
      interconnect their geographical dispersed branch office locations across
      the Wide Area Network (WAN) or the Internet, especially in the
      Software-Defined-WAN (SD-WAN) era. In addition, IPsec is also
      increasingly used by cloud providers to encrypt IP traffic traversing
      data center networks and data center interconnect WANs so as to meet the
      security and compliance requirements, especially in financial cloud and
      governmental cloud environments. To fully utilize the bandwidth
      available in the data center network, the data center interconnect WAN
      or the Internet, load balancing of IPsec traffic over Equal Cost
      Multi-Path (ECMP) and/or Link Aggregation Group (LAG) is much attractive
      to those enterprises and cloud providers. This document defines a method
      to encapsulate IPsec Encapsulating Security Payload (ESP) packets over
      UDP tunnels for improving load-balancing of IPsec ESP traffic.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>IPsec Virtual Private Network (VPN) is widely used by enterprises to
      interconnect their geographical dispersed branch office locations across
      the Wide Area Network (WAN) or the Internet, especially in the
      Software-Defined-WAN (SD-WAN) era. In addition, IPsec is also
      increasingly used by cloud providers to encrypt IP traffic traversing
      data center networks and data center interconnect WANs so as to meet the
      security and compliance requirements, especially in financial cloud and
      governmental cloud environments. To fully utilize the bandwidth
      available in the WAN or the Internet, load balancing of IPsec traffic
      over Equal Cost Multi-Path (ECMP) and/or Link Aggregation Group (LAG) is
      much attractive to those enterprises and cloud providers. Although the
      ESP SPI field within the IPsec packets can be used as the load-balancing
      key, but it cannot be used by legacy switches and routers. As a result,
      many cloud service providers allow customers to establish multiple IPsec
      VPN tunnels in parallel to enable ECMP and increase aggregate bandwidth.
      However, this approach is not ideal, as each tunnel typically requires
      its own public IP address, leading to higher public IP consumption and
      increased operational overhead.</t>

      <t>Since most existing switches within data center networks and core
      routers within IP WAN or the Internet can already support balancing IP
      traffic flows based on the hash of the five-tuple of UDP packets, by
      encapsulating IPsec Encapsulating Security Payload (ESP) packets over
      UDP tunnels with the UDP source port being used as an entropy field, it
      will enable existing data center switches and core routers to perform
      efficient load-balancing of the IPsec ESP traffic without requiring any
      change to them. Therefore, this specification defines a method of
      encapsulating IPsec ESP packets over UDP tunnels for improving
      load-balancing of IPsec ESP traffic.</t>

      <t>IPsec VPN gateways are usually implemented in the form of multi-core
      x86 servers, especially in the public cloud environment. Receive Side
      Scaling (RSS) is a widely adopted network driver technology which
      spreads incoming TCP or UDP traffic across multiple CPUs by performing
      hash function on the network and/or transport layer headers, resulting
      in increased multi-core efficiency and processor cache utilization. By
      encapsulating ESP in UDP, it would facilate RSS to distribute the
      received IPsec traffic more evenly across multiple CPU cores.</t>

      <t>Encapsulating ESP in UDP, as defined in this document, can be used in
      both IPv4 and IPv6 networks. IPv6 flow label has been proposed as an
      entropy field for load balancing in IPv6 network environment <xref
      target="RFC6438"/>. However, as stated in <xref target="RFC6936"/>, the
      end-to-end use of flow labels for load balancing is a long-term solution
      and therefore the use of load balancing using the transport header
      fields would continue until any widespread deployment is finally
      achieved. As such, ESP-in-UDP encapsulation would still have a practical
      application value in the IPv6 networks during this transition
      timeframe.</t>

      <t>Note that the difference between the ESP-in-UDP encapsulation as
      proposed in this document and the ESP-in-UDP encapsulation as described
      in <xref target="RFC3948"/> is that the former uses the UDP tunnel for
      load-balancing improvement purpose and therefore the source port is used
      as an entropy field while the latter uses the UDP tunnel for NAT
      traversal purpose and therefore the source port is set to a constant
      value (i.e., 4500). In addition, the ESP-in-UDP encapsulation as
      described in this document is applicable to both the tunnel mode ESP
      encapsulation and the transport mode ESP encapsulation.</t>

      <t>There are use cases that do not use NAT traversal such as multi-cloud
      WAN. ESP-in-UDP encapsulation along with NAT traversal is out of scope
      in this document.</t>

      <section 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">RFC 2119</xref>.</t>
      </section>
    </section>

    <section anchor="Abbreviations_Terminology" title="Terminology">
      <t>This memo makes use of the terms defined in <xref target="RFC2401">
      </xref>and <xref target="RFC2406"/>.</t>
    </section>

    <section title="Encapsulation in UDP">
      <t>ESP-in-UDP encapsulation format is shown as follows: <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
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |    Source Port = Entropy      |        Dest Port = TBD1       |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |           UDP Length          |        UDP Checksum           |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     ~                           ESP Packet                          ~
     |                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
              Figure 1: ESP-in-UDP Encapsulation Format]]></artwork>
        </figure><list>
          <t>Source Port of UDP: <list style="empty">
              <t>This field contains a 16-bit entropy value that is generated
              by the encapsulator to uniquely identify a flow. What
              constitutes a flow is locally determined by the encapsulator and
              therefore is outside the scope of this document. What algorithm
              is actually used by the encapsulator to generate an entropy
              value is outside the scope of this document.</t>

              <t>In case the tunnel does not need entropy, this field of all
              packets belonging to a given flow SHOULD be set to a randomly
              selected constant value so as to avoid packet reordering.</t>

              <t>To ensure that the source port number is always in the range
              49152 to 65535 (Note ports less than 49152 are reserved by IANA
              to identify specific applications/protocols) which may be
              required in some cases, instead of calculating a 16-bit hash,
              the encapsulator SHOULD calculate a 14-bit hash and use those 14
              bits as the least significant bits of the source port field
              while the most significant two bits SHOULD be set to binary 11.
              That still conveys 14 bits of entropy information which would be
              enough as well in practice.</t>
            </list></t>

          <t>Destination Port of UDP:</t>

          <t><list style="empty">
              <t>This field is set to a value (TBD1) allocated by IANA to
              indicate that the UDP tunnel payload is an ESP packet.</t>
            </list>UDP Length:</t>

          <t><list style="empty">
              <t>The usage of this field is in accordance with the current UDP
              specification <xref target="RFC0768"/>.</t>
            </list></t>

          <t>UDP Checksum:</t>

          <t><list style="empty">
              <t>For IPv4 UDP encapsulation, this field is RECOMMENDED to be
              set to zero for performance or implementation reasons because
              the IPv4 header includes a checksum and use of the UDP checksum
              is optional with IPv4. For IPv6 UDP encapsulation, the IPv6
              header does not include a checksum, so this field MUST contain a
              UDP checksum that MUST be used as specified in <xref
              target="RFC0768"/> and <xref target="RFC2460"/> unless one of
              the exceptions that allows use of UDP zero-checksum mode (as
              specified in <xref target="RFC6935"/>) applies.</t>
            </list></t>

          <t>ESP Packet:</t>

          <t><list style="empty">
              <t>This field contains one ESP packet.</t>
            </list></t>
        </list></t>
    </section>

    <section anchor="Advertising" title="Processing Procedures">
      <t>This ESP-in-UDP encapsulation causes ESP <xref target="RFC2406"/>
      packets to be forwarded across IP WAN via "UDP tunnels". When performing
      ESP-in-UDP encapsulation by an IPsec VPN gateway, ordinary ESP
      encapsulation procedure is performed and then a formatted UDP header is
      inserted between ESP header and IP header. The Source Port field of the
      UDP header is filled with an entropy value which is generated by the
      IPsec VPN gateway. Upon receiving these UDP encapsulated packets, remote
      IPsec VPN gateway MUST decapsulate these packets by removing the UDP
      header and then perform ordinary ESP decapsulation procedure
      consequently.</t>

      <t>Similar to all other IP-based tunneling technologies, ESP-in-UDP
      encapsulation introduces overheads and reduces the effective Maximum
      Transmission Unit (MTU) size. ESP-in-UDP encapsulation may also impact
      Time-to-Live (TTL) or Hop Count (HC) and Differentiated Services (DSCP).
      Hence, ESP-in-UDP MUST follow the corresponding procedures defined in
      <xref target="RFC2003"/>.</t>

      <t>Encapsulators MUST NOT fragment ESP packet, and when the outer IP
      header is IPv4, encapsulators MUST set the DF bit in the outer IPv4
      header. It is strongly RECOMMENDED that IP transit core be configured to
      carry an MTU at least large enough to accommodate the added
      encapsulation headers. Meanwhile, it is strongly RECOMMENDED that Path
      MTU Discovery <xref target="RFC1191"/> <xref target="RFC1981"/> or
      Packetization Layer Path MTU Discovery (PLPMTUD) <xref
      target="RFC4821"/> is used to prevent or minimize fragmentation.</t>
    </section>

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

    <section title="Applicability Statements">
      <t>TBD.</t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t/>

      <!---->
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>One UDP destination port number indicating ESP needs to be allocated
      by IANA:</t>

      <t><figure>
          <artwork><![CDATA[   Service Name: ESP-in-UDP Transport Protocol(s):UDP 
   Assignee: IESG <iesg@ietf.org> 
   Contact: IETF Chair <chair@ietf.org>. 
   Description: Encapsulate ESP packets in UDP tunnels. 
   Reference: This document. 
   Port Number: TBD1 -- To be assigned by IANA.]]></artwork>
        </figure></t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>If source port is generated using inner packet parameters, care
      should be taken to not reveal those parameters. Including some random
      bytes along with the inner packet parameters will ensure the information
      of inner IP header is not revealed.</t>

      <t>Because packets are traversing different paths and the ESP sequence
      number is assigned sequencially by the encapsulator irrespective of the
      packet flow, the receiver might receive packets out-of-order and end up
      dropping them as delayed/out-of-order packets. Based on the network
      speed and load, administrator should be able to adjust the replay window
      size or entirely disable the replay check.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2401"?>

      <?rfc include="reference.RFC.2406"?>

      <?rfc include="reference.RFC.2119"?>

      <?rfc include="reference.RFC.0768"?>

      <?rfc include="reference.RFC.1191"?>

      <?rfc include="reference.RFC.1981"?>

      <?rfc include="reference.RFC.6438"?>

      <?rfc include="reference.RFC.6935"?>

      <?rfc include="reference.RFC.6936"?>

      <?rfc include="reference.RFC.2460"?>

      <?rfc include="reference.RFC.2003"?>

      <?rfc include="reference.RFC.4821"?>

      <!---->
    </references>

    <references title="Informative References">
      <?rfc include="reference.RFC.3948"?>

      <!---->
    </references>
  </back>
</rfc>
