RFC 7766
DNS Transport over TCP - Implementation Requirements
π RFC 7766: DNS Transport over TCP - Implementation Requirements (Part 1 of 4) β¨
Quick title-block tea βπ
- Series: Internet Engineering Task Force (IETF), Request for Comments: 7766
- Authors: J. Dickinson and S. Dickinson (Sinodun), R. Bellis (ISC), A. Mankin and D. Wessels (Verisign Labs)
- Category: Standards Track π
- ISSN: 2070-1721
- Date: March 2016 ποΈ
- Obsoletes: RFC 5966 π
- Updates: RFC 1035 and RFC 1123 π₯
Abstract πΈ
okay so bestie, this doc says TCP is a legit transport for DNS, full stop. It sets out the rule that implementations need to support TCP, and it gives tips so DNS-over-TCP can perform as well as DNS-over-UDP π¦. It obsoletes RFC 5966, which means it also updates RFC 1035 and RFC 1123. iconic.
Status of This Memo π
This is an Internet Standards Track document β¨
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It got public review and was approved for publication by the Internet Engineering Steering Group (IESG). If you want more on Internet Standards, check Section 2 of RFC 5741 π
Info about the current status of this doc, any errata, and how to give feedback can be found at http://www.rfc-editor.org/info/rfc7766 π§
Copyright Notice π
Copyright (c) 2016 IETF Trust and the persons identified as the document authors. All rights reserved. π
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as in effect on the date of publication. Please read these carefully, bestie, because they explain your rights and restrictions for this doc. Code Components pulled out of this document must include the Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come without warranty as described in the Simplified BSD License π«Ά
Table of Contents πΊοΈ
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Requirements Terminology . . . . . . . . . . . . . . . . . . 4
3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4
4. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 4
5. Transport Protocol Selection . . . . . . . . . . . . . . . . 5
6. Connection Handling . . . . . . . . . . . . . . . . . . . . . 6
6.1. Current Practices . . . . . . . . . . . . . . . . . . . . 6
6.1.1. Clients . . . . . . . . . . . . . . . . . . . . . . . 7
6.1.2. Servers . . . . . . . . . . . . . . . . . . . . . . . 7
6.2. Recommendations . . . . . . . . . . . . . . . . . . . . . 8
6.2.1. Connection Reuse . . . . . . . . . . . . . . . . . . 8
6.2.1.1. Query Pipelining . . . . . . . . . . . . . . . . 8
6.2.2. Concurrent Connections . . . . . . . . . . . . . . . 9
6.2.3. Idle Timeouts . . . . . . . . . . . . . . . . . . . . 9
6.2.4. Teardown . . . . . . . . . . . . . . . . . . . . . . 10
7. Response Reordering . . . . . . . . . . . . . . . . . . . . . 10
8. TCP Message Length Field . . . . . . . . . . . . . . . . . . 11
9. TCP Fast Open . . . . . . . . . . . . . . . . . . . . . . . . 11
10. Security Considerations . . . . . . . . . . . . . . . . . . . 12
11. References . . . . . . . . . . . . . . . . . . . . . . . . . 13
11.1. Normative References . . . . . . . . . . . . . . . . . . 13
11.2. Informative References . . . . . . . . . . . . . . . . . 14
Appendix A. Summary of Advantages and Disadvantages to Using TCP
for DNS . . . . . . . . . . . . . . . . . . . . . . 16
Appendix B. Changes to RFC 5966 . . . . . . . . . . . . . . . . 16
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 17
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 18
1. Introduction π
Most DNS [RFC1034] transactions happen over UDP [RFC768]. TCP [RFC793] is always used for full zone transfers (using AXFR), and it's often used for messages whose sizes go past the DNS protocol's original 512-byte limit. The growing deployment of DNS Security (DNSSEC) and IPv6 has made responses bigger, so TCP gets used more. The need for more TCP use is also driven by the protection it gives against address spoofing, which stops DNS from being exploited in reflection/amplification attacks π‘οΈ TCP is now widely used in Response Rate Limiting [RRL1] [RRL2]. Plus, recent work on DNS privacy solutions like [DNS-over-TLS] is another reason to revisit DNS-over-TCP requirements π
Section 6.1.3.2 of [RFC1123] says:
DNS resolvers and recursive servers MUST support UDP, and SHOULD support TCP, for sending (non-zone-transfer) queries.
But some implementors read the text quoted above as meaning TCP support is an optional feature of the DNS protocol. π
The majority of DNS server operators already support TCP, and the default configuration for most software implementations is to support TCP too β¨ The main audience for this doc is the implementors whose limited TCP support holds back interoperability and slows down new DNS features π§
So this document updates the core DNS protocol specifications so that support for TCP is, from now on, a REQUIRED part of a full DNS protocol implementation. π
There are several advantages and disadvantages to using TCP more (see Appendix A), plus implementation details you need to think about. This doc addresses these issues and presents TCP as a valid transport alternative for DNS π It extends the content of [RFC5966] with extra considerations and lessons learned from research, developments, and implementation of TCP in DNS and in other Internet protocols π
While this document doesn't make any specific requirements for DNS server operators, it does offer some suggestions to help operators make sure TCP support on their servers and network is optimal π It should be noted that failing to support TCP (or blocking DNS over TCP at the network layer) will probably result in resolution failure and/or application-level timeouts π
2. Requirements Terminology π
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 [RFC2119]. π«Ά
3. Terminology π¦
- Persistent connection: a TCP connection that is not closed either by the server after sending the first response, or by the client after receiving the first response. π
- Connection Reuse: sending multiple queries and responses over a single TCP connection. β»οΈ
- Idle DNS-over-TCP session: Clients and servers view application-level idleness differently. A DNS client considers an established DNS-over-TCP session to be idle when it has no pending queries to send and there are no outstanding responses. A DNS server considers an established DNS-over-TCP session to be idle when it has sent responses to all the queries it has received on that connection. π΄
- Pipelining: sending multiple queries and responses over a single TCP connection without waiting for any outstanding replies before sending another query. π
- Out-of-Order Processing: processing queries concurrently and returning individual responses as soon as they're available, possibly out of order. This will most likely happen in recursive servers. It's also possible in authoritative servers that, for example, have different backend data stores. π
4. Discussion π
Without EDNS0 (Extension Mechanisms for DNS 0 [RFC6891]; see below), the normal behaviour of any DNS server that needs to send a UDP response bigger than the 512-byte limit is to truncate the response so it fits within that limit, and then set the TC flag in the response header. When the client gets a response like that, it takes the TC flag as a sign that it should retry over TCP instead π
RFC 1123 also says:
... 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.
Existing deployments of DNSSEC [RFC4033] have shown that truncation at the 512-byte boundary is now commonplace π For example, a Non-Existent Domain (NXDOMAIN) (RCODE == 3) response from a DNSSEC-signed zone using NextSECure 3 (NSEC3) [RFC5155] is almost always bigger than 512 bytes π
Since the original core DNS specs were written, extension mechanisms for DNS have been introduced. These extensions can be used to indicate that the client is ready to receive UDP responses bigger than 512 bytes. An EDNS0-compatible server that gets a request from an EDNS0-compatible client may send UDP packets up to that client's announced buffer size without truncation β¨
However, transporting UDP packets that exceed the path MTU causes IP packet fragmentation, which has been found to be unreliable in many circumstances. Lots of firewalls routinely block fragmented IP packets, and some don't implement the algorithms needed to reassemble them. 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 [RFC5625] π
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 π
The future that RFC 1123 anticipated has arrived, and the only standardised UDP-based mechanism that might have solved the packet size issue has been found inadequate. Main character moment, honestly ππ₯
5. Transport Protocol Selection β¨
okay so first up, [RFC1123] section 6.1.3.2 gets a glow-up π All general-purpose DNS implementations MUST support both UDP and TCP transport. no exceptions bestie π«Ά
- Authoritative server implementations MUST support TCP so that they do not limit the size of responses to what fits in a single UDP packet.
- Recursive server (or forwarder) implementations MUST support TCP so that they do not prevent large responses from a TCP-capable server from reaching its TCP-capable clients.
- Stub resolver implementations (e.g., an operating system's DNS resolution library) MUST support TCP since to do otherwise would limit the interoperability between their own clients and upstream servers.
now the UDP-or-TCP choice π RFC 1123 section 6.1.3.2 also said this:
... a DNS resolver or server that is sending a non-zone-transfer query MUST send a UDP query first.
and honestly? that rule is getting relaxed π¦ Stub resolvers and recursive resolvers MAY elect to send either TCP or UDP queries depending on local operational reasons. TCP MAY be used before sending any UDP queries. If the resolver already has an open TCP connection to the server, it SHOULD reuse this connection. In essence, TCP ought to be considered a valid alternative transport to UDP, not purely a retry option. main character energy for TCP π πΈ
also, all recursive and authoritative servers MUST send responses using the same transport as the query arrived on. and if the query came in over TCP, the response MUST also go back on the same connection π
6. Connection Handling π«§
6.1. Current Practices π
first, the old wisdom from [RFC1035] section 4.2.2, which says:
- The server should assume that the client will initiate connection closing, and should delay closing its end of the connection until all outstanding client requests have been satisfied.
- 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 graceful close.
other newer protocols like HTTP/1.1 [RFC7230] and HTTP/2 [RFC7540] have persistent TCP connections built in for all requests π Connections are then normally closed via a 'connection close' signal from one party.
the [RFC1035] description is clear that servers should view connections as persistent (particularly after receiving an SOA), but unfortunately does not provide enough detail for an unambiguous interpretation of client behaviour for queries other than a SOA. ngl that's a little chaotic π Additionally, DNS does not yet have a signalling mechanism for connection timeout or close, although some have been proposed.
6.1.1. Clients π§
there is no clear guidance today in any RFC as to when a DNS client should close a TCP connection, and there are no specific recommendations with regard to DNS client idle timeouts. however, at the time of writing, it is common practice for clients to close the TCP connection after sending a single request (apart from the SOA/AXFR case).
6.1.2. Servers π₯οΈ
many DNS server implementations use a long fixed idle timeout and default to a small number of TCP connections. they also offer little in the way of TCP connection management options. the disadvantages of this include:
- Operational experience has shown that long server timeouts can easily cause resource exhaustion and poor response under heavy load.
- Intentionally opening many connections and leaving them idle can trivially create a TCP denial of service (DoS) attack as many DNS servers are poorly equipped to defend against this by modifying their idle timeouts or other connection management policies.
- A modest number of clients that all concurrently attempt to use persistent connections with non-zero idle timeouts to such a server could unintentionally cause the same DoS problem.
note that this DoS is only on the TCP service π¬ but it affects not only clients that wish to use TCP for their queries for operational reasons, but all clients that choose to fall back to TCP from UDP after receiving a TC=1 flag.
6.2. Recommendations π‘
the following sections include recommendations that are intended to result in more consistent and scalable implementations of DNS-over-TCP β¨
6.2.1. Connection Reuse β»οΈ
one perceived disadvantage to DNS over TCP is the added connection setup latency, generally equal to one RTT. to amortise connection setup costs, both clients and servers SHOULD support connection reuse by sending multiple queries and responses over a single persistent TCP connection.
when sending multiple queries over a TCP connection, clients MUST NOT reuse the DNS Message ID of an in-flight query on that connection in order to avoid Message ID collisions. this is especially important if the server could be performing out-of-order processing (see Section 7).
6.2.1.1. Query Pipelining π
due to the historical use of TCP primarily for zone transfer and truncated responses, no existing RFC discusses the idea of pipelining DNS queries over a TCP connection. so this is new territory π«£
in order to achieve performance on par with UDP, DNS clients SHOULD pipeline their queries. when a DNS client sends multiple queries to a server, it SHOULD NOT wait for an outstanding reply before sending the next query. clients SHOULD treat TCP and UDP equivalently when considering the time at which to send a particular query.
it is likely that DNS servers need to process pipelined queries concurrently and also send out-of-order responses over TCP in order to provide the level of performance possible with UDP transport. if TCP performance is of importance, clients might find it useful to use server processing times as input to server and transport selection algorithms.
DNS servers (especially recursive) MUST expect to receive pipelined queries. the server SHOULD process TCP queries concurrently, just as it would for UDP. the server SHOULD answer all pipelined queries, even if they are received in quick succession. the handling of responses to pipelined queries is covered in Section 7 π
6.2.2. Concurrent Connections π
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. it is RECOMMENDED that for any given client/server interaction there SHOULD be no more than one connection 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 using TLS). however, it is 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 (for example, to support concurrent transfers of multiple zones).
similarly, servers MAY impose limits on the number of concurrent TCP connections being handled for any particular client IP address or subnet. these limits SHOULD be much looser than the client guidelines above, because the server does not know, for example, if a client IP address belongs to a single client, is multiple resolvers on a single machine, or is multiple clients behind a device performing Network Address Translation (NAT) π«Ά
6.2.3. Idle Timeouts β³
to mitigate the risk of unintentional server overload, DNS clients MUST take care to minimise the idle time of established DNS-over-TCP sessions made to any individual server. DNS clients SHOULD close the TCP connection of an idle session, unless an idle timeout has been established using some other signalling mechanism, for example, [edns-tcp-keepalive].
to mitigate the risk of unintentional server overload, it is RECOMMENDED that the default server application-level idle period be on the order of seconds, but no particular value is specified. in practice, the idle period can vary dynamically, and servers MAY allow idle connections to remain open for longer periods as resources permit. a timeout of at least a few seconds is advisable for normal operations to support those clients that expect the SOA and AXFR request sequence to be made on a single connection as originally specified in [RFC1035]. servers MAY use zero timeouts when they are experiencing heavy load or are under attack.
DNS messages delivered over TCP might arrive in multiple segments. a DNS server that resets its idle timeout after receiving a single segment might be vulnerable to a "slow-read attack" π± for this reason, servers SHOULD reset the idle timeout on the receipt of a full DNS message, rather than on receipt of any part of a DNS message.
6.2.4. Teardown π
under normal operation DNS clients typically initiate connection closing on idle connections; however, DNS servers can close the connection if the idle timeout set by local policy is exceeded. also, connections can be closed by either end under unusual conditions such as defending against an attack or system failure/reboot.
DNS clients SHOULD retry unanswered queries if the connection closes before receiving all outstanding responses. no specific retry algorithm is specified in this document.
if a DNS server finds that a DNS client has closed a TCP session (or if the session has been otherwise interrupted) before all pending responses have been sent, then the server MUST NOT attempt to send those responses. of course, the DNS server MAY cache those responses π§
7. Response Reordering π
[RFC1035] is a little ambiguous on whether TCP responses may be reordered π€ the only relevant text is in Section 4.2.1, which relates 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 β¨ authoritative servers and recursive resolvers are RECOMMENDED to support the preparing of responses in parallel and sending them out of order, regardless of the transport protocol in use. stub and recursive resolvers MUST be able to process responses that arrive in a different order than that in which the requests were sent, regardless of the transport protocol in use.
in order to achieve performance on par with UDP, recursive resolvers SHOULD process TCP queries in parallel and return individual responses as soon as they are available, possibly out of order.
since pipelined responses can arrive out of order, clients MUST match responses to outstanding queries on the same TCP connection using the Message ID. if the response contains a question section, the client MUST match the QNAME, QCLASS, and QTYPE fields. failure by clients to properly match responses to outstanding queries can have serious consequences for interoperability π so please, match your responses!! π«Ά
8. TCP Message Length Field β¨
okay bestie, so DNS clients and servers SHOULD pass the two-octet length field AND the message it describes to the TCP layer at the same time (like, in one single "write" system call) π That makes it way more likely that all the data goes out in a single TCP segment. It's about efficiency, and also about dodging problems caused by some DNS server implementations acting up when they read from the TCP layer (which happened because older documents were kinda unclear about this π). For example, some DNS servers might abort the whole TCP session if the first "read" from the TCP layer doesn't include both the length field and the entire message. Yikes π
To be clear, DNS servers MUST NOT close a connection simply because the first "read" from the TCP layer doesn't contain the entire DNS message π«Ά And servers SHOULD apply the connection timeouts as specified in Section 6.2.3. β°
9. TCP Fast Open π¦
This section is non-normative. πΈ
okay so TCP Fast Open (TFO) [RFC7413] lets data ride along in the SYN packet, which makes reopening TCP connections way cheaper β¨ It also saves up to one RTT compared to standard TCP. Iconic π
TFO handles the security risks of sending data in the SYN, which is especially important on a system like DNS where amplification attacks are possible, by using a server-supplied cookie π₯ The way it works: TFO clients ask for a server cookie in the initial SYN packet at the start of a new connection. The server sends back a cookie in its SYN-ACK. The client caches that cookie and reuses it when it opens later connections to the same server. π
The cookie is stored by the client's TCP stack (kernel), and it sticks around even if the client or server processes get restarted π§ TFO also falls back to a regular TCP handshake gracefully, so no drama π
DNS services that use IP anycast [RFC4786] might need to take some extra steps when turning on TFO. Here's what [RFC7413] says:
Servers behind load balancers that accept connection requests to the same server IP address should use the same key such that they generate identical Fast Open cookies for a particular client IP address. Otherwise, a client may get different cookies across connections; its Fast Open attempts would fall back to the regular 3WHS.
When DNS-over-TCP is used as a transport for DNS private exchange, as in [DNS-over-TLS], the implementor needs to be aware of TFO and make sure data that needs protection (like data for a DNS query) doesn't accidentally get sent in the clear π See [DNS-over-TLS] for the discussion.
10. Security Considerations π
Some DNS server operators have expressed concern that wider promotion and use of DNS over TCP will expose them to a higher risk of DoS attacks on TCP, both accidental and deliberate. Scary, I know π
Although there's a higher risk of some specific attacks against TCP-enabled servers, techniques for mitigating DoS attacks at the network level have improved a LOT since DNS was first designed πͺ
Readers are advised to familiarise themselves with [CPNI-TCP], a security assessment of TCP that details known TCP attacks and countermeasures and references most of the relevant RFCs on this topic. Homework, bestie π
To mitigate the risk of DoS attacks, DNS servers are advised to engage in TCP connection management. This could include maintaining state on existing connections, reusing existing connections, and controlling request queues to enable fair use. It's likely to be advantageous to provide configurable connection management options, for example:
- total number of TCP connections
- maximum TCP connections per source IP address or subnet
- TCP connection idle timeout
- maximum DNS transactions per TCP connection
- maximum TCP connection duration
No specific values are recommended for these parameters. π€·ββοΈ
Operators are advised to familiarise themselves with the configuration and tuning parameters available in the TCP stack of the operating system. Detailed advice on this is outside the scope of this document, so you'll have to go look elsewhere π
Operators of recursive servers are advised to make sure they only accept connections from expected clients (for example, by using an Access Control List (ACL)) and don't accept them from unknown sources. For UDP traffic, this helps protect against reflection attacks [RFC5358]. For TCP traffic, it stops an unknown client from exhausting the server's limits on the number of concurrent connections. Lock it down, babe π
11. References π
11.1. Normative References
- [RFC768]: Postel, J., "User Datagram Protocol", STD 6, RFC 768, DOI 10.17487/RFC0768, August 1980, <http://www.rfc-editor.org/info/rfc768>.
- [RFC793]: Postel, J., "Transmission Control Protocol", STD 7, RFC 793, DOI 10.17487/RFC0793, September 1981, <http://www.rfc-editor.org/info/rfc793>.
- [RFC1034]: Mockapetris, P., "Domain names - concepts and facilities", STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, <http://www.rfc-editor.org/info/rfc1034>.
- [RFC1035]: Mockapetris, P., "Domain names - implementation and specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, November 1987, <http://www.rfc-editor.org/info/rfc1035>.
- [RFC1123]: Braden, R., Ed., "Requirements for Internet Hosts - Application and Support", STD 3, RFC 1123, DOI 10.17487/RFC1123, October 1989, <http://www.rfc-editor.org/info/rfc1123>.
- [RFC2119]: Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <http://www.rfc-editor.org/info/rfc2119>.
- [RFC4033]: Arends, R., Austein, R., Larson, M., Massey, D., and S. Rose, "DNS Security Introduction and Requirements", RFC 4033, DOI 10.17487/RFC4033, March 2005, <http://www.rfc-editor.org/info/rfc4033>.
- [RFC4786]: Abley, J. and K. Lindqvist, "Operation of Anycast Services", BCP 126, RFC 4786, DOI 10.17487/RFC4786, December 2006, <http://www.rfc-editor.org/info/rfc4786>.
- [RFC5155]: Laurie, B., Sisson, G., Arends, R., and D. Blacka, "DNS Security (DNSSEC) Hashed Authenticated Denial of Existence", RFC 5155, DOI 10.17487/RFC5155, March 2008, <http://www.rfc-editor.org/info/rfc5155>.
- [RFC5358]: Damas, J. and F. Neves, "Preventing Use of Recursive Nameservers in Reflector Attacks", BCP 140, RFC 5358, DOI 10.17487/RFC5358, October 2008, <http://www.rfc-editor.org/info/rfc5358>.
- [RFC5625]: Bellis, R., "DNS Proxy Implementation Guidelines", BCP 152, RFC 5625, DOI 10.17487/RFC5625, August 2009, <http://www.rfc-editor.org/info/rfc5625>.
- [RFC5966]: Bellis, R., "DNS Transport over TCP - Implementation Requirements", RFC 5966, DOI 10.17487/RFC5966, August 2010, <http://www.rfc-editor.org/info/rfc5966>.
- [RFC6891]: Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms for DNS (EDNS(0))", STD 75, RFC 6891, DOI 10.17487/RFC6891, April 2013, <http://www.rfc-editor.org/info/rfc6891>.
- [RFC7230]: Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", RFC 7230, DOI 10.17487/RFC7230, June 2014, <http://www.rfc-editor.org/info/rfc7230>.
- [RFC7540]: Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext Transfer Protocol Version 2 (HTTP/2)", RFC 7540, DOI 10.17487/RFC7540, May 2015, <http://www.rfc-editor.org/info/rfc7540>.
11.2. Informative References
- [Connection-Oriented-DNS]: Zhu, L., Hu, Z., Heidemann, J., Wessels, D., Mankin, A., and N. Somaiya, "Connection-Oriented DNS to Improve Privacy and Security", 2015 IEEE Symposium on Security and Privacy (SP), DOI 10.1109/SP.2015.18, <http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=7163025>.
- [CPNI-TCP]: CPNI, "Security Assessment of the Transmission Control Protocol (TCP)", 2009, <http://www.gont.com.ar/papers/tn-03-09-security-assessment-TCP.pdf>.
- [DNS-over-TLS]: Hu, Z., Zhu, L., Heidemann, J., Mankin, A., Wessels, D., and P. Hoffman, "Specification for DNS over TLS", Work in Progress, draft-ietf-dprive-dns-over-tls-06, February 2016.
- [edns-tcp-keepalive]: Wouters, P., Abley, J., Dickinson, S., and R. Bellis, "The edns-tcp-keepalive EDNS0 Option", Work in Progress, draft-ietf-dnsop-edns-tcp-keepalive-03, September 2015.
- [fragmentation-considered-poisonous]: Herzberg, A. and H. Shulman, "Fragmentation Considered Poisonous", May 2012, <http://arxiv.org/abs/1205.4011>.
- [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, "TCP Extensions for Multipath Operation with Multiple Addresses", RFC 6824, DOI 10.17487/RFC6824, January 2013, <http://www.rfc-editor.org/info/rfc6824>.
- [RFC7413]: Cheng, Y., Chu, J., Radhakrishnan, S., and A. Jain, "TCP Fast Open", RFC 7413, DOI 10.17487/RFC7413, December 2014, <http://www.rfc-editor.org/info/rfc7413>.
- [RRL1]: Vixie, P. and V. Schryver, "DNS Response Rate Limiting (DNS RRL)", ISC-TN 2012-1-Draft1, April 2012, <https://ftp.isc.org/isc/pubs/tn/isc-tn-2012-1.txt>.
- [RRL2]: ISC Support, "Using the Response Rate Limiting Feature in BIND 9.10", ISC Knowledge Base AA-00994, June 2013, <https://kb.isc.org/article/AA-00994/>.
Appendix A. Summary of Advantages and Disadvantages to Using TCP for DNS β¨
okay so the TCP handshake basically stops address spoofing π ββοΈ, which means no reflection/amplification attacks. Those are the ones that absolutely plague UDP π€
IP fragmentation is way less of a problem for TCP π . TCP stacks generally implement Path MTU Discovery so they can avoid fragmenting TCP segments. UDP doesn't do reassembly, so datagrams bigger than the path MTU just have to get fragmented [RFC5405]. Middleboxes are known to block IP fragments, which causes timeouts and forces client implementations to "hunt" for the EDNS0 reply size values the network path supports π. Fragmentation can also lead to cache poisoning [fragmentation-considered-poisonous], which is not it π.
TCP setup costs an extra RTT compared to UDP queries π’. Those setup costs can be amortised by reusing connections, pipelining queries, and enabling TCP Fast Open β¨.
TCP also adds extra state-keeping requirements on clients and servers π§ . Using TCP Fast Open reduces the cost of closing and reopening TCP connections π¦.
Long-lived TCP connections to anycast servers might get disrupted by routing changes π. Clients using TCP for DNS need to always be prepared to re-establish connections or otherwise retry outstanding queries πͺ. It might also be possible for Multipath TCP [RFC6824] to let a server hand a connection over from the anycast address to a unicast address π.
There are lots of "middleboxes" out there today that interfere with TCP over port 53 [RFC5625] π€. This document doesn't propose any solutions, except to make it absolutely clear that TCP is a valid transport for DNS and that support for it is a requirement for all implementations π.
If you want the deeper tea on connection-oriented DNS, it's covered elsewhere [Connection-Oriented-DNS] π.
Appendix B. Changes to RFC 5966 πΈ
okay bestie, this document obsoletes [RFC5966] and is pretty different from it in several ways π¦. Here's the rundown of the biggest changes and updates implementors should clock π.
- A Terminology section (Section 3) was added, defining several new concepts π.
- Paragraph 3 of Section 5 puts TCP on a more equal footing with UDP than RFC 5966 does π. For example, it says:
- TCP MAY be used before sending any UDP queries.
- TCP ought to be considered a valid alternative transport to UDP, not purely a fallback option.
- Section 6.2.1 adds a new recommendation that TCP connection reuse SHOULD be supported π.
- Section 6.2.1.1 adds a new recommendation that DNS clients SHOULD pipeline their queries and DNS servers SHOULD process pipelined queries concurrently π.
- Section 6.2.2 adds new recommendations on the number and usage of TCP connections for client/server interactions π.
- Section 6.2.3 adds a new recommendation that DNS clients SHOULD close idle sessions unless they're using a signalling mechanism π€.
- Section 7 clarifies that servers are RECOMMENDED to prepare TCP responses in parallel and send answers out of order πββοΈ. It also clarifies how clients should match TCP queries and responses π§©.
- Section 8 adds a new recommendation about how DNS clients and servers should handle the 2-byte message length field for TCP messages π’.
- Section 9 adds a non-normative discussion of the use of TCP Fast Open π.
- Section 10 adds new advice on DoS mitigation techniques π‘οΈ.
Acknowledgements π«Ά
The authors want to thank Francis Dupont and Paul Vixie for their detailed reviews, plus Andrew Sullivan, Tony Finch, Stephane Bortzmeyer, Joe Abley, Tatuya Jinmei, and the many others who joined the mailing list discussion π. The authors also thank Liang Zhu, Zi Hu, and John Heidemann for extensive DNS-over-TCP discussions and code π, and Lucie Guiraud and Danny McPherson for reviewing early draft versions of this document π§. And they'd like to thank everyone who contributed to RFC 5966 π.
Authors' Addresses π
John Dickinson
Sinodun Internet Technologies
Magdalen Centre
Oxford Science Park
Oxford OX4 4GA
United Kingdom
Email: jad@sinodun.com
URI: http://sinodun.com
Sara Dickinson
Sinodun Internet Technologies
Magdalen Centre
Oxford Science Park
Oxford OX4 4GA
United Kingdom
Email: sara@sinodun.com
URI: http://sinodun.com
Ray Bellis
Internet Systems Consortium, Inc
950 Charter Street
Redwood City, CA 94063
United States
Phone: +1 650 423 1200
Email: ray@isc.org
URI: http://www.isc.org
Allison Mankin
Verisign Labs
12061 Bluemont Way
Reston, VA 20190
United States
Phone: +1 301 728 7198
Email: allison.mankin@gmail.com
Duane Wessels
Verisign Labs
12061 Bluemont Way
Reston, VA 20190
United States
Phone: +1 703 948 3200
Email: dwessels@verisign.com
π¦ where this page comes from
- ietf: rfc7766 2016-03
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms