idnits 2.17.1 draft-ietf-dnsop-avoid-fragmentation-02.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 seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords -- however, there's a paragraph with a matching beginning. Boilerplate error? (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (September 15, 2020) is 1320 days in the past. Is this intentional? Checking references for intended status: Best Current Practice ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Informational RFC: RFC 3542 ** Downref: Normative reference to an Informational RFC: RFC 7739 ** Obsolete normative reference: RFC 8499 (Obsoleted by RFC 9499) Summary: 3 errors (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group K. Fujiwara 3 Internet-Draft JPRS 4 Intended status: Best Current Practice P. Vixie 5 Expires: March 19, 2021 Farsight 6 September 15, 2020 8 Fragmentation Avoidance in DNS 9 draft-ietf-dnsop-avoid-fragmentation-02 11 Abstract 13 EDNS0 enables a DNS server to send large responses using UDP and is 14 widely deployed. Path MTU discovery remains widely undeployed due to 15 security issues, and IP fragmentation has exposed weaknesses in 16 application protocols. Currently, DNS is known to be the largest 17 user of IP fragmentation. It is possible to avoid IP fragmentation 18 in DNS by limiting response size where possible, and signaling the 19 need to upgrade from UDP to TCP transport where necessary. This 20 document proposes to avoid IP fragmentation in DNS. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at https://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on March 19, 2021. 39 Copyright Notice 41 Copyright (c) 2020 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (https://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 57 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 58 3. Proposal to avoid IP fragmentation in DNS . . . . . . . . . . 4 59 3.1. Recommendations for UDP requestors . . . . . . . . . . . 4 60 3.2. Recommendations for UDP responders . . . . . . . . . . . 4 61 4. Maximum DNS/UDP payload size . . . . . . . . . . . . . . . . 5 62 5. Incremental deployment . . . . . . . . . . . . . . . . . . . 6 63 6. Request to zone operators and DNS server operators . . . . . 6 64 7. Considerations . . . . . . . . . . . . . . . . . . . . . . . 6 65 7.1. Protocol compliance . . . . . . . . . . . . . . . . . . . 6 66 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 67 9. Security Considerations . . . . . . . . . . . . . . . . . . . 7 68 10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 7 69 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 70 11.1. Normative References . . . . . . . . . . . . . . . . . . 7 71 11.2. Informative References . . . . . . . . . . . . . . . . . 8 72 Appendix A. How to retrieve path MTU value to a destination from 73 applications . . . . . . . . . . . . . . . . . . . . 9 74 Appendix B. Minimal-responses . . . . . . . . . . . . . . . . . 9 75 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 9 77 1. Introduction 79 DNS has EDNS0 [RFC6891] mechanism. It enables a DNS server to send 80 large responses using UDP. EDNS0 is now widely deployed, and DNS 81 (over UDP) is said to be the biggest user of IP fragmentation. 83 However, "Fragmentation Considered Poisonous" [Herzberg2013] proposed 84 effective off-path DNS cache poisoning attack vectors using IP 85 fragmentation. "IP fragmentation attack on DNS" [Hlavacek2013] and 86 "Domain Validation++ For MitM-Resilient PKI" [Brandt2018] proposed 87 that off-path attackers can intervene in path MTU discovery [RFC1191] 88 to perform intentionally fragmented responses from authoritative 89 servers. [RFC7739] stated the security implications of predictable 90 fragment identification values. 92 DNSSEC is a countermeasure against cache poisoning attacks that use 93 IP fragmentation. However, DNS delegation responses are not signed 94 with DNSSEC, and DNSSEC does not have a mechanism to get the correct 95 response if an incorrect delegation is injected. This is a denial- 96 of-service vulnerability that can yield failed name resolutions. If 97 cache poisoning attacks can be avoided, DNSSEC validation failures 98 will be avoided. 100 In Section 3.2 (Message Side Guidelines) of UDP Usage Guidelines 101 [RFC8085] we are told that an application SHOULD NOT send UDP 102 datagrams that result in IP packets that exceed the Maximum 103 Transmission Unit (MTU) along the path to the destination. 105 A DNS message receiver cannot trust fragmented UDP datagrams 106 primarily due to the small amount of entropy provided by UDP port 107 numbers and DNS message identifiers, each of which being only 16 bits 108 in size, and both likely being in the first fragment of a packet, if 109 fragmentation occurs. By comparison, TCP protocol stack controls 110 packet size and avoid IP fragmentation under ICMP NEEDFRAG attacks. 111 In TCP, fragmentation should be avoided for performance reasons, 112 whereas for UDP, fragmentation should be avoided for resiliency and 113 authenticity reasons. 115 [RFC8900] summarized that IP fragmentation introduces fragility to 116 Internet communication. The transport of DNS messages over UDP 117 should take account of the observations stated in that document. 119 TCP avoids fragmentation using its Maximum Segment Size (MSS) 120 parameter, but each transmitted segment is header-size aware such 121 that the size of the IP and TCP headers is known, as well as the far 122 end's MSS parameter and the interface or path MTU, so that the 123 segment size can be chosen so as to keep the each IP datagram below a 124 target size. This takes advantage of the elasticity of TCP's 125 packetizing process as to how much queued data will fit into the next 126 segment. In contrast, DNS over UDP has little datagram size 127 elasticity and lacks insight into IP header and option size, and so 128 must make more conservative estimates about available UDP payload 129 space. 131 This document proposes to avoid IP fragmentation in DNS/UDP. 133 2. Terminology 135 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 136 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 137 "OPTIONAL" in this document are to be interpreted as described in 138 BCP14 [RFC2119] [RFC8174] when, and only when, they appear in all 139 capitals, as shown here. 141 "Requestor" refers to the side that sends a request. "Responder" 142 refers to an authoritative, recursive resolver or other DNS component 143 that responds to questions. (Quoted from EDNS0 [RFC6891]) 144 "Path MTU" is the minimum link MTU of all the links in a path between 145 a source node and a destination node. (Quoted from [RFC8201]) 147 "Path MTU discovery" is defined by [RFC1191], [RFC8201] and 148 [RFC8899]. 150 Many of the specialized terms used in this document are defined in 151 DNS Terminology [RFC8499]. 153 3. Proposal to avoid IP fragmentation in DNS 155 The methods to avoid IP fragmentation in DNS are described below: 157 3.1. Recommendations for UDP requestors 159 o UDP requestors SHOULD send DNS responses with IP_DONTFRAG / 160 IPV6_DONTFRAG [RFC3542] options. 162 o UDP requestors MAY probe to discover the real MTU value per 163 destination. If the path MTU discovery failed or is impossible, 164 use the default path MTU described in Section 4. 166 o UDP reqoestors SHOULD use the requestor's payload size to limit 167 the path MTU value minus the IP header length and UDP header 168 length. Of course, as in the conventional case, a specified value 169 (1220 or 1232) as the requestor's payload size may be used. 171 o UDP requestors MAY drop fragmented DNS/UDP responses without IP 172 reassembly to avoid cache poisoning attacks. 174 o DNS responses may be dropped by IP fragmentation. Upon a timeout, 175 UDP requestors may retry using TCP or UDP, per local policy. 177 3.2. Recommendations for UDP responders 179 o UDP responders SHOULD send DNS responses with IP_DONTFRAG / 180 IPV6_DONTFRAG [RFC3542] options. 182 o UDP responders MAY probe to discover the real MTU value per 183 destination. If the path MTU discovery failed or is impossible, 184 use the default path MTU described in Section 4. 186 o UDP responders SHOULD compose UDP responses that result in IP 187 packets that do not exceed the path MTU to the requestor. Of 188 course, as in the conventional case, a specified value (1220 or 189 1232) as the DNS packet size limit may be used. 191 The cause and effect of the TC bit is unchanged from EDNS0 192 [RFC6891]. 194 4. Maximum DNS/UDP payload size 196 Default path MTU value for IPv6 is XXXX. Default path MTU value for 197 IPv4 is XXXX. 199 Discussions under here will be deleted when the discussion is over. 200 There are many discussions for default path MTU values. 202 o The minimum MTU for an IPv6 interface is 1280 octets (see 203 Section 5 of [RFC8200]). Then, we can use it as default path MTU 204 value for IPv6. 206 o Most of the Internet and especially the inner core has an MTU of 207 at least 1500 octets. An operator of a full resolver would be 208 well advised to measure their path MTU to several authority name 209 servers and to a random sample of their expected stub resolver 210 client networks, to find the upper boundary on IP/UDP packet size 211 in the average case. This limit should not be exceeded by most 212 messages received or transmitted by a full resolver, or else 213 fallback to TCP will occur too often. An operator of 214 authoritative servers would also be well advised to measure their 215 path MTU to several full-service resolvers. The Linux tool 216 "tracepath" can be used to measure the path MTU to well known 217 authority name servers such as [a-m].root-servers.net or [a- 218 m].gtld-servers.net. If the reported path MTU is for example no 219 smaller than 1460, then the maximum DNS/UDP payload would be 1432 220 for IP4 (which is 1460 - IP4 header(20) - UDP header(8)) and 1412 221 for IP6 (which is 1460 - IP6 header(40) - UDP header(8)). To 222 allow for possible IP options and distant tunnel overhead, a 223 useful default for maximum DNS/UDP payload size would be 1400. 225 o [RFC4035] defines that "A security-aware name server MUST support 226 the EDNS0 message size extension, MUST support a message size of 227 at least 1220 octets". Then, the smallest number of the maximum 228 DNS/UDP payload size is 1220. 230 o DNS flag day 2020 proposed 1232 as an EDNS buffer size. 231 [DNSFlagDay2020] By the above reasoning, this proposal is either 232 too small or too large. 234 It is considered that these arguments are diverted from IPv6 235 values because most IPv4 links have path MTU values larger than or 236 equal to the minimum MTU value of IPv6. 238 5. Incremental deployment 240 The proposed method supports incremental deployment. 242 When a full-service resolver implements the proposed method, its stub 243 resolvers (clients) and the authority server network will no longer 244 observe IP fragmentation or reassembly from that server, and will 245 fall back to TCP when necessary. 247 When an authoritative server implements the proposed method, its full 248 service resolvers (clients) will no longer observe IP fragmentation 249 or reassembly from that server, and will fall back to TCP when 250 necessary. 252 6. Request to zone operators and DNS server operators 254 Large DNS responses are the result of zone configuration. Zone 255 operators SHOULD seek configurations resulting in small responses. 256 For example, 258 o Use smaller number of name servers (13 may be too large) 260 o Use smaller number of A/AAAA RRs for a domain name 262 o Use 'minimal-responses' configuration: Some implementations have 263 'minimal responses' configuration that causes DNS servers to make 264 response packets smaller, containing only mandatory and required 265 data (Appendix B). 267 o Use smaller signature / public key size algorithm for DNSSEC. 268 Notably, the signature size of ECDSA or EdDSA is smaller than RSA. 270 7. Considerations 272 7.1. Protocol compliance 274 In prior research ([Fujiwara2018] and dns-operations mailing list 275 discussions), there are some authoritative servers that ignore EDNS0 276 requestor's UDP payload size, and return large UDP responses. 278 It is also well known that there are some authoritative servers that 279 do not support TCP transport. 281 Such non-compliant behavior cannot become implementation or 282 configuration constraints for the rest of the DNS. If failure is the 283 result, then that failure must be localized to the non-compliant 284 servers. 286 8. IANA Considerations 288 This document has no IANA actions. 290 9. Security Considerations 292 10. Acknowledgments 294 The author would like to specifically thank Paul Wouters, Mukund 295 Sivaraman and Tony Finch for extensive review and comments. 297 11. References 299 11.1. Normative References 301 [RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, 302 DOI 10.17487/RFC1191, November 1990, 303 . 305 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 306 Requirement Levels", BCP 14, RFC 2119, 307 DOI 10.17487/RFC2119, March 1997, 308 . 310 [RFC3542] Stevens, W., Thomas, M., Nordmark, E., and T. Jinmei, 311 "Advanced Sockets Application Program Interface (API) for 312 IPv6", RFC 3542, DOI 10.17487/RFC3542, May 2003, 313 . 315 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 316 Rose, "Protocol Modifications for the DNS Security 317 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005, 318 . 320 [RFC5155] Laurie, B., Sisson, G., Arends, R., and D. Blacka, "DNS 321 Security (DNSSEC) Hashed Authenticated Denial of 322 Existence", RFC 5155, DOI 10.17487/RFC5155, March 2008, 323 . 325 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 326 for DNS (EDNS(0))", STD 75, RFC 6891, 327 DOI 10.17487/RFC6891, April 2013, 328 . 330 [RFC7739] Gont, F., "Security Implications of Predictable Fragment 331 Identification Values", RFC 7739, DOI 10.17487/RFC7739, 332 February 2016, . 334 [RFC8085] Eggert, L., Fairhurst, G., and G. Shepherd, "UDP Usage 335 Guidelines", BCP 145, RFC 8085, DOI 10.17487/RFC8085, 336 March 2017, . 338 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 339 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 340 May 2017, . 342 [RFC8200] Deering, S. and R. Hinden, "Internet Protocol, Version 6 343 (IPv6) Specification", STD 86, RFC 8200, 344 DOI 10.17487/RFC8200, July 2017, 345 . 347 [RFC8201] McCann, J., Deering, S., Mogul, J., and R. Hinden, Ed., 348 "Path MTU Discovery for IP version 6", STD 87, RFC 8201, 349 DOI 10.17487/RFC8201, July 2017, 350 . 352 [RFC8499] Hoffman, P., Sullivan, A., and K. Fujiwara, "DNS 353 Terminology", BCP 219, RFC 8499, DOI 10.17487/RFC8499, 354 January 2019, . 356 [RFC8899] Fairhurst, G., Jones, T., Tuexen, M., Ruengeler, I., and 357 T. Voelker, "Packetization Layer Path MTU Discovery for 358 Datagram Transports", RFC 8899, DOI 10.17487/RFC8899, 359 September 2020, . 361 [RFC8900] Bonica, R., Baker, F., Huston, G., Hinden, B., Troan, O., 362 and F. Gont, "IP Fragmentation Considered Fragile", 363 BCP 230, RFC 8900, DOI 10.17487/RFC8900, September 2020, 364 . 366 11.2. Informative References 368 [Brandt2018] 369 Brandt, M., Dai, T., Klein, A., Shulman, H., and M. 370 Waidner, "Domain Validation++ For MitM-Resilient PKI", 371 Proceedings of the 2018 ACM SIGSAC Conference on Computer 372 and Communications Security , 2018. 374 [DNSFlagDay2020] 375 "DNS flag day 2020", n.d., . 377 [Fujiwara2018] 378 Fujiwara, K., "Measures against cache poisoning attacks 379 using IP fragmentation in DNS", OARC 30 Workshop , 2019. 381 [Herzberg2013] 382 Herzberg, A. and H. Shulman, "Fragmentation Considered 383 Poisonous", IEEE Conference on Communications and Network 384 Security , 2013. 386 [Hlavacek2013] 387 Hlavacek, T., "IP fragmentation attack on DNS", RIPE 67 388 Meeting , 2013, . 391 Appendix A. How to retrieve path MTU value to a destination from 392 applications 394 Socket options: "IP_MTU (since Linux 2.2) Retrieve the current known 395 path MTU of the current socket. Valid only when the socket has been 396 connected. Returns an integer. Only valid as a getsockopt(2)." 397 (Quoted from Debian GNU Linux manual: ip(7)) 399 "IPV6_MTU getsockopt(): Retrieve the current known path MTU of the 400 current socket. Only valid when the socket has been connected. 401 Returns an integer." (Quoted from Debian GNU Linux manual: ipv6(7)) 403 Appendix B. Minimal-responses 405 Some implementations have 'minimal responses' configuration that 406 causes a DNS server to make response packets smaller, containing only 407 mandatory and required data. 409 Under the minimal-responses configuration, DNS servers compose 410 response messages using only RRSets corresponding to queries. In 411 case of delegation, DNS servers compose response packets with 412 delegation NS RRSet in authority section and in-domain (in-zone and 413 below-zone) glue in the additional data section. In case of non- 414 existent domain name or non-existent type, the start of authority 415 (SOA RR) will be placed in the Authority Section. 417 In addition, if the zone is DNSSEC signed and a query has the DNSSEC 418 OK bit, signatures are added in answer section, or the corresponding 419 DS RRSet and signatures are added in authority section. Details are 420 defined in [RFC4035] and [RFC5155]. 422 Authors' Addresses 423 Kazunori Fujiwara 424 Japan Registry Services Co., Ltd. 425 Chiyoda First Bldg. East 13F, 3-8-1 Nishi-Kanda 426 Chiyoda-ku, Tokyo 101-0065 427 Japan 429 Phone: +81 3 5215 8451 430 Email: fujiwara@jprs.co.jp 432 Paul Vixie 433 Farsight Security Inc 434 177 Bovet Road, Suite 180 435 San Mateo, CA 94402 436 United States of America 438 Phone: +1 650 393 3994 439 Email: vixie@fsi.io