One document matched: draft-ietf-dnsext-dns-tcp-requirements-03.xml


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
  <!ENTITY  rfc768 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.0768.xml'>
  <!ENTITY  rfc793 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.0793.xml'>
  <!ENTITY rfc1035 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.1035.xml'>
  <!ENTITY rfc1123 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.1123.xml'>
  <!ENTITY rfc2119 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
  <!ENTITY rfc2616 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2616.xml'>
  <!ENTITY rfc2671 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2671.xml'>
  <!ENTITY rfc4033 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4033.xml'>
  <!ENTITY rfc5155 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5155.xml'>
  <!ENTITY rfc5358 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5358.xml'>
  <!ENTITY rfc5625 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5625.xml'>
  ]>

<rfc category="std" ipr="trust200902" docName="draft-ietf-dnsext-dns-tcp-requirements-03"
    updates="1035, 1123">
    <?rfc toc='yes' ?>
    <?rfc tocompact='no' ?>
    <?rfc compact='yes' ?>
    <?rfc subcompact='yes' ?>
    <?rfc sortrefs='yes' ?>
    <?rfc symrefs='yes' ?>
    <front>
        <title abbrev="DNS over TCP">DNS Transport over TCP - Implementation Requirements</title>
        <author initials="R.P." surname="Bellis" fullname="Ray Bellis">
            <organization>Nominet UK</organization>
            <address>
            <postal>
                <street>Edmund Halley Road</street>
                <city>Oxford</city>
                <code>OX4 4DQ</code>
                <country>United Kingdom</country>
            </postal>
            <phone>+44 1865 332211</phone>
            <email>ray.bellis@nominet.org.uk</email>
            <uri>http://www.nominet.org.uk/</uri>
        </address>
        </author>

        <date year="2010"/>
        <area>Internet Area</area>
        <workgroup>DNSEXT</workgroup>
        <keyword>DNS</keyword>
        <keyword>TCP/IP</keyword>

        <abstract>
            <t> This document updates the requirements for the support of TCP as a transport
                protocol for DNS implementations.</t>
        </abstract>
    </front>

    <middle>
        <section title="Introduction" anchor="introduction">
            <t> Most <xref target="RFC1035">DNS</xref> transactions take place over <xref
                    target="RFC0768">UDP</xref>. <xref target="RFC0793">TCP</xref> is always used
                for zone transfers and is often used for messages whose sizes exceed the DNS
                protocol's original 512 byte limit.</t>

            <t> Section 6.1.3.2 of <xref target="RFC1123"/> states: <list>
                    <t><vspace/>DNS resolvers and recursive servers MUST support UDP, and SHOULD
                        support TCP, for sending (non-zone-transfer) queries.</t>
                </list>
            </t>

            <t> However, some implementors have taken the text quoted above to mean that TCP support
                is an optional feature of the DNS protocol.</t>

            <t> The majority of DNS server operators already support TCP and the default
                configuration for most software implementations is to support TCP. The primary
                audience for this document is those implementors whose failure to support TCP
                restricts interoperability and limits deployment of new DNS features.</t>

            <t> This document therefore updates the core DNS protocol specifications such that
                support for TCP is henceforth a REQUIRED part of a full DNS protocol implementation.</t>

            <t> Whilst this document makes no specific recommendations to operators of DNS servers,
                it should be noted that failure to support TCP (or blocking of DNS over TCP at the
                network layer) may result in resolution failure and/or application-level timeouts.</t>

        </section>

        <section anchor="terminology" title="Terminology used in this document">

            <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="RFC2119"/>. </t>

        </section>

        <section title="Discussion">

            <t> In the absence of EDNS0 (see below) the normal behaviour of any DNS server needing
                to send a UDP response that would exceed the 512 byte limit is for the server to
                truncate the response so that it fits within that limit and then set the TC flag in
                the response header. When the client receives such a response it takes the TC flag
                as an indication that it should retry over TCP instead.</t>

            <t> RFC 1123 also says: <list>
                    <t><vspace/>... it is also clear that some new DNS record types defined in the
                        future will contain information exceeding the 512 byte limit that applies to
                        UDP, and hence will require TCP. Thus, resolvers and name servers should
                        implement TCP services as a backup to UDP today, with the knowledge that
                        they will require the TCP service in the future.</t>
                </list>
            </t>

            <t> Existing deployments of <xref target="RFC4033">DNSSEC</xref> have shown that
                truncation at the 512 byte boundary is now commonplace. For example an NXDOMAIN
                (RCODE == 3) response from a DNSSEC signed zone using <xref target="RFC5155"
                >NSEC3</xref> is almost invariably larger than 512 bytes.</t>

            <t> Since the original core specifications for DNS were written, the Extension
                Mechanisms for DNS (<xref target="RFC2671">EDNS0</xref>) have been introduced. These
                extensions can be used to indicate that the client is prepared to receive UDP
                responses larger than 512 bytes. An EDNS0 compatible server receiving a request from
                an EDNS0 compatible client may send UDP packets up to that client's announced buffer
                size without truncation.</t>

            <t> However, transport of UDP packets that exceed the size of the path MTU causes IP
                packet fragmentation, which has been found to be unreliable in some circumstances.
                Many firewalls routinely block fragmented IP packets, and some do not implement the
                algorithms necessary to reassemble fragmented packets. Worse still, some network
                devices deliberately refuse to handle DNS packets containing EDNS0 options. Other
                issues relating to UDP transport and packet size are discussed in <xref
                    target="RFC5625"/>.</t>

            <t>The MTU most commonly found in the core of the Internet is around 1500 bytes, and
                even that limit is routinely exceeded by DNSSEC signed responses. </t>

            <t> The future that was anticipated in RFC 1123 has arrived, and the only standardised
                UDP-based mechanism which may have resolved the packet size issue has been found
                inadequate.</t>

        </section>

        <section title="Transport Protocol Selection" anchor="selection">

            <t> All general purpose DNS implementations MUST support both UDP and TCP transport.</t>

            <t>
                <list style="symbols">

                    <t> Authoritative server implementations MUST support TCP so that they do not
                        limit the size of responses.</t>

                    <t> Recursive resolver (or forwarder) implementations MUST support TCP so that
                        the do not prevent large responses from a TCP-capable server from reaching
                        its TCP-capable clients.</t>

                    <t> Stub resolver implementations (e.g. an operating system's DNS resolution
                        library) MUST support TCP since to do otherwise would limit their
                        interoperability with their own clients and with upstream servers. </t>

                </list>
            </t>

            <t> An exception may be made for proprietary stub resolver implementations. These MAY
                omit support for TCP if operating in an environment where truncation can never
                occur, or where DNS lookup failure is acceptable should truncation occur.</t>

            <t> Regarding the choice of when to use UDP or TCP, RFC 1123 says:<list>
                    <t><vspace/>... a DNS resolver or server that is sending a non-zone-transfer
                        query MUST send a UDP query first.</t>
                </list></t>

            <t> That requirement is hereby relaxed. A resolver SHOULD send a UDP query first, but
                MAY elect to send a TCP query instead if it has good reason to expect the response
                would be truncated if it were sent over UDP (with or without EDNS0) or for other
                operational reasons, in particular if it already has an open TCP connection to the
                server.</t>

        </section>

        <section title="Connection Handling" anchor="timeouts">

            <t> Section 4.2.2 of <xref target="RFC1035"/> says:<list>
                    <t><vspace/>If the server needs to close a dormant connection to reclaim
                        resources, it should wait until the connection has been idle for a period on
                        the order of two minutes. In particular, the server should allow the SOA and
                        AXFR request sequence (which begins a refresh operation) to be made on a
                        single connection. Since the server would be unable to answer queries
                        anyway, a unilateral close or reset may be used instead of a graceful close.
                    </t>
                </list></t>

            <t> Other more modern protocols (e.g. <xref target="RFC2616">HTTP</xref>) have support
                for persistent TCP connections and operational experience has shown that long
                timeouts can easily cause resource exhaustion and poor response under heavy load.
                Intentionally opening many connections and leaving them dormant can trivially create
                a "denial of service" attack.</t>

            <t> This document therefore RECOMMENDS that the default application-level idle period
                should be of the order of seconds, but does not specify any particular value. In
                practise the idle period may vary dynamically, and servers MAY allow dormant
                connections to remain open for longer periods as resources permit.</t>

            <t> To mitigate the risk of unintentional server overload, DNS clients MUST take care to
                minimize the number of concurrent TCP connections made to any individual server.
                Similarly servers MAY impose limits on the number of concurrent TCP connections
                being handled for any particular client.</t>

            <t> Further recommendations for the tuning of TCP stacks to allow higher throughput or
                improved resiliency against denial of service attacks are outside the scope of this
                document.</t>

        </section>

        <section title="Response re-ordering" anchor="re-ordering">

            <t> RFC 1035 is ambiguous on the question of whether TCP queries may be re-ordered - the
                only relevant text is in Section 4.2.1 which relates to UDP:<list>
                    <t><vspace/> Queries or their responses may be reordered by the network, or by
                        processing in name servers, so resolvers should not depend on them being
                        returned in order.</t>
                </list></t>

            <t> For the avoidance of future doubt, this requirement is clarified. Client resolvers
                MUST be able to process responses which arrive in a different order to that in which
                the requests were sent, regardless of the transport protocol in use.</t>
            <t/>

        </section>

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

            <t> Some DNS server operators have expressed concern that wider use of DNS over TCP will
                expose them to a higher risk of denial of service (DoS) attacks.</t>

            <t> Although there is a higher risk of such attacks against TCP-enabled servers,
                techniques for the mitigation of DoS attacks at the network level have improved
                substantially since DNS was first designed.</t>

            <t> At the time of writing the vast majority of TLD authority servers and all of the
                root name servers support TCP and the author knows of no evidence to suggest that
                TCP-based DoS attacks against existing DNS infrastructure are commonplace.</t>

            <t> That notwithstanding, readers are advised to familiarise themselves with <xref
                    target="CPNI-TCP"/>. </t>

            <t> Operators of recursive servers should ensure that they only accept connections from
                expected clients, and do not accept them from unknown sources. In the case of UDP
                traffic this will help protect against <xref target="RFC5358">reflector
                attacks</xref> and in the case of TCP traffic it will prevent an unknown client from
                exhausting the server's limits on the number of concurrent connections.</t>

        </section>

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

            <t>This document requests no IANA actions.</t>

        </section>

        <section title="Acknowledgements">
            <t> The author would like to thank the document reviewers from the DNSEXT Working Group,
                and in particular George Barwood, Alex Bligh, Alfred Hoenes, Fernando Gont, Jim
                Reid, Paul Vixie and Nicholas Weaver.</t>
        </section>

    </middle>

    <back>
        <references title="Normative References"> &rfc768; &rfc793; &rfc1035;
            &rfc1123; &rfc2119; &rfc2671; </references>
        <references title="Informative References"> &rfc2616; &rfc4033; &rfc5155;
            &rfc5358; &rfc5625; <reference anchor="CPNI-TCP"
                target="http://www.cpni.gov.uk/Docs/tn-03-09-security-assessment-TCP.pdf">
                <front>
                    <title>Security Assessment of the Transmission Control Protocol (TCP)</title>
                    <author>
                        <organization>CPNI</organization>
                    </author>
                    <date year="2009"/>
                </front>
            </reference>
        </references>

        <section title="Change Log" anchor="changelog">

            <t>NB: to be removed by the RFC Editor before publication.</t>


            <t>draft-ietf-dnsext-dns-tcp-requirements-03<list>
                    <t>Editorial nits from WGLC</t>
                    <t>Clarification on "general purpose"</t>
                    <t>Fixed ref to UDP (RFC 768)</t>
                    <t>Included more ยง4.2.2 text from RFC 1035 and removed some from this draft
                        relating to connection resets.</t>
                    <t>s/long/large/ for packet sizes</t>
                </list>
            </t>

            <t>draft-ietf-dnsext-dns-tcp-requirements-02<list>
                    <t>Change of title - more focus on implementation and not operation</t>
                    <t>Re-write of some of the security section</t>
                    <t>Added recommendation for minimal concurrent connections</t>
                    <t>Minor editorial nits from Alfred Hoenes</t>
                </list>
            </t>

            <t>draft-ietf-dnsext-dns-tcp-requirements-01<list>
                    <t>Addition of response ordering section</t>
                    <t>Various minor editorial changes from WG reviewers</t>
                </list>
            </t>

            <t>draft-ietf-dnsext-dns-tcp-requirements-00<list>
                    <t>Initial draft</t>
                </list>
            </t>
        </section>

    </back>
</rfc>

PAFTECH AB 2003-20262026-04-23 08:59:40