draft-ietf-dnsext-dns-tcp-requirements-03.txt   rfc5966.txt 
DNSEXT R. Bellis Internet Engineering Task Force (IETF) R. Bellis
Internet-Draft Nominet UK Request for Comments: 5966 Nominet UK
Updates: 1035, 1123 March 22, 2010 Updates: 1035, 1123 August 2010
(if approved) Category: Standards Track
Intended status: Standards Track ISSN: 2070-1721
Expires: September 23, 2010
DNS Transport over TCP - Implementation Requirements DNS Transport over TCP - Implementation Requirements
draft-ietf-dnsext-dns-tcp-requirements-03
Abstract Abstract
This document updates the requirements for the support of TCP as a This document updates the requirements for the support of TCP as a
transport protocol for DNS implementations. transport protocol for DNS implementations.
Status of this Memo Status of This Memo
This Internet-Draft is submitted to IETF in full conformance with the
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet-
Drafts.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at This is an Internet Standards Track document.
http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at This document is a product of the Internet Engineering Task Force
http://www.ietf.org/shadow.html. (IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in Section 2 of RFC 5741.
This Internet-Draft will expire on September 23, 2010. Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
http://www.rfc-editor.org/info/rfc5966.
Copyright Notice Copyright Notice
Copyright (c) 2010 IETF Trust and the persons identified as the Copyright (c) 2010 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 Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Terminology Used in This Document . . . . . . . . . . . . . . . 3
2. Terminology used in this document . . . . . . . . . . . . . . . 3
3. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . 3
4. Transport Protocol Selection . . . . . . . . . . . . . . . . . 4 4. Transport Protocol Selection . . . . . . . . . . . . . . . . . 4
5. Connection Handling . . . . . . . . . . . . . . . . . . . . . . 5 5. Connection Handling . . . . . . . . . . . . . . . . . . . . . . 5
6. Response Reordering . . . . . . . . . . . . . . . . . . . . . . 6
6. Response re-ordering . . . . . . . . . . . . . . . . . . . . . 6
7. Security Considerations . . . . . . . . . . . . . . . . . . . . 6 7. Security Considerations . . . . . . . . . . . . . . . . . . . . 6
8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 7
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 7 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7
9.1. Normative References . . . . . . . . . . . . . . . . . . . 7
9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 7 9.2. Informative References . . . . . . . . . . . . . . . . . . 7
10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7
10.1. Normative References . . . . . . . . . . . . . . . . . . . 7
10.2. Informative References . . . . . . . . . . . . . . . . . . 7
Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . . 8
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 8
1. Introduction 1. Introduction
Most DNS [RFC1035] transactions take place over UDP [RFC0768]. TCP Most DNS [RFC1034] transactions take place over UDP [RFC0768]. TCP
[RFC0793] is always used for zone transfers and is often used for [RFC0793] is always used for zone transfers and is often used for
messages whose sizes exceed the DNS protocol's original 512 byte messages whose sizes exceed the DNS protocol's original 512-byte
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 However, some implementors have taken the text quoted above to mean
that TCP support is an optional feature of the DNS protocol. that TCP support is an optional feature of the DNS protocol.
skipping to change at page 3, line 32 skipping to change at page 2, line 46
TCP. The primary audience for this document is those implementors TCP. The primary audience for this document is those implementors
whose failure to support TCP restricts interoperability and limits whose failure to support TCP restricts interoperability and limits
deployment of new DNS features. deployment of new DNS features.
This document therefore updates the core DNS protocol specifications This document therefore updates the core DNS protocol specifications
such that support for TCP is henceforth a REQUIRED part of a full DNS such that support for TCP is henceforth a REQUIRED part of a full DNS
protocol implementation. protocol implementation.
Whilst this document makes no specific recommendations to operators Whilst this document makes no specific recommendations to operators
of DNS servers, it should be noted that failure to support TCP (or 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 the blocking of DNS over TCP at the network layer) may result in
resolution failure and/or application-level timeouts. resolution failure and/or application-level timeouts.
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
In the absence of EDNS0 (see below) the normal behaviour of any DNS In the absence of EDNS0 (Extension Mechanisms for DNS 0) (see below),
server needing to send a UDP response that would exceed the 512 byte the normal behaviour of any DNS server needing to send a UDP response
limit is for the server to truncate the response so that it fits that would exceed the 512-byte limit is for the server to truncate
within that limit and then set the TC flag in the response header. the response so that it fits within that limit and then set the TC
When the client receives such a response it takes the TC flag as an flag in the response header. When the client receives such a
indication that it should retry over TCP instead. response, it takes the TC flag as an indication that it 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 DNS Security (DNSSEC) [RFC4033] have shown
at the 512 byte boundary is now commonplace. For example an NXDOMAIN that truncation at the 512-byte boundary is now commonplace. For
(RCODE == 3) response from a DNSSEC signed zone using NSEC3 [RFC5155] example, a Non-Existent Domain (NXDOMAIN) (RCODE == 3) response from
is almost invariably larger than 512 bytes. a DNSSEC-signed zone using NextSECure 3 (NSEC3) [RFC5155] is almost
invariably larger 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 larger than 512 bytes. An EDNS0 compatible to receive UDP responses larger 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 that exceed the size of the path However, transport of UDP packets that exceed the size of the path
MTU causes IP packet fragmentation, which has been found to be MTU causes IP packet fragmentation, which has been found to be
unreliable in some circumstances. Many firewalls routinely block unreliable in some circumstances. Many firewalls routinely block
fragmented IP packets, and some do not implement the algorithms fragmented IP packets, and some do not implement the algorithms
necessary to reassemble fragmented packets. Worse still, some necessary to reassemble fragmented packets. Worse still, some
network devices deliberately refuse to handle DNS packets containing network devices deliberately refuse to handle DNS packets containing
EDNS0 options. Other issues relating to UDP transport and packet EDNS0 options. Other issues relating to UDP transport and packet
size are discussed in [RFC5625]. size are 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 has arrived, and the only The future that was anticipated in RFC 1123 has arrived, and the only
standardised UDP-based mechanism which may have resolved the packet standardised UDP-based mechanism that may have resolved the packet
size issue has been found inadequate. size issue has been found inadequate.
4. Transport Protocol Selection 4. Transport Protocol Selection
All general purpose DNS implementations MUST support both UDP and TCP All general-purpose DNS implementations MUST support both UDP and TCP
transport. transport.
o Authoritative server implementations MUST support TCP so that they o Authoritative server implementations MUST support TCP so that they
do not limit the size of responses. do not limit the size of responses to what fits in a single UDP
packet.
o Recursive resolver (or forwarder) implementations MUST support TCP o Recursive server (or forwarder) implementations MUST support TCP
so that the do not prevent large responses from a TCP-capable so that they do not prevent large responses from a TCP-capable
server from reaching its TCP-capable clients. server from reaching its TCP-capable clients.
o Stub resolver implementations (e.g. an operating system's DNS
o Stub resolver implementations (e.g., an operating system's DNS
resolution library) MUST support TCP since to do otherwise would resolution library) MUST support TCP since to do otherwise would
limit their interoperability with their own clients and with limit their interoperability with their own clients and with
upstream servers. upstream servers.
An exception may be made for proprietary stub resolver Stub resolver implementations MAY omit support for TCP when
implementations. These MAY omit support for TCP if operating in an specifically designed for deployment in restricted environments where
environment where truncation can never occur, or where DNS lookup truncation can never occur or where truncated DNS responses are
failure is acceptable should truncation occur. acceptable.
Regarding the choice of when to use UDP or TCP, RFC 1123 says: Regarding the choice of when to use UDP or TCP, Section 6.1.3.2 of
RFC 1123 also 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.
That requirement is hereby relaxed. A resolver SHOULD send a UDP 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 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 reason to expect the response would be truncated if it were sent over
UDP (with or without EDNS0) or for other operational reasons, in UDP (with or without EDNS0) or for other operational reasons, in
particular if it already has an open TCP connection to the server. particular, if it already has an open TCP connection to the server.
5. Connection Handling 5. 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. In particular, the server period on the order of two minutes. In particular, the server
should allow the SOA and AXFR request sequence (which begins a should allow the SOA and AXFR request sequence (which begins a
refresh operation) to be made on a single connection. Since the refresh operation) to be made on a single connection. Since the
server would be unable to answer queries anyway, a unilateral server would be unable to answer queries anyway, a unilateral
close or reset may be used instead of a graceful close. close or reset may be used instead of a graceful close.
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 default application-level It is therefore RECOMMENDED that the default application-level idle
idle period should be of the order of seconds, but does not specify period should be of the order of seconds, but no particular value is
any particular value. In practise the idle period may vary specified. In practise, the idle period may vary dynamically, and
dynamically, and servers MAY allow dormant connections to remain open servers MAY allow dormant connections to remain open for longer
for longer periods as resources permit. periods as resources permit.
To mitigate the risk of unintentional server overload, DNS clients To mitigate the risk of unintentional server overload, DNS clients
MUST take care to minimize the number of concurrent TCP connections MUST take care to minimize the number of concurrent TCP connections
made to any individual server. Similarly servers MAY impose limits made to any individual server. Similarly, servers MAY impose limits
on the number of concurrent TCP connections being handled for any on the number of concurrent TCP connections being handled for any
particular client. particular client.
Further recommendations for the tuning of TCP stacks to allow higher Further recommendations for the tuning of TCP stacks to allow higher
throughput or improved resiliency against denial of service attacks throughput or improved resiliency against denial-of-service attacks
are outside the scope of this document. are outside the scope of this document.
6. Response re-ordering 6. Response Reordering
RFC 1035 is ambiguous on the question of whether TCP queries may be 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 reordered -- the only relevant text is in Section 4.2.1, which
to UDP: relates to UDP:
Queries or their responses may be reordered by the network, or by Queries or their responses may be reordered by the network, or by
processing in name servers, so resolvers should not depend on them processing in name servers, so resolvers should not depend on them
being returned in order. being returned in order.
For the avoidance of future doubt, this requirement is clarified. For the avoidance of future doubt, this requirement is clarified.
Client resolvers MUST be able to process responses which arrive in a Client resolvers MUST be able to process responses that arrive in a
different order to that in which the requests were sent, regardless different order to that in which the requests were sent, regardless
of the transport protocol in use. 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
(DoS) attacks. (DoS) attacks.
Although there is a higher risk of such attacks against TCP-enabled Although there is a higher risk of such attacks against TCP-enabled
servers, techniques for the mitigation of DoS attacks at the network servers, techniques for the mitigation of DoS attacks at the network
level have improved substantially since DNS was first designed. level have improved substantially since DNS was first designed.
At the time of writing the vast majority of TLD authority servers and At the time of writing, the vast majority of Top Level Domain (TLD)
all of the root name servers support TCP and the author knows of no authority servers and all of the root name servers support TCP and
evidence to suggest that TCP-based DoS attacks against existing DNS the author knows of no evidence to suggest that TCP-based DoS attacks
infrastructure are commonplace. against existing DNS infrastructure are commonplace.
That notwithstanding, readers are advised to familiarise themselves That notwithstanding, readers are advised to familiarise themselves
with [CPNI-TCP]. with [CPNI-TCP].
Operators of recursive servers should ensure that they only accept Operators of recursive servers should ensure that they only accept
connections from expected clients, and do not accept them from connections from expected clients, and do not accept them from
unknown sources. In the case of UDP traffic this will help protect unknown sources. In the case of UDP traffic, this will help protect
against reflector attacks [RFC5358] and in the case of TCP traffic it against reflector attacks [RFC5358] and in the case of TCP traffic it
will prevent an unknown client from exhausting the server's limits on will prevent an unknown client from exhausting the server's limits on
the number of concurrent connections. the number of concurrent connections.
8. IANA Considerations 8. Acknowledgements
This document requests no IANA actions.
9. Acknowledgements
The author would like to thank the document reviewers from the DNSEXT The author would like to thank the document reviewers from the DNSEXT
Working Group, and in particular George Barwood, Alex Bligh, Alfred Working Group, and in particular, George Barwood, Alex Bligh, Alfred
Hoenes, Fernando Gont, Jim Reid, Paul Vixie and Nicholas Weaver. Hoenes, Fernando Gont, Olafur Gudmondsson, Jim Reid, Paul Vixie, and
Nicholas Weaver.
10. References
10.1. Normative References
[RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768,
August 1980.
[RFC0793] Postel, J., "Transmission Control Protocol", STD 7,
RFC 793, September 1981.
[RFC1035] Mockapetris, P., "Domain names - implementation and
specification", STD 13, RFC 1035, November 1987.
[RFC1123] Braden, R., "Requirements for Internet Hosts - Application 9. References
and Support", STD 3, RFC 1123, October 1989.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 9.1. Normative References
Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2671] Vixie, P., "Extension Mechanisms for DNS (EDNS0)", [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768,
RFC 2671, August 1999. August 1980.
10.2. Informative References [RFC0793] Postel, J., "Transmission Control Protocol", STD 7,
RFC 793, September 1981.
[CPNI-TCP] [RFC1034] Mockapetris, P., "Domain names - concepts and
CPNI, "Security Assessment of the Transmission Control facilities", STD 13, RFC 1034, November 1987.
Protocol (TCP)", 2009, <http://www.cpni.gov.uk/Docs/
tn-03-09-security-assessment-TCP.pdf>.
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., [RFC1035] Mockapetris, P., "Domain names - implementation and
Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext specification", STD 13, RFC 1035, November 1987.
Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
[RFC4033] Arends, R., Austein, R., Larson, M., Massey, D., and S. [RFC1123] Braden, R., "Requirements for Internet Hosts -
Rose, "DNS Security Introduction and Requirements", Application and Support", STD 3, RFC 1123, October 1989.
RFC 4033, March 2005.
[RFC5155] Laurie, B., Sisson, G., Arends, R., and D. Blacka, "DNS [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Security (DNSSEC) Hashed Authenticated Denial of Requirement Levels", BCP 14, RFC 2119, March 1997.
Existence", RFC 5155, March 2008.
[RFC5358] Damas, J. and F. Neves, "Preventing Use of Recursive [RFC2671] Vixie, P., "Extension Mechanisms for DNS (EDNS0)",
Nameservers in Reflector Attacks", BCP 140, RFC 5358, RFC 2671, August 1999.
October 2008.
[RFC5625] Bellis, R., "DNS Proxy Implementation Guidelines", 9.2. Informative References
BCP 152, RFC 5625, August 2009.
Appendix A. Change Log [CPNI-TCP] CPNI, "Security Assessment of the Transmission Control
Protocol (TCP)", 2009, <http://www.cpni.gov.uk/Docs/
tn-03-09-security-assessment-TCP.pdf>.
NB: to be removed by the RFC Editor before publication. [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
draft-ietf-dnsext-dns-tcp-requirements-03 [RFC4033] Arends, R., Austein, R., Larson, M., Massey, D., and S.
Editorial nits from WGLC Rose, "DNS Security Introduction and Requirements",
Clarification on "general purpose" RFC 4033, March 2005.
Fixed ref to UDP (RFC 768)
Included more S.4.2.2 text from RFC 1035 and removed some from
this draft relating to connection resets.
s/long/large/ for packet sizes
draft-ietf-dnsext-dns-tcp-requirements-02 [RFC5155] Laurie, B., Sisson, G., Arends, R., and D. Blacka, "DNS
Change of title - more focus on implementation and not operation Security (DNSSEC) Hashed Authenticated Denial of
Re-write of some of the security section Existence", RFC 5155, March 2008.
Added recommendation for minimal concurrent connections
Minor editorial nits from Alfred Hoenes
draft-ietf-dnsext-dns-tcp-requirements-01 [RFC5358] Damas, J. and F. Neves, "Preventing Use of Recursive
Addition of response ordering section Nameservers in Reflector Attacks", BCP 140, RFC 5358,
Various minor editorial changes from WG reviewers October 2008.
draft-ietf-dnsext-dns-tcp-requirements-00 [RFC5625] Bellis, R., "DNS Proxy Implementation Guidelines",
Initial draft BCP 152, RFC 5625, August 2009.
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
Phone: +44 1865 332211 Phone: +44 1865 332211
Email: ray.bellis@nominet.org.uk EMail: ray.bellis@nominet.org.uk
URI: http://www.nominet.org.uk/ URI: http://www.nominet.org.uk/
 End of changes. 58 change blocks. 
160 lines changed or deleted 114 lines changed or added

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