idnits 2.17.00 (12 Aug 2021) /tmp/idnits41947/draft-ietf-dnsop-edns-client-subnet-07.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 : ---------------------------------------------------------------------------- == There are 1 instance of lines with private range IPv4 addresses in the document. If these are generic example addresses, they should be changed to use any of the ranges defined in RFC 6890 (or successor): 192.0.2.x, 198.51.100.x or 203.0.113.x. -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 21, 2016) is 2252 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 1700 (Obsoleted by RFC 3232) == Outdated reference: draft-hardie-privsec-metadata-insertion has been published as RFC 8165 -- Obsolete informational reference (is this intentional?): RFC 7719 (Obsoleted by RFC 8499) Summary: 1 error (**), 0 flaws (~~), 3 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 dnsop C. Contavalli 3 Internet-Draft W. van der Gaast 4 Intended status: Informational Google 5 Expires: September 22, 2016 D. Lawrence 6 Akamai Technologies 7 W. Kumari 8 Google 9 March 21, 2016 11 Client Subnet in DNS Queries 12 draft-ietf-dnsop-edns-client-subnet-07 14 Abstract 16 This document describes an EDNS0 extension that is in active use to 17 carry information about the network that originated a DNS query, and 18 the network for which the subsequent response can be cached. Since 19 it has some known operational and privacy shortcomings, a revision 20 will be worked through the IETF for improvement. 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 http://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 September 22, 2016. 39 Copyright Notice 41 Copyright (c) 2016 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 (http://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 . . . . . . . . . . . . . . . . . . . . . . . . 3 57 2. Privacy Note . . . . . . . . . . . . . . . . . . . . . . . . 4 58 3. Requirements Notation . . . . . . . . . . . . . . . . . . . . 4 59 4. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 60 5. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 6 61 6. Option Format . . . . . . . . . . . . . . . . . . . . . . . . 7 62 7. Protocol Description . . . . . . . . . . . . . . . . . . . . 8 63 7.1. Originating the Option . . . . . . . . . . . . . . . . . 8 64 7.1.1. Recursive Resolvers . . . . . . . . . . . . . . . . . 8 65 7.1.2. Stub Resolvers . . . . . . . . . . . . . . . . . . . 9 66 7.1.3. Forwarding Resolvers . . . . . . . . . . . . . . . . 9 67 7.2. Generating a Response . . . . . . . . . . . . . . . . . . 10 68 7.2.1. Authoritative Nameserver . . . . . . . . . . . . . . 10 69 7.2.2. Intermediate Nameserver . . . . . . . . . . . . . . . 12 70 7.3. Handling ECS Responses and Caching . . . . . . . . . . . 13 71 7.3.1. Caching the Response . . . . . . . . . . . . . . . . 13 72 7.3.2. Answering from Cache . . . . . . . . . . . . . . . . 14 73 7.4. Delegations and Negative Answers . . . . . . . . . . . . 15 74 7.5. Transitivity . . . . . . . . . . . . . . . . . . . . . . 16 75 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 76 9. DNSSEC Considerations . . . . . . . . . . . . . . . . . . . . 17 77 10. NAT Considerations . . . . . . . . . . . . . . . . . . . . . 17 78 11. Security Considerations . . . . . . . . . . . . . . . . . . . 18 79 11.1. Privacy . . . . . . . . . . . . . . . . . . . . . . . . 18 80 11.2. Birthday Attacks . . . . . . . . . . . . . . . . . . . . 19 81 11.3. Cache Pollution . . . . . . . . . . . . . . . . . . . . 20 82 12. Sending the Option . . . . . . . . . . . . . . . . . . . . . 21 83 12.1. Probing . . . . . . . . . . . . . . . . . . . . . . . . 21 84 12.2. Whitelist . . . . . . . . . . . . . . . . . . . . . . . 22 85 13. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 86 14. Contributing Authors . . . . . . . . . . . . . . . . . . . . 24 87 15. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 24 88 16. References . . . . . . . . . . . . . . . . . . . . . . . . . 25 89 16.1. Normative References . . . . . . . . . . . . . . . . . . 25 90 16.2. Informative References . . . . . . . . . . . . . . . . . 26 91 Appendix A. Document History . . . . . . . . . . . . . . . . . . 27 92 A.1. -00 . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 93 A.2. -01 . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 94 A.3. -02 . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 95 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 31 97 1. Introduction 99 Many Authoritative Nameservers today return different responses based 100 on the perceived topological location of the user. These servers use 101 the IP address of the incoming query to identify that location. 102 Since most queries come from intermediate Recursive Resolvers, the 103 source address is that of the Recursive Resolver rather than of the 104 query originator. 106 Traditionally, and probably still in the majority of instances, 107 Recursive Resolvers are reasonably close in the topological sense to 108 the Stub Resolvers or Forwarding Resolvers that are the source of 109 queries. For these resolvers, using their own IP address is 110 sufficient for Authoritative Nameservers that tailor responses based 111 upon location of the querier. 113 Increasingly, though, a class of Recursive Resolvers has arisen that 114 handle query sources that are often not topologically close. The 115 motivation for having such Centralized Resolvers varies but is 116 usually because of some enhanced experience, such as greater cache 117 security or applying policies regarding where users may connect. 118 (Although political censorship usually comes to mind here, the same 119 actions may be used by a parent when setting controls on where a 120 minor may connect.) Similarly, many ISPs and other organizations use 121 a Centralized Resolver infrastructure that can be distant from the 122 clients the resolvers serve. These cases all lead to less than 123 desirable responses from topology-sensitive Authoritative 124 Nameservers. 126 This document defines an EDNS0 [RFC6891] option to convey network 127 information that is relevant to the DNS message. It will carry 128 sufficient network information about the originator for the 129 Authoritative Nameserver to tailor responses. It will also provide 130 for the Authoritative Nameserver to indicate the scope of network 131 addresses for which the tailored answer is intended. This EDNS0 132 option is intended for those Recursive Resolvers and Authoritative 133 Nameservers that would benefit from the extension and not for general 134 purpose deployment. It is completely optional and can safely be 135 ignored by servers that choose not to implement it or enable it. 137 This document also includes guidelines on how to best cache those 138 results and provides recommendations on when this protocol extension 139 should be used. 141 At least a dozen different client and server implementations have 142 been written based on earlier versions of this specification. The 143 protocol is in active production use today. While the 144 implementations interoperate, there is varying behavior around edge 145 cases that were poorly specified. Known incompatibilities are 146 described in this document, and the authors believe that it is better 147 to describe the system as it is working today, even if not everyone 148 agrees with the details of the original specification ( 149 [I-D.vandergaast-edns-client-subnet]). The alternative is an 150 undocumented and proprietary system. 152 A revised proposal to improve upon the minor flaws in this protocol 153 will be forthcoming to the IETF. 155 2. Privacy Note 157 If we were just beginning to design this mechanism, and not 158 documenting existing protocol, it is unlikely that we would have done 159 things exactly this way. 161 The IETF is actively working on enhancing DNS privacy 162 [DPRIVE_Working_Group], and the re-injection of metadata has been 163 identified as a problematic design pattern 164 [I-D.hardie-privsec-metadata-insertion] 166 As noted above, however, this document primarily describes existing 167 behavior of a deployed method, to further the understanding of the 168 Internet community. 170 We recommend that the feature be turned off by default in all 171 nameserver software, and that operators only enable it explicitly in 172 those circumstances where it provides a clear benefit for their 173 clients. We also encourage the deployment of means to allow users to 174 make use of the opt-out provided. Finally, we recommend that others 175 avoid techniques that may introduce additional metadata in future 176 work, as it may damage user trust. 178 Regrettably, support for the opt-out provisions of this specification 179 are currently limited. Only one stub resolver, getdns, is known to 180 be able to originate queries with anonymity requested, and as yet no 181 applications are known to be able to indicate that user preference to 182 the stub resolver. 184 3. Requirements Notation 186 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 187 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 188 document are to be interpreted as described in [RFC2119]. 190 4. Terminology 192 ECS: EDNS Client Subnet. 194 Client: A Stub Resolver, Forwarding Resolver, or Recursive Resolver. 195 A client to a Recursive Resolver or a Forwarding Resolver. 197 Server: A Forwarding Resolver, Recursive Resolver or Authoritative 198 Nameserver. 200 Stub Resolver: A simple DNS protocol implementation on the client 201 side as described in [RFC1034] section 5.3.1. A client to a 202 Recursive Resolver or a Forwarding Resolver. 204 Authoritative Nameserver: A nameserver that has authority over one 205 or more DNS zones. These are normally not contacted by Stub 206 Resolver or end user clients directly but by Recursive Resolvers. 207 Described in [RFC1035] Section 6. 209 Recursive Resolver: A nameserver that is responsible for resolving 210 domain names for clients by following the domain's delegation 211 chain. Recursive Resolvers frequently use caches to be able to 212 respond to client queries quickly. Described in [RFC1035] 213 Section 7. 215 Forwarding Resolver: A nameserver that does not do iterative 216 resolution itself, but instead passes that responsibility to 217 another Recursive Resolver, called a "Forwarder" in [RFC2308] 218 section 1. 220 Intermediate Nameserver: Any nameserver in between the Stub Resolver 221 and the Authoritative Nameserver, such as a Recursive Resolver or 222 a Forwarding Resolver. 224 Centralized Resolvers: Intermediate Nameservers that serve a 225 topologically diverse network address space. 227 Tailored Response: A response from a nameserver that is customized 228 for the node that sent the query, often based on performance (i.e. 229 lowest latency, least number of hops, topological distance, ...). 231 Topologically Close: Refers to two hosts being close in terms of 232 number of hops or time it takes for a packet to travel from one 233 host to the other. The concept of topological distance is only 234 loosely related to the concept of geographical distance: two 235 geographically close hosts can still be very distant from a 236 topological perspective, and two geographically distant hosts can 237 be quite close on the network. 239 For a more comprehensive treatment of these DNS terms, please see 240 [RFC7719]. 242 5. Overview 244 The general idea of this document is to provide an EDNS0 option to 245 allow Recursive Resolvers, if they are willing, to forward details 246 about the origin network from which a query is coming when talking to 247 other Nameservers. 249 The format of the edns-client-subnet (ECS) EDNS0 option is described 250 in Section 6, and is meant to be added in queries sent by 251 Intermediate Nameservers in a way transparent to Stub Resolvers and 252 end users, as described in Section 7.1. ECS is only defined for the 253 Internet (IN) DNS class. 255 As described in Section 7.2, an Authoritative Nameserver could use 256 ECS as a hint to the network location of the end user and provide a 257 better answer. Its response would also contain an ECS option, 258 clearly indicating that the server made use of this information, and 259 that the answer is tied to the network of the client. 261 As described in Section 7.3, Intermediate Nameservers would use this 262 information to cache the response. 264 Some Intermediate Nameservers may also have to be able to forward ECS 265 queries they receive. This is described in Section 7.5. 267 The mechanisms provided by ECS raise various security related 268 concerns related to cache growth, the ability to spoof EDNS0 options, 269 and privacy. Section 11 explores various mitigation techniques. 271 The expectation, however, is that this option will primarily be used 272 between Recursive Resolvers and Authoritative Nameservers that are 273 sensitive to network location issues. Most Recursive Resolvers, 274 Authoritative Nameservers and Stub Resolvers will never need to know 275 about this option, and will continue working as they had been. 277 Failure to support this option or its improper handling will, at 278 worst, cause suboptimal identification of client network location, 279 which is a common occurrence in current content delivery network 280 (CDN) setups. 282 Section 7.1 also provides a mechanism for Stub Resolvers to signal 283 Recursive Resolvers that they do not want ECS treatment for specific 284 queries. 286 Additionally, operators of Intermediate Nameservers with ECS enabled 287 are allowed to choose how many bits of the address of received 288 queries to forward, or to reduce the number of bits forwarded for 289 queries already including an ECS option. 291 6. Option Format 293 This protocol uses an EDNS0 [RFC6891]) option to include client 294 address information in DNS messages. The option is structured as 295 follows: 297 +0 (MSB) +1 (LSB) 298 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 299 0: | OPTION-CODE | 300 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 301 2: | OPTION-LENGTH | 302 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 303 4: | FAMILY | 304 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 305 6: | SOURCE PREFIX-LENGTH | SCOPE PREFIX-LENGTH | 306 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 307 8: | ADDRESS... / 308 +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 310 o (Defined in [RFC6891]) OPTION-CODE, 2 octets, for ECS is 8 (0x00 311 0x08). 313 o (Defined in [RFC6891]) OPTION-LENGTH, 2 octets, contains the 314 length of the payload (everything after OPTION-LENGTH) in octets. 316 o FAMILY, 2 octets, indicates the family of the address contained in 317 the option, using address family codes as assigned by IANA in 318 Address Family Numbers [Address_Family_Numbers]. 320 The format of the address part depends on the value of FAMILY. This 321 document only defines the format for FAMILY 1 (IP version 4) and 2 322 (IP version 6), which are as follows: 324 o SOURCE PREFIX-LENGTH, an unsigned octet representing the leftmost 325 number of significant bits of ADDRESS to be used for the lookup. 326 In responses, it mirrors the same value as in the queries. 328 o SCOPE PREFIX-LENGTH, an unsigned octet representing the leftmost 329 number of significant bits of ADDRESS that the response covers. 330 In queries, it MUST be set to 0. 332 o ADDRESS, variable number of octets, contains either an IPv4 or 333 IPv6 address, depending on FAMILY, which MUST be truncated to the 334 number of bits indicated by the SOURCE PREFIX-LENGTH field, 335 padding with 0 bits to pad to the end of the last octet needed. 337 o A server receiving an ECS option that uses either too few or too 338 many ADDRESS octets, or that has non-zero ADDRESS bits set beyond 339 SOURCE PREFIX-LENGTH, SHOULD return FORMERR to reject the packet, 340 as a signal to the developer of the software making the request to 341 fix their implementation. 343 All fields are in network byte order ("big-endian", per [RFC1700], 344 Data Notation). 346 7. Protocol Description 348 7.1. Originating the Option 350 The ECS option should generally be added by Recursive Resolvers when 351 querying Authoritative Nameservers, as described in Section 12. The 352 option can also be initialized by a Stub Resolver or Forwarding 353 Resolver. 355 7.1.1. Recursive Resolvers 357 The setup of the ECS option in a Recursive Resolver depends on the 358 client query that triggered the resolution process. 360 In the usual case, where no ECS option was present in the client 361 query, the Recursive Resolver initializes the option by setting the 362 FAMILY of the client's address. It then uses the value of its 363 maximum cacheable prefix length to set SOURCE PREFIX-LENGTH. For 364 privacy reasons, and because the whole IP address is rarely required 365 to determine a tailored response, this length SHOULD be shorter than 366 the full address, as described in Section 11. 368 If the triggering query included an ECS option itself, it MUST be 369 examined for its SOURCE PREFIX-LENGTH. The Recursive Resolver's 370 outgoing query MUST then set SOURCE PREFIX-LENGTH to the shorter of 371 the incoming query's SOURCE PREFIX-LENGTH or the server's maximum 372 cacheable prefix length. 374 Finally, in both cases, SCOPE PREFIX-LENGTH is set to 0 and the 375 ADDRESS is then added up to the SOURCE PREFIX-LENGTH number of bits, 376 with trailing 0 bits added, if needed, to fill the final octet. The 377 total number of octets used MUST only be enough to cover SOURCE 378 PREFIX-LENGTH bits, rather than the full width that would normally be 379 used by addresses in FAMILY. 381 FAMILY and ADDRESS information MAY be used from the ECS option in the 382 incoming query. Passing the existing address data is supportive of 383 the Recursive Resolver being used as the target of a Forwarding 384 Resolver, but could possibly run into policy problems with regard to 385 usage agreements between the Recursive Resolver and Authoritative 386 Nameserver. See Section 12.2 for more discussion on this point. If 387 the Recursive Resolver will not forward the FAMILY and ADDRESS data 388 from the incoming ECS option, it SHOULD return a REFUSED response. 390 Subsequent queries to refresh the data MUST, if unrestricted by an 391 incoming SOURCE PREFIX-LENGTH, specify the longest SOURCE PREFIX- 392 LENGTH that the Recursive Resolver is willing to cache, even if a 393 previous response indicated that a shorter prefix length was 394 sufficient. 396 7.1.2. Stub Resolvers 398 A Stub Resolver MAY generate DNS queries with an ECS option that sets 399 SOURCE PREFIX-LENGTH to limit how network information should be 400 revealed. An Intermediate Nameserver that receives such a query MUST 401 NOT make queries that include more bits of client address than in the 402 originating query. 404 A SOURCE PREFIX-LENGTH of 0 means the Recursive Resolver MUST NOT add 405 address information of the client to its queries. The subsequent 406 Recursive Resolver query to the Authoritative Nameserver will then 407 either not include an ECS option or MAY optionally include its own 408 address information, which is what the Authoritative Nameserver will 409 almost certainly use to generate any Tailored Response in lieu of an 410 option. This allows the answer to be handled by the same caching 411 mechanism as other queries, with an explicit indicator of the 412 applicable scope. Subsequent Stub Resolver queries for /0 can then 413 be answered from this cached response. 415 A Stub Resolver MUST set SCOPE PREFIX-LENGTH to 0. It MAY include 416 FAMILY and ADDRESS data, but should be prepared to handle a REFUSED 417 response if the Intermediate Nameserver that it queries has a policy 418 that denies forwarding of the ADDRESS. If there is no ADDRESS set, 419 i.e. SOURCE PREFIX-LENGTH is set to 0, then FAMILY MUST be set to 0. 421 7.1.3. Forwarding Resolvers 423 Forwarding Resolvers essentially appear to be Stub Resolvers to 424 whatever Recursive Resolver is ultimately handling the query, but 425 look like a Recursive Resolver to their client. A Forwarding 426 Resolver using this option MUST prepare it as described above in 427 Section 7.1.1, Recursive Resolvers. In particular, a Forwarding 428 Resolver that implements this protocol MUST honor SOURCE PREFIX- 429 LENGTH restrictions indicated in the incoming query from its client. 430 See also Section 7.5. 432 Since the Recursive Resolver it contacts will treat the Forwarding 433 Resolver like a Stub Resolver, the Recursive Resolver's policies 434 regarding incoming ADDRESS information will apply in the same way. 435 If the Forwarding Resolver receives a REFUSED response when it sends 436 a query which includes a non-zero ADDRESS, it MUST retry with FAMILY 437 set to 0 and no ADDRESS. 439 7.2. Generating a Response 441 7.2.1. Authoritative Nameserver 443 When a query containing an ECS option is received, an Authoritative 444 Nameserver supporting ECS MAY use the address information specified 445 in the option in order to generate a tailored response. 447 Authoritative Nameservers that have not implemented or enabled 448 support for the ECS option ought to safely ignore it within incoming 449 queries, per [RFC6891] section 6.1.2. Such a server MUST NOT include 450 an ECS option within replies, to indicate lack of support for it. 451 Implementers of Intermediate Nameservers should be aware, however, 452 that some nameservers incorrectly echo back unknown EDNS0 options. 453 In this protocol that should be mostly harmless, as SCOPE PREFIX- 454 LENGTH should come back as 0, thus marking the response as covering 455 all networks. 457 A query with a wrongly formatted option (e.g., an unknown FAMILY) 458 MUST be rejected and a FORMERR response MUST be returned to the 459 sender, as described by [RFC6891], Transport Considerations. 461 An Authoritative Nameserver that implements this protocol and 462 receives an ECS option MUST include an ECS option in its response to 463 indicate that it SHOULD be cached accordingly, regardless of whether 464 the client information was needed to formulate an answer. (Note that 465 the [RFC6891] requirement to reserve space for the OPT record could 466 mean that the answer section of the response will be truncated and 467 fallback to TCP indicated accordingly.) If an ECS option was not 468 included in a query, one MUST NOT be included in the response even if 469 the server is providing a Tailored Response -- presumably based on 470 the address from which it received the query. 472 The FAMILY, SOURCE PREFIX-LENGTH and ADDRESS in the response MUST 473 match those in the query, unless the query specified only the SOURCE 474 PREFIX-LENGTH for privacy (and thus with FAMILY set to 0 and no 475 ADDRESS). Echoing back these values helps to mitigate certain attack 476 vectors, as described in Section 11. 478 The SCOPE PREFIX-LENGTH in the response indicates the network for 479 which the answer is intended. 481 A SCOPE PREFIX-LENGTH value longer than the SOURCE PREFIX-LENGTH 482 indicates that the provided prefix length was not specific enough to 483 select the most appropriate Tailored Response. Future queries for 484 the name within the specified network SHOULD use the longer SCOPE 485 PREFIX-LENGTH. Factors affecting whether the Recursive Resolver 486 would use the longer length include the amount of privacy masking the 487 operator wants to provide their users, and the additional resource 488 implications for the cache. 490 Conversely, a shorter SCOPE PREFIX-LENGTH indicates that more bits 491 than necessary were provided, and the answer is suitable for a 492 broader range of addresses. This could be as short as 0, to indicate 493 that the answer is suitable for all addresses in FAMILY. 495 As the logical topology of any part of the network with regard to the 496 tailored response can vary, an Authoritative Nameserver may return 497 different values of SCOPE PREFIX-LENGTH for different networks. 499 Since some queries can result in multiple RRsets being added to the 500 response, there is an unfortunate ambiguity from the original 501 specification as to how SCOPE PREFIX-LENGTH would apply to each 502 individual RRset. For example, multiple types in response to an ANY 503 metaquery could all have different applicable SCOPE PREFIX-LENGTH 504 values, but this protocol only has the ability to signal one. The 505 response SHOULD therefore include the longest relevant PREFIX-LENGTH 506 of any RRset in the answer, which could have the unfortunate side- 507 effect of redundantly caching some data that could be cached more 508 broadly. For the specific case of a CNAME chain, the Authoritative 509 Nameserver SHOULD only place the initial CNAME record in the Answer 510 section, to have it cached unambiguously appropriately. Most modern 511 Recursive Resolvers restart the query with the canonical name, so the 512 remainder of the chain is typically ignored anyway. For message- 513 focused resolvers, rather than RRset-focused ones, this will mean 514 caching the entire CNAME chain at the longest PREFIX-LENGTH of any 515 RRset in the chain. 517 The specific logic that an Authoritative Nameserver uses to choose a 518 tailored response is not in the scope of this document. Implementers 519 are encouraged, however, to consider carefully their selection of 520 SCOPE PREFIX-LENGTH for the response in the event that the best 521 tailored response cannot be determined, and what the implications 522 would be over the life of the TTL. 524 Authoritative Nameservers might have situations where one Tailored 525 Response is appropriate for a relatively broad address range, such as 526 an IPv4 /20, except for some exceptions, such as a few /24 ranges 527 within that /20. Because it can't be guaranteed that queries for all 528 longer prefix lengths would arrive before one that would be answered 529 by the shorter prefix length, an Authoritative Nameserver MUST NOT 530 overlap prefixes. 532 When the Authoritative Nameserver has a longer prefix length Tailored 533 Response within a shorter prefix length Tailored Response, then 534 implementations can either: 536 1. Deaggregate the shorter prefix response into multiple longer 537 prefix responses, or, 539 2. Alert the operator that the order of queries will determine which 540 answers get cached, and either warn and continue or treat this as 541 an error and refuse to load the configuration. 543 This choice should be documented for the operator, for example in the 544 user manual. 546 When deaggregating to correct the overlap, prefix lengths should be 547 optimized to use the minimum necessary to cover the address space, in 548 order to reduce the overhead that results from having multipe copies 549 of the same answer. As a trivial example, if the Tailored Response 550 for 1.2.0/20 is A but there is one exception of 1.2.3/24 for B, then 551 the Authoritative Nameserver would need to provide Tailored Responses 552 for 1.2.0/23, 1.2.2/24, 1.2.4/22, and 1.2.8/21 all pointing to A, and 553 1.2.3/24 to B. 555 7.2.2. Intermediate Nameserver 557 When an Intermediate Nameserver uses ECS, whether it passes an ECS 558 option in its own response to its client is predicated on whether the 559 client originally included the option. Because a client that did not 560 use an ECS option might not be able to understand it, the server MUST 561 NOT provide one in its response. If the client query did include the 562 option, the server MUST include one in its response, especially as it 563 could be talking to a Forwarding Resolver which would need the 564 information for its own caching. 566 If an Intermediate Nameserver receives a response which has a longer 567 SCOPE PREFIX-LENGTH than the SOURCE PREFIX-LENGTH that it provided in 568 its query, it SHOULD still provide the result as the answer to the 569 triggering client request even if the client is in a different 570 address range. The Intermediate Nameserver MAY instead opt to retry 571 with a longer SOURCE PREFIX-LENGTH to get a better reply before 572 responding to its client, as long as it does not exceed a SOURCE 573 PREFIX-LENGTH specified in the query that triggered resolution, but 574 this obviously has implications for the latency of the overall 575 lookup. 577 The logic for using the cache to determine whether the Intermediate 578 Nameserver already knows the response to provide to its client is 579 covered in the next section. 581 7.3. Handling ECS Responses and Caching 583 When an Intermediate Nameserver receives a response containing an ECS 584 option and without the TC bit set, it SHOULD cache the result based 585 on the data in the option. If the TC bit was set, the Intermediate 586 Resolver SHOULD retry the query over TCP to get the complete answer 587 section for caching. 589 If the FAMILY, SOURCE PREFIX-LENGTH, and SOURCE PREFIX-LENGTH bits of 590 ADDRESS in the response don't match the non-zero fields in the 591 corresponding query, the full response MUST be dropped, as described 592 in Section 11. In a response to a query which specified only the 593 SOURCE PREFIX-LENGTH for privacy masking, the FAMILY and ADDRESS 594 fields MUST contain the appropriate non-zero information that the 595 Authoritative Nameserver used to generate the answer, so that it can 596 be cached accordingly. 598 If no ECS option is contained in the response, the Intermediate 599 Nameserver SHOULD treat this as being equivalent to having received a 600 SCOPE PREFIX-LENGTH of 0, which is an answer suitable for all client 601 addresses. See further discussion on the security implications of 602 this in Section 11. 604 If a REFUSED response is received from an Authoritative Nameserver, 605 an ECS-aware resolver MUST retry the query without ECS to distinguish 606 the response from one where the Authoritative Nameserver is not 607 responsible for the name, which is a common convention for the 608 REFUSED status. Similarly, a client of a Recursive Resolver SHOULD 609 retry for REFUSED because it is not sufficiently clear whether the 610 REFUSED was because of the ECS option or some other reason. 612 7.3.1. Caching the Response 614 In the cache, all resource records in the answer section MUST be to 615 the network specified in the response. The appropriate prefix length 616 depends on the relationship between SOURCE PREFIX-LENGTH, SCOPE 617 PREFIX-LENGTH, and the maximum cacheable prefix length configured for 618 the cache. 620 If SCOPE PREFIX-LENGTH is not longer than SOURCE PREFIX-LENGTH store 621 SCOPE PREFIX-LENGTH bits of ADDRESS and mark the response as valid 622 for all addresses that fall within that range. 624 Similarly, if SOURCE PREFIX-LENGTH is the maximum configured for the 625 cache, store SOURCE PREFIX-LENGTH bits of ADDRESS and mark the 626 response as valid for all addresses that fall within that range. 628 If SOURCE PREFIX-LENGTH is shorter than the configured maximum and 629 SCOPE PREFiX-LENGTH is longer than SOURCE PREFIX-LENGTH, store SOURCE 630 PREFIX-LENGTH bits of ADDRESS and mark the response as only valid to 631 answer client queries that specify exactly the same SOURCE PREFIX- 632 LENGTH in their own ECS option. 634 DNSKEY and DS records are the one exception to the above rules for 635 records in the answer section. These records SHOULD always be cached 636 at /0. See Section 9 for more. 638 Note that the additional and authority sections from a DNS response 639 message are specifically excluded here. Any records from these 640 sections MUST NOT be tied to a network. See more at Section 7.4. 642 Records that are cached as /0 because of a query's SOURCE PREFIX- 643 LENGTH of 0 MUST be distinguished from those that are cached as /0 644 because of a response's SCOPE PREFIX-LENGTH of 0. The former should 645 only be used for other /0 queries that the Intermediate Resolver 646 receives, but the latter is suitable as a response for all networks. 648 Although omitting network-specific caching will significantly 649 simplify an implementation, the resulting drop in cache hits is very 650 likely to defeat most latency benefits provided by ECS. Therefore, 651 implementing full caching support as described in this section is 652 strongly RECOMMENDED. 654 Enabling support for ECS in an Intermediate Nameserver will 655 significantly increase the size of the cache, reduce the number of 656 results that can be served from cache, and increase the load on the 657 server. Implementing the mitigation techniques described in 658 Section 11 is strongly recommended. For cache size issues, 659 implementers should consider data storage formats that allow the same 660 answer data to be shared among multiple prefixes. 662 7.3.2. Answering from Cache 664 Cache lookups are first done as usual for a DNS query, using the 665 query tuple of . Then the appropriate RRset MUST 666 be chosen based on longest prefix matching. The client address to 667 use for comparison will depend on whether the Intermediate Nameserver 668 received an ECS option in its client query. 670 o If no ECS option was provided, the client's address is used. 672 o If there was an ECS option specifying SOURCE PREFIX-LENGTH but no 673 ADDRESS, the client's address is used but SOURCE PREFIX-LENGTH is 674 initially ignored. If no covering entry is found and SOURCE 675 PREFIX-LENGTH is shorter than the configured maximum length 676 allowed for the cache, repeat the cache lookup for an entry that 677 exactly matches SOURCE PREFIX-LENGTH. These special entries, 678 which do not cover longer prefix lengths, occur as described in 679 the previous section. 681 o If there was an ECS option with an ADDRESS, the ADDRESS from it 682 MAY be used if local policy allows. Policy can vary depending on 683 the agreements the operator of the Intermediate Nameserver has 684 with Authoritative Nameserver operators; see Section 12.2. If 685 policy does not allow, a REFUSED response SHOULD be sent. See 686 Section 7.5 for more. 688 If a matching network is found and the relevant data is unexpired, 689 the response is generated as per Section 7.2. 691 If no matching network is found, the Intermediate Nameserver MUST 692 perform resolution as usual. This is necessary to avoid Tailored 693 Responses in the cache from being returned to the wrong clients, and 694 to avoid a single query coming from a client on a different network 695 from polluting the cache with a Tailored Response for all the users 696 of that resolver. 698 7.4. Delegations and Negative Answers 700 The prohibition against tying ECS data to records from the Authority 701 and Additional section left an unfortunate ambiguity in the original 702 specification, primarily with regard to negative answers. The 703 expectation of the original authors was that ECS would only really be 704 used for address requests and the positive result in the response's 705 answer section, the use case that was driving the definition of the 706 protocol. 708 For negative answers, some independent implementations of both 709 resolvers and authorities did not see the section restriction as 710 necessarily meaning that a given name and type must only have either 711 positive ECS-tagged answers or a negative answer. They support being 712 able to tell one part of the network that the data does not exist, 713 while telling another part of the network that it does. 715 Several other implementations, however, do not support being able to 716 mix positive and negative answers, and thus interoperability is a 717 problem. It is recommended that no specific behavior regarding 718 negative answers be relied upon. 720 This issue is expected to be revisited in a future revision of the 721 protocol, possibly blessing the mixing of positive and negative 722 answers. There are implications for cache data structures that 723 developers should consider when writing new ECS code. 725 The delegations case is a bit easier to tease out. In operational 726 practice, if an authoritative server is using address information to 727 provide customized delegations, it is the resolver that will be using 728 the answer for its next iterative query. Addresses in the Additional 729 section SHOULD therefore ignore ECS data, and the Authoritative 730 Nameserver SHOULD return a zero SCOPE PREFIX-LENGTH on delegations. 731 A recursive resolver SHOULD treat a non-zero SCOPE PREFIX LENGTH in a 732 delegation as though it were zero. 734 7.5. Transitivity 736 Generally, ECS options will only be present in DNS messages between a 737 Recursive Resolver and an Authoritative Nameserver, i.e., one hop. 738 In certain configurations however, for example multi-tier nameserver 739 setups, it may be necessary to implement transitive behavior on 740 Intermediate Nameservers. 742 Any Intermediate Nameserver that forwards ECS options received from 743 its clients MUST fully implement the caching behavior described in 744 Section 7.3. 746 An Intermediate Nameserver MAY forward ECS options with address 747 information. This information MAY match the source IP address of the 748 incoming query, and MAY have more or fewer address bits than the 749 Nameserver would normally include in a locally originated ECS option. 750 If an Intermediate Nameserver receives a query with SOURCE PREFIX- 751 LENGTH set to 0 it MUST forward the query as-is and MUST NOT replace 752 it with more accurate address information. 754 If for any reason the Intermediate Nameserver does not want to use 755 the information in an ECS option it receives (too little address 756 information, network address from a range not authorized to use the 757 server, private/unroutable address space, etc), it SHOULD drop the 758 query and return a REFUSED response. Note again that a query MUST 759 NOT be refused solely because it provides 0 address bits. 761 Be aware that at least one major existing implementation does not 762 return REFUSED and instead just processes the query as though the 763 problematic information were not present. This can lead to anomalous 764 situations, such as a response from the Intermediate Nameserver that 765 indicates it is tailored for one network (the one passed in the 766 original query, since ADDRESS must match) when actually it is for 767 another network (the one which contains the address that the 768 Intermediate Nameserver saw as making the query). 770 8. IANA Considerations 772 IANA has already assigned option code 8 in the "DNS EDNS0 Option 773 Codes (OPT)" registry to ECS. 775 The IANA is requested to update the reference ("draft-vandergaast- 776 edns-client-subnet") to refer to this RFC when published. 778 9. DNSSEC Considerations 780 The presence or absence of an [RFC6891] EDNS0 OPT resource record 781 containing an ECS option in a DNS query does not change the usage of 782 the resource records and mechanisms used to provide data origin 783 authentication and data integrity to the DNS, as described in 784 [RFC4033], [RFC4034] and [RFC4035]. OPT records are not signed. 786 Use of this option, however, does imply increased DNS traffic between 787 any given Recursive Resolver and Authoritative Nameserver, which 788 could be another barrier to further DNSSEC adoption in this area. 790 It is expected that in a signed zone using ECS all signatures will 791 use the same DNSKEY record independent of the Tailored Response that 792 should be cached per network. Trying to establish a network-specific 793 chain of trust from a non-ECS-enabled zone into an ECS-enabled zone, 794 which tecnically feasbile, has no apparent benefits. Therefore, 795 while RRSIGs are obviously tied to the same network as the Tailored 796 Response that they cover, DNSKEY and DS records SHOULD be invariant 797 for all clients. 799 NSEC and NSEC3 are explicitly not addressed in this specification per 800 the discussion about negative answers in Section 7.4. 802 10. NAT Considerations 804 Special awareness of ECS in devices that perform Network Address 805 Translation (NAT) as described in [RFC2663] is not required; queries 806 can be passed through as-is. The client's network address SHOULD NOT 807 be added, and existing ECS options, if present, SHOULD NOT be 808 modified by NAT devices. 810 In large-scale global networks behind a NAT device (but for example 811 with Centralized Resolver infrastructure), an internal Intermediate 812 Nameserver might have detailed network layout information, and may 813 know which external subnets are used for egress traffic by each 814 internal network. In such cases, the Intermediate Nameserver MAY use 815 that information when originating ECS options. 817 In other cases, if a Recursive Resolver knows it is sited behind a 818 NAT device, it SHOULD NOT originate ECS options with their external 819 IP address, and instead rely on downstream Intermediate Nameservers 820 to do so. It MAY, however, choose to include the option with their 821 internal address for the purposes of signaling its own limit for 822 SOURCE PREFIX-LENGTH. 824 Full treatment of special network addresses is beyond the scope of 825 this document; handling them will likely differ according to the 826 operational environments of each service provider. As a general 827 guideline, if an Authoritative Nameserver on the publicly routed 828 Internet receives a query that specifies an ADDRESS in [RFC1918] or 829 [RFC4193] private address space, it SHOULD ignore ADDRESS and look up 830 its answer based on the address of the Recursive Resolver. In the 831 response it SHOULD set SCOPE PREFIX-LENGTH to cover all of the 832 relevant private space. For example, a query for ADDRESS 10.1.2.0 833 with a SOURCE PREFIX-LENGTH of 24 would get a returned SCOPE PREFIX- 834 LENGTH of 8. The Intermediate Nameserver MAY elect to cache the 835 answer under one entry for special-purpose addresses [RFC6890]; see 836 Section 11.3. 838 11. Security Considerations 840 11.1. Privacy 842 With the ECS option, the network address of the client that initiated 843 the resolution becomes visible to all servers involved in the 844 resolution process. Additionally, it will be visible from any 845 network traversed by the DNS packets. 847 To protect users' privacy, Recursive Resolvers are strongly 848 encouraged to conceal part of the IP address of the user by 849 truncating IPv4 addresses to 24 bits. 56 bits are recommended for 850 IPv6, based on [RFC6177]. 852 ISPs should have more detailed knowledge of their own networks. That 853 is, they might know that all 24-bit prefixes in a /20 are in the same 854 area. In those cases, for optimal cache utilization and improved 855 privacy, the ISP's Recursive Resolver SHOULD truncate IP addresses in 856 this /20 to just 20 bits, instead of 24 as recommended above. 858 Users who wish their full IP address to be hidden need to configure 859 their client software, if possible, to include an ECS option 860 specifying the wildcard address (i.e. SOURCE PREFIX-LENGTH of 0). 861 As described in previous sections, this option will be forwarded 862 across all the Recursive Resolvers supporting ECS, which MUST NOT 863 modify it to include the network address of the client. 865 Note that even without an ECS option, any server queried directly by 866 the user will be able to see the full client IP address. Recursive 867 Resolvers or Authoritative Nameservers MAY use the source IP address 868 of queries to return a cached entry or to generate a Tailored 869 Response that best matches the query. 871 11.2. Birthday Attacks 873 ECS adds information to the DNS query tupe (q-tuple). This allows an 874 attacker to send a caching Intermediate Nameserver multiple queries 875 with spoofed IP addresses either in the ECS option or as the source 876 IP. These queries will trigger multiple outgoing queries with the 877 same name, type and class, just different address information in the 878 ECS option. 880 With multiple queries for the same name in flight, the attacker has a 881 higher chance of success to send a matching response with the SCOPE 882 PREFIX-LENGTH set to 0 to get it cached for all hosts. 884 To counter this, the ECS option in a response packet MUST contain the 885 full FAMILY, ADDRESS and SOURCE PREFIX-LENGTH fields from the 886 corresponding query. Intermediate Nameservers processing a response 887 MUST verify that these match, and SHOULD discard the entire response 888 if they do not. 890 That requirement to discard is "SHOULD" instead of "MUST" because it 891 stands in opposition to the instruction in Section 7.3 which states 892 that a response lacking an ECS option should be treated as though it 893 had one of SCOPE PREFIX-LENGTH of 0. If that is always true, then an 894 attacker does not need to worry about matching the original ECS 895 option data and just needs to flood back responses that have no ECS 896 option at all. 898 This type of attack could be detected in ongoing operations by 899 marking whether the responding nameserver had previously been sending 900 ECS option, and/or by taking note of an incoming flood of bogus 901 responses and flagging the relevant query for re-resolution. This is 902 more complex than existing nameserver responses to spoof floods, and 903 would also need to be sensitive to a nameserver legitimately stopping 904 ECS replies even though it had previously given them. 906 11.3. Cache Pollution 908 It is simple for an arbitrary resolver or client to provide false 909 information in the ECS option, or to send UDP packets with forged 910 source IP addresses. 912 This could be used to: 914 o pollute the cache of intermediate resolvers, by filling it with 915 results that will rarely (if ever) be used. 917 o reverse engineer the algorithms (or data) used by the 918 Authoritative Nameserver to calculate Tailored Responses. 920 o mount a denial-of-service attack against an Intermediate 921 Nameserver, by forcing it to perform many more recursive queries 922 than it would normally do, due to how caching is handled for 923 queries containing the ECS option. 925 Even without malicious intent, Centralized Resolvers providing 926 answers to clients in multiple networks will need to cache different 927 responses for different networks, putting more memory pressure on the 928 cache. 930 To mitigate those problems: 932 o Recursive Resolvers implementing ECS should only enable it in 933 deployments where it is expected to bring clear advantages to the 934 end users, such as when expecting clients from a variety of 935 networks or from a wide geographical area. Due to the high cache 936 pressure introduced by ECS, the feature SHOULD be disabled in all 937 default configurations. 939 o Recursive Resolvers SHOULD limit the number of networks and 940 answers they keep in the cache for any given query. 942 o Recursive Resolvers SHOULD limit the number of total different 943 networks that they keep in cache. 945 o Recursive Resolvers MUST NOT send an ECS option with a SOURCE 946 PREFIX-LENGTH providing more bits in the ADDRESS than they are 947 willing to cache responses for. 949 o Recursive Resolvers should implement algorithms to improve the 950 cache hit rate, given the size constraints indicated above. 951 Recursive Resolvers MAY, for example, decide to discard more 952 specific cache entries first. 954 o Authoritative Nameservers and Recursive Resolvers should discard 955 ECS options that are either obviously forged or otherwise known to 956 be wrong. They SHOULD at least treat unroutable addresses, such 957 as some of the address blocks defined in [RFC6890], as equivalent 958 to the Recursive Resolver's own identity. They SHOULD ignore and 959 never forward ECS options specifying other routable addresses that 960 are known not to be served by the query source. 962 o The ECS option is just a hint to Authoritative Nameservers for 963 customizing results. They can decide to ignore the content of the 964 ECS option based on black or white lists, rate limiting 965 mechanisms, or any other logic implemented in the software. 967 12. Sending the Option 969 When implementing a Recursive Resolver, there are two strategies on 970 deciding when to include an ECS option in a query. At this stage, 971 it's not clear which strategy is best. 973 12.1. Probing 975 A Recursive Resolver can send the ECS option with every outgoing 976 query. However, it is RECOMMENDED that Resolvers remember which 977 Authoritative Nameservers did not return the option with their 978 response, and omit client address information from subsequent queries 979 to those Nameservers. 981 Additionally, Recursive Resolvers SHOULD be configured to never send 982 the option when querying root, top-level, and effective top-level 983 (ie, ("public suffix") [Public_Suffix_List] domain servers. These 984 domains are delegation-centric and are very unlikely to generate 985 different responses based on the address of the client. 987 When probing, it is important that several things are probed: support 988 for ECS, support for EDNS0, support for EDNS0 options, or possibly an 989 unreachable Nameserver. Various implementations are known to drop 990 DNS packets with OPT RRs (with or without options), thus several 991 probes are required to discover what is supported. 993 Probing, if implemented, MUST be repeated periodically, e.g., daily. 994 If an Authoritative Nameserver indicates ECS support for one zone, it 995 is to be expected that the Nameserver supports ECS for all of its 996 zones. Likewise, an Authoritative Nameserver that uses ECS 997 information for one of its zones, MUST indicate support for the 998 option in all of its responses to ECS queries. If the option is 999 supported but not actually used for generating a response, its SCOPE 1000 PREFIX-LENGTH MUST be set to 0. 1002 12.2. Whitelist 1004 As described previously, it is expected that only a few Recursive 1005 Resolvers will need to use ECS, and that it will generally be enabled 1006 only if it offers a clear benefit to the users. 1008 To avoid the complexity of implementing a probing and detection 1009 mechanism (and the possible query loss/delay that may come with it), 1010 an implementation could use a whitelist of Authoritative Nameservers 1011 to send the option to, likely specified by their domain name. 1012 Implementations MAY also allow additionally configuring this based on 1013 other criteria, such as zone or query type. As of the time of this 1014 writing, at least one implementation makes use of a whitelist. 1016 An advantage of using a whitelist is that partial client address 1017 information is only disclosed to Nameservers that are known to use 1018 the information, improving privacy. 1020 A drawback is scalability. The operator needs to track which 1021 Authoritative Nameservers support ECS, making it harder for new 1022 Authoritative Nameservers to start using the option. 1024 Similarly, Authoritative Nameservers can also use whitelists to limit 1025 the feature to only certain clients. For example, a CDN that does 1026 not want all of their mapping trivially walked might require a legal 1027 agreement with the Recursive Resolver operator, to clearly describe 1028 the acceptable use of the feature. 1030 The maintenance of access control mechanisms is out of scope for this 1031 protocol definition. 1033 13. Example 1035 1. A stub resolver, SR, with IP address 192.0.2.37, tries to 1036 resolve www.example.com by forwarding the query to the Recursive 1037 Resolver, RNS, asking for recursion. 1039 2. RNS, supporting ECS, looks up www.example.com in its cache. An 1040 entry is found neither for www.example.com, nor for example.com. 1042 3. RNS builds a query to send to the root and .com servers. The 1043 implementation of RNS provides facilities so an administrator 1044 can configure it not to forward ECS in certain cases. In 1045 particular, RNS is configured to not include an ECS option when 1046 talking to TLD or root nameservers, as described in Section 7.1. 1047 Thus, no ECS option is added, and resolution is performed as 1048 usual. 1050 4. RNS now knows the next server to query: the Authoritative 1051 Nameserver, ANS, responsible for example.com. 1053 5. RNS prepares a new query for www.example.com, including an ECS 1054 option with: 1056 * OPTION-CODE, set to 8. 1058 * OPTION-LENGTH, set to 0x00 0x07 for the following fixed 4 1059 octets plus the 3 octets that will be used for ADDRESS. 1061 * FAMILY, set to 0x00 0x01 as IP is an IPv4 address. 1063 * SOURCE PREFIX-LENGTH, set to 0x18, as RNS is configured to 1064 conceal the last 8 bits of every IPv4 address. 1066 * SCOPE PREFIX-LENGTH, set to 0x00, as specified by this 1067 document for all queries. 1069 * ADDRESS, set to 0xC0 0x00 0x02, providing only the first 24 1070 bits of the IPv4 address. 1072 6. The query is sent. ANS understands and uses ECS. It parses the 1073 ECS option, and generates a Tailored Response. 1075 7. Due its internal implementation, ANS finds a response that is 1076 tailored for the whole /16 of the client that performed the 1077 query. 1079 8. ANS adds an ECS option in the response, containing: 1081 * OPTION-CODE, set to 8. 1083 * OPTION-LENGTH, set to 0x00 0x07. 1085 * FAMILY, set to 0x00 0x01. 1087 * SOURCE PREFIX-LENGTH, set to 0x18, copied from the query. 1089 * SCOPE PREFIX-LENGTH, set to 0x10, indicating a /16 network. 1091 * ADDRESS, set to 0xC0 0x00 0x02, copied from the query. 1093 9. RNS receives the response containing an ECS option. It verifies 1094 that FAMILY, SOURCE PREFIX-LENGTH, and ADDRESS match the query. 1095 If not, the message is discarded. 1097 10. The response is interpreted as usual. Since the response 1098 contains an ECS option, the ADDRESS, SCOPE PREFIX-LENGTH, and 1099 FAMILY in the response are used to cache the entry. 1101 11. RNS sends a response to stub resolver SR, without including an 1102 ECS option. 1104 12. RNS receives another query to resolve www.example.com. This 1105 time, a response is cached. The response, however, is tied to a 1106 particular network. If the address of the client matches any 1107 network in the cache, then the response is returned from the 1108 cache. Otherwise, another query is performed. If multiple 1109 results match, the one with the longest SCOPE PREFIX-LENGTH is 1110 chosen, as per common best-network match algorithms. 1112 14. Contributing Authors 1114 The below individuals contributed significantly to the document. The 1115 RFC Editor prefers a maximum of 5 names on the front page, and so we 1116 have listed additional authors in this section 1118 Edward Lewis 1119 ICANN 1120 12025 Waterfront Drive, Suite 300 1121 Los Angeles CA 90094-2536 1122 USA 1123 Email: edward.lewis@icann.org 1125 Sean Leach 1126 Fastly 1127 POBox 78266 1128 San Francisco CA 94107 1130 Jason Moreau 1131 Akamai Technologies 1132 8 Cambridge Ctr 1133 Cambridge MA 02142-1413 1134 USA 1136 15. Acknowledgements 1138 The authors wish to thank Darryl Rodden for his work as a co-author 1139 on previous versions, and the following people for reviewing early 1140 drafts of this document and for providing useful feedback: Paul S. 1141 R. Chisholm, B. Narendran, Leonidas Kontothanassis, David Presotto, 1142 Philip Rowlands, Chris Morrow, Kara Moscoe, Alex Nizhner, Warren 1143 Kumari, and Richard Rabbat from Google; Terry Farmer, Mark Teodoro, 1144 Edward Lewis, and Eric Burger from Neustar; David Ulevitch and 1145 Matthew Dempsky from OpenDNS; Patrick W. Gilmore and Steve Hill from 1146 Akamai; Colm MacCarthaigh and Richard Sheehan from Amazon; Tatuya 1147 Jinmei from Infoblox; Andrew Sullivan from Dyn; John Dickinson from 1148 Sinodun; Mark Delany from Apple; Yuri Schaeffer from NLnet Labs; 1149 Duane Wessels from from Verisign; Antonio Querubin; Daniel Kahn 1150 Gillmor from the ACLU; Evan Hunt and Mukund Sivaraman from the 1151 Internet Software Consortium; Russ Housley from Vigilsec; Stephen 1152 Farrell from Trinity College Dublin; Alissa Cooper from Cisco; 1153 Suzanne Woolf; and all of the other people that replied to our emails 1154 on various mailing lists. 1156 16. References 1158 16.1. Normative References 1160 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 1161 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 1162 . 1164 [RFC1035] Mockapetris, P., "Domain names - implementation and 1165 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 1166 November 1987, . 1168 [RFC1700] Reynolds, J. and J. Postel, "Assigned Numbers", RFC 1700, 1169 DOI 10.17487/RFC1700, October 1994, 1170 . 1172 [RFC1918] Rekhter, Y., Moskowitz, B., Karrenberg, D., de Groot, G., 1173 and E. Lear, "Address Allocation for Private Internets", 1174 BCP 5, RFC 1918, DOI 10.17487/RFC1918, February 1996, 1175 . 1177 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1178 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 1179 RFC2119, March 1997, 1180 . 1182 [RFC4033] Arends, R., Austein, R., Larson, M., Massey, D., and S. 1183 Rose, "DNS Security Introduction and Requirements", RFC 1184 4033, DOI 10.17487/RFC4033, March 2005, 1185 . 1187 [RFC4034] Arends, R., Austein, R., Larson, M., Massey, D., and S. 1188 Rose, "Resource Records for the DNS Security Extensions", 1189 RFC 4034, DOI 10.17487/RFC4034, March 2005, 1190 . 1192 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 1193 Rose, "Protocol Modifications for the DNS Security 1194 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005, 1195 . 1197 [RFC4193] Hinden, R. and B. Haberman, "Unique Local IPv6 Unicast 1198 Addresses", RFC 4193, DOI 10.17487/RFC4193, October 2005, 1199 . 1201 [RFC6177] Narten, T., Huston, G., and L. Roberts, "IPv6 Address 1202 Assignment to End Sites", BCP 157, RFC 6177, DOI 10.17487/ 1203 RFC6177, March 2011, 1204 . 1206 [RFC6890] Cotton, M., Vegoda, L., Bonica, R., Ed., and B. Haberman, 1207 "Special-Purpose IP Address Registries", BCP 153, RFC 1208 6890, DOI 10.17487/RFC6890, April 2013, 1209 . 1211 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 1212 for DNS (EDNS(0))", STD 75, RFC 6891, DOI 10.17487/ 1213 RFC6891, April 2013, 1214 . 1216 16.2. Informative References 1218 [Address_Family_Numbers] 1219 "Address Family Numbers", 1220 . 1223 [DPRIVE_Working_Group] 1224 "DPRIVE Working Group", 1225 . 1227 [I-D.hardie-privsec-metadata-insertion] 1228 Hardie, T., "Design considerations for Metadata 1229 Insertion", draft-hardie-privsec-metadata-insertion-02 1230 (work in progress), March 2016. 1232 [I-D.vandergaast-edns-client-subnet] 1233 Contavalli, C., Gaast, W., Leach, S., and E. Lewis, 1234 "Client Subnet in DNS Requests", draft-vandergaast-edns- 1235 client-subnet-02 (work in progress), July 2013. 1237 [Public_Suffix_List] 1238 "Public Suffix List", . 1240 [RFC2308] Andrews, M., "Negative Caching of DNS Queries (DNS 1241 NCACHE)", RFC 2308, DOI 10.17487/RFC2308, March 1998, 1242 . 1244 [RFC2663] Srisuresh, P. and M. Holdrege, "IP Network Address 1245 Translator (NAT) Terminology and Considerations", RFC 1246 2663, DOI 10.17487/RFC2663, August 1999, 1247 . 1249 [RFC7719] Hoffman, P., Sullivan, A., and K. Fujiwara, "DNS 1250 Terminology", RFC 7719, DOI 10.17487/RFC7719, December 1251 2015, . 1253 Appendix A. Document History 1255 [RFC Editor: Please delete this section before publication.] 1257 -06 to -07: 1259 o Minor comments from Suzanne, Mukund, Jinmei and from the IESG on 1260 the dnsop list. 1262 o Incorporated feedback from conference call with Mukund and Evan, 1263 notably clarifying what prefix length to associate with answers in 1264 the cache, how and why to deaggregate, and some DNSSEC stuff. 1266 -05 to -06: 1268 o Integrated David Lawrence comments. 1270 o Ran spellcheck again. One ady I';; laern to tyoe/ 1272 -04 to -05: 1274 o Moved comment about retrying for REFUSED to section on "Handling 1275 ECS Responses". (Jinmei) 1277 o Clarify that a new proposal for an improved ECS protool is 1278 expected. 1280 o "Forwarders" had been used as though they were the source of a 1281 forwarded query rather than the targeted of one; clarified and 1282 defined as "Forwarding Resolver". (Jinmei) 1284 o "representing the leftmost significant bits" => "representing the 1285 leftmost number of significant bits". (Jinmei) 1287 o Minor other clarifying text. (Jinmei) 1288 o Jinmei's affiliation. 1290 o Minor wording clarifications. (David Kahn Gillmor) 1292 o Russ Housely's GenART review. 1294 -03 to -04: 1296 o Privacy note per Ted Hardie's suggestion. 1298 o MUST use minimum octet length to cover PREFIX bits. 1300 o Expose note about documenting deployed, if flawed, protocol. 1302 -02 to -03: 1304 o Some cleanup of the whitelist text. 1306 -01 to -02 (IETF) 1308 o Clean up the open issues, mostly by saying that they were out of 1309 scope for this document. 1311 o How in the world did no reviewers note that "Queries" had been 1312 spelled as "Querys" in the title? (Aaron Falk did.) 1314 -00 to -01 (IETF) 1316 o Note ambiguity with multiple RRsets appearing in reply, eg, for an 1317 ANY query or CNAME chain. (Duane Wessels) 1319 o Open issue questioning the guidance about resolvers behind a NAT. 1320 How do they know they are? What real requirement is this 1321 imposing? (Duane Wessels) 1323 o Some other wording changes based on Duane's review of an earlier 1324 draft. 1326 -IND to -00 (IETF) 1328 o Made the document describe how things are actually 1329 implmented now. This makes the document be more of a "this is how 1330 we are doing things, this provides information on that". There 1331 may be a future document that describes additional funcationality. 1333 o NETMASK was not a good desription, changed to PREFIX-LENGTH 1334 (Jinmei, others). Stole most of the definition for prefix length 1335 from RFC4291. 1337 o Fixed the "SOURCE PREFIX-LENGTH set to 0" definition to include 1338 IPv6 (Tatuya Jinmei) 1340 o Comment that ECS cannot be used to hand NXDOMAIN to some clients 1341 and not others, primarily because of interoperability issues. 1342 (Tatuya Jinmei) 1344 o Added text explaining that implmentations need to document thier 1345 behavior with overlapping networks. 1347 o Soften "optimized reply" language. (Andrew Sullivan). 1349 o Fixed some of legacy IPv4 cruft (things like 0.0.0.0/0) 1351 o Some more grammar / working cleanups. 1353 o Replaced a whole heap of occurances of "edns-client-subnet" with 1354 "ECS" for readability. (John Dickinson) 1356 o More clearly describe the process from the point of view of each 1357 type of nameserver. (John Dickinson) 1359 o Birthday attack still possible if attacker floods with ECS-less 1360 responses. (Yuri Schaeffer) 1362 o Added some open issues directly to the text. 1364 A.1. -00 1366 o Document moved to experimental track, added experiment description 1367 in header with details in a new section. 1369 o Specifically note that ECS applies to the answer section only. 1371 o Warn that caching based on ECS is optional but very important for 1372 performance reasons. 1374 o Updated NAT section. 1376 o Added recommendation to not use the default /24 recommendation for 1377 the source prefix-length field if more detailed information about 1378 the network is available. 1380 o Rewritten problem statement to be more clear about the goal of ECS 1381 and the fact that it's entirely optional. 1383 o Wire format changed to include the original address and prefix 1384 length in responses in defence against birthday attacks. 1386 o Security considerations now includes a section about birthday 1387 attacks. 1389 o Renamed edns-client-ip in ECS, following suggestions on the 1390 mailing list. 1392 o Clarified behavior of resolvers when presented with an invalid ECS 1393 option. 1395 o Fully take multi-tier DNS setups in mind and be more clear about 1396 where the option should be originated. 1398 o A note on Authoritative Nameservers receiving queries that specify 1399 private address space. 1401 o A note to always ask for the longest acceptable SOURCE prefix 1402 length, even if a prior answer indicated that a shorter prefix 1403 length was suitable. 1405 o Marked up a few more references. 1407 o Added a few definitions in the Terminology section, and a few more 1408 aesthetic changes in the rest of the document. 1410 A.2. -01 1412 o Document version number reset from -02 to -00 due to the rename of 1413 base document. 1415 o Clarified example (dealing with TLDs, and various minor errors). 1417 o Referencing RFC5035 instead of RFC1918. 1419 o Added a section on probing (and how it should be done) vs. 1420 whitelisting. 1422 o Moved description on how to forward ECS option in dedicated 1423 section. 1425 o Queries with wrongly formatted ECS options should now be rejected 1426 with FORMERR. 1428 o Added an "Overview" section, providing an introduction to the 1429 document. 1431 o Intermediate Nameservers can now remove an ECS option, or reduce 1432 the SOURCE PREFIX-LENGTH to increase privacy. 1434 o Added a reference to DoS attacks in the Security section. 1436 o Don't use "network range", as it seems to have different meaning 1437 in other contexts, and turned out to be confusing. 1439 o Use shorter and longer prefix lengths, rather than higher or 1440 lower. Add a better explanation in the format section. 1442 o Minor corrections in various other sections. 1444 A.3. -02 1446 o Added IANA-assigned option code. 1448 Authors' Addresses 1450 Carlo Contavalli 1451 Google 1452 1600 Amphitheater Parkway 1453 Mountain View, CA 94043 1454 US 1456 Email: ccontavalli@google.com 1458 Wilmer van der Gaast 1459 Google 1460 Belgrave House, 76 Buckingham Palace Road 1461 London SW1W 9TQ 1462 UK 1464 Email: wilmer@google.com 1466 David C Lawrence 1467 Akamai Technologies 1468 8 Cambridge Center 1469 Cambridge, MA 02142 1470 US 1472 Email: tale@akamai.com 1473 Warren Kumari 1474 Google 1475 1600 Amphitheatre Parkway 1476 Mountain View, CA 94043 1477 US 1479 Email: warren@kumari.net