idnits 2.17.1 draft-ietf-dnsop-edns-tcp-keepalive-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (September 30, 2015) is 3131 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'TBD' is mentioned on line 213, but not defined == Missing Reference: 'TBA' is mentioned on line 382, but not defined == Missing Reference: 'STARTTLS' is mentioned on line 457, but not defined == Unused Reference: 'RFC5966' is defined on line 408, but no explicit reference was found in the text ** Obsolete normative reference: RFC 5966 (Obsoleted by RFC 7766) ** Obsolete normative reference: RFC 6824 (Obsoleted by RFC 8684) ** Obsolete normative reference: RFC 7320 (Obsoleted by RFC 8820) == Outdated reference: A later version (-09) exists of draft-ietf-dprive-dns-over-tls-00 == Outdated reference: A later version (-06) exists of draft-ietf-dnsop-5966bis-03 Summary: 3 errors (**), 0 flaws (~~), 7 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 dnsop P. Wouters 3 Internet-Draft Red Hat 4 Intended status: Standards Track J. Abley 5 Expires: April 2, 2016 Dyn, Inc. 6 S. Dickinson 7 Sinodun 8 R. Bellis 9 ISC 10 September 30, 2015 12 The edns-tcp-keepalive EDNS0 Option 13 draft-ietf-dnsop-edns-tcp-keepalive-03 15 Abstract 17 DNS messages between clients and servers may be received over either 18 UDP or TCP. UDP transport involves keeping less state on a busy 19 server, but can cause truncation and retries over TCP. Additionally, 20 UDP can be exploited for reflection attacks. Using TCP would reduce 21 retransmits and amplification. However, clients commonly use TCP 22 only for fallback and servers typically use idle timeouts on the 23 order of seconds. 25 This document defines an EDNS0 option ("edns-tcp-keepalive") that 26 allows DNS servers to signal a variable idle timeout. This 27 signalling facilitates a better balance of UDP and TCP transport 28 between individual clients and servers, reducing the impact of 29 problems associated with UDP transport and allowing the state 30 associated with TCP transport to be managed effectively with minimal 31 impact on the DNS transaction time. 33 Status of This Memo 35 This Internet-Draft is submitted in full conformance with the 36 provisions of BCP 78 and BCP 79. 38 Internet-Drafts are working documents of the Internet Engineering 39 Task Force (IETF). Note that other groups may also distribute 40 working documents as Internet-Drafts. The list of current Internet- 41 Drafts is at http://datatracker.ietf.org/drafts/current/. 43 Internet-Drafts are draft documents valid for a maximum of six months 44 and may be updated, replaced, or obsoleted by other documents at any 45 time. It is inappropriate to use Internet-Drafts as reference 46 material or to cite them other than as "work in progress." 48 This Internet-Draft will expire on April 2, 2016. 50 Copyright Notice 52 Copyright (c) 2015 IETF Trust and the persons identified as the 53 document authors. All rights reserved. 55 This document is subject to BCP 78 and the IETF Trust's Legal 56 Provisions Relating to IETF Documents 57 (http://trustee.ietf.org/license-info) in effect on the date of 58 publication of this document. Please review these documents 59 carefully, as they describe your rights and restrictions with respect 60 to this document. Code Components extracted from this document must 61 include Simplified BSD License text as described in Section 4.e of 62 the Trust Legal Provisions and are provided without warranty as 63 described in the Simplified BSD License. 65 Table of Contents 67 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 68 2. Requirements Notation . . . . . . . . . . . . . . . . . . . . 4 69 3. The edns-tcp-keepalive Option . . . . . . . . . . . . . . . . 4 70 3.1. Option Format . . . . . . . . . . . . . . . . . . . . . . 5 71 3.2. Use by DNS Clients . . . . . . . . . . . . . . . . . . . 5 72 3.2.1. Sending Queries . . . . . . . . . . . . . . . . . . . 5 73 3.2.2. Receiving Responses . . . . . . . . . . . . . . . . . 6 74 3.3. Use by DNS Servers . . . . . . . . . . . . . . . . . . . 6 75 3.3.1. Receiving Queries . . . . . . . . . . . . . . . . . . 6 76 3.3.2. Sending Responses . . . . . . . . . . . . . . . . . . 6 77 3.4. TCP Session Management . . . . . . . . . . . . . . . . . 7 78 3.5. Non-Clean Paths . . . . . . . . . . . . . . . . . . . . . 8 79 3.6. Anycast Considerations . . . . . . . . . . . . . . . . . 8 80 4. Intermediary Considerations . . . . . . . . . . . . . . . . . 8 81 5. Security Considerations . . . . . . . . . . . . . . . . . . . 8 82 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 83 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 9 84 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 9 85 8.1. Normative References . . . . . . . . . . . . . . . . . . 9 86 8.2. Informative References . . . . . . . . . . . . . . . . . 10 87 Appendix A. Editors' Notes . . . . . . . . . . . . . . . . . . . 10 88 A.1. Abridged Change History . . . . . . . . . . . . . . . . . 10 89 A.1.1. draft-ietf-dnsop-edns-tcp-keepalive-03 . . . . . . . 10 90 A.1.2. draft-ietf-dnsop-edns-tcp-keepalive-02 . . . . . . . 11 91 A.1.3. draft-ietf-dnsop-edns-tcp-keepalive-01 . . . . . . . 11 92 A.1.4. draft-ietf-dnsop-edns-tcp-keepalive-00 . . . . . . . 11 93 A.1.5. draft-wouters-edns-tcp-keepalive-01 . . . . . . . . . 12 94 A.1.6. draft-wouters-edns-tcp-keepalive-00 . . . . . . . . . 12 95 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 12 97 1. Introduction 99 DNS messages between clients and servers may be received over either 100 UDP or TCP [RFC1035]. Historically, DNS clients used API's that only 101 facilitated sending and receiving a single query over either UDP or 102 TCP. New APIs and deployment of DNSSEC validating resolvers on hosts 103 that in the past were using stub resolving only is increasing the DNS 104 client base that prefer using long lived TCP connections. Long-lived 105 TCP connections can result in lower request latency than the case 106 where UDP transport is used and truncated responses are received, 107 since clients that have fallen back to TCP transport in response to a 108 truncated response typically only uses the TCP session for a single 109 (request, response) pair, continuing with UDP transport for 110 subsequent queries. Clients wishing to use other stream-based 111 transport protocols for DNS would also benefit from the set-up 112 amortisation afforded by long lived connections. 114 UDP transport is stateless, and hence presents a much lower resource 115 burden on a busy DNS server than TCP. An exchange of DNS messages 116 over UDP can also be completed in a single round trip between 117 communicating hosts, resulting in optimally-short transaction times. 118 UDP transport is not without its risks, however. 120 A single-datagram exchange over UDP between two hosts can be 121 exploited to enable a reflection attack on a third party. Response 122 Rate Limiting [RRL] is designed to help mitigate such attacks against 123 authoritative-only servers. One feature of RRL is to let some amount 124 of responses "slip" through the rate limiter. These are returned 125 with the TC (truncation) bit set, which causes legitimate clients to 126 re-query using TCP transport. 128 [RFC1035] specified a maximum DNS message size over UDP transport of 129 512 bytes. Deployment of DNSSEC [RFC4033] and other protocols 130 subsequently increased the observed frequency at which responses 131 exceed this limit. EDNS0 [RFC6891] allows DNS messages larger than 132 512 bytes to be exchanged over UDP, with a corresponding increased 133 incidence of fragmentation. Fragmentation is known to be problematic 134 in general, and has also been implicated in increasing the risk of 135 cache poisoning attacks [fragmentation-considered-poisonous]. 137 TCP transport is less susceptible to the risks of fragmentation and 138 reflection attacks. However, TCP transport as currently deployed has 139 expensive overhead. 141 The overhead of the three-way TCP handshake for a single DNS 142 transaction is substantial, increasing the transaction time for a 143 single (request, response) pair of DNS messages from 1 x RTT to 2 x 144 RTT. There is no such overhead for a session that is already 145 established, however, and the overall impact of the TCP setup 146 handshake when the resulting session is used to exchange N DNS 147 message pairs over a single session, (1 + N)/N, approaches unity as N 148 increases. 150 With increased deployment of DNSSEC and new RRtypes containing 151 application specific cryptographic material, there is an increase in 152 the prevalence of truncated responses received over UDP with fallback 153 to TCP. 155 (It should perhaps be noted that the overhead for a DNS transaction 156 over UDP truncated due to RRL is 3x RTT, higher than the overhead 157 imposed on the same transaction initiated over TCP.) 159 The use of TCP transport requires state to be retained on DNS 160 servers. If a server is to perform adequately with a significant 161 query load received over TCP, it must manage its available resources 162 to ensure that all established TCP sessions are well-used, and idle 163 connections are closed after an appropriate amount of time. 165 This document proposes a signalling mechanism between DNS clients and 166 servers that provides a means to better balance the use of UDP and 167 TCP transport (thereby helping to manage the impact of problems 168 associated with UDP), whilst constraining the impact of TCP on 169 response times and server resources to a manageable level. 171 This mechanism will be of benefit both for stub-resolver and 172 resolver-authoritative TCP connections. In the latter case the 173 persistent nature of the TCP connection can provide improved defence 174 against attacks including DDoS. 176 The reduced overhead of this extension adds up significantly when 177 combined with other EDNS0 extensions, such as [CHAIN-QUERY] and 178 [DNS-over-TLS]. For example, the combination of these EDNS0 179 extensions make it possible for hosts on high-latency mobile networks 180 to natively and efficiently perform DNSSEC validation and encrypt 181 queries. 183 2. Requirements Notation 185 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 186 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 187 document are to be interpreted as described in [RFC2119]. 189 3. The edns-tcp-keepalive Option 191 This document specifies a new EDNS0 [RFC6891] option, edns-tcp- 192 keepalive, which can be used by DNS clients and servers to signal a 193 willingness to keep an idle TCP session open for a certain amount of 194 time to conduct future DNS transactions. This specification does not 195 distinguish between different types of DNS client and server in the 196 use of this option. 198 3.1. Option Format 200 The edns-tcp-keepalive option is encoded as follows: 202 1 2 3 203 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 204 +-------------------------------+-------------------------------+ 205 ! OPTION-CODE ! OPTION-LENGTH ! 206 +-------------------------------+-------------------------------+ 207 | TIMEOUT ! 208 +-------------------------------+ 210 where: 212 OPTION-CODE: the EDNS0 option code assigned to edns-tcp-keepalive, 213 [TBD] 215 OPTION-LENGTH: the value 0 if the TIMEOUT is omitted, the value 2 216 if it is present; 218 TIMEOUT: an idle timeout value for the TCP connection, specified in 219 units of 100 milliseconds, encoded in network byte order. 221 3.2. Use by DNS Clients 223 3.2.1. Sending Queries 225 DNS clients MUST NOT include the edns-tcp-keepalive option in queries 226 sent using UDP transport. 228 DNS clients MAY include the edns-tcp-keepalive option in the first 229 query sent to a server using TCP transport to signal their desire to 230 keep the connection open when idle. 232 Clients MUST specify an OPTION-LENGTH of 0 and omit the TIMEOUT 233 value. 235 3.2.2. Receiving Responses 237 A DNS client that receives a response using UDP transport that 238 includes the edns-tcp-keepalive option MUST ignore the option. 240 A DNS client that receives a response using TCP transport that 241 includes the edns-tcp-keepalive option MAY keep the existing TCP 242 session open when it is idle. It SHOULD honour the timeout and 243 initiate close of the connection before the timeout expires. 245 A DNS client that receives a response that includes the edns-tcp- 246 keepalive option with a TIMEOUT value of 0 should send no more 247 queries on that connection and initiate closing the connection as 248 soon as it has received all outstanding responses. 250 A DNS client that sent a query containing the edns-keepalive-option 251 but receives a response that does not contain the edns-keepalive- 252 option should assume the server does not support keepalive and behave 253 following the guidance in [DRAFT-5966bis]. This holds true even if a 254 previous edns-keepalive-option exchange occurred on the existing TCP 255 connection. 257 3.3. Use by DNS Servers 259 3.3.1. Receiving Queries 261 A DNS server that receives a query using UDP transport that includes 262 the edns-tcp-keepalive option MUST ignore the option. 264 A DNS server that receives a query using TCP transport that includes 265 the edns-tcp-keepalive option MAY modify the local idle timeout 266 associated with that TCP session if resources permit. 268 3.3.2. Sending Responses 270 A DNS server that receives a query sent using TCP transport that 271 includes an OPT RR MAY include the edns-tcp-keepalive option in the 272 response to signal the expected idle timeout on a connection. 273 Servers MUST specify the TIMEOUT value that is currently associated 274 with the TCP session. It is reasonable for this value to change 275 according to local resource constraints or in consideration of 276 intermediary behaviour (for example TCP middleboxes or NATs). The 277 DNS server SHOULD send a edns-tcp-keepalive option with a timeout of 278 0 if it deems its local resources are too low to service more TCP 279 keepalive sessions, or if it wants clients to close currently open 280 connections. 282 3.4. TCP Session Management 284 Both DNS clients and servers are subject to resource constraints 285 which will limit the extent to which TCP sessions can persist. 286 Effective limits for the number of active sessions that can be 287 maintained on individual clients and servers should be established, 288 either as configuration options or by interrogation of process limits 289 imposed by the operating system. Servers that implement edns-tcp- 290 keepalive should also engage in TCP connection management by 291 recycling existing connections when appropriate, closing connections 292 gracefully and managing request queues to enable fair use. 294 In the event that there is greater demand for TCP sessions than can 295 be accommodated, servers may reduce the TIMEOUT value signalled in 296 successive DNS messages to minimise idle time on existing sessions. 297 This also allows, for example, clients with other candidate servers 298 to query to establish new TCP sessions with different servers in 299 expectation that an existing session is likely to be closed, or to 300 fall back to UDP. 302 Based on TCP session resources servers may signal a TIMEOUT value of 303 0 to request clients to close connections as soon as possible. This 304 is useful when server resources become very low or a denial-of- 305 service attack is detected and further maximises the shifting of 306 TIME_WAIT state to well-behaved clients. 308 However it should be noted that RCF6891 states: 310 Lack of presence of an OPT record in a request MUST be taken as an 311 indication that the requestor does not implement any part of this 312 specification and that the responder MUST NOT include an OPT 313 record in its response. 315 Since servers must be faithful to this specification even on a 316 persistent TCP connection it means that (following the initial 317 exchange of timeouts) a server may not be presented with the 318 opportunity to signal a change in the idle timeout associated with a 319 connection if the client does not send any further requests 320 containing EDNS0 OPT RRs. This limitation makes persistent 321 connection handling via an initial idle timeout signal more 322 attractive than a mechanism that establishes default persistence and 323 then uses a connection close signal (in a similar manner to HTTP 1.1 324 [RFC7320]). 326 DNS clients and servers MAY close a TCP session at any time in order 327 to manage local resource constraints. The algorithm by which clients 328 and servers rank active TCP sessions in order to determine which to 329 close is not specified in this document. 331 3.5. Non-Clean Paths 333 Many paths between DNS clients and servers suffer from poor hygiene, 334 limiting the free flow of DNS messages that include particular EDNS0 335 options, or messages that exceed a particular size. A fallback 336 strategy similar to that described in [RFC6891] section 6.2.2 SHOULD 337 be employed to avoid persistent interference due to non-clean paths. 339 3.6. Anycast Considerations 341 DNS servers of various types are commonly deployed using anycast 342 [RFC4786]. 344 Changes in network topology between clients and anycast servers may 345 cause disruption to TCP sessions making use of edns-tcp-keepalive 346 more often than with TCP sessions that omit it, since the TCP 347 sessions are expected to be longer-lived. Anycast servers MAY make 348 use of TCP multipath [RFC6824] to anchor the server side of the TCP 349 connection to an unambiguously-unicast address in order to avoid 350 disruption due to topology changes. 352 4. Intermediary Considerations 354 It is RECOMMENDED that DNS intermediaries which terminate TCP 355 connections implement edns-tcp-keepalive. An intermediary that does 356 not implement edns-tcp-keepalive but sits between a client and server 357 that both support edns-tcp-keepalive might close idle connections 358 unnecessarily. 360 5. Security Considerations 361 The edns-tcp-keepalive option can potentially be abused to request 362 large numbers of sessions in a quick burst. When a Nameserver 363 detects abusive behaviour, it SHOULD immediately close the TCP 364 connection and free the resources used. 366 Servers could choose to monitor client behaviour with respect to the 367 edns-tcp-keepalive option to build up profiles of clients that do not 368 honour the specified timeout. 370 Readers are advised to familiarise themselves with the security 371 considerations outlined in [DRAFT-5966bis] 373 6. IANA Considerations 375 The IANA is directed to assign an EDNS0 option code for the edns-tcp- 376 keepalive option from the DNS EDNS0 Option Codes (OPT) registry as 377 follows: 379 +-------+--------------------+----------+-----------------+ 380 | Value | Name | Status | Reference | 381 +-------+--------------------+----------+-----------------+ 382 | [TBA] | edns-tcp-keepalive | Optional | [This document] | 383 +-------+--------------------+----------+-----------------+ 385 7. Acknowledgements 387 The authors acknowledge the contributions of Jinmei TATUYA and Mark 388 Andrews. Thanks to Duane Wessels for detailed review and the many 389 others who contributed to the mailing list discussion. 391 8. References 393 8.1. Normative References 395 [RFC1035] Mockapetris, P., "Domain names - implementation and 396 specification", STD 13, RFC 1035, November 1987. 398 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 399 Requirement Levels", BCP 14, RFC 2119, March 1997. 401 [RFC4033] Arends, R., Austein, R., Larson, M., Massey, D., and S. 402 Rose, "DNS Security Introduction and Requirements", RFC 403 4033, March 2005. 405 [RFC4786] Abley, J. and K. Lindqvist, "Operation of Anycast 406 Services", BCP 126, RFC 4786, December 2006. 408 [RFC5966] Bellis, R., "DNS Transport over TCP - Implementation 409 Requirements", RFC 5966, August 2010. 411 [RFC6824] Ford, A., Raiciu, C., Handley, M., and O. Bonaventure, 412 "TCP Extensions for Multipath Operation with Multiple 413 Addresses", RFC 6824, January 2013. 415 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 416 for DNS (EDNS(0))", STD 75, RFC 6891, April 2013. 418 [RFC7320] Nottingham, M., "URI Design and Ownership", BCP 190, RFC 419 7320, July 2014. 421 8.2. Informative References 423 [CHAIN-QUERY] 424 Wouters, P., "Chain Query requests in DNS", draft-ietf- 425 dnsop-edns-chain-query (work in progress), March 2015. 427 [DNS-over-TLS] 428 Hu, Z., Zhu, L., Heidemann, J., Mankin, A., Wessels, D., 429 and P. Hoffman, "TLS for DNS: Initiation and Performance 430 Considerations", draft-ietf-dprive-dns-over-tls-00 (work 431 in progress), September 2015. 433 [DRAFT-5966bis] 434 Dickinson, J., Dickinson, S., Bellis, R., Mankin, A., and 435 D. Wessels, "DNS Transport over TCP - Implementation 436 Requirements", draft-ietf-dnsop-5966bis-03 (work in 437 progress), September 2015. 439 [RRL] Vixie, P. and V. Schryver, "DNS Response Rate Limiting 440 (DNS RRL)", ISC-TN 2012-1-Draft1, April 2012. 442 [fragmentation-considered-poisonous] 443 Herzberg, A. and H. Shulman, "Fragmentation Considered 444 Poisonous", arXiv 1205.4011, May 2012. 446 Appendix A. Editors' Notes 448 A.1. Abridged Change History 450 A.1.1. draft-ietf-dnsop-edns-tcp-keepalive-03 452 Clarified that a response to a query with any OPT RR may contain the 453 ends-tcp-keepalive option. 455 Corrected TIMEOUT length from 4 to 2 in the diagram. 457 Updated references, including name change of [STARTTLS] -> [DNS-over- 458 TLS] and adding reference for cache poisoning. 460 Updated wording in section on Intermediary Considerations. 462 Updated wording describing RRL. 464 Added paragraph to security section describing client behaviour 465 profiles. 467 Added wording to introduction on use case for stub/resolver/ 468 authoritative. 470 A.1.2. draft-ietf-dnsop-edns-tcp-keepalive-02 472 Changed timeout value to idle timeout and re-phrased document around 473 this. 475 Changed units of timeout to 100ms to allow values less than 1 second. 477 Change specification to remove use of the option over UDP. This is 478 potentially confusing, could cause issues with ALG's and adds only 479 limited value. 481 Changed semantics so the client no longer sends a timeout. The 482 client timeout is of limited value as servers should be managing 483 connections based on their view of their resources, not on client 484 requests as this is open to abuse. Additionally this identifies 485 cases were the option is simply being reflected back. 487 Changed semantics for the meaning of a server sending a timeout of 0. 488 The maximum timeout value of 6553.5s (~1.8h) is already large and a 489 distinct 'connection close'-like signal is potentially more useful. 491 Added more detail on server side requirements when supporting 492 keepalive in terms of resource and connection management. 494 Added discussion of EDNS0 per-message limitation and implications of 495 this. 497 Added reference to STARTTLS draft and RFC7320. 499 A.1.3. draft-ietf-dnsop-edns-tcp-keepalive-01 501 Version bump with no changes 503 A.1.4. draft-ietf-dnsop-edns-tcp-keepalive-00 504 Clarifications, working group adoption. 506 A.1.5. draft-wouters-edns-tcp-keepalive-01 508 Also allow clients to specify KEEPALIVE timeout values, clarify 509 motivation of document. 511 A.1.6. draft-wouters-edns-tcp-keepalive-00 513 Initial draft. 515 Authors' Addresses 517 Paul Wouters 518 Red Hat 520 Email: pwouters@redhat.com 522 Joe Abley 523 Dyn, Inc. 524 470 Moore Street 525 London, ON N6C 2C2 526 Canada 528 Phone: +1 519 670 9327 529 Email: jabley@dyn.com 531 Sara Dickinson 532 Sinodun Internet Technologies 533 Magdalen Centre 534 Oxford Science Park 535 Oxford OX4 4GA 536 UK 538 Email: sara@sinodun.com 539 URI: http://sinodun.com 540 Ray Bellis 541 Internet Systems Consortium, Inc 542 950 Charter Street 543 Redwood City CA 94063 544 USA 546 Phone: +1 650 423 1200 547 Email: ray@isc.org 548 URI: http://www.isc.org