<?xml version="1.0"?>
<?rfc compact="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc toc="yes" ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<rfc ipr="trust200902" category="info" updates="RFC 3542" docName="draft-andrews-6man-force-fragmentation-01">
  <front>
    <title>Forcing Fragmentation of IPv6 Packets</title>
    <author initials="M." surname="Andrews" fullname="Mark Andrews">
      <organization abbrev="ISC">Internet Systems Consortium</organization>
      <address>
	<postal>
	  <street>950 Charter Street</street>
	  <city>Redwood City</city>
	  <region>CA</region>
	  <code>94063</code>
	  <country>US</country>
	</postal>
	<email>marka@isc.org</email>
      </address>
    </author>
    <date day="22" month="January" year="2012"/>
    <abstract>
      <t>
	Extend The Advanced Sockets API for IPv6 (RFC 3542) to
	provide a mechanism to force a Fragment header to be added
	to a packet.
      </t>
    </abstract>
  </front>

  <middle>
    <section toc="yes" anchor="intro" title="Background">
      <t>
	In order to avoid Path MTU Discover (MTUD) <xref target="RFC 1191"
	/> in IPv6 an application must not only force packets to
	be fragmented at the minimum IPv6 MTU it must also force
	the addition of a Fragment header to unfragmented packets
	otherwise PTB ICMPv6 may be sent if the packet goes through
	a IPv6 to IPv4 translating router <xref target="RFC 2460"
	/>.
      </t> <t>
	The Advanced Sockets API for IPv6 <xref target="RFC 3542"
	/> provides mechanisms to force fragmentation of a packet
	greater than the minimum IPv6 MTU (IPV6_USE_MIN_MTU).  It
	also provides mechanisms to prevent fragmentation of a
	packet (IPV6_DONTFRAG).  It however does not provide a
	mechanism to force a fragmentation header to be added.  This
	document intends to add such a mechanism.
      </t> <t>
	There appears to be 3 viable alternatives. 1) extend
	IPV6_USE_MIN_MTU to force the inclusion of a Fragment header.
	2) extend IPV6_DONTFRAG to signal that a Fragment header
	needs to be included. 3) add a new socket option like
	IPV6_DOFRAG.
      </t> <t>
	While there are multiple options available we should select
	exactly one.
      </t>

      <section toc="yes" anchor="reserved" title="Reserved Words">
	<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="RFC 2119" />.
	</t>
      </section>
    </section>

    <section toc="yes" anchor="background" title="Background">
      <t>
	Path MTU Discover assumes that the application / network
	stack will be in the position to retransmit the packet apon
	reception of a PTB ICMPv6 message.  While this is true of
	TCP, there is class of protocols for which this is not
	true, like DNS/UDP.  DNS/UDP is a stateless single packet
	exchange protocol.  The client asks a query of the server
	and the server responds, usually with a bigger response,
	then immediately forgets the request.  This works well for
	IPv4 where routers fragment the packets.  For IPv6, however,
	it requires the client to timeout as the PTB message is usually
	being sent to the server which has no memory of the packet
	that triggered the PTB message.  Setting IPV6_USE_MIN_MTU to
	1 on the UDP socket reduces but does not remove the problem
	as the "minimum IPv6 MTU" of 1280 is not a true minimum.
      </t>
      <t> 
	<xref target="RFC 2460" /> permits PTB messages with values
	smaller than 1280 and requires the sending node to add a
	fragmentation header to subsequent packets.  To avoid timeouts
	protocols, like DNS/UDP, need a way to force the addition of a
	fragment header to packets at or below the minimum IPv6 MTU.
      </t>
    </section>

    <section toc="yes" anchor="IPV6_USE_MIN_MTU" title="Extend IPV6_USE_MIN_MTU">
      <t>
	Currently IPV6_USE_MIN_MTU only requires a Fragmentation
	header to be added when the packet size is greater that
	1280 byte, packets less that 1280 bytes are not required
	to have a Fragment header added.  This change would result
	in a Fragmentation header also being added to packets that
	are 1280 bytes or less.
      </t> <t>
	If IPV6_USE_MIN_MTU is set to 1 then a Fragment header MUST
	be added to both multicast and unicast packets.
      </t> <t>
	If IPV6_USE_MIN_MTU is set to -1 then a Fragment header
	MUST be added to multicast packets.
      </t> <t>
	Alternatively, one could use 2 and -2 to indicate the forced
	addition of a Fragment header in addition to limiting the
	MTU.
      </t>
    </section>

    <section toc="yes" anchor="IPV6_DONTFRAG" title="Extend IPV6_DONTFRAG">
      <t>
	If IPV6_DONTFRAG is set to -1 (new value) then a Fragment
	header MUST be added to the packet.
      </t>
    </section>

    <section toc="yes" anchor="IPV6_DOFRAG" title="Add IPV6_DOFRAG">
      <t>
	This is similar to IPV6_USE_MIN_MTU in that it is a tri-state
	flag.  When set to -1 a Fragment header MUST be added to
	multicast packets.  When set to 1 a Fragment header MUST
	be added to both multicast and unicast packets.  When set
	to 0 a Fragment header is only added if fragmentation would
	otherwise happen.
      </t> <figure>
	<artwork>
    int on = 1;
    setsockopt(fd, IPPROTO_IPV6, IPV6_DOFRAG, &on, sizeof(on));
	</artwork>
      </figure> <t>
	Setting IPV6_DONTFRAG to 1 will force IPV6_DOFRAG to 0.
      </t> <t>
	Setting IPV6_DOFRAG to 1 or -1 will force IPV6_DONTFRAG to
	0.
      </t>
    </section>

    <section toc="yes" anchor="iana" title="IANA Considerations">
      <t>
	No IANA Considerations.
      </t>
    </section>

    <section toc="yes" anchor="security" title="Security Considerations">
      <t>
	TBA
      </t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <reference anchor="RFC 1191">
	<front>
	  <title>Path MTU Discovery</title>
	  <author initials="J." surname="Mogul" fullname="J. Mogul" />
	  <author initials="S." surname="Deering" fullname="S. Deering" />
	  <date month="November" year="1990" />
	</front>
	<seriesInfo name="RFC" value="1191" />
      </reference>

      <reference anchor="RFC 2119">
	<front>
	  <title>Key words for use in RFCs to Indicate Requirement Levels</title>
	  <author initials="S." surname="Bradner" fullname="S. Bradner"/>
	  <date month="March" year="1997" />
	</front>
	<seriesInfo name="BCP" value="14" />
	<seriesInfo name="RFC" value="2119" />
      </reference>

      <reference anchor="RFC 2460">
	<front>
	  <title>Internet Protocol, Version 6 (IPv6) Specification</title>
	  <author initials="S." surname="Deering" fullname="S. Deering"/>
	  <author initials="R." surname="Hinden" fullname="R. Hinden"/>
	  <date month="December" year="1998" />
	</front>
	<seriesInfo name="RFC" value="2460" />
      </reference>

      <reference anchor="RFC 3542">
	<front>
	  <title>Advanced Sockets Application Program Interface (API) for IPv6</title>
	  <author initials="W." surname="Stevens" fullname="W. Bradner"/>
	  <author initials="M." surname="Thomas" fullname="M. Thomas"/>
	  <author initials="E." surname="Normark" fullname="E. Normark"/>
	  <author initials="T." surname="Jinmei" fullname="T. Jinmei"/>
	  <date month="May" year="2003" />
	</front>
	<seriesInfo name="RFC" value="2003" />
      </reference>

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

