1 Document: draft-cheshire-dnsext-multicastdns-05.txt Stuart Cheshire 2 Category: Standards Track Apple Computer, Inc. 3 Expires 7th December 2005 Marc Krochmal 4 Apple Computer, Inc. 5 7th June 2005 6 7 Multicast DNS 8 9 <draft-cheshire-dnsext-multicastdns-05.txt> 10 11 12 Status of this Memo 13 14 By submitting this Internet-Draft, each author represents 15 that any applicable patent or other IPR claims of which he or she is 16 aware have been or will be disclosed, and any of which he or she 17 become aware will be disclosed, in accordance with RFC 3979. 18 19 Internet-Drafts are working documents of the Internet Engineering 20 Task Force (IETF), its areas, and its working groups. Note that 21 other groups may also distribute working documents as 22 Internet-Drafts. 23 24 Internet-Drafts are draft documents valid for a maximum of six months 25 and may be updated, replaced, or obsoleted by other documents at any 26 time. It is inappropriate to use Internet-Drafts as reference 27 material or to cite them other than as "work in progress." 28 29 The list of current Internet-Drafts can be accessed at 30 http://www.ietf.org/ietf/1id-abstracts.txt. 31 32 The list of Internet-Draft Shadow Directories can be accessed at 33 http://www.ietf.org/shadow.html. 34 35 36 Abstract 37 38 As networked devices become smaller, more portable, and more 39 ubiquitous, the ability to operate with less configured 40 infrastructure is increasingly important. In particular, the ability 41 to look up DNS resource record data types (including, but not limited 42 to, host names) in the absence of a conventional managed DNS server, 43 is becoming essential. 44 45 Multicast DNS (mDNS) provides the ability to do DNS-like operations 46 on the local link in the absence of any conventional unicast DNS 47 server. In addition, mDNS designates a portion of the DNS namespace 48 to be free for local use, without the need to pay any annual fee, and 49 without the need to set up delegations or otherwise configure a 50 conventional DNS server to answer for those names. 51 52 The primary benefits of mDNS names are that (i) they require little 53 or no administration or configuration to set them up, (ii) they work 54 when no infrastructure is present, and (iii) they work during 55 infrastructure failures. 56 57 58 59 60 Expires 7th December 2005 Cheshire & Krochmal [Page 1] 61 63 Internet Draft Multicast DNS 7th June 2005 64 65 66 Table of Contents 67 68 1. Introduction...................................................3 69 2. Conventions and Terminology Used in this Document..............4 70 3. Multicast DNS Names............................................5 71 4. Source Address Check...........................................8 72 5. Reverse Address Mapping........................................9 73 6. Querying.......................................................9 74 7. Duplicate Suppression.........................................13 75 8. Responding....................................................15 76 9. Probing and Announcing on Startup.............................18 77 10. Conflict Resolution...........................................22 78 11. Resource Record TTL Values and Cache Coherency................23 79 12. Special Characteristics of Multicast DNS Domains..............28 80 13. Multicast DNS for Service Discovery...........................30 81 14. Enabling and Disabling Multicast DNS..........................30 82 15. Considerations for Multiple Interfaces........................30 83 16. Multicast DNS and Power Management............................31 84 17. Multicast DNS Character Set...................................32 85 18. Multicast DNS Message Size....................................34 86 19. Multicast DNS Message Format..................................34 87 20. Choice of UDP Port Number.....................................37 88 21. Summary of Differences Between Multicast DNS and Unicast DNS..38 89 22. Benefits of Multicast Responses...............................38 90 23. IPv6 Considerations...........................................39 91 24. Security Considerations.......................................40 92 25. IANA Considerations...........................................41 93 26. Acknowledgments...............................................42 94 27. Copyright.....................................................42 95 28. Normative References..........................................42 96 29. Informative References........................................43 97 30. Authors' Addresses............................................44 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 Expires 7th December 2005 Cheshire & Krochmal [Page 2] 122 124 Internet Draft Multicast DNS 7th June 2005 125 126 127 1. Introduction 128 129 When reading this document, familiarity with the concepts of Zero 130 Configuration Networking [ZC] and automatic link-local addressing 131 [RFC 2462] [RFC 3927] is helpful. 132 133 This document proposes no change to the structure of DNS messages, 134 and no new operation codes, response codes, or resource record types. 135 This document simply discusses what needs to happen if DNS clients 136 start sending DNS queries to a multicast address, and how a 137 collection of hosts can cooperate to collectively answer those 138 queries in a useful manner. 139 140 There has been discussion of how much burden Multicast DNS might 141 impose on a network. It should be remembered that whenever IPv4 hosts 142 communicate, they broadcast ARP packets on the network on a regular 143 basis, and this is not disastrous. The approximate amount of 144 multicast traffic generated by hosts making conventional use of 145 Multicast DNS is anticipated to be roughly the same order of 146 magnitude as the amount of broadcast ARP traffic those hosts already 147 generate. 148 149 New applications making new use of Multicast DNS capabilities for 150 unconventional purposes may generate more traffic. If some of those 151 new applications are "chatty", then work will be needed to help them 152 become less chatty. When performing any analysis, it is important to 153 make a distinction between the application behavior and the 154 underlying protocol behavior. If a chatty application uses UDP, that 155 doesn't mean that UDP is chatty, or that IP is chatty, or that 156 Ethernet is chatty. What it means is that the application is chatty. 157 The same applies to any future applications that may decide to layer 158 increasing portions of their functionality over Multicast DNS. 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 Expires 7th December 2005 Cheshire & Krochmal [Page 3] 183 185 Internet Draft Multicast DNS 7th June 2005 186 187 188 2. Conventions and Terminology Used in this Document 189 190 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 191 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 192 document are to be interpreted as described in "Key words for use in 193 RFCs to Indicate Requirement Levels" [RFC 2119]. 194 195 This document uses the term "host name" in the strict sense to mean a 196 fully qualified domain name that has an address record. It does not 197 use the term "host name" in the commonly used but incorrect sense to 198 mean just the first DNS label of a host's fully qualified domain 199 name. 200 201 A DNS (or mDNS) packet contains an IP TTL in the IP header, which 202 is effectively a hop-count limit for the packet, to guard against 203 routing loops. Each Resource Record also contains a TTL, which is 204 the number of seconds for which the Resource Record may be cached. 205 206 In any place where there may be potential confusion between these two 207 types of TTL, the term "IP TTL" is used to refer to the IP header TTL 208 (hop limit), and the term "RR TTL" is used to refer to the Resource 209 Record TTL (cache lifetime). 210 211 When this document uses the term "Multicast DNS", it should be taken 212 to mean: "Clients performing DNS-like queries for DNS-like resource 213 records by sending DNS-like UDP query and response packets over IP 214 Multicast to UDP port 5353." 215 216 This document uses the terms "shared" and "unique" when referring to 217 resource record sets. 218 219 A "shared" resource record set is one where several Multicast DNS 220 responders may have records with that name, rrtype, and rrclass, and 221 several responders may respond to a particular query. 222 223 A "unique" resource record set is one where all the records with that 224 name, rrtype, and rrclass are under the control or ownership of a 225 single responder, and at most one responder should respond to any 226 given query. Before claiming ownership of a unique resource record 227 set, a responder MUST probe to verify that no other responder 228 already claims ownership of that set, as described in Section 9.1 229 "Probing". 230 231 Strictly speaking the terms "shared" and "unique" apply to resource 232 record sets, not to individual resource records, but it is sometimes 233 convenient to talk of "shared resource records" and "unique resource 234 records". When used this way, the terms should be understood to mean 235 a record that is a member of a "shared" or "unique" resource record 236 set, respectively. 237 238 239 240 241 242 243 Expires 7th December 2005 Cheshire & Krochmal [Page 4] 244 246 Internet Draft Multicast DNS 7th June 2005 247 248 249 3. Multicast DNS Names 250 251 This document proposes that the DNS top-level domain ".local." be 252 designated a special domain with special semantics, namely that any 253 fully-qualified name ending in ".local." is link-local, and names 254 within this domain are meaningful only on the link where they 255 originate. This is analogous to IPv4 addresses in the 169.254/16 256 prefix, which are link-local and meaningful only on the link where 257 they originate. 258 259 Any DNS query for a name ending with ".local." MUST be sent 260 to the mDNS multicast address (224.0.0.251 or its IPv6 equivalent 261 FF02::FB). 262 263 It is unimportant whether a name ending with ".local." occurred 264 because the user explicitly typed in a fully qualified domain name 265 ending in ".local.", or because the user entered an unqualified 266 domain name and the host software appended the suffix ".local." 267 because that suffix appears in the user's search list. The ".local." 268 suffix could appear in the search list because the user manually 269 configured it, or because it was received in a DHCP option, or via 270 any other valid mechanism for configuring the DNS search list. In 271 this respect the ".local." suffix is treated no differently to any 272 other search domain that might appear in the DNS search list. 273 274 DNS queries for names that do not end with ".local." MAY be sent to 275 the mDNS multicast address, if no other conventional DNS server is 276 available. This can allow hosts on the same link to continue 277 communicating using each other's globally unique DNS names during 278 network outages which disrupt communication with the greater 279 Internet. When resolving global names via local multicast, it is even 280 more important to use DNSSEC or other security mechanisms to ensure 281 that the response is trustworthy. Resolving global names via local 282 multicast is a contentious issue, and this document does not discuss 283 it in detail, instead concentrating on the issue of resolving local 284 names using DNS packets sent to a multicast address. 285 286 A host which belongs to an organization or individual who has control 287 over some portion of the DNS namespace can be assigned a globally 288 unique name within that portion of the DNS namespace, for example, 289 "cheshire.apple.com." For those of us who have this luxury, this 290 works very well. However, the majority of home customers do not have 291 easy access to any portion of the global DNS namespace within which 292 they have the authority to create names as they wish. This leaves the 293 majority of home computers effectively anonymous for practical 294 purposes. 295 296 To remedy this problem, this document allows any computer user to 297 elect to give their computers link-local Multicast DNS host names of 298 the form: "single-dns-label.local." For example, a laptop computer 299 may answer to the name "cheshire.local." Any computer user is granted 300 the authority to name their computer this way, provided that the 301 chosen host name is not already in use on that link. Having named 302 303 304 Expires 7th December 2005 Cheshire & Krochmal [Page 5] 305 307 Internet Draft Multicast DNS 7th June 2005 308 309 310 their computer this way, the user has the authority to continue using 311 that name until such time as a name conflict occurs on the link which 312 is not resolved in the user's favour. If this happens, the computer 313 (or its human user) SHOULD cease using the name, and may choose to 314 attempt to allocate a new unique name for use on that link. These 315 conflicts are expected to be relatively rare for people who choose 316 reasonably imaginative names, but it is still important to have a 317 mechanism in place to handle them when they happen. 318 319 The point made in the previous paragraph is very important and bears 320 repeating. It is easy for those of us in the IETF community who run 321 our own name servers at home to forget that the majority of computer 322 users do not run their own name server and have no easy way to create 323 their own host names. When these users wish to transfer files between 324 two laptop computers, they are frequently reduced to typing in 325 dotted-decimal IP addresses because they simply have no other way for 326 one host to refer to the other by name. This is a sorry state of 327 affairs. What is worse, most users don't even bother trying to use 328 dotted-decimal IP addresses. Most users still move data between 329 machines by copying it onto a floppy disk or similar removable media. 330 331 In a world of gigabit Ethernet and ubiquitous wireless networking it 332 is a sad indictment of the networking community that the preferred 333 communication medium for most computer users is still the floppy 334 disk. 335 336 Allowing ad-hoc allocation of single-label names in a single flat 337 ".local." namespace may seem to invite chaos. However, operational 338 experience with AppleTalk NBP names [NBP], which on any given link 339 are also effectively single-label names in a flat namespace, shows 340 that in practice name collisions happen extremely rarely and are not 341 a problem. Groups of computer users from disparate organizations 342 bring Macintosh laptop computers to events such as IETF Meetings, the 343 Mac Hack conference, the Apple World Wide Developer Conference, etc., 344 and complaints at these events about users suffering conflicts and 345 being forced to rename their machines have never been an issue. 346 347 Enforcing uniqueness of host names (i.e. the names of DNS address 348 records mapping names to IP addresses) is probably desirable in the 349 common case, but this document does not mandate that. It is 350 permissible for a collection of coordinated hosts to agree to 351 maintain multiple DNS address records with the same name, possibly 352 for load balancing or fault-tolerance reasons. This document does not 353 take a position on whether that is sensible. It is important that 354 both modes of operation are supported. The Multicast DNS protocol 355 allows hosts to verify and maintain unique names for resource records 356 where that behavior is desired, and it also allows hosts to maintain 357 multiple resource records with a single shared name where that 358 behavior is desired. This consideration applies to all resource 359 records, not just address records (host names). In summary: It is 360 required that the protocol have the ability to detect and handle name 361 conflicts, but it is not required that this ability be used for every 362 record. 363 364 365 Expires 7th December 2005 Cheshire & Krochmal [Page 6] 366 368 Internet Draft Multicast DNS 7th June 2005 369 370 371 3.1 Governing Standards Body 372 373 Note that this use of the ".local." suffix falls under IETF 374 jurisdiction, not ICANN jurisdiction. DNS is an IETF network 375 protocol, governed by protocol rules defined by the IETF. These IETF 376 protocol rules dictate character set, maximum name length, packet 377 format, etc. ICANN determines additional rules that apply when the 378 IETF's DNS protocol is used on the public Internet. In contrast, 379 private uses of the DNS protocol on isolated private networks are not 380 governed by ICANN. Since this proposed change is a change to the core 381 DNS protocol rules, it affects everyone, not just those machines 382 using the ICANN-governed Internet. Hence this change falls into the 383 category of an IETF protocol rule, not an ICANN usage rule. 384 385 3.2 Private DNS Namespaces 386 387 Note also that the special treatment of names ending in ".local." has 388 been implemented in Macintosh computers since the days of Mac OS 9, 389 and continues today in Mac OS X. There are also implementations for 390 Linux and other platforms [dotlocal]. Operators setting up private 391 internal networks ("intranets") are advised that their lives may be 392 easier if they avoid using the suffix ".local." in names in their 393 private internal DNS server. Alternative possibilities include: 394 395 .intranet 396 .internal 397 .private 398 .corp 399 .home 400 401 Another alternative naming scheme, advocated by Professor D. J. 402 Bernstein, is to use a numerical suffix, such as ".6." [djbdl]. 403 404 3.3 Maximum Multicast DNS Name Length 405 406 RFC 1034 says: 407 408 "the total number of octets that represent a domain name (i.e., 409 the sum of all label octets and label lengths) is limited to 255." 410 411 This text implies that the final root label at the end of every name 412 is included in this count (a name can't be represented without it), 413 but the text does not explicitly state that. Implementations of 414 Multicast DNS MUST include the label length byte of the final root 415 label at the end of every name when enforcing the rule that no name 416 may be longer than 255 bytes. For example, the length of the name 417 "apple.com." is considered to be 11, which is the number of bytes it 418 takes to represent that name in a packet without using name 419 compression: 420 421 ------------------------------------------------------ 422 | 0x05 | a | p | p | l | e | 0x03 | c | o | m | 0x00 | 423 ------------------------------------------------------ 424 425 426 Expires 7th December 2005 Cheshire & Krochmal [Page 7] 427 429 Internet Draft Multicast DNS 7th June 2005 430 431 432 4. Source Address Check 433 434 All Multicast DNS responses (including responses sent via unicast) 435 SHOULD be sent with IP TTL set to 255. This is recommended to provide 436 backwards-compatibility with older Multicast DNS clients that check 437 the IP TTL on reception to determine whether the packet originated 438 on the local link. These older clients discard all packets with TTLs 439 other than 255. 440 441 A host sending Multicast DNS queries to a link-local destination 442 address (including the 224.0.0.251 link-local multicast address) 443 MUST only accept responses to that query that originate from the 444 local link, and silently discard any other response packets. Without 445 this check, it could be possible for remote rogue hosts to send 446 spoof answer packets (perhaps unicast to the victim host) which the 447 receiving machine could misinterpret as having originated on the 448 local link. 449 450 The test for whether a response originated on the local link 451 is done in two ways: 452 453 * All responses sent to the link-local multicast address 224.0.0.251 454 are necessarily deemed to have originated on the local link, 455 regardless of source IP address. This is essential to allow devices 456 to work correctly and reliably in unusual configurations, such as 457 multiple logical IP subnets overlayed on a single link, or in cases 458 of severe misconfiguration, where devices are physically connected 459 to the same link, but are currently misconfigured with completely 460 unrelated IP addresses and subnet masks. 461 462 * For responses sent to a unicast destination address, the source IP 463 address in the packet is checked to see if it is an address on a 464 local subnet. An address is determined to be on a local subnet if, 465 for (one of) the address(es) configured on the interface receiving 466 the packet, (I & M) == (P & M), where I and M are the interface 467 address and subnet mask respectively, P is the source IP address 468 from the packet, '&' represents the bitwise logical 'and' 469 operation, and '==' represents a bitwise equality test. 470 471 Since queriers will ignore responses apparently originating outside 472 the local subnet, responders SHOULD avoid generating responses that 473 it can reasonably predict will be ignored. This applies particularly 474 in the case of overlayed subnets. If a responder receives a query 475 addressed to the link-local multicast address 224.0.0.251, from a 476 source address not apparently on the same subnet as the responder, 477 then even if the query indicates that a unicast response is preferred 478 (see Section 6.5, "Questions Requesting Unicast Responses"), the 479 responder SHOULD elect to respond by multicast anyway, since it can 480 reasonably predict that a unicast response with an apparently 481 non-local source address will probably be ignored. 482 483 484 485 486 487 Expires 7th December 2005 Cheshire & Krochmal [Page 8] 488 490 Internet Draft Multicast DNS 7th June 2005 491 492 493 5. Reverse Address Mapping 494 495 Like ".local.", the IPv4 and IPv6 reverse-mapping domains are also 496 defined to be link-local. 497 498 Any DNS query for a name ending with "254.169.in-addr.arpa." MUST 499 be sent to the mDNS multicast address 224.0.0.251. Since names under 500 this domain correspond to IPv4 link-local addresses, it is logical 501 that the local link is the best place to find information pertaining 502 to those names. As an optimization, these queries MAY be first 503 unicast directly to the address in question, but if this query is not 504 answered, the query MUST also be sent via multicast, to accommodate 505 the case where the machine in question is not answering for itself 506 (for example, because it is currently sleeping). 507 508 Likewise, any DNS query for a name ending with "0.8.e.f.ip6.arpa." 509 MUST be sent to the IPv6 mDNS link-local multicast address FF02::FB, 510 with or without an optional initial query unicast directly to the 511 address in question. 512 513 514 6. Querying 515 516 There are three kinds of Multicast DNS Queries, one-shot queries of 517 the kind made by today's conventional DNS clients, one-shot queries 518 accumulating multiple responses made by multicast-aware DNS clients, 519 and continuous ongoing Multicast DNS Queries used by IP network 520 browser software. 521 522 A Multicast DNS Responder that is offering records that are intended 523 to be unique on the local link MUST also implement a Multicast DNS 524 Querier so that it can first verify the uniqueness of those records 525 before it begins answering queries for them. 526 527 528 6.1 One-Shot Queries 529 530 An unsophisticated DNS client may simply send its DNS queries 531 blindly to the 224.0.0.251 multicast address, without necessarily 532 even being aware what a multicast address is. 533 534 Such an unsophisticated DNS client may not get ideal behavior. Such 535 a client may simply take the first response it receives and fail to 536 wait to see if there are more, but in many instances this may not be 537 a serious problem. If a user types "http://cheshire.local." into 538 their Web browser and gets to see the page they were hoping for, 539 then the protocol has met the user's needs in this case. 540 541 542 543 544 545 546 547 548 Expires 7th December 2005 Cheshire & Krochmal [Page 9] 549 551 Internet Draft Multicast DNS 7th June 2005 552 553 554 6.2 One-Shot Queries, Accumulating Multiple Responses 555 556 A more sophisticated DNS client should understand that Multicast DNS 557 is not exactly the same as unicast DNS, and should modify its 558 behavior in some simple ways. 559 560 As described above, there are some cases, such as looking up the 561 address associated with a unique host name, where a single response 562 is sufficient, and moreover may be all that is expected. However, 563 there are other DNS queries where more than one response is 564 possible, and for these queries a more sophisticated Multicast DNS 565 client should include the ability to wait for an appropriate period 566 of time to collect multiple responses. 567 568 A naive DNS client retransmits its query only so long as it has 569 received no response. A more sophisticated Multicast DNS client is 570 aware that having received one response is not necessarily an 571 indication that it might not receive others, and has the ability to 572 retransmit its query an appropriate number of times at appropriate 573 intervals until it is satisfied with the collection of responses it 574 has gathered. 575 576 A more sophisticated Multicast DNS client that is retransmitting 577 a query for which it has already received some responses, MUST 578 implement Known Answer Suppression, as described below in Section 579 7.1. This indicates to responders who have already replied that their 580 responses have been received, and they don't need to send them again 581 in response to this repeated query. In addition, the interval between 582 the first two queries SHOULD be one second, and the intervals between 583 subsequent queries SHOULD double. 584 585 586 6.3 Continuous Querying 587 588 In One-Shot Queries, with either a single or multiple responses, 589 the underlying assumption is that the transaction begins when the 590 application issues a query, and ends when all the desired responses 591 have been received. There is another type of operation which is more 592 akin to continuous monitoring. 593 594 Macintosh users are accustomed to opening the "Chooser" window, 595 selecting a desired printer, and then closing the Chooser window. 596 However, when the desired printer does not appear in the list, the 597 user will typically leave the "Chooser" window open while they go and 598 check to verify that the printer is plugged in, powered on, connected 599 to the Ethernet, etc. While the user jiggles the wires, hits the 600 Ethernet hub, and so forth, they keep an eye on the Chooser window, 601 and when the printer name appears, they know they have fixed whatever 602 the problem was. This can be a useful and intuitive troubleshooting 603 technique, but a user who goes home for the weekend leaving the 604 Chooser window open places a non-trivial burden on the network. 605 606 607 608 609 Expires 7th December 2005 Cheshire & Krochmal [Page 10] 610 612 Internet Draft Multicast DNS 7th June 2005 613 614 615 With continuous querying, multiple queries are sent over a long 616 period of time, until the user terminates the operation. It is 617 important that an IP network browser window displaying live 618 information from the network using Multicast DNS, if left running 619 for an extended period of time, should generate significantly less 620 multicast traffic on the network than the old AppleTalk Chooser. 621 Therefore, the interval between the first two queries SHOULD be one 622 second, the intervals between subsequent queries SHOULD double, and 623 the querier MUST implement Known Answer Suppression, as described 624 below in Section 7.1. When the interval between queries reaches or 625 exceeds 60 minutes, a querier MAY cap the interval to a maximum of 60 626 minutes, and perform subsequent queries at a steady-state rate of one 627 query per hour. 628 629 When a Multicast DNS Querier receives an answer, the answer contains 630 a TTL value that indicates for how many seconds this answer is valid. 631 After this interval has passed, the answer will no longer be valid 632 and SHOULD be deleted from the cache. Before this time is reached, a 633 Multicast DNS Querier with an ongoing interest in that record SHOULD 634 re-issue its query to determine whether the record is still valid, 635 and if so update its expiry time. 636 637 To perform this cache maintenance, a Multicast DNS Querier should 638 plan to re-query for records after at least 50% of the record 639 lifetime has elapsed. This document recommends the following 640 specific strategy: 641 642 The Querier should plan to issue a query at 80% of the record 643 lifetime, and then if no answer is received, at 85%, 90% and 95%. If 644 an answer is received, then the remaining TTL is reset to the value 645 given in the answer, and this process repeats for as long as the 646 Multicast DNS Querier has an ongoing interest in the record. If after 647 four queries no answer is received, the record is deleted when it 648 reaches 100% of its lifetime. 649 650 To avoid the case where multiple Multicast DNS Queriers on a network 651 all issue their queries simultaneously, a random variation of 2% of 652 the record TTL should be added, so that queries are scheduled to be 653 performed at 80-82%, 85-87%, 90-92% and then 95-97% of the TTL. 654 655 656 6.4 Multiple Questions per Query 657 658 Multicast DNS allows a querier to place multiple questions in the 659 Question Section of a single Multicast DNS query packet. 660 661 The semantics of a Multicast DNS query packet containing multiple 662 questions is identical to a series of individual DNS query packets 663 containing one question each. Combining multiple questions into a 664 single packet is purely an efficiency optimization, and has no other 665 semantic significance. 666 667 668 669 670 Expires 7th December 2005 Cheshire & Krochmal [Page 11] 671 673 Internet Draft Multicast DNS 7th June 2005 674 675 676 A useful technique for adaptively combining multiple questions into a 677 single query is to use a Nagle-style algorithm: When a client issues 678 its first question, a Query packet is immediately built and sent, 679 without delay. If the client then continues issuing a rapid series of 680 questions they are held until either the first query receives at 681 least one answer, or 100ms has passed, or there are enough questions 682 to fill the Question Section of a Multicast DNS query packet. At this 683 time, all the held questions are placed into a Multicast DNS query 684 packet and sent. 685 686 6.5 Questions Requesting Unicast Responses 687 688 Sending Multicast DNS responses via multicast has the benefit that 689 all the other hosts on the network get to see those responses, and 690 can keep their caches up to date, and detect conflicting responses. 691 692 However, there are situations where all the other hosts on the 693 network don't need to see every response. One example is a laptop 694 computer waking from sleep. At that instant it is a brand new 695 participant on a new network. Its Multicast DNS cache is empty, and 696 it has no knowledge of its surroundings. It may have a significant 697 number of queries that it wants answered right away to discover 698 information about its new surroundings and present that information 699 to the user. As a new participant on the network, it has no idea 700 whether the exact same questions may have been asked and answered 701 just seconds ago. In this case, trigging a large sudden flood of 702 multicast responses may impose an unreasonable burden on the network. 703 To avoid this, the Multicast DNS Querier SHOULD set the top bit in 704 the class field of its DNS question(s), to indicate that it is 705 willing to accept unicast responses instead of the usual multicast 706 responses. These questions requesting unicast responses are referred 707 to as "QU" questions, to distinguish them from the more usual 708 questions requesting multicast responses ("QM" questions). 709 710 When retransmitting a question more than once, the 'unicast response' 711 bit SHOULD be set only for the first question of the series. After 712 the first question has received its responses, the querier should 713 have a large known-answer list (see "Known Answer Suppression" below) 714 so that subsequent queries should elicit few, if any, further 715 responses. Reverting to multicast responses as soon as possible is 716 important because of the benefits that multicast responses provide 717 (see "Benefits of Multicast Responses" below). 718 719 When receiving a question with the 'unicast response' bit set, a 720 responder SHOULD usually respond with a unicast packet directed back 721 to the querier. If the responder has not multicast that record 722 recently (within one quarter of its TTL), then the responder SHOULD 723 instead multicast the response so as to keep all the peer caches up 724 to date, and to permit passive conflict detection. 725 726 Unicast replies are subject to all the same packet generation rules 727 as multicast replies, including the cache flush bit (see Section 728 11.3, "Announcements to Flush Outdated Cache Entries") and randomized 729 delays to reduce network collisions (see Section 8, "Responding"). 730 731 Expires 7th December 2005 Cheshire & Krochmal [Page 12] 732 734 Internet Draft Multicast DNS 7th June 2005 735 736 737 6.6 Suppressing Initial Query 738 739 If a query is issued for which there already exist one or more 740 records in the local cache, and those record(s) were received with 741 the cache flush bit set (see Section 11.3, "Announcements to Flush 742 Outdated Cache Entries"), indicating that they form a unique RRSet, 743 then the host SHOULD suppress its initial "QU" query, and proceed to 744 issue a "QM" query. To avoid the situation where a group of hosts 745 are synchronized by some external event and all perform the same 746 query simultaneously, a host suppressing its initial "QU" query 747 SHOULD impose a random delay from 500-1000ms before transmitting its 748 first "QM" query for this question. This means that when the first 749 host (selected randomly by this algorithm) transmits its "QM" query, 750 all the other hosts that were about to transmit the same query can 751 suppress their superfluous query, as described in "Duplicate 752 Question Suppression" below. 753 754 7. Duplicate Suppression 755 756 A variety of techniques are used to reduce the amount of redundant 757 traffic on the network. 758 759 7.1 Known Answer Suppression 760 761 When a Multicast DNS Querier sends a query to which it already knows 762 some answers, it populates the Answer Section of the DNS message with 763 those answers. 764 765 A Multicast DNS Responder SHOULD NOT answer a Multicast DNS Query if 766 the answer it would give is already included in the Answer Section 767 with an RR TTL at least half the correct value. If the RR TTL of the 768 answer as given in the Answer Section is less than half of the true 769 RR TTL as known by the Multicast DNS Responder, the responder MUST 770 send an answer so as to update the Querier's cache before the record 771 becomes in danger of expiration. 772 773 Because a Multicast DNS Responder will respond if the remaining TTL 774 given in the known answer list is less than half the true TTL, it is 775 superfluous for the Querier to include such records in the known 776 answer list. Therefore a Multicast DNS Querier SHOULD NOT include 777 records in the known answer list whose remaining TTL is less than 778 half their original TTL. Doing so would simply consume space in the 779 packet without achieving the goal of suppressing responses, and would 780 therefore be a pointless waste of network bandwidth. 781 782 A Multicast DNS Querier MUST NOT cache resource records observed in 783 the Known Answer Section of other Multicast DNS Queries. The Answer 784 Section of Multicast DNS Queries is not authoritative. By placing 785 information in the Answer Section of a Multicast DNS Query the 786 querier is stating that it *believes* the information to be true. 787 It is not asserting that the information *is* true. Some of those 788 records may have come from other hosts that are no longer on the 789 network. Propagating that stale information to other Multicast DNS 790 Queriers on the network would not be helpful. 791 792 Expires 7th December 2005 Cheshire & Krochmal [Page 13] 793 795 Internet Draft Multicast DNS 7th June 2005 796 797 798 7.2 Multi-Packet Known Answer Suppression 799 800 Sometimes a Multicast DNS Querier will already have too many answers 801 to fit in the Known Answer Section of its query packets. In this 802 case, it should issue a Multicast DNS Query containing a question and 803 as many Known Answer records as will fit. It MUST then set the TC 804 (Truncated) bit in the header before sending the Query. It MUST then 805 immediately follow the packet with another query packet containing no 806 questions, and as many more Known Answer records as will fit. If 807 there are still too many records remaining to fit in the packet, it 808 again sets the TC bit and continues until all the Known Answer 809 records have been sent. 810 811 A Multicast DNS Responder seeing a Multicast DNS Query with the TC 812 bit set defers its response for a time period randomly selected in 813 the interval 400-500ms. This gives the Multicast DNS Querier time to 814 send additional Known Answer packets before the Responder responds. 815 If the Responder sees any of its answers listed in the Known Answer 816 lists of subsequent packets from the querying host, it SHOULD delete 817 that answer from the list of answers it is planning to give, provided 818 that no other host on the network is also waiting to receive the same 819 answer record. 820 821 Previous versions of this draft specified a delay of 20-120ms before 822 answering queries with multi-packet Known Answer lists. However, 823 operational experience showed that, while this works well on 824 Ethernet, on very busy 802.11 networks, it is not uncommon to observe 825 consecutively sent packets arriving separated by as much as 826 200-400ms. 827 828 829 7.3 Duplicate Question Suppression 830 831 If a host is planning to send a query, and it sees another host on 832 the network send a query containing the same question, and the Known 833 Answer Section of that query does not contain any records which this 834 host would not also put in its own Known Answer Section, then this 835 host should treat its own query as having been sent. When multiple 836 clients on the network are querying for the same resource records, 837 there is no need for them to all be repeatedly asking the same 838 question. 839 840 841 7.4 Duplicate Answer Suppression 842 843 If a host is planning to send an answer, and it sees another host on 844 the network send a response packet containing the same answer record, 845 and the TTL in that record is not less than the TTL this host would 846 have given, then this host should treat its own answer as having been 847 sent. When multiple responders on the network have the same data, 848 there is no need for all of them to respond. 849 850 851 852 853 Expires 7th December 2005 Cheshire & Krochmal [Page 14] 854 856 Internet Draft Multicast DNS 7th June 2005 857 858 859 This feature is particularly useful when multiple Sleep Proxy Servers 860 are deployed (see Section 16, "Multicast DNS and Power Management"). 861 In the future it is possible that every general-purpose OS (Mac, 862 Windows, Linux, etc.) will implement Sleep Proxy Service as a matter 863 of course. In this case there could be a large number of Sleep Proxy 864 Servers on any given network, which is good for reliability and 865 fault-tolerance, but would be bad for the network if every Sleep 866 Proxy Server were to answer every query. 867 868 869 8. Responding 870 871 When a Multicast DNS Responder constructs and sends a Multicast DNS 872 response packet, the Answer Section of that packet must contain only 873 records for which that Responder is explicitly authoritative. These 874 answers may be generated because the record answers a question 875 received in a Multicast DNS query packet, or at certain other times 876 that the responder determines than an unsolicited announcement is 877 warranted. A Multicast DNS Responder MUST NOT place records from its 878 cache, which have been learned from other responders on the network, 879 in the Answer Section of outgoing response packets. Only an 880 authoritative source for a given record is allowed to issue responses 881 containing that record. 882 883 The determination of whether a given record answers a given question 884 is done using the standard DNS rules: The record name must match the 885 question name, the record rrtype must match the question qtype 886 (unless the qtype is "ANY"), and the record rrclass must match the 887 question qclass (unless the qclass is "ANY"). 888 889 A Multicast DNS Responder MUST only respond when it has a positive 890 non-null response to send. Error responses must never be sent. The 891 non-existence of any name in a Multicast DNS Domain is ascertained by 892 the failure of any machine to respond to the Multicast DNS query, not 893 by NXDOMAIN errors. 894 895 Multicast DNS Responses MUST NOT contain any questions in the 896 Question Section. Any questions in the Question Section of a received 897 Multicast DNS Response MUST be silently ignored. Multicast DNS 898 Queriers receiving Multicast DNS Responses do not care what question 899 elicited the response; they care only that the information in the 900 response is true and accurate. 901 902 A Multicast DNS Responder on Ethernet [IEEE802] and similar shared 903 multiple access networks SHOULD have the capability of delaying its 904 responses by up to 500ms, as determined by the rules described below. 905 If multiple Multicast DNS Responders were all to respond immediately 906 to a particular query, a collision would be virtually guaranteed. By 907 imposing a small random delay, the number of collisions is 908 dramatically reduced. On a full-sized Ethernet using the maximum 909 cable lengths allowed and the maximum number of repeaters allowed, an 910 Ethernet frame is vulnerable to collisions during the transmission of 911 its first 256 bits. On 10Mb/s Ethernet, this equates to a vulnerable 912 913 914 Expires 7th December 2005 Cheshire & Krochmal [Page 15] 915 917 Internet Draft Multicast DNS 7th June 2005 918 919 920 time window of 25.6us. On higher-speed variants of Ethernet, the 921 vulnerable time window is shorter. 922 923 In the case where a Multicast DNS Responder has good reason to 924 believe that it will be the only responder on the link with a 925 positive non-null response, it SHOULD NOT impose any random delay 926 before responding, and SHOULD normally generate its response within 927 at most 10ms. In particular, this applies to responding to probe 928 queries. Since receiving a probe query gives a clear indication that 929 some other Responder is planning to start using this name in the very 930 near future, answering such probe queries to defend a unique record 931 is a high priority and needs to be done immediately, without delay. A 932 probe query can be distinguished from a normal query by the fact that 933 a probe query contains a proposed record in the Authority Section 934 which answers the question in the Question Section (for more details, 935 see Section 9.1, "Probing"). 936 937 To generate immediate responses safely, it MUST have previously 938 verified that the requested name, rrtype and rrclass in the DNS query 939 are unique on this link. Responding immediately without delay is 940 appropriate for things like looking up the address record for a 941 particular host name, when the host name has been previously verified 942 unique. Responding immediately without delay is *not* appropriate for 943 things like looking up PTR records used for DNS Service Discovery 944 [DNS-SD], where a large number of responses may be anticipated. 945 946 In any case where there may be multiple responses, such as queries 947 where the answer is a member of a shared resource record set, each 948 responder SHOULD delay its response by a random amount of time 949 selected with uniform random distribution in the range 20-120ms. 950 951 In the case where the query has the TC (truncated) bit set, 952 indicating that subsequent known answer packets will follow, 953 responders SHOULD delay their responses by a random amount of time 954 selected with uniform random distribution in the range 400-500ms, 955 to allow enough time for all the known answer packets to arrive. 956 957 Except when a unicast reply has been explicitly requested via the 958 "unicast reply" bit, Multicast DNS Responses MUST be sent to UDP port 959 5353 (the well-known port assigned to mDNS) on the 224.0.0.251 960 multicast address (or its IPv6 equivalent FF02::FB). Operating in a 961 Zeroconf environment requires constant vigilance. Just because a name 962 has been previously verified unique does not mean it will continue to 963 be so indefinitely. By allowing all Multicast DNS Responders to 964 constantly monitor their peers' responses, conflicts arising out of 965 network topology changes can be promptly detected and resolved. 966 967 Sending all responses by multicast also facilitates opportunistic 968 caching by other hosts on the network. 969 970 To protect the network against excessive packet flooding due to 971 software bugs or malicious attack, a Multicast DNS Responder MUST NOT 972 multicast a given record on a given interface if it has previously 973 974 975 Expires 7th December 2005 Cheshire & Krochmal [Page 16] 976 978 Internet Draft Multicast DNS 7th June 2005 979 980 981 multicast that record on that interface within the last second. A 982 legitimate client on the network should have seen the previous 983 transmission and cached it. A client that did not receive and cache 984 the previous transmission will retry its request and receive a 985 subsequent response. Under no circumstances is there any legitimate 986 reason for a Multicast DNS Responder to multicast a given record more 987 than once per second on any given interface. 988 989 990 8.1 Legacy Unicast Responses 991 992 If the source UDP port in a received Multicast DNS Query is not port 993 5353, this indicates that the client originating the query is a 994 simple client that does not fully implement all of Multicast DNS. In 995 this case, the Multicast DNS Responder MUST send a UDP response 996 directly back to the client, via unicast, to the query packet's 997 source IP address and port. This unicast response MUST be a 998 conventional unicast response as would be generated by a conventional 999 unicast DNS server; for example, it MUST repeat the query ID and the 1000 question given in the query packet. 1001 1002 The resource record TTL given in a legacy unicast response SHOULD NOT 1003 be greater than ten seconds, even if the true TTL of the Multicast 1004 DNS resource record is higher. This is because Multicast DNS 1005 Responders that fully participate in the protocol use the cache 1006 coherency mechanisms described in Section 13 to update and invalidate 1007 stale data. Were unicast responses sent to legacy clients to use the 1008 same high TTLs, these legacy clients, which do not implement these 1009 cache coherency mechanisms, could retain stale cached resource record 1010 data long after it is no longer valid. 1011 1012 Having sent this unicast response, if the Responder has not sent this 1013 record in any multicast response recently, it SHOULD schedule the 1014 record to be sent via multicast as well, to facilitate passive 1015 conflict detection. "Recently" in this context means "if the time 1016 since the record was last sent via multicast is less than one quarter 1017 of the record's TTL". 1018 1019 1020 8.2 Multi-Question Queries 1021 1022 Multicast DNS Responders MUST correctly handle DNS query packets 1023 containing more than one question, by answering any or all of the 1024 questions to which they have answers. Any (non-defensive) answers 1025 generated in response to query packets containing more than one 1026 question SHOULD be randomly delayed in the range 20-120ms, or 1027 400-500ms if the TC (truncated) bit is set, as described above. 1028 (Answers defending a name, in response to a probe for that name, 1029 are not subject to this delay rule and are still sent immediately.) 1030 1031 1032 1033 1034 1035 1036 Expires 7th December 2005 Cheshire & Krochmal [Page 17] 1037 1039 Internet Draft Multicast DNS 7th June 2005 1040 1041 1042 8.3 Response Aggregation 1043 1044 When possible, a responder SHOULD, for the sake of network 1045 efficiency, aggregate as many responses as possible into a single 1046 Multicast DNS response packet. For example, when a responder has 1047 several responses it plans to send, each delayed by a different 1048 interval, then earlier responses SHOULD be delayed by up to an 1049 additional 500ms if that will permit them to be aggregated with 1050 other responses scheduled to go out a little later. 1051 1052 1053 9. Probing and Announcing on Startup 1054 1055 Typically a Multicast DNS Responder should have, at the very least, 1056 address records for all of its active interfaces. Creating and 1057 advertising an HINFO record on each interface as well can be useful 1058 to network administrators. 1059 1060 Whenever a Multicast DNS Responder starts up, wakes up from sleep, 1061 receives an indication of an Ethernet "Link Change" event, or has any 1062 other reason to believe that its network connectivity may have 1063 changed in some relevant way, it MUST perform the two startup steps 1064 below. 1065 1066 1067 9.1 Probing 1068 1069 The first startup step is that for all those resource records that a 1070 Multicast DNS Responder desires to be unique on the local link, it 1071 MUST send a Multicast DNS Query asking for those resource records, to 1072 see if any of them are already in use. The primary example of this is 1073 its address record which maps its unique host name to its unique IP 1074 address. All Probe Queries SHOULD be done using the desired resource 1075 record name and query type T_ANY (255), to elicit answers for all 1076 types of records with that name. This allows a single question to be 1077 used in place of several questions, which is more efficient on the 1078 network. It also allows a host to verify exclusive ownership of a 1079 name, which is desirable in most cases. It would be confusing, for 1080 example, if one host owned the "A" record for "myhost.local.", but a 1081 different host owned the HINFO record for that name. 1082 1083 The ability to place more than one question in a Multicast DNS Query 1084 is useful here, because it can allow a host to use a single packet 1085 for all of its resource records instead of needing a separate packet 1086 for each. For example, a host can simultaneously probe for uniqueness 1087 of its "A" record and all its SRV records [DNS-SD] in the same query 1088 packet. 1089 1090 When ready to send its mDNS probe packet(s) the host should first 1091 wait for a short random delay time, uniformly distributed in the 1092 range 0-250ms. This random delay is to guard against the case where a 1093 group of devices are powered on simultaneously, or a group of devices 1094 are connected to an Ethernet hub which is then powered on, or some 1095 1096 1097 Expires 7th December 2005 Cheshire & Krochmal [Page 18] 1098 1100 Internet Draft Multicast DNS 7th June 2005 1101 1102 1103 other external event happens that might cause a group of hosts to all 1104 send synchronized probes. 1105 1106 250ms after the first query the host should send a second, then 1107 250ms after that a third. If, by 250ms after the third probe, no 1108 conflicting Multicast DNS responses have been received, the host may 1109 move to the next step, announcing. (Note that this is the one 1110 exception from the normal rule that there should be at least one 1111 second between repetitions of the same question, and the interval 1112 between subsequent repetitions should double.) 1113 1114 If any conflicting Multicast DNS responses are received, then the 1115 probing host MUST defer to the existing host, and MUST choose new 1116 names for some or all of its resource records as appropriate, to 1117 avoid conflict with pre-existing hosts on the network. In the case 1118 of a host probing using query type T_ANY as recommended above, any 1119 answer containing a record with that name, of any type, MUST be 1120 considered a conflicting response and handled accordingly. 1121 1122 If fifteen failures occur within any ten-second period, then the host 1123 MUST wait at least five seconds before each successive additional 1124 probe attempt. This is to help ensure that in the event of software 1125 bugs or other unanticipated problems, errant hosts do not flood the 1126 network with a continuous stream of multicast traffic. For very 1127 simple devices, a valid way to comply with this requirement is to 1128 always wait five seconds after any failed probe attempt. 1129 1130 If a responder knows by other means, with absolute certainty, that 1131 its unique resource record set name, rrtype and rrclass cannot 1132 already be in use by any other responder on the network, then it MAY 1133 skip the probing step for that resource record set. For example, when 1134 creating the reverse address mapping PTR records, the host can 1135 reasonably assume that no other host will be trying to create those 1136 same PTR records, since that would imply that the two hosts were 1137 trying to use the same IP address, and if that were the case, the two 1138 hosts would be suffering communication problems beyond the scope of 1139 what Multicast DNS is designed to solve. 1140 1141 1142 9.2 Simultaneous Probe Tie-Breaking 1143 1144 The astute reader will observe that there is a race condition 1145 inherent in the previous description. If two hosts are probing for 1146 the same name simultaneously, neither will receive any response to 1147 the probe, and the hosts could incorrectly conclude that they may 1148 both proceed to use the name. To break this symmetry, each host 1149 populates the Authority Section of its queries with records giving 1150 the rdata that it would be proposing to use, should its probing be 1151 successful. The Authority Section is being used here in a way 1152 analogous to the Update Section of a DNS Update packet [RFC 2136]. 1153 1154 When a host that is probing for a record sees another host issue a 1155 query for the same record, it consults the Authority Section of that 1156 1157 1158 Expires 7th December 2005 Cheshire & Krochmal [Page 19] 1159 1161 Internet Draft Multicast DNS 7th June 2005 1162 1163 1164 query. If it finds any resource record there which answers the query, 1165 then it compares the data of that resource record with its own 1166 tentative data. The lexicographically later data wins. This means 1167 that if the host finds that its own data is lexicographically later, 1168 it simply ignores the other host's probe. If the host finds that its 1169 own data is lexicographically earlier, then it treats this exactly 1170 as if it had received a positive answer to its query, and concludes 1171 that it may not use the desired name. 1172 1173 The determination of 'lexicographically later' is performed by first 1174 comparing the record class, then the record type, then raw comparison 1175 of the binary content of the rdata without regard for meaning or 1176 structure. If the record classes differ, then the numerically greater 1177 class is considered 'lexicographically later'. Otherwise, if the 1178 record types differ, then the numerically greater type is considered 1179 'lexicographically later'. If the rrtype and rrclass both match then 1180 the rdata is compared. 1181 1182 In the case of resource records containing rdata that is subject to 1183 name compression, the names MUST be uncompressed before comparison. 1184 (The details of how a particular name is compressed is an artifact of 1185 how and where the record is written into the DNS message; it is not 1186 an intrinsic property of the resource record itself.) 1187 1188 The bytes of the raw uncompressed rdata are compared in turn, 1189 interpreting the bytes as eight-bit UNSIGNED values, until a byte 1190 is found whose value is greater than that of its counterpart (in 1191 which case the rdata whose byte has the greater value is deemed 1192 lexicographically later) or one of the resource records runs out 1193 of rdata (in which case the resource record which still has 1194 remaining data first is deemed lexicographically later). 1195 1196 The following is an example of a conflict: 1197 1198 cheshire.local. A 169.254.99.200 1199 cheshire.local. A 169.254.200.50 1200 1201 In this case 169.254.200.50 is lexicographically later (the third 1202 byte, with value 200, is greater than its counterpart with value 99), 1203 so it is deemed the winner. 1204 1205 Note that it is vital that the bytes are interpreted as UNSIGNED 1206 values, or the wrong outcome may result. In the example above, if 1207 the byte with value 200 had been incorrectly interpreted as a 1208 signed value then it would be interpreted as value -56, and the 1209 wrong address record would be deemed the winner. 1210 1211 1212 9.3 Announcing 1213 1214 The second startup step is that the Multicast DNS Responder MUST send 1215 a gratuitous Multicast DNS Response containing, in the Answer 1216 Section, all of its resource records (both shared records, and unique 1217 1218 1219 Expires 7th December 2005 Cheshire & Krochmal [Page 20] 1220 1222 Internet Draft Multicast DNS 7th June 2005 1223 1224 1225 records that have completed the probing step). If there are too many 1226 resource records to fit in a single packet, multiple packets should 1227 be used. 1228 1229 In the case of shared records (e.g. the PTR records used by DNS 1230 Service Discovery [DNS-SD]), the records are simply placed as-is 1231 into the Answer Section of the DNS Response. 1232 1233 In the case of records that have been verified to be unique in the 1234 previous step, they are placed into the Answer Section of the DNS 1235 Response with the most significant bit of the rrclass set to one. 1236 The most significant bit of the rrclass for a record in the Answer 1237 Section of a response packet is the mDNS "cache flush" bit and is 1238 discussed in more detail below in Section 11.3 "Announcements to 1239 Flush Outdated Cache Entries". 1240 1241 The Multicast DNS Responder MUST send at least two gratuitous 1242 responses, one second apart. A Responder MAY send up to ten 1243 gratuitous Responses, provided that the interval between gratuitous 1244 responses doubles with every response sent. 1245 1246 A Multicast DNS Responder SHOULD NOT continue sending gratuitous 1247 Responses for longer than the TTL of the record. The purpose of 1248 announcing new records via gratuitous Responses is to ensure that 1249 peer caches are up to date. After a time interval equal to the TTL of 1250 the record has passed, it is very likely that old stale copies of 1251 that record in peer caches will have expired naturally, so subsequent 1252 announcements serve little purpose. 1253 1254 A Multicast DNS Responder MUST NOT send announcements in the absence 1255 of information that its network connectivity may have changed in some 1256 relevant way. In particular, a Multicast DNS Responder MUST NOT send 1257 regular periodic announcements as a matter of course. 1258 1259 Whenever a Multicast DNS Responder receives any Multicast DNS 1260 response (gratuitous or otherwise) containing a conflicting resource 1261 record, the conflict MUST be resolved as described below in "Conflict 1262 Resolution". 1263 1264 9.4 Updating 1265 1266 At any time, if the rdata of any of a host's Multicast DNS records 1267 changes, the host MUST repeat the Announcing step described above to 1268 update neighboring caches. For example, if any of a host's IP 1269 addresses change, it MUST re-announce those address records. 1270 1271 In the case of shared records, a host MUST send a 'goodbye' 1272 announcement with TTL zero (see Section 11.2 "Goodbye Packets") 1273 for the old rdata, to cause it to be deleted from peer caches, 1274 before announcing the new rdata. In the case of unique records, 1275 a host SHOULD omit the 'goodbye' announcement, since the cache 1276 flush bit on the newly announced records will cause old rdata 1277 to be flushed from peer caches anyway. 1278 1279 1280 Expires 7th December 2005 Cheshire & Krochmal [Page 21] 1281 1283 Internet Draft Multicast DNS 7th June 2005 1284 1285 1286 A host may update the contents of any of its records at any time, 1287 though a host SHOULD NOT update records more frequently than ten 1288 times per minute. Frequent rapid updates impose a burden on the 1289 network. If a host has information to disseminate which changes more 1290 frequently than ten times per minute, then it may be more appropriate 1291 to design a protocol for that specific purpose. 1292 1293 1294 10. Conflict Resolution 1295 1296 A conflict occurs when a Multicast DNS Responder has a unique record 1297 for which it is authoritative, and it receives, in the Answer Section 1298 of a Multicast DNS response another record with the same name, rrtype 1299 and rrclass, but inconsistent rdata. What may be considered 1300 inconsistent is context sensitive, except that resource records with 1301 identical rdata are never considered inconsistent, even if they 1302 originate from different hosts. This is to permit use of proxies and 1303 other fault-tolerance mechanisms that may cause more than one 1304 responder to be capable of issuing identical answers on the network. 1305 1306 A common example of a resource record type that is intended to be 1307 unique, not shared between hosts, is the address record that maps a 1308 host's name to its IP address. Should a host witness another host 1309 announce an address record with the same name but a different IP 1310 address, then that is considered inconsistent, and that address 1311 record is considered to be in conflict. 1312 1313 Whenever a Multicast DNS Responder receives any Multicast DNS 1314 response (gratuitous or otherwise) containing a conflicting resource 1315 record in the Answer Section, the Multicast DNS Responder MUST 1316 immediately reset its conflicted unique record to probing state, and 1317 go through the startup steps described above in Section 9. "Probing 1318 and Announcing on Startup". The protocol used in the Probing phase 1319 will determine a winner and a loser, and the loser MUST cease using 1320 the name, and reconfigure. 1321 1322 It is very important that any host receiving a resource record that 1323 conflicts with one of its own MUST take action as described above. 1324 In the case of two hosts using the same host name, where one has been 1325 configured to require a unique host name and the other has not, the 1326 one that has not been configured to require a unique host name will 1327 not perceive any conflict, and will not take any action. By reverting 1328 to Probing state, the host that desires a unique host name will go 1329 through the necessary steps to ensure that a unique host is obtained. 1330 1331 The recommended course of action after probing and failing is as 1332 follows: 1333 1334 o Programmatically change the resource record name in an attempt to 1335 find a new name that is unique. This could be done by adding some 1336 further identifying information (e.g. the model name of the 1337 hardware) if it is not already present in the name, appending the 1338 digit "2" to the name, or incrementing a number at the end of the 1339 name if one is already present. 1340 1341 Expires 7th December 2005 Cheshire & Krochmal [Page 22] 1342 1344 Internet Draft Multicast DNS 7th June 2005 1345 1346 1347 o Probe again, and repeat until a unique name is found. 1348 1349 o Record this newly chosen name in persistent storage so that the 1350 device will use the same name the next time it is power-cycled. 1351 1352 o Display a message to the user or operator informing them of the 1353 name change. For example: 1354 1355 The name "Bob's Music" is in use by another iTunes music 1356 server on the network. Your music has been renamed to 1357 "Bob's Music (G4 Cube)". If you want to change this name, 1358 use [describe appropriate menu item or preference dialog]. 1359 1360 How the user or operator is informed depends on context. A desktop 1361 computer with a screen might put up a dialog box. A headless server 1362 in the closet may write a message to a log file, or use whatever 1363 mechanism (email, SNMP trap, etc.) it uses to inform the 1364 administrator of other error conditions. On the other hand a headless 1365 server in the closet may not inform the user at all -- if the user 1366 cares, they will notice the name has changed, and connect to the 1367 server in the usual way (e.g. via Web Browser) to configure a new 1368 name. 1369 1370 The examples in this section focus on address records (i.e. host 1371 names), but the same considerations apply to all resource records 1372 where uniqueness (or maintenance of some other defined constraint) 1373 is desired. 1374 1375 1376 1377 11. Resource Record TTL Values and Cache Coherency 1378 1379 As a general rule, the recommended TTL value for Multicast DNS 1380 resource records with a host name as the resource record's name 1381 (e.g. A, AAAA, HINFO, etc.) or contained within the resource record's 1382 rdata (e.g. SRV, reverse mapping PTR record, etc.) is 120 seconds. 1383 1384 The recommended TTL value for other Multicast DNS resource records 1385 is 75 minutes. 1386 1387 A client with an active outstanding query will issue a query packet 1388 when one or more of the resource record(s) in its cache is (are) 80% 1389 of the way to expiry. If the TTL on those records is 75 minutes, 1390 this ongoing cache maintenance process yields a steady-state query 1391 rate of one query every 60 minutes. 1392 1393 Any distributed cache needs a cache coherency protocol. If Multicast 1394 DNS resource records follow the recommendation and have a TTL of 75 1395 minutes, that means that stale data could persist in the system for 1396 a little over an hour. Making the default TTL significantly lower 1397 would reduce the lifetime of stale data, but would produce too much 1398 extra traffic on the network. Various techniques are available to 1399 minimize the impact of such stale data. 1400 1401 1402 Expires 7th December 2005 Cheshire & Krochmal [Page 23] 1403 1405 Internet Draft Multicast DNS 7th June 2005 1406 1407 1408 11.1 Cooperating Multicast DNS Responders 1409 1410 If a Multicast DNS Responder ("A") observes some other Multicast DNS 1411 Responder ("B") send a Multicast DNS Response packet containing a 1412 resource record with the same name, rrtype and rrclass as one of A's 1413 resource records, but different rdata, then: 1414 1415 o If A's resource record is intended to be a shared resource record, 1416 then this is no conflict, and no action is required. 1417 1418 o If A's resource record is intended to be a member of a unique 1419 resource record set owned solely by that responder, then this 1420 is a conflict and MUST be handled as described in Section 10 1421 "Conflict Resolution". 1422 1423 If a Multicast DNS Responder ("A") observes some other Multicast DNS 1424 Responder ("B") send a Multicast DNS Response packet containing a 1425 resource record with the same name, rrtype and rrclass as one of A's 1426 resource records, and identical rdata, then: 1427 1428 o If the TTL of B's resource record given in the packet is at least 1429 half the true TTL from A's point of view, then no action is 1430 required. 1431 1432 o If the TTL of B's resource record given in the packet is less than 1433 half the true TTL from A's point of view, then A MUST mark its 1434 record to be announced via multicast. Clients receiving the record 1435 from B would use the TTL given by B, and hence may delete the 1436 record sooner than A expects. By sending its own multicast response 1437 correcting the TTL, A ensures that the record will be retained for 1438 the desired time. 1439 1440 These rules allow multiple Multicast DNS Responders to offer the same 1441 data on the network (perhaps for fault tolerance reasons) without 1442 conflicting with each other. 1443 1444 1445 11.2 Goodbye Packets 1446 1447 In the case where a host knows that certain resource record data is 1448 about to become invalid (for example when the host is undergoing a 1449 clean shutdown) the host SHOULD send a gratuitous announcement mDNS 1450 response packet, giving the same resource record name, rrtype, 1451 rrclass and rdata, but an RR TTL of zero. This has the effect of 1452 updating the TTL stored in neighboring hosts' cache entries to zero, 1453 causing that cache entry to be promptly deleted. 1454 1455 Clients receiving a Multicast DNS Response with a TTL of zero SHOULD 1456 NOT immediately delete the record from the cache, but instead record 1457 a TTL of 1 and then delete the record one second later. In the case 1458 of multiple Multicast DNS Responders on the network described in 1459 Section 11.1 above, if one of the Responders shuts down and 1460 incorrectly sends goodbye packets for its records, it gives the other 1461 1462 1463 Expires 7th December 2005 Cheshire & Krochmal [Page 24] 1464 1466 Internet Draft Multicast DNS 7th June 2005 1467 1468 1469 cooperating Responders one second to send out their own response to 1470 "rescue" the records before they expire and are deleted. 1471 1472 Generally speaking, it is more important to send goodbye packets for 1473 shared records than unique records. A given shared record name (such 1474 as a PTR record used for DNS Service Discovery [DNS-SD]) by its 1475 nature often has many representatives from many different hosts, and 1476 tends to be the subject of long-lived ongoing queries. Those 1477 long-lived queries are often concerned not just about being informed 1478 when records appear, but also about being informed if those records 1479 vanish again. In contrast, a unique record set (such as an SRV 1480 record, or a host address record), by its nature, often has far fewer 1481 members than a shared record set, and is usually the subject of 1482 one-shot queries which simply retrieve the data and then cease 1483 querying once they have the answer they are seeking. Therefore, 1484 sending a goodbye packet for a unique record set is likely to offer 1485 less benefit, because it is likely at any given moment that no one 1486 has an active query running for that record set. One example where 1487 goodbye packets for SRV and address records are useful is when 1488 transferring control to a Sleep Proxy Server (see Section 16, 1489 "Multicast DNS and Power Management"). 1490 1491 1492 11.3 Announcements to Flush Outdated Cache Entries 1493 1494 Whenever a host has a resource record with potentially new data (e.g. 1495 after rebooting, waking from sleep, connecting to a new network link, 1496 changing IP address, etc.), the host MUST send a series of gratuitous 1497 announcements to update cache entries in its neighbor hosts. In 1498 these gratuitous announcements, if the record is one that is intended 1499 to be unique, the host sets the most significant bit of the rrclass 1500 field of the resource record. This bit, the "cache flush" bit, tells 1501 neighboring hosts that this is not a shared record type. Instead of 1502 merging this new record additively into the cache in addition to any 1503 previous records with the same name, rrtype and rrclass, all old 1504 records with that name, type and class that were received more than 1505 one second ago are declared invalid, and marked to expire from the 1506 cache in one second. 1507 1508 The semantics of the cache flush bit are as follows: Normally when a 1509 resource record appears in the Answer Section of the DNS Response, it 1510 means, "This is an assertion that this information is true." When a 1511 resource record appears in the Answer Section of the DNS Response 1512 with the "cache flush" bit set, it means, "This is an assertion that 1513 this information is the truth and the whole truth, and anything you 1514 may have heard more than a second ago regarding records of this 1515 name/rrtype/rrclass is no longer valid". 1516 1517 To accommodate the case where the set of records from one host 1518 constituting a single unique RRSet is too large to fit in a single 1519 packet, only cache records that are more than one second old are 1520 flushed. This allows the announcing host to generate a quick burst of 1521 packets back-to-back on the wire containing all the members 1522 1523 1524 Expires 7th December 2005 Cheshire & Krochmal [Page 25] 1525 1527 Internet Draft Multicast DNS 7th June 2005 1528 1529 1530 of the RRSet. When receiving records with the "cache flush" bit set, 1531 all records older than one second are marked to be deleted one second 1532 in the future. One second after the end of the little packet burst, 1533 any records not represented within that packet burst will then be 1534 expired from all peer caches. 1535 1536 Any time a host sends a response packet containing some members of a 1537 unique RRSet, it SHOULD send the entire RRSet, preferably in a single 1538 packet, or if the entire RRSet will not fit in a single packet, in a 1539 quick burst of packets sent as close together as possible. The host 1540 SHOULD set the cache flush bit on all members of the unique RRSet. 1541 In the event that for some reason the host chooses not to send the 1542 entire unique RRSet in a single packet or a rapid packet burst, 1543 it MUST NOT set the cache flush bit on any of those records. 1544 1545 The reason for waiting one second before deleting stale records from 1546 the cache is to accommodate bridged networks. For example, a host's 1547 address record announcement on a wireless interface may be bridged 1548 onto a wired Ethernet, and cause that same host's Ethernet address 1549 records to be flushed from peer caches. The one-second delay gives 1550 the host the chance to see its own announcement arrive on the wired 1551 Ethernet, and immediately re-announce its Ethernet interface's 1552 address records so that both sets remain valid and live in peer 1553 caches. 1554 1555 These rules apply regardless of *why* the response packet is being 1556 generated. They apply to startup announcements as described in 1557 Section 9.3, and to responses generated as a result of receiving 1558 query packets. 1559 1560 The "cache flush" bit is only set in records in the Answer Section of 1561 Multicast DNS responses sent to UDP port 5353. The "cache flush" bit 1562 MUST NOT be set in any resource records in a response packet sent in 1563 legacy unicast responses to UDP ports other than 5353. 1564 1565 The "cache flush" bit MUST NOT be set in any resource records in the 1566 known-answer list of any query packet. 1567 1568 The "cache flush" bit MUST NOT ever be set in any shared resource 1569 record. To do so would cause all the other shared versions of this 1570 resource record with different rdata from different Responders to be 1571 immediately deleted from all the caches on the network. 1572 1573 The "cache flush" bit does apply to questions listed in the Question 1574 Section of a Multicast DNS packet. The top bit of the rrclass field 1575 in questions is used for an entirely different purpose (see Section 1576 6.5, "Questions Requesting Unicast Responses"). 1577 1578 Note that the "cache flush" bit is NOT part of the resource record 1579 class. The "cache flush" bit is the most significant bit of the 1580 second 16-bit word of a resource record in the Answer Section of 1581 an mDNS packet (the field conventionally referred to as the rrclass 1582 field), and the actual resource record class is the least-significant 1583 1584 1585 Expires 7th December 2005 Cheshire & Krochmal [Page 26] 1586 1588 Internet Draft Multicast DNS 7th June 2005 1589 1590 1591 fifteen bits of this field. There is no mDNS resource record class 1592 0x8001. The value 0x8001 in the rrclass field of a resource record in 1593 an mDNS response packet indicates a resource record with class 1, 1594 with the "cache flush" bit set. When receiving a resource record with 1595 the "cache flush" bit set, implementations should take care to mask 1596 off that bit before storing the resource record in memory. 1597 1598 1599 11.4 Cache Flush on Topology change 1600 1601 If the hardware on a given host is able to indicate physical changes 1602 of connectivity, then when the hardware indicates such a change, the 1603 host should take this information into account in its mDNS cache 1604 management strategy. For example, a host may choose to immediately 1605 flush all cache records received on a particular interface when that 1606 cable is disconnected. Alternatively, a host may choose to adjust the 1607 remaining TTL on all those records to a few seconds so that if the 1608 cable is not reconnected quickly, those records will expire from the 1609 cache. 1610 1611 Likewise, when a host reboots, or wakes from sleep, or undergoes some 1612 other similar discontinuous state change, the cache management 1613 strategy should take that information into account. 1614 1615 1616 11.5 Cache Flush on Failure Indication 1617 1618 Sometimes a cache record can be determined to be stale when a client 1619 attempts to use the rdata it contains, and finds that rdata to be 1620 incorrect. 1621 1622 For example, the rdata in an address record can be determined to be 1623 incorrect if attempts to contact that host fail, either because 1624 ARP/ND requests for that address go unanswered (for an address on a 1625 local subnet) or because a router returns an ICMP "Host Unreachable" 1626 error (for an address on a remote subnet). 1627 1628 The rdata in an SRV record can be determined to be incorrect if 1629 attempts to communicate with the indicated service at the host and 1630 port number indicated are not successful. 1631 1632 The rdata in a DNS-SD PTR record can be determined to be incorrect if 1633 attempts to look up the SRV record it references are not successful. 1634 1635 In any such case, the software implementing the mDNS resource record 1636 cache should provide a mechanism so that clients detecting stale 1637 rdata can inform the cache. 1638 1639 When the cache receives this hint that it should reconfirm some 1640 record, it MUST issue two or more queries for the resource record in 1641 question. If no response is received in a reasonable amount of time, 1642 then, even though its TTL may indicate that it is not yet due to 1643 expire, that record SHOULD be promptly flushed from the cache. 1644 1645 1646 Expires 7th December 2005 Cheshire & Krochmal [Page 27] 1647 1649 Internet Draft Multicast DNS 7th June 2005 1650 1651 1652 The end result of this is that if a printer suffers a sudden power 1653 failure or other abrupt disconnection from the network, its name may 1654 continue to appear in DNS-SD browser lists displayed on users' 1655 screens. Eventually that entry will expire from the cache naturally, 1656 but if a user tries to access the printer before that happens, the 1657 failure to successfully contact the printer will trigger the more 1658 hasty demise of its cache entries. This is a sensible trade-off 1659 between good user-experience and good network efficiency. If we were 1660 to insist that printers should disappear from the printer list within 1661 30 seconds of becoming unavailable, for all failure modes, the only 1662 way to achieve this would be for the client to poll the printer at 1663 least every 30 seconds, or for the printer to announce its presence 1664 at least every 30 seconds, both of which would be an unreasonable 1665 burden on most networks. 1666 1667 1668 11.6 Passive Observation of Failures 1669 1670 A host observes the multicast queries issued by the other hosts on 1671 the network. One of the major benefits of also sending responses 1672 using multicast is that it allows all hosts to see the responses (or 1673 lack thereof) to those queries. 1674 1675 If a host sees queries, for which a record in its cache would be 1676 expected to be given as an answer in a multicast response, but no 1677 such answer is seen, then the host may take this as an indication 1678 that the record may no longer be valid. 1679 1680 After seeing two or more of these queries, and seeing no multicast 1681 response containing the expected answer within a reasonable amount of 1682 time, then even though its TTL may indicate that it is not yet due to 1683 expire, that record MAY be flushed from the cache. The host SHOULD 1684 NOT perform its own queries to re-confirm that the record is truly 1685 gone. If every host on a large network were to do this, it would 1686 cause a lot of unnecessary multicast traffic. If host A sends 1687 multicast queries that remain unanswered, then there is no reason to 1688 suppose that host B or any other host is likely to be any more 1689 successful. 1690 1691 The previous section, "Cache Flush on Failure Indication", describes 1692 a situation where a user trying to print discovers that the printer 1693 is no longer available. By implementing the passive observation 1694 described here, when one user fails to contact the printer, all hosts 1695 on the network observe that failure and update their caches 1696 accordingly. 1697 1698 1699 12. Special Characteristics of Multicast DNS Domains 1700 1701 Unlike conventional DNS names, names that end in ".local.", 1702 "254.169.in-addr.arpa." or "0.8.e.f.ip6.arpa." have only local 1703 significance. Conventional DNS seeks to provide a single unified 1704 namespace, where a given DNS query yields the same answer no matter 1705 1706 1707 Expires 7th December 2005 Cheshire & Krochmal [Page 28] 1708 1710 Internet Draft Multicast DNS 7th June 2005 1711 1712 1713 where on the planet it is performed or to which recursive DNS server 1714 the query is sent. (However, split views, firewalls, intranets and 1715 the like have somewhat interfered with this goal of DNS representing 1716 a single universal truth.) In contrast, each IP link has its own 1717 private ".local.", "254.169.in-addr.arpa." and "0.8.e.f.ip6.arpa." 1718 namespaces, and the answer to any query for a name within those 1719 domains depends on where that query is asked. 1720 1721 Multicast DNS Domains are not delegated from their parent domain via 1722 use of NS records. There are no NS records anywhere in Multicast DNS 1723 Domains. Instead, all Multicast DNS Domains are delegated to the IP 1724 addresses 224.0.0.251 and FF02::FB by virtue of the individual 1725 organizations producing DNS client software deciding how to handle 1726 those names. It would be extremely valuable for the industry if this 1727 special handling were ratified and recorded by IANA, since otherwise 1728 the special handling provided by each vendor is likely to be 1729 inconsistent. 1730 1731 The IPv4 name server for a Multicast DNS Domain is 224.0.0.251. The 1732 IPv6 name server for a Multicast DNS Domain is FF02::FB. These are 1733 multicast addresses; therefore they identify not a single host but a 1734 collection of hosts, working in cooperation to maintain some 1735 reasonable facsimile of a competently managed DNS zone. Conceptually 1736 a Multicast DNS Domain is a single DNS zone, however its server is 1737 implemented as a distributed process running on a cluster of loosely 1738 cooperating CPUs rather than as a single process running on a single 1739 CPU. 1740 1741 No delegation is performed within Multicast DNS Domains. Because the 1742 cluster of loosely coordinated CPUs is cooperating to administer a 1743 single zone, delegation is neither necessary nor desirable. Just 1744 because a particular host on the network may answer queries for a 1745 particular record type with the name "example.local." does not imply 1746 anything about whether that host will answer for the name 1747 "child.example.local.", or indeed for other record types with the 1748 name "example.local." 1749 1750 Multicast DNS Zones have no SOA record. A conventional DNS zone's 1751 SOA record contains information such as the email address of the zone 1752 administrator and the monotonically increasing serial number of the 1753 last zone modification. There is no single human administrator for 1754 any given Multicast DNS Zone, so there is no email address. Because 1755 the hosts managing any given Multicast DNS Zone are only loosely 1756 coordinated, there is no readily available monotonically increasing 1757 serial number to determine whether or not the zone contents have 1758 changed. A host holding part of the shared zone could crash or be 1759 disconnected from the network at any time without informing the other 1760 hosts. There is no reliable way to provide a zone serial number that 1761 would, whenever such a crash or disconnection occurred, immediately 1762 change to indicate that the contents of the shared zone had changed. 1763 1764 Zone transfers are not possible for any Multicast DNS Zone. 1765 1766 1767 1768 Expires 7th December 2005 Cheshire & Krochmal [Page 29] 1769 1771 Internet Draft Multicast DNS 7th June 2005 1772 1773 1774 13. Multicast DNS for Service Discovery 1775 1776 This document does not describe using Multicast DNS for network 1777 browsing or service discovery. However, the mechanisms this document 1778 describes are compatible with (and support) the browsing and service 1779 discovery mechanisms proposed in "DNS-Based Service Discovery" 1780 [DNS-SD]. 1781 1782 1783 14. Enabling and Disabling Multicast DNS 1784 1785 The option to fail-over to Multicast DNS for names not ending in 1786 ".local." SHOULD be a user-configured option, and SHOULD 1787 be disabled by default because of the possible security issues 1788 related to unintended local resolution of apparently global names. 1789 1790 The option to lookup unqualified (relative) names by appending 1791 ".local." (or not) is controlled by whether ".local." appears 1792 (or not) in the client's DNS search list. 1793 1794 No special control is needed for enabling and disabling Multicast DNS 1795 for names explicitly ending with ".local." as entered by the user. 1796 The user doesn't need a way to disable Multicast DNS for names ending 1797 with ".local.", because if the user doesn't want to use Multicast 1798 DNS, they can achieve this by simply not using those names. If a user 1799 *does* enter a name ending in ".local.", then we can safely assume 1800 the user's intention was probably that it should work. Having user 1801 configuration options that can be (intentionally or unintentionally) 1802 set so that local names don't work is just one more way of 1803 frustrating the user's ability to perform the tasks they want, 1804 perpetuating the view that, "IP networking is too complicated to 1805 configure and too hard to use." This in turn perpetuates the 1806 continued use of protocols like AppleTalk. If we want to retire 1807 AppleTalk, NetBIOS, etc., we need to offer users equivalent IP 1808 functionality that they can rely on to, "always work, like 1809 AppleTalk." A little Multicast DNS traffic may be a burden on the 1810 network, but it is an insignificant burden compared to continued 1811 widespread use of AppleTalk. 1812 1813 1814 15. Considerations for Multiple Interfaces 1815 1816 A host should defend its host name (FQDN) on all active interfaces on 1817 which it is answering Multicast DNS queries. 1818 1819 In the event of a name conflict on *any* interface, a host should 1820 configure a new host name, if it wishes to maintain uniqueness of its 1821 host name. 1822 1823 A host may choose to use the same name for all of its address records 1824 on all interfaces, or it may choose to manage its Multicast DNS host 1825 name(s) independently on each interface, potentially answering to 1826 different names on different interfaces. 1827 1828 1829 Expires 7th December 2005 Cheshire & Krochmal [Page 30] 1830 1832 Internet Draft Multicast DNS 7th June 2005 1833 1834 1835 When answering a Multicast DNS query, a multi-homed host with a 1836 link-local address (or addresses) should take care to ensure that 1837 any address going out in a Multicast DNS response is valid for use 1838 on the interface on which the response is going out. 1839 1840 Just as the same link-local IP address may validly be in use 1841 simultaneously on different links by different hosts, the same 1842 link-local host name may validly be in use simultaneously on 1843 different links, and this is not an error. A multi-homed host with 1844 connections to two different links may be able to communicate with 1845 two different hosts that are validly using the same name. While this 1846 kind of name duplication should be rare, it means that a host that 1847 wants to fully support this case needs network programming APIs that 1848 allow applications to specify on what interface to perform a 1849 link-local Multicast DNS query, and to discover on what interface a 1850 Multicast DNS response was received. 1851 1852 1853 16. Multicast DNS and Power Management 1854 1855 Many modern network devices have the ability to go into a low-power 1856 mode where only a small part of the Ethernet hardware remains 1857 powered, and the device can be woken up by sending a specially 1858 formatted Ethernet frame which the device's power-management hardware 1859 recognizes. 1860 1861 To make use of this in conjunction with Multicast DNS, we propose a 1862 network power management service called Sleep Proxy Service. A device 1863 that wishes to enter low-power mode first uses DNS-SD to determine if 1864 Sleep Proxy Service is available on the local network. In some 1865 networks there may be more than one piece of hardware implementing 1866 Sleep Proxy Service, for fault-tolerance reasons. 1867 1868 If the device finds the network has Sleep Proxy Service, the device 1869 transmits two or more gratuitous mDNS announcements setting the TTL 1870 of its relevant resource records to zero, to delete them from 1871 neighboring caches. The relevant resource records include address 1872 records and SRV records, and other resource records as may apply to a 1873 particular device. The device then communicates all of its remaining 1874 active records, plus the names, rrtypes and rrclasses of the deleted 1875 records, to the Sleep Proxy Service(s), along with a copy of the 1876 specific "magic packet" required to wake the device up. 1877 1878 When a Sleep Proxy Service sees an mDNS query for one of the 1879 device's active records (e.g. a DNS-SD PTR record), it answers on 1880 behalf of the device without waking it up. When a Sleep Proxy Service 1881 sees an mDNS query for one of the device's deleted resource 1882 records, it deduces that some client on the network needs to make an 1883 active connection to the device, and sends the specified "magic 1884 packet" to wake the device up. The device then wakes up, reactivates 1885 its deleted resource records, and re-announces them to the network. 1886 The client waiting to connect sees the announcements, learns the 1887 current IP address and port number of the desired service on the 1888 device, and proceeds to connect to it. 1889 1890 Expires 7th December 2005 Cheshire & Krochmal [Page 31] 1891 1893 Internet Draft Multicast DNS 7th June 2005 1894 1895 1896 The connecting client does not need to be aware of how Sleep Proxy 1897 Service works. Only devices that implement low power mode and wish to 1898 make use of Sleep Proxy Service need to be aware of how that protocol 1899 works. 1900 1901 The reason that a device using a Sleep Proxy Service should send more 1902 than one goodbye packet is to ensure deletion of the resource records 1903 from all peer caches. If resource records were to inadvertently 1904 remain in some peer caches, then those peers may not issue any query 1905 packets for those records when attempting to access the sleeping 1906 device, so the Sleep Proxy Service would not receive any queries for 1907 the device's SRV and/or address records, and the necessary wake-up 1908 message would not be triggered. 1909 1910 The full specification of mDNS / DNS-SD Sleep Proxy Service 1911 is described in another document [not yet published]. 1912 1913 1914 17. Multicast DNS Character Set 1915 1916 Unicast DNS has been plagued by the lack of any support for non-US 1917 characters. Indeed, conventional DNS is usually limited to just 1918 letters, digits and hyphens, with no spaces or other punctuation. 1919 Attempts to remedy this for unicast DNS have been badly constrained 1920 by the need to accommodate old buggy legacy DNS implementations. 1921 In reality, the DNS specification actually imposes no limits on what 1922 characters may be used in names, and good DNS implementations handle 1923 any arbitrary eight-bit data without trouble. However, the old rules 1924 for ARPANET host names back in the 1980s required names to be just 1925 letters, digits, and hyphens [RFC 1034], and since the predominant 1926 use of DNS is to store host address records, many have assumed that 1927 the DNS protocol itself suffers from the same limitation. It would be 1928 more accurate to say that certain bad implementations may not handle 1929 eight-bit data correctly, not that the protocol doesn't support it. 1930 1931 Multicast DNS is a new protocol and doesn't (yet) have old buggy 1932 legacy implementations to constrain the design choices. Accordingly, 1933 it adopts the simple obvious elegant solution: all names in Multicast 1934 DNS are encoded using precomposed UTF-8 [RFC 3629]. The 1935 characters SHOULD conform to Unicode Normalization Form C (NFC): Use 1936 precomposed characters instead of combining sequences where possible, 1937 e.g. use U+00C4 ("Latin capital letter A with diaeresis") instead of 1938 U+0041 U+0308 ("Latin capital letter A", "combining diaeresis"). 1939 1940 For names that are restricted to letters, digits and hyphens, the 1941 UTF-8 encoding is identical to the US-ASCII encoding, so this is 1942 entirely compatible with existing host names. For characters outside 1943 the US-ASCII range, UTF-8 encoding is used. 1944 1945 Multicast DNS implementations MUST NOT use any other encodings apart 1946 from precomposed UTF-8 (US-ASCII being considered a compatible subset 1947 of UTF-8). 1948 1949 1950 1951 Expires 7th December 2005 Cheshire & Krochmal [Page 32] 1952 1954 Internet Draft Multicast DNS 7th June 2005 1955 1956 1957 This point bears repeating: After many years of debate, as a result 1958 of the need to accommodate certain DNS implementations that 1959 apparently couldn't handle any character that's not a letter, digit 1960 or hyphen (and apparently never will be updated to remedy this 1961 limitation) the unicast DNS community settled on an extremely baroque 1962 encoding called "Punycode" [RFC 3492]. Punycode is a remarkably 1963 ingenious encoding solution, but it is complicated, hard to 1964 understand, and hard to implement, using sophisticated techniques 1965 including insertion unsort coding, generalized variable-length 1966 integers, and bias adaptation. The resulting encoding is remarkably 1967 compact given the constraints, but it's still not as good as simple 1968 straightforward UTF-8, and it's hard even to predict whether a given 1969 input string will encode to a Punycode string that fits within DNS's 1970 63-byte limit, except by simply trying the encoding and seeing 1971 whether it fits. Indeed, the encoded size depends not only on the 1972 input characters, but on the order they appear, so the same set of 1973 characters may or may not encode to a legal Punycode string that fits 1974 within DNS's 63-byte limit, depending on the order the characters 1975 appear. This is extremely hard to present in a user interface that 1976 explains to users why one name is allowed, but another name 1977 containing the exact same characters is not. Neither Punycode nor any 1978 other of the "Ascii Compatible Encodings" proposed for Unicast DNS 1979 may be used in Multicast DNS packets. Any text being represented 1980 internally in some other representation MUST be converted to 1981 canonical precomposed UTF-8 before being placed in any Multicast DNS 1982 packet. 1983 1984 The simple rules for case-insensitivity in Unicast DNS also apply in 1985 Multicast DNS; that is to say, in name comparisons, the lower-case 1986 letters "a" to "z" (0x61 to 0x7A) match their upper-case equivalents 1987 "A" to "Z" (0x41 to 0x5A). Hence, if a client issues a query for an 1988 address record with the name "cheshire.local", then a responder 1989 having an address record with the name "Cheshire.local" should 1990 issue a response. No other automatic equivalences should be assumed. 1991 In particular all UTF-8 multi-byte characters (codes 0x80 and higher) 1992 are compared by simple binary comparison of the raw byte values. 1993 1994 No other automatic character equivalence is defined in Multicast DNS. 1995 For example, accented characters are not defined to be automatically 1996 equivalent to their unaccented counterparts. Where automatic 1997 equivalences are desired, this may be achieved through the use of 1998 programmatically-generated CNAME records. For example, if a responder 1999 has an address record for an accented name Y, and a client issues a 2000 query for a name X, where X is the same as Y with all the accents 2001 removed, then the responder may issue a response containing two 2002 resource records: A CNAME record "X CNAME Y", asserting that the 2003 requested name X (unaccented) is an alias for the true (accented) 2004 name Y, followed by the address record for Y. 2005 2006 2007 2008 2009 2010 2011 2012 Expires 7th December 2005 Cheshire & Krochmal [Page 33] 2013 2015 Internet Draft Multicast DNS 7th June 2005 2016 2017 2018 18. Multicast DNS Message Size 2019 2020 RFC 1035 restricts DNS Messages carried by UDP to no more than 512 2021 bytes (not counting the IP or UDP headers). For UDP packets carried 2022 over the wide-area Internet in 1987, this was appropriate. For 2023 link-local multicast packets on today's networks, there is no reason 2024 to retain this restriction. Given that the packets are by definition 2025 link-local, there are no Path MTU issues to consider. 2026 2027 Multicast DNS Messages carried by UDP may be up to the IP MTU of the 2028 physical interface, less the space required for the IP header (20 2029 bytes for IPv4; 40 bytes for IPv6) and the UDP header (8 bytes). 2030 2031 In the case of a single mDNS Resource Record which is too large to 2032 fit in a single MTU-sized multicast response packet, a Multicast DNS 2033 Responder SHOULD send the Resource Record alone, in a single IP 2034 datagram, sent using multiple IP fragments. Resource Records this 2035 large SHOULD be avoided, except in the very rare cases where they 2036 really are the appropriate solution to the problem at hand. 2037 Implementers should be aware that many simple devices do not 2038 re-assemble fragmented IP datagrams, so large Resource Records SHOULD 2039 NOT be used except in specialized cases where the implementer knows 2040 that all receivers implement reassembly. 2041 2042 A Multicast DNS packet larger than the interface MTU, which is sent 2043 using fragments, MUST NOT contain more than one Resource Record. 2044 2045 Even when fragmentation is used, a Multicast DNS packet, including IP 2046 and UDP headers, MUST NOT exceed 9000 bytes. 2047 2048 2049 19. Multicast DNS Message Format 2050 2051 This section describes specific restrictions on the allowable 2052 values for the header fields of a Multicast DNS message. 2053 2054 19.1. ID (Query Identifier) 2055 2056 Multicast DNS clients SHOULD listen for gratuitous responses 2057 issued by hosts booting up (or waking up from sleep or otherwise 2058 joining the network). Since these gratuitous responses may contain a 2059 useful answer to a question for which the client is currently 2060 awaiting an answer, Multicast DNS clients SHOULD examine all received 2061 Multicast DNS response messages for useful answers, without regard to 2062 the contents of the ID field or the Question Section. In Multicast 2063 DNS, knowing which particular query message (if any) is responsible 2064 for eliciting a particular response message is less interesting than 2065 knowing whether the response message contains useful information. 2066 2067 Multicast DNS clients MAY cache any or all Multicast DNS response 2068 messages they receive, for possible future use, provided of course 2069 that normal TTL aging is performed on these cached resource records. 2070 2071 2072 2073 Expires 7th December 2005 Cheshire & Krochmal [Page 34] 2074 2076 Internet Draft Multicast DNS 7th June 2005 2077 2078 2079 In multicast query messages, the Query ID SHOULD be set to zero on 2080 transmission. 2081 2082 In multicast responses, including gratuitous multicast responses, the 2083 Query ID MUST be set to zero on transmission, and MUST be ignored on 2084 reception. 2085 2086 In unicast response messages generated specifically in response to a 2087 particular (unicast or multicast) query, the Query ID MUST match the 2088 ID from the query message. 2089 2090 2091 19.2. QR (Query/Response) Bit 2092 2093 In query messages, MUST be zero. 2094 2095 In response messages, MUST be one. 2096 2097 2098 19.3. OPCODE 2099 2100 In both multicast query and multicast response messages, MUST be zero 2101 (only standard queries are currently supported over multicast, unless 2102 other queries are allowed by future IETF Standards Action). 2103 2104 2105 19.4. AA (Authoritative Answer) Bit 2106 2107 In query messages, the Authoritative Answer bit MUST be zero on 2108 transmission, and MUST be ignored on reception. 2109 2110 In response messages for Multicast Domains, the Authoritative Answer 2111 bit MUST be set to one (not setting this bit implies there's some 2112 other place where "better" information may be found) and MUST be 2113 ignored on reception. 2114 2115 2116 19.5. TC (Truncated) Bit 2117 2118 In query messages, if the TC bit is set, it means that additional 2119 Known Answer records may be following shortly. A responder MAY choose 2120 to record this fact, and wait for those additional Known Answer 2121 records, before deciding whether to respond. If the TC bit is clear, 2122 it means that the querying host has no additional Known Answers. 2123 2124 In multicast response messages, the TC bit MUST be zero on 2125 transmission, and MUST be ignored on reception. 2126 2127 In legacy unicast response messages, the TC bit has the same meaning 2128 as in conventional unicast DNS: it means that the response was too 2129 large to fit in a single packet, so the client SHOULD re-issue its 2130 query using TCP in order to receive the larger response. 2131 2132 2133 2134 Expires 7th December 2005 Cheshire & Krochmal [Page 35] 2135 2137 Internet Draft Multicast DNS 7th June 2005 2138 2139 2140 19.6. RD (Recursion Desired) Bit 2141 2142 In both multicast query and multicast response messages, the 2143 Recursion Desired bit SHOULD be zero on transmission, and MUST be 2144 ignored on reception. 2145 2146 2147 19.7. RA (Recursion Available) Bit 2148 2149 In both multicast query and multicast response messages, the 2150 Recursion Available bit MUST be zero on transmission, and MUST be 2151 ignored on reception. 2152 2153 2154 19.8. Z (Zero) Bit 2155 2156 In both query and response messages, the Zero bit MUST be zero on 2157 transmission, and MUST be ignored on reception. 2158 2159 2160 19.9. AD (Authentic Data) Bit [RFC 2535] 2161 2162 In query messages the Authentic Data bit MUST be zero on 2163 transmission, and MUST be ignored on reception. 2164 2165 In response messages, the Authentic Data bit MAY be set. Resolvers 2166 receiving response messages with the AD bit set MUST NOT trust the AD 2167 bit unless they trust the source of the message and either have a 2168 secure path to it or use DNS transaction security. 2169 2170 2171 19.10. CD (Checking Disabled) Bit [RFC 2535] 2172 2173 In query messages, a resolver willing to do cryptography SHOULD set 2174 the Checking Disabled bit to permit it to impose its own policies. 2175 2176 In response messages, the Checking Disabled bit MUST be zero on 2177 transmission, and MUST be ignored on reception. 2178 2179 2180 19.11. RCODE (Response Code) 2181 2182 In both multicast query and multicast response messages, the Response 2183 Code MUST be zero on transmission. Multicast DNS messages received 2184 with non-zero Response Codes MUST be silently ignored. 2185 2186 2187 19.12. Repurposing of top bit of qclass in Question Section 2188 2189 In the Question Section of a Multicast DNS Query, the top bit of the 2190 qclass field is used to indicate that unicast responses are preferred 2191 for this particular question. 2192 2193 2194 2195 Expires 7th December 2005 Cheshire & Krochmal [Page 36] 2196 2198 Internet Draft Multicast DNS 7th June 2005 2199 2200 2201 19.12. Repurposing of top bit of rrclass in Answer Section 2202 2203 In the Answer Section of a Multicast DNS Response, the top bit of the 2204 rrclass field is used to indicate that the record is a member of a 2205 unique RRSet, and the entire RRSet has been sent together (in the 2206 same packet, or in consecutive packets if there are too many records 2207 to fit in a single packet). 2208 2209 2210 20. Choice of UDP Port Number 2211 2212 Arguments were made for and against using Multicast on UDP port 53. 2213 The final decision was to use UDP port 5353. Some of the arguments 2214 for and against are given below. 2215 2216 2217 20.1 Arguments for using UDP port 53: 2218 2219 * This is "just DNS", so it should be the same port. 2220 2221 * There is less work to be done updating old clients to do simple 2222 mDNS queries. Only the destination address need be changed. 2223 In some cases, this can be achieved without any code changes, 2224 just by adding the address 224.0.0.251 to a configuration file. 2225 2226 2227 20.2 Arguments for using a different port (UDP port 5353): 2228 2229 * This is not "just DNS". This is a DNS-like protocol, but different. 2230 2231 * Changing client code to use a different port number is not hard. 2232 2233 * Using the same port number makes it hard to run an mDNS Responder 2234 and a conventional unicast DNS server on the same machine. If a 2235 conventional unicast DNS server wishes to implement mDNS as well, 2236 it can still do that, by opening two sockets. Having two different 2237 port numbers is important to allow this flexibility. 2238 2239 * Some VPN software hijacks all outgoing traffic to port 53 and 2240 redirects it to a special DNS server set up to serve those VPN 2241 clients while they are connected to the corporate network. It is 2242 questionable whether this is the right thing to do, but it is 2243 common, and redirecting link-local multicast DNS packets to a 2244 remote server rarely produces any useful results. It does mean, for 2245 example, that the user becomes unable to access their local network 2246 printer sitting on their desk right next to their computer. Using 2247 a different UDP port eliminates this particular problem. 2248 2249 * On many operating systems, unprivileged clients may not send or 2250 receive packets on low-numbered ports. This means that any client 2251 sending or receiving mDNS packets on port 53 would have to run as 2252 "root", which is an undesirable security risk. Using a higher- 2253 numbered UDP port eliminates this particular problem. 2254 2255 2256 Expires 7th December 2005 Cheshire & Krochmal [Page 37] 2257 2259 Internet Draft Multicast DNS 7th June 2005 2260 2261 2262 Continuing the previous point, since using an unprivileged port 2263 allows normal user-level code to bind, a given machine may have more 2264 than one such user-level application running at a time. Because of 2265 this, any code binding to UDP port 5353 MUST use the SO_REUSEPORT 2266 option, so as to be a good citizen and not block other clients on the 2267 machine from also binding to that port. 2268 2269 2270 21. Summary of Differences Between Multicast DNS and Unicast DNS 2271 2272 The value of Multicast DNS is that it shares, as much as possible, 2273 the familiar APIs, naming syntax, resource record types, etc., of 2274 Unicast DNS. There are of course necessary differences by virtue of 2275 it using Multicast, and by virtue of it operating in a community of 2276 cooperating peers, rather than a precisely defined authoritarian 2277 hierarchy controlled by a strict chain of formal delegations from the 2278 top. These differences are listed below: 2279 2280 Multicast DNS... 2281 * uses multicast 2282 * uses UDP port 5353 instead of port 53 2283 * operates in well-defined parts of the DNS namespace 2284 * uses UTF-8, and only UTF-8, to encode resource record names 2285 * defines a clear limit on the maximum legal domain name (255 bytes) 2286 * allows larger UDP packets 2287 * allows more than one question in a query packet 2288 * uses the Answer Section of a query to list Known Answers 2289 * uses the TC bit in a query to indicate additional Known Answers 2290 * uses the Authority Section of a query for probe tie-breaking 2291 * ignores the Query ID field (except for generating legacy responses) 2292 * doesn't require the question to be repeated in the response packet 2293 * uses gratuitous responses to announce new records to the peer group 2294 * defines a "unicast response" bit in the rrclass of query questions 2295 * defines a "cache flush" bit in the rrclass of response answers 2296 * uses DNS TTL 0 to indicate that a record has been deleted 2297 * monitors queries to perform Duplicate Question Suppression 2298 * monitors responses to perform Duplicate Answer Suppression... 2299 * ... and Ongoing Conflict Detection 2300 * ... and Opportunistic Caching 2301 2302 2303 22. Benefits of Multicast Responses 2304 2305 Some people have argued that sending responses via multicast is 2306 inefficient on the network. In fact the benefits of using multicast 2307 responses result in a net lowering of overall multicast traffic, for 2308 a variety of reasons. 2309 2310 * One multicast response can update the cache on all machines on the 2311 network. If another machine later wants to issue the same query, it 2312 already has the answer in its cache, so it may not need to even 2313 transmit that multicast query on the network at all. 2314 2315 2316 2317 Expires 7th December 2005 Cheshire & Krochmal [Page 38] 2318 2320 Internet Draft Multicast DNS 7th June 2005 2321 2322 2323 * When more than one machine has the same ongoing long-lived query 2324 running, every machine does not have to transmit its own 2325 independent query. When one machine transmits a query, all the 2326 other hosts see the answers, so they can suppress their own 2327 queries. 2328 2329 * When a host sees a multicast query, but does not see the 2330 corresponding multicast response, it can use this information to 2331 promptly delete stale data from its cache. To achieve the same 2332 level of user-interface quality and responsiveness without 2333 multicast responses would require lower cache lifetimes and more 2334 frequent network polling, resulting in a significantly higher 2335 packet rate. 2336 2337 * Multicast responses allow passive conflict detection. Without this 2338 ability, some other conflict detection mechanism would be needed, 2339 imposing its own additional burden on the network. 2340 2341 * When using delayed responses to reduce network collisions, clients 2342 need to maintain a list recording to whom each answer should be 2343 sent. The option of multicast responses allows clients with limited 2344 storage, which cannot store an arbitrarily long list of response 2345 addresses, to choose to fail-over to a single multicast response in 2346 place of multiple unicast responses, when appropriate. 2347 2348 * In the case of overlayed subnets and other misconfigurations, 2349 multicast responses allow a receiver to know with certainty that 2350 a response originated on the local link, even when its source 2351 address may apparently suggest otherwise. This can be extremely 2352 helpful when diagnosing and rectifying network problems, since 2353 it facilitates a direct communication channel between client and 2354 server that works without reliance on ARP, IP routing tables, etc. 2355 Being able to discover what IP address a device has (or thinks it 2356 has) is frequently a very valuable first step in diagnosing why 2357 it unable to communicate on the local network. 2358 2359 2360 23. IPv6 Considerations 2361 2362 An IPv4-only host and an IPv6-only host behave as "ships that pass in 2363 the night". Even if they are on the same Ethernet, neither is aware 2364 of the other's traffic. For this reason, each physical link may have 2365 *two* unrelated ".local." zones, one for IPv4 and one for IPv6. 2366 Since for practical purposes, a group of IPv4-only hosts and a group 2367 of IPv6-only hosts on the same Ethernet act as if they were on two 2368 entirely separate Ethernet segments, it is unsurprising that their 2369 use of the ".local." zone should occur exactly as it would if 2370 they really were on two entirely separate Ethernet segments. 2371 2372 A dual-stack (v4/v6) host can participate in both ".local." 2373 zones, and should register its name(s) and perform its lookups both 2374 using IPv4 and IPv6. This enables it to reach, and be reached by, 2375 both IPv4-only and IPv6-only hosts. In effect this acts like a 2376 2377 2378 Expires 7th December 2005 Cheshire & Krochmal [Page 39] 2379 2381 Internet Draft Multicast DNS 7th June 2005 2382 2383 2384 multi-homed host, with one connection to the logical "IPv4 Ethernet 2385 segment", and a connection to the logical "IPv6 Ethernet segment". 2386 2387 23.1 IPv6 Multicast Addresses by Hashing 2388 2389 Some discovery protocols use a range of multicast addresses, and 2390 determine the address to be used by a hash function of the name being 2391 sought. Queries are sent via multicast to the address as indicated by 2392 the hash function, and responses are returned to the querier via 2393 unicast. Particularly in IPv6, where multicast addresses are 2394 extremely plentiful, this approach is frequently advocated. 2395 2396 There are some problems with this: 2397 2398 * When a host has a large number of records with different names, the 2399 host may have to join a large number of multicast groups. This can 2400 place undue burden on the Ethernet hardware, which typically 2401 supports a limited number of multicast addresses efficiently. When 2402 this number is exceeded, the Ethernet hardware may have to resort 2403 to receiving all multicasts and passing them up to the host 2404 software for filtering, thereby defeating the point of using a 2405 multicast address range in the first place. 2406 2407 * Multiple questions cannot be placed in one packet if they don't all 2408 hash to the same multicast address. 2409 2410 * Duplicate Question Suppression doesn't work if queriers are not 2411 seeing each other's queries. 2412 2413 * Duplicate Answer Suppression doesn't work if responders are not 2414 seeing each other's responses. 2415 2416 * Opportunistic Caching doesn't work. 2417 2418 * Ongoing Conflict Detection doesn't work. 2419 2420 2421 24. Security Considerations 2422 2423 The algorithm for detecting and resolving name conflicts is, by its 2424 very nature, an algorithm that assumes cooperating participants. Its 2425 purpose is to allow a group of hosts to arrive at a mutually disjoint 2426 set of host names and other DNS resource record names, in the absence 2427 of any central authority to coordinate this or mediate disputes. In 2428 the absence of any higher authority to resolve disputes, the only 2429 alternative is that the participants must work together cooperatively 2430 to arrive at a resolution. 2431 2432 In an environment where the participants are mutually antagonistic 2433 and unwilling to cooperate, other mechanisms are appropriate, like 2434 manually administered DNS. 2435 2436 2437 2438 2439 Expires 7th December 2005 Cheshire & Krochmal [Page 40] 2440 2442 Internet Draft Multicast DNS 7th June 2005 2443 2444 2445 In an environment where there is a group of cooperating participants, 2446 but there may be other antagonistic participants on the same physical 2447 link, the cooperating participants need to use IPSEC signatures 2448 and/or DNSSEC [RFC 2535] signatures so that they can distinguish mDNS 2449 messages from trusted participants (which they process as usual) from 2450 mDNS messages from untrusted participants (which they silently 2451 discard). 2452 2453 When DNS queries for *global* DNS names are sent to the mDNS 2454 multicast address (during network outages which disrupt communication 2455 with the greater Internet) it is *especially* important to use 2456 DNSSEC, because the user may have the impression that he or she is 2457 communicating with some authentic host, when in fact he or she is 2458 really communicating with some local host that is merely masquerading 2459 as that name. This is less critical for names ending with ".local.", 2460 because the user should be aware that those names have only local 2461 significance and no global authority is implied. 2462 2463 Most computer users neglect to type the trailing dot at the end of a 2464 fully qualified domain name, making it a relative domain name (e.g. 2465 "www.example.com"). In the event of network outage, attempts to 2466 positively resolve the name as entered will fail, resulting in 2467 application of the search list, including ".local.", if present. 2468 A malicious host could masquerade as "www.example.com" by answering 2469 the resulting Multicast DNS query for "www.example.com.local." 2470 To avoid this, a host MUST NOT append the search suffix 2471 ".local.", if present, to any relative (partially qualified) 2472 domain name containing two or more labels. Appending ".local." to 2473 single-label relative domain names is acceptable, since the user 2474 should have no expectation that a single-label domain name will 2475 resolve as-is. 2476 2477 2478 25. IANA Considerations 2479 2480 IANA has allocated the IPv4 link-local multicast address 224.0.0.251 2481 for the use described in this document. 2482 2483 IANA has allocated the IPv6 multicast address set FF0X::FB for the 2484 use described in this document. Only address FF02::FB (Link-Local 2485 Scope) is currently in use by deployed software, but it is possible 2486 that in future implementers may experiment with Multicast DNS using 2487 larger-scoped addresses, such as FF05::FB (Site-Local Scope). 2488 2489 When this document is published, IANA should designate a list of 2490 domains which are deemed to have only link-local significance, as 2491 described in Section 12 of this document ("Special Characteristics of 2492 Multicast DNS Domains"). 2493 2494 The re-use of the top bit of the rrclass field in the Question and 2495 Answer Sections means that Multicast DNS can only carry DNS records 2496 with classes in the range 0-32767. Classes in the range 32768 to 2497 65535 are incompatible with Multicast DNS. However, since to-date 2498 2499 2500 Expires 7th December 2005 Cheshire & Krochmal [Page 41] 2501 2503 Internet Draft Multicast DNS 7th June 2005 2504 2505 2506 only three DNS classes have been assigned by IANA (1, 3 and 4), 2507 and only one (1, "Internet") is actually in widespread use, this 2508 limitation is likely to remain a purely theoretical one. 2509 2510 No other IANA services are required by this document. 2511 2512 2513 26. Acknowledgments 2514 2515 The concepts described in this document have been explored, developed 2516 and implemented with help from Freek Dijkstra, Erik Guttman, Paul 2517 Vixie, Bill Woodcock, and others. 2518 2519 Special thanks go to Bob Bradley, Josh Graessley, Scott Herscher, 2520 Roger Pantos and Kiren Sekar for their significant contributions. 2521 2522 2523 27. Copyright 2524 2525 Copyright (C) The Internet Society 2005. 2526 All Rights Reserved. 2527 2528 This document and translations of it may be copied and furnished to 2529 others, and derivative works that comment on or otherwise explain it 2530 or assist in its implementation may be prepared, copied, published 2531 and distributed, in whole or in part, without restriction of any 2532 kind, provided that the above copyright notice and this paragraph are 2533 included on all such copies and derivative works. However, this 2534 document itself may not be modified in any way, such as by removing 2535 the copyright notice or references to the Internet Society or other 2536 Internet organizations, except as needed for the purpose of 2537 developing Internet standards in which case the procedures for 2538 copyrights defined in the Internet Standards process must be 2539 followed, or as required to translate it into languages other than 2540 English. 2541 2542 The limited permissions granted above are perpetual and will not be 2543 revoked by the Internet Society or its successors or assigns. 2544 2545 This document and the information contained herein is provided on an 2546 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 2547 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 2548 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 2549 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 2550 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 2551 2552 2553 28. Normative References 2554 2555 [RFC 1034] Mockapetris, P., "Domain Names - Concepts and 2556 Facilities", STD 13, RFC 1034, November 1987. 2557 2558 [RFC 1035] Mockapetris, P., "Domain Names - Implementation and 2559 Specifications", STD 13, RFC 1035, November 1987. 2560 2561 Expires 7th December 2005 Cheshire & Krochmal [Page 42] 2562 2564 Internet Draft Multicast DNS 7th June 2005 2565 2566 2567 [RFC 2119] Bradner, S., "Key words for use in RFCs to Indicate 2568 Requirement Levels", RFC 2119, March 1997. 2569 2570 [RFC 3629] Yergeau, F., "UTF-8, a transformation format of ISO 2571 10646", RFC 3629, November 2003. 2572 2573 2574 29. Informative References 2575 2576 [dotlocal] <http://www.dotlocal.org/> 2577 2578 [djbdl] <http://cr.yp.to/djbdns/dot-local.html> 2579 2580 [DNS-SD] Cheshire, S., and M. Krochmal, "DNS-Based Service 2581 Discovery", Internet-Draft (work in progress), 2582 draft-cheshire-dnsext-dns-sd-03.txt, June 2005. 2583 2584 [IEEE802] IEEE Standards for Local and Metropolitan Area Networks: 2585 Overview and Architecture. 2586 Institute of Electrical and Electronic Engineers, 2587 IEEE Standard 802, 1990. 2588 2589 [NBP] Cheshire, S., and M. Krochmal, 2590 "Requirements for a Protocol to Replace AppleTalk NBP", 2591 Internet-Draft (work in progress), 2592 draft-cheshire-dnsext-nbp-04.txt, June 2005. 2593 2594 [RFC 2136] Vixie, P., et al., "Dynamic Updates in the Domain Name 2595 System (DNS UPDATE)", RFC 2136, April 1997. 2596 2597 [RFC 2462] S. Thomson and T. Narten, "IPv6 Stateless Address 2598 Autoconfiguration", RFC 2462, December 1998. 2599 2600 [RFC 2535] Eastlake, D., "Domain Name System Security Extensions", 2601 RFC 2535, March 1999. 2602 2603 [RFC 3492] Costello, A., "Punycode: A Bootstring encoding of 2604 Unicode for use with Internationalized Domain Names 2605 in Applications (IDNA)", RFC 3492, March 2003. 2606 2607 [RFC 3927] Cheshire, S., B. Aboba, and E. Guttman, 2608 "Dynamic Configuration of IPv4 Link-Local Addresses", 2609 RFC 3927, May 2005. 2610 2611 [ZC] Williams, A., "Requirements for Automatic Configuration 2612 of IP Hosts", Internet-Draft (work in progress), 2613 draft-ietf-zeroconf-reqts-12.txt, September 2002. 2614 2615 2616 2617 2618 2619 2620 2621 2622 Expires 7th December 2005 Cheshire & Krochmal [Page 43] 2623 2625 Internet Draft Multicast DNS 7th June 2005 2626 2627 2628 30. Authors' Addresses 2629 2630 Stuart Cheshire 2631 Apple Computer, Inc. 2632 1 Infinite Loop 2633 Cupertino 2634 California 95014 2635 USA 2636 2637 Phone: +1 408 974 3207 2638 EMail: rfc (a] stuartcheshire.org 2639 2640 2641 Marc Krochmal 2642 Apple Computer, Inc. 2643 1 Infinite Loop 2644 Cupertino 2645 California 95014 2646 USA 2647 2648 Phone: +1 408 974 4368 2649 EMail: marc (a] apple.com 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 Expires 7th December 2005 Cheshire & Krochmal [Page 44] 2684