<?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="std" docName="draft-andrews-dnsext-udp-fragmentation-01.txt">
  <front>
    <title>DNS and UDP Fragmentation</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>
	This document provides advice to DNS developers about sending
	DNS UDP messages and Path MTU Discovery.
      </t>
    </abstract>
  </front>

  <middle>
    <section toc="yes" anchor="intro" title="Background">
      <t>
	IPv6 has changed the dynamics of UDP, Path MTU Discovery
	(PMTUD) and IP fragmentation.  With IPv4 DNS/UDP packets
	were fragmented by the network and no PMTUD was performed.
	With IPv6 fragmentation occurs in the sending node and PMTUD
	is allways performed unless the IPv6 packet is fragmented by
	the sending node using the minimum IPv6 MTU.
      </t> <t>
	DNS/UDP does not work well when PMTUD is performed.  If the
	Packet Too Big (PTB) / Need Fragmentation ICMP messages are
	not received there is no feedback path in DNS to reduce the
	size of the fragments like there is with TCP.
      </t> <t>
	Additionally there is no automatic retransmission of UDP
	packets like there is with TCP in response to a PTB message.
	The sender needs to send the request after timing out.  Not
	only is this process slow, the resulting traffic patterns
	can be confused with other common sources of error, resulting
	from badly configured firewalls, leading to inappropriate
	remedial action being taken.
      </t> <t>
	This document recommends that all DNS/UDP messages are sent
	such that they do not trigger PMTUD.
      </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="IPv4" title="IPv4 and Fragmentation">
      <t>
	There are a number of IP stacks that enable PMTUD for all
	IP packets by default against the advice of <xref
	target="RFC 1191" />.  On those IP stacks it is necessary
	for the application to disable PMTUD on a per socket/packet
	basis or for the operator to disable it globally if there
	is no per socket/packet control.
      </t>
    </section>

    <section toc="yes" anchor="IPv6" title="IPv6 and Fragmentation">
      <t>
	It was realised that IPv6 changed the way PMTUD happened
	and that there were applications, like DNS, that would not
	work well with PMTUD.  For those applications a socket
	option called IPV6_USE_MIN_MTU was developed <xref
	target="RFC 3542" /> which tells the IPv6 stack to fragment
	packets at the minimum IPv6 MTU rather than use PMTUD to find
	the actual PMTU.
     </t> <t>
	It is RECOMMENDED that IPV6_USE_MIN_MTU be set to 1 (one)
	when sending DNS/UDP messages over IPv6.  This option can
	be set at the socket level or it can be set on a per UDP
	datagram basis.
      </t> <t>
	If the IPv6 stack does not support IPV6_USE_MIN_MTU, then
	steps should be taken to prevent PMTUD occuring.  These
	include, but are not limited to, setting the MTU of the
	interface the packets are being sent over to the minimum
	IPv6 MTU (1280 bytes), or restricing DNS/UDP packets to
	no more than 1280 bytes including IPv6 headers.
      </t> <t>
	It should be noted that even with IPV6_USE_MIN_MTU set to
	one that a PTB message may still be received <xref
	target="RFC 2460" /> which requires a IPv6 to add a
	Fragmentation header to subsequent packets.  There is
	currently no way to avoid this, without using raw sockets,
	as there is no way for a application to request that a
	Fragmentation header be added to a packet.  <xref
        target="I-D.draft-andrews-6man-force-fragmentation" /> however
	has some proposed methods.
      </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>
	Failure to prevent PMTUD can lead to denial of service for
	DNS clients.
      </t> <t>
	Firewalls are often configured to block fragmented IP packets
	as early IP stacks had fragmentation re-assembly bugs.
	These bugs were exploited to perform a number of denial of
	service and other attacks cira 1999.
      </t> <t>
	Such blocks should be relaxed to permit fragmented UDP
	packets.
      </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>

      <reference anchor="I-D.draft-andrews-6man-force-fragmentation">
	<front>
	  <title>Forcing Fragmentation of IPv6 Packets</title>
	  <author initials="M." surname="Andrews" fullname="M. Andrews"/>
	  <date month="January" year="2012" />
	</front>
	<seriesInfo name="internet-draft" value="draft-andrews-6man-force-fragmentation-01" />
      </reference>

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

