<?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-intarea-ip-in-udp-02" ipr="trust200902">
  <front>
    <title abbrev="Encapsulating IP in UDP">Encapsulating IP in UDP</title>

    <author fullname="Xiaohu Xu" initials="X.X." surname="Xu">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street>No.156 Beiqing Rd</street>

          <city>Beijing</city>

          <region/>

          <code>100095</code>

          <country>CHINA</country>
        </postal>

        <phone>+86-10-60610041</phone>

        <facsimile/>

        <email>xuxiaohu@huawei.com</email>

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

    <author fullname="Rajiv Asati" initials="R.A" surname="Asati">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street>7200 Kit Creek Road</street>

          <city>Research Triangle Park,</city>

          <region>NC</region>

          <code>27709</code>

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

        <phone/>

        <facsimile/>

        <email>rajiva@cisco.com</email>

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

    <author fullname="Tom Herbert" initials="T.H" surname="Herbert">
      <organization>Facebook</organization>

      <address>
        <postal>
          <street>1 Hacker Way,</street>

          <city>Menlo Park</city>

          <region>CA</region>

          <code>94052</code>

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

        <phone/>

        <facsimile/>

        <email>tom@herbertland.com</email>

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

    <author fullname="Lucy Yong" initials="L.Y" surname="Yong">
      <organization>Huawei USA</organization>

      <address>
        <postal>
          <street>5340 Legacy Dr</street>

          <city>Plano</city>

          <region>TX</region>

          <code>75025</code>

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

        <phone/>

        <facsimile/>

        <email>Lucy.yong@huawei.com</email>

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

    <author fullname="Yiu Lee" initials="Y.L" surname="Lee">
      <organization>Comcast</organization>

      <address>
        <postal>
          <street>One Comcast Center</street>

          <city>Philadelphia</city>

          <region>PA</region>

          <code/>

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

        <phone/>

        <facsimile/>

        <email>Yiu_Lee@Cable.Comcast.com</email>

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

    <author fullname="Yongbing Fan" initials="Y.F" surname="Fan">
      <organization>China Telecom</organization>

      <address>
        <postal>
          <street/>

          <city>Guangzhou</city>

          <region/>

          <code/>

          <country>CHINA</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>fanyb@gsta.com</email>

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

    <author fullname="Iljitsch van Beijnum" initials="I.B" surname="Beijnum">
      <organization>Institute IMDEA Networks</organization>

      <address>
        <postal>
          <street>Avda. del Mar Mediterraneo, 22</street>

          <city>Leganes,</city>

          <region>Madrid</region>

          <code>28918</code>

          <country>Spain</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>iljitsch@muada.com</email>

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

    <!--

-->

    <date day="" month="" year="2015"/>

    <abstract>
      <t>Existing Softwire encapsulation technologies are not adequate for
      efficient load balancing of Softwire service traffic across IP networks.
      This document specifies additional Softwire encapsulation technology,
      referred to as IP-in-User Datagram Protocol (UDP), which can facilitate
      the load balancing of Softwire service traffic across IP networks.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>To fully utilize the bandwidth available in IP networks and/or
      facilitate recovery from a link or node failure, load balancing of
      traffic over Equal Cost Multi-Path (ECMP) and/or Link Aggregation Group
      (LAG) across IP networks is widely used. <xref target="RFC5640"/>
      describes a method for improving the load balancing efficiency in a
      network carrying Softwire Mesh service <xref target="RFC5565"/> over
      Layer Two Tunneling Protocol - Version 3 (L2TPv3) <xref
      target="RFC3931"/> and Generic Routing Encapsulation (GRE) <xref
      target="RFC2784"/> encapsulations. However, this method requires core
      routers to perform hash calculation on the "load-balancing" field
      contained in tunnel encapsulation headers (i.e., the Session ID field in
      L2TPv3 headers or the Key field in GRE headers), which is not widely
      supported by existing core routers.</t>

      <t>Most existing routers in IP networks are already capable of
      distributing IP traffic "microflows" <xref target="RFC2474"/> over ECMP
      paths and/or LAG based on the hash of the five-tuple of User Datagram
      Protocol (UDP) <xref target="RFC0768"/> and Transmission Control
      Protocol (TCP) packets (i.e., source IP address, destination IP address,
      source port, destination port, and protocol). By encapsulating the
      Softwire service traffic into an UDP tunnel and using the source port of
      the UDP header as an entropy field, the existing load-balancing
      capability as mentioned above can be leveraged to provide fine-grained
      load-balancing of Softwire service traffic traffic over IP networks.
      This is similar to why LISP <xref target="RFC6830"/> , MPLS-in-UDP <xref
      target="RFC7510"/> and VXLAN <xref target="RFC7348"/> use UDP
      encapsulation. Therefore, this specification defines an IP-in-UDP
      encapsulation method for Software service (including both mesh and
      hub-spoke modes).</t>

      <t>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, IP-in-UDP
      encapsulation would still have a practical application value in the IPv6
      networks during this transition timeframe.</t>

      <t>Similarly, the IP-in-UDP encapsulation format defined in this
      document by itself cannot ensure the integrity and privacy of data
      packets being transported through the IP-in-UDP tunnels and cannot
      enable the tunnel decapsulators to authenticate the tunnel encapsulator.
      Therefore, in the case where any of the above security issues is
      concerned, the IP-in-UDP SHOULD be secured with IPsec <xref
      target="RFC4301"/> or DTLS <xref target="RFC6347"/>. For more details,
      please see Section 6 of Security Considerations.</t>

      <t/>

      <section title="Conventions">
        <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="Teminology" title="Terminology">
      <t>This memo makes use of the terms defined in <xref
      target="RFC5565"/>.</t>
    </section>

    <section title="Encapsulation in UDP">
      <t>IP-in-UDP encapsulation format is shown as follows:</t>

      <t><figure>
          <artwork align="center"><![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           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                           IP Packet                           ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure></t>

      <t><list style="empty">
          <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 that those 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<list style="empty">
              <t>This field is set to a value (TBD1) allocated by IANA to
              indicate that the UDP tunnel payload is an IP packet. As for
              whether the encapsulated IP packet is IPv4 or IPv6, it would be
              determined according to the Version field in the IP header of
              the encapsulated IP packet.</t>
            </list></t>

          <t>UDP Length<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<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>IP Packet<list style="empty">
              <t>This field contains one IP packet.</t>
            </list></t>
        </list></t>
    </section>

    <section title="Processing Procedures">
      <t>This IP-in-UDP encapsulation causes E-IP<xref target="RFC5565"/>
      packets to be forwarded across an I-IP <xref target="RFC5565"/> transit
      core via "UDP tunnels". While performing IP-in-UDP encapsulation, an
      ingress AFBR (e.g. PE router) would generate an entropy value and encode
      it in the Source Port field of the UDP header. The Destination Port
      field is set to a value (TBD1) allocated by IANA to indicate that the
      UDP tunnel payload is an IP packet. Transit routers, upon receiving
      these UDP encapsulated IP packets, could balance these packets based on
      the hash of the five-tuple of UDP packets. Egress AFBRs receiving these
      UDP encapsulated IP packets MUST decapsulate these packets by removing
      the UDP header and then forward them accordingly (assuming that the
      Destination Port was set to the reserved value pertaining to IP).</t>

      <t>Similar to all other Softwire tunneling technologies, IP-in-UDP
      encapsualtion introduces overheads and reduces the effective Maximum
      Transmision Unit (MTU) size. IP-in-UDP encapsulation may also impact
      Time-to-Live (TTL) or Hop Count (HC) and Differentiated Services (DSCP).
      Hence, IP-in-UDP MUST follow the corresponding procedures defined in
      <xref target="RFC2003"/>. If an ingress AFBR performs fragmentation on
      an E-IP packet before encapsulating, it MUST use the same source UDP
      port for all fragmented packets so as to ensures these fragmented
      packets are always forwarded on the same path.</t>
    </section>

    <section title="Congestion Considerations">
      <t>Section 3.1.3 of <xref target="RFC5405"/> discussed the congestion
      implications of UDP tunnels. As discussed in <xref target="RFC5405"/>,
      because other flows can share the path with one or more UDP tunnels,
      congestion control <xref target="RFC2914"/> needs to be considered. As
      specified in <xref target="RFC5405"/>: <list style="empty">
          <t>"IP-based traffic is generally assumed to be
          congestion-controlled, i.e., it is assumed that the transport
          protocols generating IP-based traffic at the sender already employ
          mechanisms that are sufficient to address congestion on the path.
          Consequently, a tunnel carrying IP-based traffic should already
          interact appropriately with other traffic sharing the path, and
          specific congestion control mechanisms for the tunnel are not
          necessary".</t>
        </list></t>

      <t>Since IP-in-UDP is only used to carry IP traffic which is generally
      assumed to be congestion controlled, it generally does not need
      additional congestion control mechanisms.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>The security problems faced with the IP-in-UDP tunnel are exactly the
      same as those faced with IP-in-IP <xref target="RFC2003"/> and IP-in-GRE
      tunnels <xref target="RFC2784"/>. In other words, the IP-in-UDP tunnel
      as defined in this document by itself cannot ensure the integrity and
      privacy of data packets being transported through the IP-in-UDP tunnel
      and cannot enable the tunnel decapsulator to authenticate the tunnel
      encapsulator. In the case where any of the above security issues is
      concerned, the IP-in-UDP tunnel SHOULD be secured with IPsec or DTLS.
      IPsec was designed as a network security mechanism and therefore it
      resides at the network layer. As such, if the tunnel is secured with
      IPsec, the UDP header would not be visible to intermediate routers
      anymore in either IPsec tunnel or transport mode. As a result, the
      meaning of adopting the IP-in-UDP tunnel as an alternative to the
      IP-in-GRE or IP-in-IP tunnel is lost. By comparison, DTLS is better
      suited for application security and can better preserve network and
      transport layer protocol information. Specifically, if DTLS is used, the
      destination port of the UDP header will be filled with a value (TBD2)
      indicating IP with DTLS and the source port can still be used as an
      entropy field for load-sharing purposes.</t>

      <t>If the tunnel is not secured with IPsec or DTLS, some other method
      should be used to ensure that packets are decapsulated and forwarded by
      the tunnel tail only if those packets were encapsulated by the tunnel
      head. If the tunnel lies entirely within a single administrative domain,
      address filtering at the boundaries can be used to ensure that no packet
      with the IP source address of a tunnel endpoint or with the IP
      destination address of a tunnel endpoint can enter the domain from
      outside. However, when the tunnel head and the tunnel tail are not in
      the same administrative domain, this may become difficult, and filtering
      based on the destination address can even become impossible if the
      packets must traverse the public Internet. Sometimes only source address
      filtering (but not destination address filtering) is done at the
      boundaries of an administrative domain. If this is the case, the
      filtering does not provide effective protection at all unless the
      decapsulator of an IP-in-UDP validates the IP source address of the
      packet.</t>

      <!---->
    </section>

    <!---->

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

      <t><list style="empty">
          <t>Service Name: IP-in-UDP</t>

          <t>Transport Protocol(s): UDP</t>

          <t>Assignee: IESG &lt;iesg@ietf.org&gt;</t>

          <t>Contact: IETF Chair &lt;chair@ietf.org&gt;.</t>

          <t>Description: Encapsulate IP packets in UDP tunnels.</t>

          <t>Reference: This document.</t>

          <t>Port Number: TBD1 -- To be assigned by IANA.</t>
        </list></t>

      <t>One UDP destination port number indicating IP with DTLS needs to be
      allocated by IANA:</t>

      <t><list style="empty">
          <t>Service Name: IP-in-UDP-with-DTLS</t>

          <t>Transport Protocol(s): UDP</t>

          <t>Assignee: IESG &lt;iesg@ietf.org&gt;</t>

          <t>Contact: IETF Chair &lt;chair@ietf.org&gt;.</t>

          <t>Description: Encapsulate IP packets in UDP tunnels with DTLS.</t>

          <t>Reference: This document.</t>

          <t>Port Number: TBD2 -- To be assigned by IANA.</t>
        </list></t>

      <!---->
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>Thanks to Vivek Kumar, Carlos Pignataro and Mark Townsley for their
      valuable comments on the initial idea of this document. Thanks to Andrew
      G. Malis for their valuable comments on this document.</t>

      <!---->
    </section>
  </middle>

  <back>
    <references title="Normative References">
      &RFC2119;

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

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

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

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

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

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

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

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

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

      <!---->
    </references>

    <references title="Informative References">
      <!---->

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

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

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

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

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

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

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

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

      <?rfc include="reference.RFC.7348"?>
    </references>
  </back>
</rfc>
