<?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-05.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="22" month="June" year="2012" />

    <keyword>I-D</keyword>

    <keyword>Internet-Draft</keyword>

    <abstract>
      <t>The Maximum Transmission Unit (MTU) for popular IP-within-IP tunnels
      is currently recommended to be set to 1500 (or less) minus the length of
      the encapsulation headers when static MTU determination is used. This
      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 Path MTU Discovery (PMTUD)
      point to the possibility of MTU-related black holes when a packet is
      dropped due to an MTU restriction. The current "Internet cell size" is
      effectively 1500 bytes (i.e., the minimum MTU configured by the vast
      majority of links in the Internet) and should therefore also be the
      minimum MTU assigned to tunnels, but the desired end state is full
      accommodation of MTU diversity. This document therefore presents a
      method to boost the tunnel MTU to larger values.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>The Maximum Transmission Unit (MTU) for popular IP-within-IP tunnels
      is currently recommended to be set to 1500 (or less) minus the length of
      the encapsulation headers when static MTU determination is used. This
      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 <xref target="RFC0791"></xref><xref target="RFC2460"></xref>.
      Concerns for operational issues with Path MTU Discovery (PMTUD) <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. The current "Internet cell size" is effectively 1500
      bytes (i.e., the minimum MTU configured by the vast majority of links in
      the Internet) and should therefore also be the minimum MTU assigned to
      tunnels, but the desired end state is full accommodation of MTU
      diversity. 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 encapsulation headers would cause an
      inner IP packet that is 1500 byte (or slightly less) to appear as a
      slightly larger than 1500 byte outer IP packet on the wire, where it may
      be too large to traverse a link on the path in one piece. One
      alternative is to perform IP fragmentation on the outer IP packet
      following encapsulation, however existing tunneling protocols do not
      require the egress to reassemble packets as large as 1500 bytes plus the
      size of the encapsulation headers. The tunnel ingress therefore has no
      way of knowing whether the egress can reassemble larger sizes. In the
      case of IPv6, the tunnel ingress can instead perform IP fragmentation on
      the inner packet before encapsulating each fragment in outer headers.
      Considerations for both inner and outer fragmentation are presented in
      the following sections. A third alternative known as tunnel
      fragmentation is also given.</t>
    </section>

    <section title="Problem Statement">
      <t>Existing tunneling protocols have by and large relied on PMTUD in
      order to provide necessary packet size feedback to the original source.
      When an IP tunnel configures an MTU smaller than 1500 bytes, packets
      that are small enough to traverse earlier links in the path toward the
      final destination may be dropped at the tunnel ingress with a 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, even though encapsulation would cause the
      tunneled packet to be larger than 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 Identification field wrapping while
      reassemblies are still active <xref target="RFC4963"></xref>. Also, if
      outer IP fragmentation were used the tunnel egress would need to
      reassemble which can be an onerous burden when the egress is located on
      a router near the "middle" of the network. The tunnel ingress further
      has no assurance that the egress can reassemble packets larger than 1500
      bytes.</t>

      <t>A second possibility is to enable 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 existing tunneling protocols is a mess and a new
      approach is needed.</t>
    </section>

    <section title="Tunnel MTU">
      <t>Section 3.2 of <xref target="RFC4213"></xref> presents both static
      and dynamic MTU determination algorithms. Similar algorithms appear in
      other tunneling mechanisms. These algorithms have been shown to be
      problematic in many instances, as discussed in Section 2.</t>

      <t>The desired end state is for tunnels to support assured delivery of
      packets that are no larger than 1500 bytes while admitting larger
      packets into the tunnel without explicit assurances of delivery. Hosts
      should therefore set a tunnel ingress MTU of at least 1500 bytes, but
      should take care to not set so large an MTU that applications would be
      delayed by excessive PMTUD messages. Routers should instead set a
      constant value "HLEN" to the length of the encapsulation headers, then
      set the tunnel MTU to "infinity", where infinity is defined as ((2^32 -1
      ) - HLEN) for tunnels over IPv6 and ((2^16 - 1) - HLEN) for tunnels over
      IPv4.</t>

      <t>This document therefore proposes a generic MTU determination method
      suitable for all tunnel types. In particular, the tunnel ingress admits
      inner packets into the tunnel based on their size, and may need to use
      inner packet fragmentation, outer packet fragmentation or tunnel
      fragmentation as necessary. The following sections discuss
      considerations for the approaches.</t>
    </section>

    <section title="Packet Admission Algorithm">
      <t>Tunnel ingresses use the following algorithm for admitting packets of
      various sizes into the tunnel:</t>

      <t><figure>
          <artwork><![CDATA[  1) if the packet is larger than 1500:
    - if the packet is an atomic packet (*) admit it
      into the tunnel if it is no larger than the MTU
      of the underlying interface; otherwise, drop the
      packet and return a PTB message.
    - if the packet is not an atomic packet, break it
      into N pieces (where each piece is a random length
      between 500-1000 bytes) and admit each piece into
      the tunnel.
  2) if the packet is larger than 1280 but no larger
       than 1500:
     - if the packet is either an atomic IPv6 packet or a
       non-atomic packet break it into 2 pieces (where each
       piece is a random length between 500-1000 bytes)
       and admit each piece into the tunnel. For atomic
       IPv6 packets, also return a PTB message with MTU
       set to 1000.
     - if the packet is an atomic IPv4 packet, admit the
       packet into the tunnel and use either outer
       fragmentation or tunnel fragmentation
  3) if the packet is 1280 or less:
     - admit the packet into the tunnel
  4) the IP destination gets to reassemble if necessary
]]></artwork>
        </figure>(*) An "atomic packet" is an IPv6 packet that does not
      contain a fragment header, or an IPv4 packet with (DF=1 &amp;&amp; MF=0
      &amp;&amp; Offset=0) <xref
      target="I-D.ietf-intarea-ipv4-id-update"></xref>.</t>

      <t>In the above algorithm, clause 1) requires that large atomic packets
      not be subject to reassembly at the tunnel egress. Instead, the tunnel
      ingress should process any PTB messages returned by the tunnel and
      translate them into a corresponding PTB message to return to the
      original source. (The size 1500 is chosen with the expectation that
      hosts that send packets larger than this also used host-based MTU
      determination, e.g, per <xref target="RFC4821"></xref>.) In clauses 2)
      and 3), fragmentation within the tunnel must be permitted, however the
      fragment size chosen for inner fragmentation before encapsulation
      reduces the likelihood that outer fragmentation will occur following
      encapsulation.</t>

      <t>For non-atomic inner IP packets, clause 2) in the algorithm performs
      inner fragmentation using the Identification value already present in
      the packet. The tunnel ingress then admits each fragment into the tunnel
      unconditionally, since it is the original source (and not the tunnel)
      that asserts the uniqueness of the packet's Identification value. For
      atomic inner IPv6 packets, clause 2) in the algorithm ignores the
      requirement that routers in the network must not fragment atomic
      packets. The rest of this section discusses considerations for inner
      fragmentation of atomic IPv6 packets.</t>

      <t>For fragmentation of atomic inner IPv6 packets in clause 2), the use
      of inner fragmentation requires that the tunnel ingress insert an IPv6
      fragment header on each fragment. The ingress then selects a
      randomly-initialized and arithmetically-increasing Identification value
      that it writes in each fragment when admitting the fragment into the
      tunnel. The ingress then also returns a PTB message with MTU set to 1000
      as an indication to the source host that it must begin including a
      fragment header in the packets it sends (see Secction 5 of <xref
      target="RFC2460"></xref>).</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, the
      tunnel ingress can therefore calculate a maximum data rate for admission
      of fragmented packets into the tunnel.</t>

      <t>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 atomic 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 a source host emits both
      atomic and non-atomic packets. In that case, there is a small
      possibility that the Identification values used by the source host in
      non-atomic packets will temporarily be in close correlation with those
      used by the tunnel ingress in atomic packets, where a "collision" may
      occur in the Identification values. Factors that mitigate such conflicts
      are the random assignment of the initial Identification value,
      arithmetical incrementation, random arrivals of atomic and non-atomic
      packets, the random length of the fragments used by the tunnel ingress
      (i.e., to cause a length mismatch for colliding reassemblies) and, in
      even rarer instance, the use of the Internet checksum following
      reassembly.</t>

      <t>Note also that inner fragmentation requires instrumentation of the
      tunnel ingress only. No instrumentation is required on the tunnel
      egress, nor on any end systems.</t>
    </section>

    <section title="Outer Packet Fragmentation">
      <t>Following any inner fragmentation, the tunnel ingress admits the
      packets/fragments into the tunnel where (for IPv4) they may undergo
      further fragmentation within the tunnel. In that case, any fragmentation
      that occurs within the tunnel must be reassembled by the tunnel
      egress.</t>

      <t>In some instances, the tunnel ingress should perform outer
      fragmentation before admitting the packets/fragments into the tunnel
      even if inner fragmentation is not used. For example, for
      IPv4-within-IPv6 encapsulation outer fragmentation only is used since
      IPv6 provides a 32-bit Identification value instead of only the 16-bit
      IPv4 Identification. When the ingress performs outer fragmentation, it
      splits the packet into 2 pieces (where each piece is a random length
      between 500-1000 bytes) the same as for inner fragmentation.</t>

      <t>Before blindly performing outer fragmentation, the tunnel ingress
      requires knowledge of the egress' reassembly capabilities, including the
      egress' position within the network (e.g., nearer the middle or nearer
      the edge) and the size of the egress' reassembly buffer. In all
      instances, however, the ingress must ensure that 1500 byte inner packets
      can traverse the tunnel whether inner fragmentation, outer fragmentation
      or both are used. Therefore, a tunnel ingress that performs only outer
      fragmentation must have assurance that the egress can reassemble outer
      packets of at least (1500 + HLEN) bytes in length.</t>
    </section>

    <section title="Tunnel Fragmentation">
      <t>A third and less commonly known method of fragmentation is called
      "tunnel fragmentation". Tunnel fragmentation occurs following any inner
      fragmentation but before any outer fragmentation. Tunnel fragmentation
      requires separate packet Identification and segmentation control bits in
      a mid-layer of encapsulation that is added between the inner and outer
      IP headers. As for outer fragmentation, the tunnel egress is responsible
      for reassembly.</t>

      <t>Tunnel fragmentation can be particularly useful for tunnels over
      IPv4, since the mid-layer encapsulation can include an extended
      Identification field that avoids the identification wrapping issues seen
      for IPv4 fragmentation <xref target="RFC4963"></xref>. Furthermore, when
      tunnel fragmentation is used the tunnel ingress has assurance that the
      egress can reassemble up to (1500 + HLEN) since both the ingress and
      egress are required to implement the scheme. An example of tunnel
      fragmentation appears in SEAL <xref
      target="I-D.templin-intarea-seal"></xref>.</t>
    </section>

    <section title="Applicability">
      <t>This approach applies to existing IPv6 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>This same approach can further be applied to existing IP-within-IP
      tunneling mechanisms of all varieties, including GRE <xref
      target="RFC1701"></xref>, IPv4-in-IPv4 <xref target="RFC2003"></xref>,
      IPv6-in-IPv6 <xref target="RFC2473"></xref>, IPv4-in-IPv6 <xref
      target="RFC6333"></xref>, IPsec <xref target="RFC4301"></xref>, Teredo
      <xref target="RFC4380"></xref>, etc.</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 the various tunneling mechanisms
      apply also to this document.</t>
    </section>

    <section anchor="acknowledge" title="Acknowledgments">
      <t>This method was inspired through discussion on the IETF v6ops and
      NANOG mailing lists in the May/June 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.RFC.4301"?>

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

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

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

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

      <?rfc include="reference.I-D.ietf-intarea-ipv4-id-update"?>

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

      <?rfc ?>
    </references>
  </back>
</rfc>
