draft-ietf-dnsop-5966bis-02.txt   draft-ietf-dnsop-5966bis-03.txt 
dnsop J. Dickinson dnsop J. Dickinson
Internet-Draft S. Dickinson Internet-Draft S. Dickinson
Obsoletes: 5966 (if approved) Sinodun Obsoletes: 5966 (if approved) Sinodun
Intended status: Standards Track R. Bellis Intended status: Standards Track R. Bellis
Expires: January 7, 2016 ISC Expires: March 23, 2016 ISC
A. Mankin A. Mankin
D. Wessels D. Wessels
Verisign Labs Verisign Labs
July 6, 2015 September 20, 2015
DNS Transport over TCP - Implementation Requirements DNS Transport over TCP - Implementation Requirements
draft-ietf-dnsop-5966bis-02 draft-ietf-dnsop-5966bis-03
Abstract Abstract
This document specifies the requirement for support of TCP as a This document specifies the requirement for support of TCP as a
transport protocol for DNS implementations and provides guidelines transport protocol for DNS implementations and provides guidelines
towards DNS-over-TCP performance on par with that of DNS-over-UDP. towards DNS-over-TCP performance on par with that of DNS-over-UDP.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
skipping to change at page 1, line 37 skipping to change at page 1, line 37
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
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."
This Internet-Draft will expire on January 7, 2016. This Internet-Draft will expire on March 23, 2016.
Copyright Notice Copyright Notice
Copyright (c) 2015 IETF Trust and the persons identified as the Copyright (c) 2015 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 Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Requirements Terminology . . . . . . . . . . . . . . . . . . 3 2. Requirements Terminology . . . . . . . . . . . . . . . . . . 3
3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4
4. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 4 4. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 4
5. Transport Protocol Selection . . . . . . . . . . . . . . . . 5 5. Transport Protocol Selection . . . . . . . . . . . . . . . . 5
6. Connection Handling . . . . . . . . . . . . . . . . . . . . . 6 6. Connection Handling . . . . . . . . . . . . . . . . . . . . . 6
6.1. Current practices . . . . . . . . . . . . . . . . . . . . 6 6.1. Current practices . . . . . . . . . . . . . . . . . . . . 6
6.1.1. Clients . . . . . . . . . . . . . . . . . . . . . . . 6 6.1.1. Clients . . . . . . . . . . . . . . . . . . . . . . . 7
6.1.2. Servers . . . . . . . . . . . . . . . . . . . . . . . 7 6.1.2. Servers . . . . . . . . . . . . . . . . . . . . . . . 7
6.2. Recommendations . . . . . . . . . . . . . . . . . . . . . 7 6.2. Recommendations . . . . . . . . . . . . . . . . . . . . . 7
6.2.1. Connection Re-use . . . . . . . . . . . . . . . . . . 7 6.2.1. Connection Re-use . . . . . . . . . . . . . . . . . . 7
6.2.1.1. Query Pipelining . . . . . . . . . . . . . . . . 8 6.2.1.1. Query Pipelining . . . . . . . . . . . . . . . . 8
6.2.2. Concurrent connections . . . . . . . . . . . . . . . 8 6.2.2. Concurrent connections . . . . . . . . . . . . . . . 8
6.2.3. Idle Timeouts . . . . . . . . . . . . . . . . . . . . 8 6.2.3. Idle Timeouts . . . . . . . . . . . . . . . . . . . . 9
6.2.4. Tear Down . . . . . . . . . . . . . . . . . . . . . . 9 6.2.4. Tear Down . . . . . . . . . . . . . . . . . . . . . . 9
7. Response Reordering . . . . . . . . . . . . . . . . . . . . . 9 7. Response Reordering . . . . . . . . . . . . . . . . . . . . . 9
8. TCP Message Length Field . . . . . . . . . . . . . . . . . . 10 8. TCP Message Length Field . . . . . . . . . . . . . . . . . . 10
9. TCP Fast Open . . . . . . . . . . . . . . . . . . . . . . . . 10 9. TCP Fast Open . . . . . . . . . . . . . . . . . . . . . . . . 10
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11
11. Security Considerations . . . . . . . . . . . . . . . . . . . 11 11. Security Considerations . . . . . . . . . . . . . . . . . . . 11
12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 12 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 12
13. References . . . . . . . . . . . . . . . . . . . . . . . . . 12 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 12
13.1. Normative References . . . . . . . . . . . . . . . . . . 12 13.1. Normative References . . . . . . . . . . . . . . . . . . 12
13.2. Informative References . . . . . . . . . . . . . . . . . 13 13.2. Informative References . . . . . . . . . . . . . . . . . 13
Appendix A. Summary of Advantages and Disadvantages to using TCP Appendix A. Summary of Advantages and Disadvantages to using TCP
for DNS . . . . . . . . . . . . . . . . . . . . . . 13 for DNS . . . . . . . . . . . . . . . . . . . . . . 14
Appendix B. Changes -01 to -02 . . . . . . . . . . . . . . . . . 14 Appendix B. Changes between revisions . . . . . . . . . . . . . 15
Appendix C. Changes -00 to -01 . . . . . . . . . . . . . . . . . 15 B.1. Changes -02 to -03 . . . . . . . . . . . . . . . . . . . 15
Appendix D. Changes to RFC 5966 . . . . . . . . . . . . . . . . 15 B.2. Changes -01 to -02 . . . . . . . . . . . . . . . . . . . 15
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 16 B.3. Changes -00 to -01 . . . . . . . . . . . . . . . . . . . 16
B.4. Changes to RFC 5966 . . . . . . . . . . . . . . . . . . . 17
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 17
1. Introduction 1. Introduction
Most DNS [RFC1034] transactions take place over UDP [RFC0768]. TCP Most DNS [RFC1034] transactions take place over UDP [RFC0768]. TCP
[RFC0793] is always used for full zone transfers (AXFR) and is often [RFC0793] is always used for full zone transfers (AXFR) and is often
used for messages whose sizes exceed the DNS protocol's original used for messages whose sizes exceed the DNS protocol's original
512-byte limit. The growing deployment of DNSSEC and IPv6 has 512-byte limit. The growing deployment of DNSSEC and IPv6 has
increased response sizes and therefore the use of TCP. The need for increased response sizes and therefore the use of TCP. The need for
increased TCP use has also been driven by the protection it provides increased TCP use has also been driven by the protection it provides
against address spoofing and therefore exploitation of DNS in against address spoofing and therefore exploitation of DNS in
reflection/amplification attacks. It is now widely used in Response reflection/amplification attacks. It is now widely used in Response
Rate Limiting [RRL] Response Rate Limiting [RRL]. Rate Limiting [RRL].
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.
The majority of DNS server operators already support TCP and the The majority of DNS server operators already support TCP and the
default configuration for most software implementations is to support default configuration for most software implementations is to support
TCP. The primary audience for this document is those implementors TCP. The primary audience for this document is those implementors
whose limited support for TCP restricts interoperability and hinders whose limited support for TCP restricts interoperability and hinders
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.
There are several advantages and disadvantages to the increased use There are several advantages and disadvantages to the increased use
of TCP as well as implementation details that need to be considered. of TCP (see Appendix A) as well as implementation details that need
This document addresses these issues and therefore extends the to be considered. This document addresses these issues and presents
content of [RFC5966], with additional considerations and lessons TCP as a valid transport alternative for DNS. It extends the content
learned from research, developments and implementation in DNS and in of [RFC5966], with additional considerations and lessons learned from
other internet protocols. research, developments and implementation of TCP in DNS and in other
internet protocols.
Whilst this document makes no specific requirements for operators of Whilst this document makes no specific requirements for operators of
DNS servers to meet, it does offer some suggestions to operators to DNS servers to meet, it does offer some suggestions to operators to
help ensure that support for TCP on their servers and network is help ensure that support for TCP on their servers and network is
optimal. It should be noted that failure to support TCP (or the optimal. It should be noted that failure to support TCP (or the
blocking of DNS over TCP at the network layer) may result in 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. Requirements Terminology 2. Requirements Terminology
skipping to change at page 4, line 6 skipping to change at page 4, line 15
3. Terminology 3. Terminology
o Persistent connection: a TCP connection that is not closed either o Persistent connection: a TCP connection that is not closed either
by the server after sending the first response nor by the client by the server after sending the first response nor by the client
after receiving the first response. after receiving the first response.
o Connection Reuse: the sending of multiple queries and responses o Connection Reuse: the sending of multiple queries and responses
over a single TCP connection. over a single TCP connection.
o Idle DNS-over-TCP session: Clients and servers view application o Idle DNS-over-TCP session: Clients and servers view application
level idleness differently. A DNS client considers a DNS-over-TCP level idleness differently. A DNS client considers an established
session to be idle when it has no pending queries to send and DNS-over-TCP session to be idle when it has no pending queries to
there are no outstanding responses. A DNS server considers a DNS- send and there are no outstanding responses. A DNS server
over-TCP session to be idle when it has sent responses to all the considers an established DNS-over-TCP session to be idle when it
queries it has received on that connection. has sent responses to all the queries it has received on that
connection.
o Pipelining: the sending of multiple queries and responses over a o Pipelining: the sending of multiple queries and responses over a
single TCP connection but not waiting for any outstanding replies single TCP connection but not waiting for any outstanding replies
before sending another query. before sending another query.
o Out-Of-Order Processing: The processing of queries concurrently o Out-Of-Order Processing: The processing of queries concurrently
and the returning of individual responses as soon as they are and the returning of individual responses as soon as they are
available, possibly out-of-order. This will most likely occur in available, possibly out-of-order. This will most likely occur in
recursive servers, however it is possible in authoritative servers recursive servers, however it is possible in authoritative servers
that, for example, have different backend data stores. that, for example, have different backend data stores.
skipping to change at page 6, line 5 skipping to change at page 6, line 15
Regarding the choice of when to use UDP or TCP, Section 6.1.3.2 of Regarding the choice of when to use UDP or TCP, Section 6.1.3.2 of
RFC 1123 also says: 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.
This requirement is hereby relaxed. A resolver MAY elect to send This requirement is hereby relaxed. A resolver MAY elect to send
either TCP or UDP queries depending on local operational reasons. either TCP or UDP queries depending on local operational reasons.
TCP MAY be used before sending any UDP queries. If it already has an TCP MAY be used before sending any UDP queries. If it already has an
open TCP connection to the server it SHOULD reuse this connection. open TCP connection to the server it SHOULD reuse this connection.
In essence, TCP should be considered a valid alternative transport to In essence, TCP ought to be considered a valid alternative transport
UDP, not purely a fallback option. to UDP, not purely a fallback option.
In addition it is noted that all Recursive and Authoritative servers In addition it is noted that all Recursive and Authoritative servers
MUST send responses using the same transport as the query arrived on. MUST send responses using the same transport as the query arrived on.
In the case of TCP this MUST also be the same connection. In the case of TCP this MUST also be the same connection.
6. Connection Handling 6. Connection Handling
6.1. Current practices 6.1. Current practices
Section 4.2.2 of [RFC1035] says: Section 4.2.2 of [RFC1035] says:
skipping to change at page 7, line 29 skipping to change at page 7, line 37
their idle timeouts or other connection management policies. their idle timeouts or other connection management policies.
o A modest number of clients that all concurrently attempt to use o A modest number of clients that all concurrently attempt to use
persistent connections with non-zero idle timeouts to such a persistent connections with non-zero idle timeouts to such a
server could unintentionally cause the same "denial-of-service" server could unintentionally cause the same "denial-of-service"
problem. problem.
Note that this denial-of-service is only on the TCP service. Note that this denial-of-service is only on the TCP service.
However, in these cases it affects not only clients wishing to use However, in these cases it affects not only clients wishing to use
TCP for their queries for operational reasons, but all clients who TCP for their queries for operational reasons, but all clients who
must fall back to TCP from UDP after receiving a TC=1 flag. choose to fall back to TCP from UDP after receiving a TC=1 flag.
6.2. Recommendations 6.2. Recommendations
The following sections include recommendations that are intended to The following sections include recommendations that are intended to
result in more consistent and scalable implementations of DNS-over- result in more consistent and scalable implementations of DNS-over-
TCP. TCP.
6.2.1. Connection Re-use 6.2.1. Connection Re-use
One perceived disadvantage to DNS over TCP is the added connection One perceived disadvantage to DNS over TCP is the added connection
skipping to change at page 8, line 13 skipping to change at page 8, line 19
(see Section 7). (see Section 7).
6.2.1.1. Query Pipelining 6.2.1.1. Query Pipelining
Due to the historical use of TCP primarily for zone transfer and Due to the historical use of TCP primarily for zone transfer and
truncated responses, no existing RFC discusses the idea of pipelining truncated responses, no existing RFC discusses the idea of pipelining
DNS queries over a TCP connection. DNS queries over a TCP connection.
In order to achieve performance on par with UDP DNS clients SHOULD In order to achieve performance on par with UDP DNS clients SHOULD
pipeline their queries. When a DNS client sends multiple queries to pipeline their queries. When a DNS client sends multiple queries to
a server, it should not wait for an outstanding reply before sending a server, it SHOULD not wait for an outstanding reply before sending
the next query. Clients should treat TCP and UDP equivalently when the next query. Clients SHOULD treat TCP and UDP equivalently when
considering the time at which to send a particular query. considering the time at which to send a particular query.
DNS clients should note that DNS servers that do not both process DNS clients will benefit from noting that DNS servers that do not
pipelined queries concurrently and send out-of-order responses will both process pipelined queries concurrently and send out-of-order
likely not provide performance on a par with UDP. IF TCP performance responses will likely not provide performance on a par with UDP. If
is of importance, clients may find it useful to use server processing TCP performance is of importance, clients might find it useful to use
times as input to server and transport selection algorithms. server processing times as input to server and transport selection
algorithms.
DNS servers (especially recursive) SHOULD expect to receive pipelined DNS servers (especially recursive) SHOULD expect to receive pipelined
queries. The server should process TCP queries concurrently, just as queries. The server SHOULD process TCP queries concurrently, just as
it would for UDP. The server SHOULD answer all pipelined queries, it would for UDP. The server SHOULD answer all pipelined queries,
even if they are sent in quick succession. The handling of responses even if they are sent in quick succession. The handling of responses
to pipelined queries is covered in Section 7. to pipelined queries is covered in Section 7.
6.2.2. Concurrent connections 6.2.2. Concurrent connections
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. It is RECOMMENDED that for any given made to any individual server. It is RECOMMENDED that for any given
client/server interaction there SHOULD be no more than one connection client/server interaction there SHOULD be no more than one connection
for regular queries, one for zone transfers and one for each protocol for regular queries, one for zone transfers and one for each protocol
that is being used on top of TCP, for example, if the resolver was that is being used on top of TCP, for example, if the resolver was
using TLS. using TLS. It is however noted that certain primary/secondary
configurations with many busy zones might need to use more than one
TCP connection for zone transfers for operational reasons.
Similarly, servers MAY impose limits on the number of concurrent TCP Similarly, servers MAY impose limits on the number of concurrent TCP
connections being handled for any particular client. These limits connections being handled for any particular client IP address or
SHOULD be much looser than the client guidelines above, because the subnet. These limits SHOULD be much looser than the client
server does not know if the client IP address belongs to a single guidelines above, because the server does not know, for example, if a
client or is, for example, multiple resolvers on a single machine, or client IP address belongs to a single client or is multiple resolvers
multiple clients behind NAT. on a single machine, or multiple clients behind NAT.
6.2.3. Idle Timeouts 6.2.3. Idle Timeouts
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 idle time of DNS-over-TCP sessions MUST take care to minimize the idle time of established DNS-over-TCP
made to any individual server. DNS clients SHOULD close the TCP sessions made to any individual server. DNS clients SHOULD close the
connection of an idle session, unless an idle timeout has been TCP connection of an idle session, unless an idle timeout has been
established using some other signalling mechanism. established using some other signalling mechanism, for example,
[edns-tcp-keepalive].
To mitigate the risk of unintentional server overload it is To mitigate the risk of unintentional server overload it is
RECOMMENDED that the default server application-level idle period be RECOMMENDED that the default server application-level idle period be
of the order of seconds, but no particular value is specified. In of the order of seconds, but no particular value is specified. In
practice, the idle period may vary dynamically, and servers MAY allow practice, the idle period can vary dynamically, and servers MAY allow
idle connections to remain open for longer periods as resources idle connections to remain open for longer periods as resources
permit. A timeout of at least a few seconds is advisable for normal permit. A timeout of at least a few seconds is advisable for normal
operations to support those clients that expect the SOA and AXFR operations to support those clients that expect the SOA and AXFR
request sequence to be made on a single connection as originally request sequence to be made on a single connection as originally
specified in [RFC1035]. Servers MAY use zero timeouts when specified in [RFC1035]. Servers MAY use zero timeouts when
experiencing heavy load or are under attack. experiencing heavy load or are under attack.
6.2.4. Tear Down 6.2.4. Tear Down
Under normal operation clients should initiate connection closing on Under normal operation clients typically initiate connection closing
idle connections however servers may close the connection if their on idle connections however servers can close the connection if their
local idle timeout policy is exceeded. Connections may be also local idle timeout policy is exceeded. Connections can be also
closed by either end under unusual conditions such as defending closed by either end under unusual conditions such as defending
against an attack or system failure/reboot. against an attack or system failure/reboot.
Clients SHOULD retry unanswered queries if the connection closes Clients SHOULD retry unanswered queries if the connection closes
before receiving all outstanding responses. No specific retry before receiving all outstanding responses. No specific retry
algorithm is specified in this document. algorithm is specified in this document.
If a server finds that a client has closed a TCP session, or if the If a server finds that a client has closed a TCP session, or if the
session has been otherwise interrupted, before all pending responses session has been otherwise interrupted, before all pending responses
have been sent then the server MUST NOT attempt to send those have been sent then the server MUST NOT attempt to send those
skipping to change at page 10, line 9 skipping to change at page 10, line 24
support the sending of responses in parallel and/or out-of-order, support the sending of responses in parallel and/or out-of-order,
regardless of the transport protocol in use. Stub and recursive regardless of the transport protocol in use. Stub and recursive
resolvers MUST be able to process responses that arrive in a 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.
In order to achieve performance on par with UDP, recursive resolvers In order to achieve performance on par with UDP, recursive resolvers
SHOULD process TCP queries in parallel and return individual SHOULD process TCP queries in parallel and return individual
responses as soon as they are available, possibly out-of-order. responses as soon as they are available, possibly out-of-order.
Since pipelined responses may arrive out-of-order, clients must take Since pipelined responses can arrive out-of-order, clients MUST match
care to match responses to outstanding queries, using the ID field, responses to outstanding queries using the ID field and port number.
port number, query name/type/class, and any other relevant protocol Failure by clients to properly match responses to outstanding queries
features. Failure by clients to properly match responses to can have serious consequences for interoperability.
outstanding queries can have serious consequences for inter-
operability.
8. TCP Message Length Field 8. TCP Message Length Field
For reasons of efficiency, DNS clients and servers SHOULD transmit For reasons of efficiency, DNS clients and servers SHOULD pass the
the two-octet length field, and the message described by that length two-octet length field, and the message described by that length
field, in a single TCP segment. This additionally avoids problems field, to the TCP layer at the same time (e.g., in a single "write"
due to some DNS servers being very sensitive to timeout conditions on system call) to make it more likely that all the data will be
receiving messages (they may abort a TCP session if the first TCP transmitted in a single TCP segment. This additionally avoids
segment does not contain both the length field and the entire problems due to some DNS servers being very sensitive to timeout
message). conditions on receiving messages (they might abort a TCP session if
the first TCP segment does not contain both the length field and the
entire message).
9. TCP Fast Open 9. TCP Fast Open
This section is non-normative. This section is non-normative.
TCP fastopen [RFC7413] (TFO) allows data to be carried in the SYN TCP Fast Open [RFC7413] (TFO) allows data to be carried in the SYN
packet. It also saves up to one RTT compared to standard TCP. packet, reducing the cost of re-opening TCP connections. It also
saves up to one RTT compared to standard TCP.
TFO mitigates the security vulnerabilities inherent in sending data TFO mitigates the security vulnerabilities inherent in sending data
in the SYN, especially on a system like DNS where amplification in the SYN, especially on a system like DNS where amplification
attacks are possible, by use of a server-supplied cookie. TFO attacks are possible, by use of a server-supplied cookie. TFO
clients request a server cookie in the initial SYN packet at the clients request a server cookie in the initial SYN packet at the
start of a new connection. The server returns a cookie in its SYN- start of a new connection. The server returns a cookie in its SYN-
ACK. The client caches the cookie and reuses it when opening ACK. The client caches the cookie and reuses it when opening
subsequent connections to the same server. subsequent connections to the same server.
The cookie is stored by the client's TCP stack (kernel) and persists The cookie is stored by the client's TCP stack (kernel) and persists
if either the client or server processes are restarted. TFO also if either the client or server processes are restarted. TFO also
falls back to a regular TCP handshake gracefully. falls back to a regular TCP handshake gracefully.
DNS services taking advantage of IP anycast [RFC4786] may need to DNS services taking advantage of IP anycast [RFC4786] might need to
take additional steps when enabling TFO.From [RFC7413]: take additional steps when enabling TFO. From [RFC7413]:
Servers that accept connection requests to the same server IP Servers that accept connection requests to the same server IP
address should use the same key such that they generate identical address should use the same key such that they generate identical
Fast Open Cookies for a particular client IP address. Otherwise a Fast Open Cookies for a particular client IP address. Otherwise a
client may get different cookies across connections; its Fast Open client may get different cookies across connections; its Fast Open
attempts would fall back to regular 3WHS. attempts would fall back to regular 3WHS.
10. IANA Considerations 10. IANA Considerations
This memo includes no request to IANA. This memo includes no request to IANA.
11. Security Considerations 11. Security Considerations
Some DNS server operators have expressed concern that wider use of Some DNS server operators have expressed concern that wider promotion
DNS over TCP will expose them to a higher risk of denial-of-service and use of DNS over TCP will expose them to a higher risk of denial-
(DoS) attacks. of-service (DoS) attacks on TCP (both accidental and deliberate).
Although there is a higher risk of such attacks against TCP-enabled Although there is a higher risk of some specific attacks against TCP-
servers, techniques for the mitigation of DoS attacks at the network enabled servers, techniques for the mitigation of DoS attacks at the
level have improved substantially since DNS was first designed. network level have improved substantially since DNS was first
designed.
Readers are advised to familiarise themselves with [CPNI-TCP]. Readers are advised to familiarise themselves with [CPNI-TCP], a
security assessment of TCP detailing known TCP attacks and
countermeasures which references most of the relevant RFCs on this
topic.
To mitigate the risk of DoS attacks, DNS servers should engage in TCP To mitigate the risk of DoS attacks, DNS servers are advised to
connection management. This may include maintaining state on engage in TCP connection management. This could include maintaining
existing connections, re-using existing connections and controlling state on existing connections, re-using existing connections and
request queues to enable fair use. It is likely to be advantageous controlling request queues to enable fair use. It is likely to be
to provide configurable connection management options, for example: advantageous to provide configurable connection management options,
for example:
o total number of TCP connections o total number of TCP connections
o maximum TCP connections per source IP address or subnet
o maximum TCP connections per source IP address
o TCP connection idle timeout o TCP connection idle timeout
o maximum DNS transactions per TCP connection o maximum DNS transactions per TCP connection
o maximum TCP connection duration o maximum TCP connection duration
No specific values are recommended for these parameters. No specific values are recommended for these parameters.
Operators are advised to familiarise themselves with the Operators are advised to familiarise themselves with the
configuration and tuning parameters available in the operating system configuration and tuning parameters available in the operating system
TCP stack. However detailed advice on this is outside the scope of TCP stack. However detailed advice on this is outside the scope of
this document. this document.
Operators of recursive servers should ensure that they only accept Operators of recursive servers are advised to ensure that they only
connections from expected clients, and do not accept them from accept 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.
12. Acknowledgements 12. Acknowledgements
The authors would like to thank Francis Dupont and Paul Vixie for The authors would like to thank Francis Dupont and Paul Vixie for
detailed review, Andrew Sullivan, Tony Finch, Stephane Bortzmeyer and detailed review, Andrew Sullivan, Tony Finch, Stephane Bortzmeyer and
the many others who contributed to the mailing list discussion. Also the many others who contributed to the mailing list discussion. Also
skipping to change at page 13, line 31 skipping to change at page 14, line 5
CPNI, "Security Assessment of the Transmission Control CPNI, "Security Assessment of the Transmission Control
Protocol (TCP)", 2009, <http://www.gont.com.ar/papers/ Protocol (TCP)", 2009, <http://www.gont.com.ar/papers/
tn-03-09-security-assessment-TCP.pdf>. tn-03-09-security-assessment-TCP.pdf>.
[Connection-Oriented-DNS] [Connection-Oriented-DNS]
Zhu, L., Hu, Z., Heidemann, J., Wessels, D., Mankin, A., Zhu, L., Hu, Z., Heidemann, J., Wessels, D., Mankin, A.,
and N. Somaiya, "Connection-Oriented DNS to Improve and N. Somaiya, "Connection-Oriented DNS to Improve
Privacy and Security", Privacy and Security",
<http://www.isi.edu/~johnh/PAPERS/Zhu15b.pdf>. <http://www.isi.edu/~johnh/PAPERS/Zhu15b.pdf>.
[RFC5405] Eggert, L. and G. Fairhurst, "Unicast UDP Usage Guidelines
for Application Designers", BCP 145, RFC 5405, DOI
10.17487/RFC5405, November 2008,
<http://www.rfc-editor.org/info/rfc5405>.
[RFC6824] Ford, A., Raiciu, C., Handley, M., and O. Bonaventure, [RFC6824] Ford, A., Raiciu, C., Handley, M., and O. Bonaventure,
"TCP Extensions for Multipath Operation with Multiple "TCP Extensions for Multipath Operation with Multiple
Addresses", RFC 6824, January 2013. Addresses", RFC 6824, January 2013.
[RFC7413] Cheng, Y., Chu, J., Radhakrishnan, S., and A. Jain, "TCP [RFC7413] Cheng, Y., Chu, J., Radhakrishnan, S., and A. Jain, "TCP
Fast Open", RFC 7413, December 2014. Fast Open", RFC 7413, December 2014.
[RRL] Vixie, P. and V. Schryver, "DNS Response Rate Limiting [RRL] Vixie, P. and V. Schryver, "DNS Response Rate Limiting
(DNS RRL)", ISC-TN 2012-1-Draft1, April 2012. (DNS RRL)", ISC-TN 2012-1-Draft1, April 2012.
[edns-tcp-keepalive]
Wouters, P., Abley, J., Dickinson, S., and R. Bellis, "The
edns-tcp-keepalive EDNS0 Option", draft-ietf-dnsop-edns-
tcp-keepalive-02 (work in progress), May 2015.
[fragmentation-considered-poisonous] [fragmentation-considered-poisonous]
Herzberg, A. and H. Shulman, "Fragmentation Considered Herzberg, A. and H. Shulman, "Fragmentation Considered
Poisonous", May 2012, <http://arxiv.org/abs/1205.4011>. Poisonous", May 2012, <http://arxiv.org/abs/1205.4011>.
Appendix A. Summary of Advantages and Disadvantages to using TCP for Appendix A. Summary of Advantages and Disadvantages to using TCP for
DNS DNS
The TCP handshake generally prevents address spoofing and, therefore, The TCP handshake generally prevents address spoofing and, therefore,
the reflection/amplification attacks which plague UDP. the reflection/amplification attacks which plague UDP.
TCP does not suffer from UDP's issues with fragmentation. IP fragmentation is less of a problem for TCP than it is for UDP.
Middleboxes are known to block IP fragments, leading to timeouts and TCP stacks generally implement Path MTU Discovery so they can avoid
forcing client implementations to "hunt" for EDNS0 reply size values IP fragmentation of TCP segments. UDP, on the other hand, does not
supported by the network path. Additionally, fragmentation may lead provide reassembly, which means datagrams that exceed the path MTU
to cache poisoning [fragmentation-considered-poisonous]. size must experience fragmentation [RFC5405]. Middleboxes are known
to block IP fragments, leading to timeouts and forcing client
implementations to "hunt" for EDNS0 reply size values supported by
the network path. Additionally, fragmentation may lead to cache
poisoning [fragmentation-considered-poisonous].
TCP setup costs an additional RTT compared to UDP queries. Setup TCP setup costs an additional RTT compared to UDP queries. Setup
costs can be amortized by reusing connections, pipelining queries, costs can be amortized by reusing connections, pipelining queries,
and enabling TCP Fast Open. and enabling TCP Fast Open.
TCP imposes additional state-keeping requirements on clients and TCP imposes additional state-keeping requirements on clients and
servers. The use of TCP Fast Open reduces the cost of closing and servers. The use of TCP Fast Open reduces the cost of closing and
re-opening TCP connections. re-opening TCP connections.
Long-lived TCP connections to anycast servers may be disrupted due to Long-lived TCP connections to anycast servers might be disrupted due
routing changes. Clients utilizing TCP for DNS must always be to routing changes. Clients utilizing TCP for DNS need to always be
prepared to re-establish connections or otherwise retry outstanding prepared to re-establish connections or otherwise retry outstanding
queries. It may also possible for TCP Multipath [RFC6824] to allow a queries. It might also be possible for TCP Multipath [RFC6824] to
server to hand a connection over from the anycast address to a allow a server to hand a connection over from the anycast address to
unicast address. a unicast address.
There are many "Middleboxes" in use today that interfere with TCP There are many "Middleboxes" in use today that interfere with TCP
over port 53 [RFC5625]. This document does not propose any over port 53 [RFC5625]. This document does not propose any
solutions, other than to make it absolutely clear that TCP is a valid solutions, other than to make it absolutely clear that TCP is a valid
transport for DNS and must be supported by all implementations. transport for DNS and support for it is a requirement for all
implementations.
A more in-depth discussion of connection orientated DNS can be found A more in-depth discussion of connection orientated DNS can be found
elsewhere [Connection-Oriented-DNS]. elsewhere [Connection-Oriented-DNS].
Appendix B. Changes -01 to -02 Appendix B. Changes between revisions
[Note to RFC Editor: please remove this section prior to
publication.]
B.1. Changes -02 to -03
o Replaced certain lower case RFC2119 keywords to improve clarity.
o Updated section 6.2.2 to recognise requirements for concurrent
zone transfers.
o Changed 'client IP address' to 'client IP address or subnet' when
discussing restrictions on TCP connections from clients.
o Added reference to edns-tcp-keepalive draft.
o Added wording to introduction to reference Appendix A and state
TCP is a valid transport alternative for DNS.
o Improved description of CPNI-TCP as a general reference source on
TCP security related RFCs.
B.2. Changes -01 to -02
o Added more text to Introduction as background to TCP use. o Added more text to Introduction as background to TCP use.
o Added definitions of Persistent connection and Idle session to o Added definitions of Persistent connection and Idle session to
Terminology section. Terminology section.
o Separated Connection Handling section into Current Practice and o Separated Connection Handling section into Current Practice and
Recommendations. Provide more detail on current practices and Recommendations. Provide more detail on current practices and
divided Recommendations up into more granular sub-sections. divided Recommendations up into more granular sub-sections.
skipping to change at page 15, line 18 skipping to change at page 16, line 32
o Updated text on server limits on concurrent connections from a o Updated text on server limits on concurrent connections from a
particular client. particular client.
o Added text that client retry logic is outside the scope of this o Added text that client retry logic is outside the scope of this
document. document.
o Clarified that servers should answer all pipelined queries even if o Clarified that servers should answer all pipelined queries even if
sent very close together. sent very close together.
Appendix C. Changes -00 to -01 B.3. Changes -00 to -01
o Changed updates to obsoletes RFC 5966. o Changed updates to obsoletes RFC 5966.
o Improved text in Section 4 Transport Protocol Selection to change o Improved text in Section 4 Transport Protocol Selection to change
"TCP SHOULD NOT be used only for the transfers and as a fallback" "TCP SHOULD NOT be used only for the transfers and as a fallback"
to make the intention clearer and more consistent. to make the intention clearer and more consistent.
o Reference to TCP FASTOPEN updated now that it is an RFC. o Reference to TCP FASTOPEN updated now that it is an RFC.
o Added paragraph to say that implementations MUST NOT send the TCP o Added paragraph to say that implementations MUST NOT send the TCP
skipping to change at page 15, line 42 skipping to change at page 17, line 7
o Added Terminology section. o Added Terminology section.
o Changed should and RECOMMENDED in reference to parallel processing o Changed should and RECOMMENDED in reference to parallel processing
to SHOULD in sections 7 and 8. to SHOULD in sections 7 and 8.
o Added text to address what a server should do when a client closes o Added text to address what a server should do when a client closes
the TCP connection before pending responses are sent. the TCP connection before pending responses are sent.
o Moved the Advantages and Disadvantages section to an appendix. o Moved the Advantages and Disadvantages section to an appendix.
Appendix D. Changes to RFC 5966 B.4. Changes to RFC 5966
This document differs from RFC 5966 in four additions: This document differs from RFC 5966 in four additions:
1. DNS implementations are recommended not only to support TCP but 1. DNS implementations are recommended not only to support TCP but
to support it on an equal footing with UDP to support it on an equal footing with UDP
2. DNS implementations are recommended to support reuse of TCP 2. DNS implementations are recommended to support reuse of TCP
connections connections
3. DNS implementations are recommended to support pipelining and out 3. DNS implementations are recommended to support pipelining and out
 End of changes. 40 change blocks. 
95 lines changed or deleted 146 lines changed or added

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