<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc strict='yes'?>
<?rfc iprnotified='no'?>
<rfc category="info" docName="draft-generic-v6ops-tunmtu-01.txt"
     ipr="trust200902">
  <front>
    <title abbrev="Generic Tunnel MTU">Generic Tunnel MTU
    Determination</title>

    <author fullname="Fred L. Templin" initials="F. L." role="editor"
            surname="Templin">
      <organization>Boeing Research &amp; Technology</organization>

      <address>
        <postal>
          <street>P.O. Box 3707</street>

          <city>Seattle</city>

          <region>WA</region>

          <code>98124</code>

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

        <email>fltemplin@acm.org</email>
      </address>
    </author>

    <date day="24" month="May" year="2012" />

    <keyword>I-D</keyword>

    <keyword>Internet-Draft</keyword>

    <abstract>
      <t>The tunnel MTU for popular IP-in-IP tunneling mechanisms is currently
      recommended to be set to 1500 (or less) minus the length of the
      encapsulation headers when static MTU determination is used. This is to
      avoid IP fragmentation within the tunnel, but requires the tunnel
      ingress to either fragment any IP packet larger than the MTU or drop the
      packet and return an ICMP Packet Too Big (PTB) message. Concerns for
      operational issues with both IPv4 and IPv6 Path MTU Discovery point to
      the possibility of MTU-related black holes when a packet is dropped due
      to an MTU restriction. Fortunately, the "Internet cell size" is 1500
      bytes, i.e., the minimum MTU configured by the vast majority of links in
      the Internet. We also note that these same considerations apply to the
      encapsulation of any combination of IP-within-IP protocol versions. This
      document therefore presents a method to boost the tunnel MTU to larger
      values.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>The tunnel MTU for popular IP-in-IP tunneling mechanisms is currently
      recommended to be set to 1500 (or less) minus the length of the
      encapsulation headers when static MTU determination is used. This is to
      avoid IP fragmentation within the tunnel <xref
      target="RFC0791"></xref><xref target="RFC2460"></xref>, but requires the
      tunnel ingress to either fragment any IP packet larger than the MTU or
      drop the packet and return an ICMP Packet Too Big (PTB) message.
      Concerns for operational issues with both IPv4 and IPv6 Path MTU
      Discovery <xref target="RFC1191"></xref><xref target="RFC1981"></xref>
      point to the possibility of MTU-related black holes when a packet is
      dropped due to an MTU restriction. Fortunately, the "Internet cell size"
      is 1500 bytes, i.e., the minimum MTU configured by the vast majority of
      links in the Internet. We also note that these same considerations apply
      to the encapsulation of any combination of IP-within-IP protocol
      versions. This document therefore presents a method to boost the tunnel
      MTU to larger values.</t>

      <t>Pushing the tunnel MTU to 1500 bytes or beyond is met with the
      challenge that the addition of the IP encapsulation header would cause
      an inner IP packet that is slightly less than 1500 bytes to appear as a
      1501 byte or larger outer IP packet on the wire. This can result in the
      packet being either fragmented or dropped by a router that configures a
      1500 byte link. Using the approach outlined in this document, the tunnel
      ingress avoids this issue by performing IP fragmentation on the inner
      packet before outer IP encapsulation. The approach is outlined in the
      following sections.</t>
    </section>

    <section title="Problem Statement">
      <t>When an IP tunnel configures a smaller MTU than 1500 bytes, packets
      that are small enough to traverse earlier links in the path toward the
      final destination can suddenly be dropped at the tunnel ingress with an
      ICMP PTB message returned to the original source. However, operational
      experience has shown that the PTB messages can be lost in the network
      due to filtering in which case the source does not receive notification
      of the loss. It is therefore highly desirable that the tunnel configure
      an MTU of at least 1500 bytes.</t>

      <t>One possibility is to use IP fragmentation of the outer IP layer
      protocol so that inner packets up to 1500 bytes are delivered even if
      the tunnel encapsulation causes the outer packet to be larger than 1500
      bytes. However, IPv4 fragmentation has been shown to be dangerous at
      high data rates due to the 16-bit Identification field wrapping while
      reassemblies are still active. Also, if outer IP fragmentation were used
      the tunnel egress would need to do the reassembly which can be an
      onerous burden when the egress is located on a router.</t>

      <t>A second possibility is to enable IP PMTUD on the outer packet.
      However, the PTB messages that may result could either be lost on the
      return path to the tunnel ingress or may not contain enough information
      for translation into an inner packet PTB for delivery to the original
      source. Still another possibility is for the tunnel ingress to maintain
      state about MTU sizes for various tunnel egresses, but this becomes
      unwieldy when the number of egresses is large.</t>

      <t>In short, PMTUD for both IPv4 and IPv6 is a mess and new approaches
      are needed. Preferably, PMTUD can be avoided through operational
      arrangements, as described in the following sections.</t>
    </section>

    <section title="Tunnel MTU and Fragmentation">
      <t>Section 3.2 of <xref target="RFC4213"></xref> presents both static
      and dynamic MTU determination algorithms. These algorithms have been
      shown to be problematic in many instances, as discussed in Section 2.
      This document therefore proposes a new and generic tunnel MTU and
      fragmentation method via the following algorithm:</t>

      <t><figure>
          <artwork><![CDATA[
   1. set the tunnel ingress MTU to "infinity"
   2. for IP packets to be admitted into the tunnel:
      a) if the packet is 1501 or more, admit it into the
         tunnel if it is an IPv6 packet or an IPv4 packet
         with DF=1. Otherwise (i.e., for an IPv4 packet
         with DF=0) break it into N pieces, where each
         piece is a random length between 512-1024 bytes.
      b) if the packet is between 1281 - 1500:
         - admit the packet into the tunnel, subject to
           rate limiting (see Section 3).
         - break the packet into 2 pieces, where the first
           piece is a random length between 512-1024 bytes
         - insert a fragment header on both pieces and set
           the Identification as specified in Section 4.
         - encapsulate both pieces in an IP header and
           send them to the tunnel far end.
      c) if the packet is 1280 or less:
         - admit the packet into the tunnel
  3. the IP destination gets to reassemble if necessary
]]></artwork>
        </figure>In the above algorithm, the tunnel MTU can be set to infinity
      independently of other nodes, i.e., the approach is incrementally
      deployable. Note also that in clauses 2 b) and 2 c), the tunnel sets
      DF=0 for IPv4 packets.</t>
    </section>

    <section title="Setting the Identification Field">
      <t>The algorithm in Section 3 ignores the requirement that routers in
      the network must not fragment inner IPv6 packets or inner IPv4 packets
      with DF=1. In the case of IPv6, the use of fragmentation requires that
      the tunnel ingress insert an IPv6 fragment header on each fragment. In
      the case of IPv4 packets with DF=1, the use of fragmentation requires
      that the tunnel ingress rewrite the value in the Identification field.
      In both cases, we observe that the Identification field provides
      sufficient protection against accidental reassembly of fragments from
      different IP packets given careful operational considerations.</t>

      <t>Specifically, the tunnel ingress must ensure that there will be no IP
      fragments alive in the system with duplicate Identification values.
      Since <xref target="RFC2460"></xref> specifies that the maximum time a
      node may retain an incomplete fragmented packet is 60 seconds, this
      means that the tunnel ingress must not allow the Identification values
      to be repeated within this timeframe. The tunnel ingress can therefore
      calculate a maximum data rate for admission of fragmented packets into
      the tunnel.</t>

      <t>For IPv4, to avoid Identification value duplication the tunnel
      ingress must admit no more than (2^16 / 60) = 1092 IPv4 packets
      requiring fragmentation into the tunnel per second. In the worst case,
      consider that each packet is 1281 bytes (i.e., 10248 bits) in length.
      The tunnel ingress can then calculate the maximum data rate as (1092 *
      10248) = 11190816 bits/sec, or approximately 11 Mbps. It is therefore
      essential that the tunnel ingress set a rate limit to no more than 11
      Mbps for those IPv4 packets that will require fragmentation. This
      restriction can be relaxed if the tunnel ingress maintains a
      per-destination Identification value instead of a single Identification
      value for all destinations.</t>

      <t>For IPv6, to avoid Identification value duplication the tunnel
      ingress must admit no more than (2^32 / 60) = 71582788 IPv6 packets
      requiring fragmentation into the tunnel per second. In the worst case,
      consider that each packet is 1281 bytes (i.e., 10248 bits) in length.
      The tunnel ingress can then calculate the maximum data rate as (71582788
      * 10248) = 733580411424 bits/sec, or approximately 733 Gbps. It is
      therefore essential that the tunnel ingress set a rate limit to no more
      than 733 Gbps for those IPv6 packets that will require fragmentation.
      This restriction can be relaxed if the tunnel ingress maintains a
      per-destination Identification value instead of a single Identification
      value for all destinations.</t>

      <t>Note that a possible conflict exists when IP fragmentation has
      already been performed by a source host before the fragments arrive at
      the tunnel ingress. In that case, there is a small possibility that the
      Identification values used by the source host will temporarily be in
      close correlation with those used by the tunnel ingress, where a
      "collision" may occur in which the fragments produced by the source host
      have the same Identification value as the fragments produced by the
      tunnel ingress. Two factors that mitigate such conflicts are the random
      length of the first fragment used by the tunnel ingress (i.e., to cause
      a length mismatch for colliding reassemblies) and, in even rarer
      instance, the use of the TCP/UDP checksum.</t>

      <t>For that reason, the Identification values chosen for the fragmented
      tunneled packets are *not* assigned sequentially to avoid corrupting a
      block of reassemblies at a single destination host. Instead, let L be
      the length (in bits) of the Identification field, let N be a random
      value between (0, (2^L -1)) and let C be a bounded constant value (e.g.,
      between (512, 1024)). Then, set each successive Identification value to
      N, then (N + C), then (N + 2C), then (N + 3C) etc. modulo 2^L until the
      count returns again to N. The sequence then begins at (N+1), then ((N+1)
      + C), then ((N+1) + 2C), etc. until all integer values within 2^L are
      covered. Using this method, large numbers of outstanding reassemblies
      can be accommodated with only very rare instances of reassembly
      misassociation.</t>
    </section>

    <section title="Applicability">
      <t>This approach applies to all tunneling methods that use the basic
      transition mechanisms, including configured tunnels <xref
      target="RFC4213"></xref>, 6to4 <xref target="RFC3056"></xref>, ISATAP
      <xref target="RFC5214"></xref>, DSMIP <xref target="RFC5555"></xref>,
      6rd <xref target="RFC5969"></xref>, etc.</t>

      <t>Note that this same approach can also be applied to tunneling methods
      that use other than the basic transition mechanisms. These can include
      Teredo <xref target="RFC4380"></xref>, LISP <xref
      target="I-D.ietf-lisp"></xref>, SEAL <xref
      target="I-D.templin-intarea-seal"></xref>, and IPv6-over-IPv6
      encapsulation <xref target="RFC2473"></xref>, and even IPv4-over-IPv6
      encapsulation <xref target="RFC6333"></xref></t>
    </section>

    <section title="IANA Considerations">
      <t>There are no IANA considerations for this document.</t>
    </section>

    <section anchor="security" title="Security Considerations">
      <t>The security considerations for basic transition mechanisms apply
      also to this document.</t>
    </section>

    <section anchor="acknowledge" title="Acknowledgments">
      <t>This method was inspired through discussion on the IETF v6ops list in
      the May 2012 timeframe.</t>
    </section>
  </middle>

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

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

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

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

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

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

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

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

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

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

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

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

      <?rfc include="reference.I-D.templin-intarea-seal"?>

      <?rfc include="reference.I-D.ietf-lisp"?>
    </references>
  </back>
</rfc>
