draft-ietf-dnsext-dns-tcp-requirements-00.txt   draft-ietf-dnsext-dns-tcp-requirements-01.txt 
DNSEXT R. Bellis DNSEXT R. Bellis
Internet-Draft Nominet UK Internet-Draft Nominet UK
Updates: 1123, 1035 October 6, 2009 Updates: 1035, 1123 October 26, 2009
(if approved) (if approved)
Intended status: Standards Track Intended status: Standards Track
Expires: April 9, 2010 Expires: April 29, 2010
DNS Transport over TCP DNS Transport over TCP
draft-ietf-dnsext-dns-tcp-requirements-00 draft-ietf-dnsext-dns-tcp-requirements-01
Status of this Memo Status of this Memo
This Internet-Draft is submitted to IETF in full conformance with the This Internet-Draft is submitted to IETF in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet- other groups may also distribute working documents as Internet-
Drafts. Drafts.
skipping to change at page 1, line 34 skipping to change at page 1, line 34
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on April 9, 2010. This Internet-Draft will expire on April 29, 2010.
Copyright Notice Copyright Notice
Copyright (c) 2009 IETF Trust and the persons identified as the Copyright (c) 2009 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents in effect on the date of Provisions Relating to IETF Documents in effect on the date of
publication of this document (http://trustee.ietf.org/license-info). publication of this document (http://trustee.ietf.org/license-info).
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
skipping to change at page 3, line 9 skipping to change at page 3, line 9
9.2. Informative References . . . . . . . . . . . . . . . . . . 7 9.2. Informative References . . . . . . . . . . . . . . . . . . 7
Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . . 7 Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . . 7
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 7 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 7
1. Introduction 1. Introduction
Most DNS [RFC1035] transactions take place over the UDP [RFC0792] Most DNS [RFC1035] transactions take place over the UDP [RFC0792]
protocol. The TCP [RFC0793] protocol is used for zone transfers and protocol. The TCP [RFC0793] protocol is used for zone transfers and
is supported by some implementations for the transfer of other is supported by many implementations for the transfer of other
packets which exceed the protocol's original 512 byte packet-size packets which exceed the protocol's original 512 byte packet-size
limit. limit.
Section 6.1.3.2 of [RFC1123] states: Section 6.1.3.2 of [RFC1123] states:
DNS resolvers and recursive servers MUST support UDP, and SHOULD DNS resolvers and recursive servers MUST support UDP, and SHOULD
support TCP, for sending (non-zone-transfer) queries. support TCP, for sending (non-zone-transfer) queries.
However, some implementors have taken the text quoted above to mean
that TCP support is truly optional for typical DNS operation.
This document normatively updates the core DNS protocol This document normatively updates the core DNS protocol
specifications such that (except in very limited circumstances) specifications such that (except in very limited circumstances)
support for the TCP protocol is henceforth REQUIRED. support for the TCP protocol is henceforth REQUIRED.
2. Terminology used in this document 2. Terminology used in this document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119]. document are to be interpreted as described in [RFC2119].
3. Discussion 3. Discussion
Some implementors have taken the [RFC1123] text quoted above to mean
that TCP support is truly optional for typical DNS operation.
However, whilst RFC 1123 predates the current RFC 2119 terminology
document it uses exactly the same text:
SHOULD - This word, or the adjective "RECOMMENDED", mean that
there may exist valid reasons in particular circumstances to
ignore a particular item, but the full implications must be
understood and carefully weighed before choosing a different
course.
In the absence of EDNS0 (see below) the normal behaviour of any DNS In the absence of EDNS0 (see below) the normal behaviour of any DNS
server needing to send a UDP response that exceeds that 512 limit is server needing to send a UDP response that exceeds that 512 byte
for the server to truncate the response at the 512 byte limit and set limit is for the server to truncate the response at the 512 byte
the TC flag in the response header. When the client receives such a limit and set the TC flag in the response header. When the client
response it takes the TC flag as notice that it should retry over TCP receives such a response it takes the TC flag as notice that it
instead. should retry over TCP instead.
RFC 1123 also says: RFC 1123 also says:
... it is also clear that some new DNS record types defined in the ... it is also clear that some new DNS record types defined in the
future will contain information exceeding the 512 byte limit that future will contain information exceeding the 512 byte limit that
applies to UDP, and hence will require TCP. Thus, resolvers and applies to UDP, and hence will require TCP. Thus, resolvers and
name servers should implement TCP services as a backup to UDP name servers should implement TCP services as a backup to UDP
today, with the knowledge that they will require the TCP service today, with the knowledge that they will require the TCP service
in the future. in the future.
Existing deployments of DNSSEC [RFC4033] have shown that truncation Existing deployments of DNSSEC [RFC4033] have shown that truncation
at the 512 byte boundary is now commonplace. For example an NXDOMAIN at the 512 byte boundary is now commonplace. For example an NXDOMAIN
(RCODE == 3) response from a DNSSEC signed zone using NSEC3 [RFC5155] (RCODE == 3) response from a DNSSEC signed zone using NSEC3 [RFC5155]
is almost invariably longer than 512 bytes. is almost invariably longer than 512 bytes.
Since the original core specifications for DNS were written the Since the original core specifications for DNS were written, the
Extension Mechanisms for DNS EDNS0 [RFC2671] have been introduced. Extension Mechanisms for DNS (EDNS0 [RFC2671]) have been introduced.
These extensions can be used to indicate that the client is prepared These extensions can be used to indicate that the client is prepared
to receive UDP responses longer than 512 bytes. An EDNS0 compatible to receive UDP responses longer than 512 bytes. An EDNS0 compatible
server receiving a request from an EDNS0 compatible client may send server receiving a request from an EDNS0 compatible client may send
UDP packets up to that client's announced buffer size without UDP packets up to that client's announced buffer size without
truncation. truncation.
However, transport of UDP packets which exceed the size of the path However, transport of UDP packets which exceed the size of the path
MTU has been found to be unreliable in some circumstances because of MTU has been found to be unreliable in some circumstances because of
IP packet fragmentation. Many firewalls routinely block fragmented IP packet fragmentation. Many firewalls routinely block fragmented
IP packets, and some implementations lack the software logic IP packets, and some implementations lack the software logic
necessary to reassemble a fragmented datagram. Worse still, some necessary to reassemble a fragmented datagram. Worse still, some
devices deliberately refuse to handle DNS packets containing EDNS0 devices deliberately refuse to handle DNS packets containing EDNS0
options. Other issues relating to UDP transport and packet size are options. Other issues relating to UDP transport and packet size are
discussed in [RFC5625]. discussed in [RFC5625].
The MTU most commonly found in the core of the Internet is around The MTU most commonly found in the core of the Internet is around
1500 bytes, and even that limit is routinely exceeded by DNSSEC 1500 bytes, and even that limit is routinely exceeded by DNSSEC
signed responses. signed responses.
The future that was anticipated in RFC 1123 is now here, and the only The future that was anticipated in RFC 1123 has arrived, and the only
standardised mechanism which may have resolved the packet size issue standardised mechanism which may have resolved the packet size issue
has been found inadequate. has been found inadequate.
4. Transport Protocol Selection 4. Transport Protocol Selection
All DNS implementations MUST support both UDP and TCP transport
protocols, except as set out below.
On a case by case basis, authoritative DNS server operators MAY elect On a case by case basis, authoritative DNS server operators MAY elect
to disable DNS transport over TCP if all of the conditions below are to disable DNS transport over TCP if all of the following conditions
satisfied: are satisfied:
o the server is authoritative o the server is authoritative only
o the server does not support AXFR o the server does not support AXFR
o the server does not support DNSSEC
o all requests and responses are guaranteed to be <= 512 bytes o all requests and responses are guaranteed to be <= 512 bytes
A general purpose stub resolver implementation (e.g. an operating A general purpose stub resolver implementation (e.g. an operating
system's DNS resolution library) MUST support TCP since to do system's DNS resolution library) MUST support TCP since to do
otherwise would limit its interoperability with its own clients and otherwise would limit its interoperability with its own clients and
with upstream servers. with upstream servers.
A proprietary stub resolver implementation MAY omit support for TCP A proprietary stub resolver implementation MAY omit support for TCP
if it is operating in an environment where truncation will not occur, if it is operating in an environment where truncation can never
or if it is prepared to accept a DNS lookup failure should truncation occur, or if it is prepared to accept a DNS lookup failure should
occur. truncation occur.
A recursive resolver or forwarder MUST support TCP so that it does A recursive resolver or forwarder MUST support TCP so that it does
not prevent long responses from a TCP-capable server from reaching not prevent long responses from a TCP-capable server from reaching
its TCP-capable clients. its TCP-capable clients.
Otherwise, all DNS implementations MUST support TCP transport.
Regarding the choice of when to use UDP or TCP, RFC 1123 says: Regarding the choice of when to use UDP or TCP, RFC 1123 says:
... a DNS resolver or server that is sending a non-zone-transfer ... a DNS resolver or server that is sending a non-zone-transfer
query MUST send a UDP query first. query MUST send a UDP query first.
This requirement is no longer mandatory. A resolver SHOULD send a That requirement is hereby relaxed. A resolver SHOULD send a UDP
UDP query first, but MAY elect to send a TCP query instead if it has query first, but MAY elect to send a TCP query instead if it has good
good reason to expect the response would be truncated if it were sent reason to expect the response would be truncated if it were sent over
over UDP, or other operational considerations suggest otherwise. UDP (with or without EDNS0) or for other operational reasons.
5. Dormant Connection Handling 5. Dormant Connection Handling
Section 4.2.2 of [RFC1035] says: Section 4.2.2 of [RFC1035] says:
If the server needs to close a dormant connection to reclaim If the server needs to close a dormant connection to reclaim
resources, it should wait until the connection has been idle for a resources, it should wait until the connection has been idle for a
period on the order of two minutes. period on the order of two minutes.
Other more modern protocols (e.g. HTTP [RFC2616]) have support for Other more modern protocols (e.g. HTTP [RFC2616]) have support for
persistent TCP connections and operational experience has shown that persistent TCP connections and operational experience has shown that
long timeouts can easily cause resource exhaustion and poor response long timeouts can easily cause resource exhaustion and poor response
under heavy load. Intentionally opening many connections and leaving under heavy load. Intentionally opening many connections and leaving
them dormant can trivially create a "denial of service" attack. them dormant can trivially create a "denial of service" attack.
This document therefore RECOMMENDS that the idle period should be of This document therefore RECOMMENDS that the idle period should be of
the order of TBD seconds. With modern high performance networks 2 to the order of TBD seconds.
4 seconds should be sufficient to allow significant numbers (i.e.
thousands) of concurrent dormant connections without impacting Servers MAY allow dormant connections to remain open for longer
service performance. periods, but for the avoidance of doubt persistent DNS connections
should generally be considered to be as much for the server's benefit
as for the client's. Therefore if the server needs to unilaterally
close a dormant TCP connection it MUST be free to do so whenever
required.
Servers MAY allow idle connections to remain open for longer periods, Further recommendations for the tuning of TCP parameters to allow
but for the avoidance of doubt persistent DNS connections should higher throughput or improved resiliency against denial of service
generally be considered to be as much for the server's benefit as for attacks are (currently) outside the scope of this document.
the client's. Therefore if the server needs to unilaterally close a
dormant TCP connection it MUST be free to do so whenever required.
6. Response re-ordering 6. Response re-ordering
[Potential text to be added regarding whether TCP responses can come RFC 1035 is ambiguous on the question of whether TCP queries may be
back in a different order to requests. I'm not aware whether this is re-ordered - the only relevant text is in Section 4.2.1 which relates
specified anywhere] to UDP:
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.
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.
7. Security Considerations 7. Security Considerations
Some DNS server operators have expressed concern that wider use of 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" DNS over TCP will expose them to a higher risk of "denial of service"
attacks. attacks.
Many large authoritative DNS operators including all but one of the Many large authoritative DNS operators including all but one of the
root servers and the vast majority of TLDs already support TCP and root servers and the vast majority of TLDs already support TCP and
attacks against them are infrequent and very rarely successful. attacks against them are infrequent and very rarely successful.
skipping to change at page 7, line 43 skipping to change at page 7, line 42
Nameservers in Reflector Attacks", BCP 140, RFC 5358, Nameservers in Reflector Attacks", BCP 140, RFC 5358,
October 2008. October 2008.
[RFC5625] Bellis, R., "DNS Proxy Implementation Guidelines", [RFC5625] Bellis, R., "DNS Proxy Implementation Guidelines",
BCP 152, RFC 5625, August 2009. BCP 152, RFC 5625, August 2009.
Appendix A. Change Log Appendix A. Change Log
NB: to be removed by the RFC Editor before publication. NB: to be removed by the RFC Editor before publication.
draft-ietf-dnsext-dns-tcp-requirements-01
Addition of response ordering section
Various minor editorial changes from WG reviewers
draft-ietf-dnsext-dns-tcp-requirements-00 draft-ietf-dnsext-dns-tcp-requirements-00
Initial draft Initial draft
Author's Address Author's Address
Ray Bellis Ray Bellis
Nominet UK Nominet UK
Edmund Halley Road Edmund Halley Road
Oxford OX4 4DQ Oxford OX4 4DQ
United Kingdom United Kingdom
 End of changes. 22 change blocks. 
50 lines changed or deleted 55 lines changed or added

This html diff was produced by rfcdiff 1.37a. The latest version is available from http://tools.ietf.org/tools/rfcdiff/