<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>

<rfc
    xmlns:xi="http://www.w3.org/2001/XInclude"
    category="bcp"
    docName="draft-hinden-v6ops-dns-00"
    ipr="trust200902"
    updates=""
    obsoletes=""
    consensus="true"
    submissionType="IETF"
    tocInclude="true"
    tocDepth="4"
    symRefs="true"
    sortRefs="true"
    version="3"> 

<front>

<title abbrev="DNS over IPv6 Best Practices">
DNS over IPv6 Best Practices</title>

<!--
<seriesInfo name="Internet-Draft" value="draft-ietf-xml2rfc-template-06"/>
-->

<seriesInfo name="Internet-Draft" value="draft-hinden-v6ops-dns-00"/>

<author fullname="Robert M. Hinden" initials="R" surname="Hinden">
      <organization>Check Point Software</organization>
      <address>
        <postal>
          <street>100 Oracle Parkway, Suite 800</street>
          <!-- Reorder these if your country does things differently -->
          <city>Redwood City</city>
          <region>CA</region>
          <code>94065</code>
          <country>USA</country>
        </postal>
        <phone/>
        <email>bob.hinden@gmail.com</email>
      </address>
</author>
<author fullname="Suresh Krishnan" initials="S." surname="Krishnan">
      <organization>Cisco</organization>

      <address>
        <postal>
          <street></street>

          <city></city>

          <region></region>

          <code></code>

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

        <email>suresh.krishnan@gmail.com</email>

      </address>
  </author>

<date day="03" month="05" year="2024"/>

<abstract>

  <t>This document describes an approach to how Domain Name Protocol
  (DNS) should be carried over IPv6.  There have been some operational
  issues identified in carrying DNS packets over IPv6 and this draft
  proposes solutions to address them.  A summary of what is proposed is
  to limit IPv6 DNS responses over UDP to be 1280 octets and use TCP or
  QUIC for anything larger.</t> 

</abstract>

</front>

<middle>

<section title=" Introduction" anchor="INTRO">

  <t>This document describes an approach to how the Domain Name
  Protocol (DNS) should be carried over IPv6 <xref target="RFC8200"/>.
  There have been some operatonal issues identified in carrying DNS
  packets over IPv6 and this draft proposes solutions to address
  them.</t> 

  <t>The IPv6 protocol requires a minimum link MTU of 1280 octets.
  From Section 5 "Packet Size Issues" of RFC8200:</t>

  <ul empty="true">
  <li>IPv6 requires that every link in the Internet have an MTU of 1280
  octets or greater.  This is known as the IPv6 minimum link MTU.  On
  any link that cannot convey a 1280-octet packet in one piece, link-
  specific fragmentation and reassembly must be provided at a layer
  below IPv6.</li>
  </ul>

<t>Using Path MTU Discovery and IPv6 fragmentation larger packets may be
sent.  However, there is operational experience that seems to indicate
that sending large DNS  over UDP over IPv6 packets results in high loss
rates.  </t>

<t>Most modern transport protocols like TCP [TCP] and [QUIC] include
packet segmentation techniques that allow them to send larger data streams
over IPv6.</t>

<t>A recent dnsop working group document titled "IP Fragmentation Avoidance in DNS over UDP"
<xref target="I-D.ietf-dnsop-avoid-fragmentation"/> also describes the
issue, and recommends as best current practice to disable IPv6
fragmentation for sending DNS packets over IPv6.  Specifically:</t>

  <ul empty="true">
   <li>3.1.  Recommendations for UDP responders</li>

   <li>R1.  UDP responders SHOULD NOT use IPv6 fragmentation [RFC8200].</li>
  </ul> 

<t>
This document is aligned with the recommendation in 
<xref target="I-D.ietf-dnsop-avoid-fragmentation"/>, but focuses 
on DNS over IPv6, and also recommends and provides additional details on running DNS over TCP or QUIC.</t>

</section>

<section title="Requirements Language">

  <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in
   BCP 14
   <xref target="RFC2119"/>
   <xref target="RFC8174"/>
   when, and only when, they appear in all
   capitals, as shown here.</t>
</section>

<section title="Domain Name System Protocols" anchor="DNS">

 <t>
The Domain Name System was originally defined in <xref target="RFC1034"/>
and <xref target="RFC1035"/>. It was designed to be able to run over
different transport protocols, including UDP, and TCP. It has also
recently been extended to be able to run over QUIC <xref
target="RFC9250"/>. These transport protocols can be run over IPv4 or
IPv6. 
</t>

<t>When DNS was originally designed, the size of the DNS packets carried
over UDP was limited to 512 bytes as defined in Section 2.3.4. of <xref
target="RFC1035"/>. Longer messages were truncated and the Truncation
(TC) bit was set indicating the response is incomplete so that the client
can retry with TCP.</t> 

<t>With this original behavior UDP over IPv6 would not exceed the IPv6
link MTU and hence would not present operational issues due to
fragmentation. When DNSSEC was introduced, several responses were too
small to fit into this 512 byte limit for UDP and hence resulted in TCP
connections which impacted the scalability of the DNS servers. <xref
target="RFC6891"/> allowed the requestors to specify larger UDP message
sizes that they are able to handle but the sizes specified by the
requestor might exceed the Path MTU. </t> 

</section>

<section title="DNS over IPv6" anchor="DNSIPV6">

<t>DNS over IPv6 is defined to run over UDP, a very simple transport
protocol, or more capable transport protocols like TCP or QUIC.   UDP
only provides for source and destination ports, a length field, and
simple checksum. It is connectionless.  Transport protocols like TCP
and UDP provide additional features like packet segmentation, reliability,
error correction, and connection state.</t>

<t>DNS over UDP over IPv6 works fine with small packet sizes, but becomes
less reliable with larger packet sizes, especially in cases that require IPv6 datagram fragmentation.</t>

<t>DNS over TCP/QUIC over IPv6 will work fine with all packet sizes.  The
downside of running DNS over a stateful protocol such as TCP or QUIC is that this will require more resources on the DNS server and potentially affect scalability. This might be a reasonable tradeoff in case of servers that need to send larger DNS response packets.</t>


<section title="DNS over UDP" anchor="UDP">

<t>It is recommended to limit packet sizes of DNS over UDP over IPv6 to
1280 octets. This avoids any need for IPv6 fragmentation or Path MTU
Discovery. This should be very reliable.</t>

<t>Many (if not most) DNS queries and responses will fit with this packet size limit and hence can be sent over UDP.  Larger DNS packets SHOULD not be sent over UDP, instead they SHOULD be sent over TCP or QUIC as described in the next section.
</t>

<t>This recommendation is consistent with "UDP Usage Guidelines" <xref
target="RFC8085"/> that makes the following recommendation when
effective PMTU/PLPMTUD in not supported (as it is potentially the case in Internet-wide DNS operations):</t>  

<ul empty="true">
   <li>Applications that do not follow the recommendation to do PMTU/PLPMTUD
   discovery SHOULD still avoid sending UDP datagrams that would result
   in IP packets that exceed the path MTU.  Because the actual path MTU
   is unknown, such applications SHOULD fall back to sending messages
   that are shorter than the default effective MTU for sending (EMTU_S
   in [RFC1122]).  For IPv4, EMTU_S is the smaller of 576 bytes and the
   first-hop MTU [RFC1122].  For IPv6, EMTU_S is 1280 bytes [RFC2460].
   </li>
</ul>



</section>

<section title="DNS over TCP and QUIC" anchor="TCP">

  <t>When larger DNS packets need to be carried, it is recommended to run
  DNS over TCP or QUIC. These protocols handle segmentation and will
  reliably adjust their segment size for different link and path MTU values.
  In this regard they work much more reliably than using UDP with IPv6 fragmentation.
  </t>

  <t>Section 4.2.2. of <xref target="RFC1035"/> describes the of TCP for
  carrying DNS messages. <xref target="RFC9250"/> describes how to use
  DNS over QUIC in order to provide transport confidentiality.
  Operation requirements for DNS over TCP are described in <xref
  target="RFC9210"/> 
  </t> 
  
</section>

</section>

<section anchor="IANA" title="IANA Considerations">

  <t>There are no actions required for IANA defined in this document.
  </t>

</section>


<section title="Security Considerations" anchor="Security">

  <t>Switching from UDP to TCP/QUIC for large responses means that the DNS server needs to maintain additional state for each query that was received over TCP/QUIC. This will consume additional resources on the servers and impact the scalability of the DNS system. It may also leave the servers vulnerable to DoS attacks.</t>

</section>


<section title="Acknowledgments" anchor="Ack">

    <t>Geoff Huston discussed the operational issues in his article
    "IPv6, DNS, and truncation in UDP" IPv6" <xref target="HUSTON"/> and
    Jared Mauch brought up the issues to the 6MAN working group.</t> 

    <t>Helpful comments were received from Warren Kumari, 
    and other members of the V6OPS working group.</t>

    
</section>

 <section anchor="changes" title="Change log [RFC Editor: Please remove]">


   <t>draft-hinden-ipv6-v6ops-00, 2024-May-02:</t>

   <ul spacing="compact">
      <li>Initial draft.</li>
   </ul>

      
 </section>

</middle>

<back>

  <references>
      <name>Normative References</name>

      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.1034.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.1035.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8200.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
<!--
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9499.xml"/>
-->
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8085.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9250.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9210.xml"/>



  </references>	

  <references>	
     <name>Informative References</name>
      <xi:include
	  href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6891.xml"/>

        <reference anchor="HUSTON" target="https://blog.apnic.net/2024/03/14/ipv6-dns-and-truncation-in-udp/">
        <front>
            <title>IPv6, DNS, and truncation in UDP</title>
            <author initials="G" surname="Huston" fullname="Geoff Huston">
                <organization />
            </author>
            <date month="March" year="2024" />
        </front>
        <seriesInfo name="" value="" />
        <refcontent></refcontent>
    </reference>

    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-dnsop-avoid-fragmentation.xml"/>
      
   </references>


</back>

</rfc>
