forked from avahi/avahi
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdraft-cheshire-dnsext-multicastdns-06.txt
3074 lines (2216 loc) · 139 KB
/
draft-cheshire-dnsext-multicastdns-06.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Document: draft-cheshire-dnsext-multicastdns-06.txt Stuart Cheshire
Internet-Draft Marc Krochmal
Category: Standards Track Apple Computer, Inc.
Expires 10th February 2007 10th August 2006
Multicast DNS
<draft-cheshire-dnsext-multicastdns-06.txt>
Status of this Memo
By submitting this Internet-Draft, each author represents that any
applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79.
For the purposes of this document, the term "BCP 79" refers
exclusively to RFC 3979, "Intellectual Property Rights in IETF
Technology", published March 2005.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet-
Drafts.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at
http://www.ietf.org/1id-abstracts.html
The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html
Abstract
As networked devices become smaller, more portable, and
more ubiquitous, the ability to operate with less configured
infrastructure is increasingly important. In particular,
the ability to look up DNS resource record data types
(including, but not limited to, host names) in the absence
of a conventional managed DNS server, is becoming essential.
Multicast DNS (mDNS) provides the ability to do DNS-like operations
on the local link in the absence of any conventional unicast DNS
server. In addition, mDNS designates a portion of the DNS namespace
to be free for local use, without the need to pay any annual fee, and
without the need to set up delegations or otherwise configure a
conventional DNS server to answer for those names.
The primary benefits of mDNS names are that (i) they require little
or no administration or configuration to set them up, (ii) they work
when no infrastructure is present, and (iii) they work during
infrastructure failures.
Expires 10th February 2007 Cheshire & Krochmal [Page 1]
Internet Draft Multicast DNS 10th August 2006
Table of Contents
1. Introduction....................................................3
2. Conventions and Terminology Used in this Document...............3
3. Multicast DNS Names.............................................4
4. Source Address Check............................................8
5. Reverse Address Mapping.........................................9
6. Querying.......................................................10
7. Duplicate Suppression..........................................15
8. Responding.....................................................17
9. Probing and Announcing on Startup..............................20
10. Conflict Resolution............................................26
11. Resource Record TTL Values and Cache Coherency.................28
12. Special Characteristics of Multicast DNS Domains...............33
13. Multicast DNS for Service Discovery............................34
14. Enabling and Disabling Multicast DNS...........................34
15. Considerations for Multiple Interfaces.........................35
16. Considerations for Multiple Responders on the Same Machine.....36
17. Multicast DNS and Power Management.............................38
18. Multicast DNS Character Set....................................39
19. Multicast DNS Message Size.....................................41
20. Multicast DNS Message Format...................................42
21. Choice of UDP Port Number......................................45
22. Summary of Differences Between Multicast DNS and Unicast DNS...46
23. Benefits of Multicast Responses................................47
24. IPv6 Considerations............................................48
25. Security Considerations........................................49
26. IANA Considerations............................................50
27. Acknowledgments................................................50
28. Deployment History.............................................50
29. Copyright Notice...............................................51
30. Normative References...........................................51
31. Informative References.........................................52
32. Authors' Addresses.............................................53
Expires 10th February 2007 Cheshire & Krochmal [Page 2]
Internet Draft Multicast DNS 10th August 2006
1. Introduction
When reading this document, familiarity with the concepts of Zero
Configuration Networking [ZC] and automatic link-local addressing
[RFC 2462] [RFC 3927] is helpful.
This document proposes no change to the structure of DNS messages,
and no new operation codes, response codes, or resource record types.
This document simply discusses what needs to happen if DNS clients
start sending DNS queries to a multicast address, and how a
collection of hosts can cooperate to collectively answer those
queries in a useful manner.
There has been discussion of how much burden Multicast DNS might
impose on a network. It should be remembered that whenever IPv4 hosts
communicate, they broadcast ARP packets on the network on a regular
basis, and this is not disastrous. The approximate amount of
multicast traffic generated by hosts making conventional use of
Multicast DNS is anticipated to be roughly the same order of
magnitude as the amount of broadcast ARP traffic those hosts already
generate.
New applications making new use of Multicast DNS capabilities for
unconventional purposes may generate more traffic. If some of those
new applications are "chatty", then work will be needed to help them
become less chatty. When performing any analysis, it is important
to make a distinction between the application behavior and the
underlying protocol behavior. If a chatty application uses UDP,
that doesn't mean that UDP is chatty, or that IP is chatty, or that
Ethernet is chatty. What it means is that the application is chatty.
The same applies to any future applications that may decide to layer
increasing portions of their functionality over Multicast DNS.
2. Conventions and Terminology Used in this Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in "Key words for use in
RFCs to Indicate Requirement Levels" [RFC 2119].
This document uses the term "host name" in the strict sense to mean
a fully qualified domain name that has an address record. It does
not use the term "host name" in the commonly used but incorrect
sense to mean just the first DNS label of a host's fully qualified
domain name.
A DNS (or mDNS) packet contains an IP TTL in the IP header, which
is effectively a hop-count limit for the packet, to guard against
routing loops. Each Resource Record also contains a TTL, which is
the number of seconds for which the Resource Record may be cached.
Expires 10th February 2007 Cheshire & Krochmal [Page 3]
Internet Draft Multicast DNS 10th August 2006
In any place where there may be potential confusion between these two
types of TTL, the term "IP TTL" is used to refer to the IP header TTL
(hop limit), and the term "RR TTL" is used to refer to the Resource
Record TTL (cache lifetime).
When this document uses the term "Multicast DNS", it should be taken
to mean: "Clients performing DNS-like queries for DNS-like resource
records by sending DNS-like UDP query and response packets over IP
Multicast to UDP port 5353."
This document uses the terms "shared" and "unique" when referring to
resource record sets.
A "shared" resource record set is one where several Multicast DNS
responders may have records with that name, rrtype, and rrclass, and
several responders may respond to a particular query.
A "unique" resource record set is one where all the records with
that name, rrtype, and rrclass are conceptually under the control
or ownership of a single responder, and it is expected that at most
one responder should respond to a query for that name, rrtype, and
rrclass. Before claiming ownership of a unique resource record set,
a responder MUST probe to verify that no other responder already
claims ownership of that set, as described in Section 9.1 "Probing".
For fault-tolerance and other reasons it is permitted sometimes to
have more than one responder answering for a particular "unique"
resource record set, but such cooperating responders MUST give
answers containing identical rdata for these records or the
answers will be perceived to be in conflict with each other.
Strictly speaking the terms "shared" and "unique" apply to resource
record sets, not to individual resource records, but it is sometimes
convenient to talk of "shared resource records" and "unique resource
records". When used this way, the terms should be understood to mean
a record that is a member of a "shared" or "unique" resource record
set, respectively.
3. Multicast DNS Names
This document proposes that the DNS top-level domain ".local." be
designated a special domain with special semantics, namely that any
fully-qualified name ending in ".local." is link-local, and names
within this domain are meaningful only on the link where they
originate. This is analogous to IPv4 addresses in the 169.254/16
prefix, which are link-local and meaningful only on the link where
they originate.
Any DNS query for a name ending with ".local." MUST be sent
to the mDNS multicast address (224.0.0.251 or its IPv6 equivalent
FF02::FB).
Expires 10th February 2007 Cheshire & Krochmal [Page 4]
Internet Draft Multicast DNS 10th August 2006
It is unimportant whether a name ending with ".local." occurred
because the user explicitly typed in a fully qualified domain name
ending in ".local.", or because the user entered an unqualified
domain name and the host software appended the suffix ".local."
because that suffix appears in the user's search list. The ".local."
suffix could appear in the search list because the user manually
configured it, or because it was received in a DHCP option, or via
any other valid mechanism for configuring the DNS search list. In
this respect the ".local." suffix is treated no differently to any
other search domain that might appear in the DNS search list.
DNS queries for names that do not end with ".local." MAY be sent to
the mDNS multicast address, if no other conventional DNS server is
available. This can allow hosts on the same link to continue
communicating using each other's globally unique DNS names during
network outages which disrupt communication with the greater
Internet. When resolving global names via local multicast, it is even
more important to use DNSSEC or other security mechanisms to ensure
that the response is trustworthy. Resolving global names via local
multicast is a contentious issue, and this document does not discuss
it in detail, instead concentrating on the issue of resolving local
names using DNS packets sent to a multicast address.
A host that belongs to an organization or individual who has control
over some portion of the DNS namespace can be assigned a globally
unique name within that portion of the DNS namespace, for example,
"cheshire.apple.com." For those of us who have this luxury, this
works very well. However, the majority of home customers do not have
easy access to any portion of the global DNS namespace within which
they have the authority to create names as they wish. This leaves the
majority of home computers effectively anonymous for practical
purposes.
To remedy this problem, this document allows any computer user to
elect to give their computers link-local Multicast DNS host names of
the form: "single-dns-label.local." For example, a laptop computer
may answer to the name "cheshire.local." Any computer user is granted
the authority to name their computer this way, provided that the
chosen host name is not already in use on that link. Having named
their computer this way, the user has the authority to continue using
that name until such time as a name conflict occurs on the link which
is not resolved in the user's favour. If this happens, the computer
(or its human user) SHOULD cease using the name, and may choose to
attempt to allocate a new unique name for use on that link. These
conflicts are expected to be relatively rare for people who choose
reasonably imaginative names, but it is still important to have a
mechanism in place to handle them when they happen.
The point made in the previous paragraph is very important and bears
repeating. It is easy for those of us in the IETF community who run
our own name servers at home to forget that the majority of computer
Expires 10th February 2007 Cheshire & Krochmal [Page 5]
Internet Draft Multicast DNS 10th August 2006
users do not run their own name server and have no easy way to create
their own host names. When these users wish to transfer files between
two laptop computers, they are frequently reduced to typing in
dotted-decimal IP addresses because they simply have no other way for
one host to refer to the other by name. This is a sorry state of
affairs. What is worse, most users don't even bother trying to use
dotted-decimal IP addresses. Most users still move data between
machines by burning it onto CD-R, copying it onto a USB "keychain"
flash drive, or similar removable media.
In a world of gigabit Ethernet and ubiquitous wireless networking it
is a sad indictment of the networking community that most users still
prefer sneakernet.
Allowing ad-hoc allocation of single-label names in a single flat
".local." namespace may seem to invite chaos. However, operational
experience with AppleTalk NBP names [NBP], which on any given link
are also effectively single-label names in a flat namespace, shows
that in practice name collisions happen extremely rarely and are not
a problem. Groups of computer users from disparate organizations
bring Macintosh laptop computers to events such as IETF Meetings, the
Mac Hack conference, the Apple World Wide Developer Conference, etc.,
and complaints at these events about users suffering conflicts and
being forced to rename their machines have never been an issue.
This document advocates a single flat namespace for dot-local host
names, (i.e. the names of DNS address records), but other DNS record
types (such as those used by DNS Service Discovery [DNS-SD]) may
contain as many labels as appropriate for the desired usage, subject
to the 255-byte name length limit specified below in Section 3.3
"Maximum Multicast DNS Name Length".
Enforcing uniqueness of host names (i.e. the names of DNS address
records mapping names to IP addresses) is probably desirable in the
common case, but this document does not mandate that. It is
permissible for a collection of coordinated hosts to agree to
maintain multiple DNS address records with the same name, possibly
for load balancing or fault-tolerance reasons. This document does not
take a position on whether that is sensible. It is important that
both modes of operation are supported. The Multicast DNS protocol
allows hosts to verify and maintain unique names for resource records
where that behavior is desired, and it also allows hosts to maintain
multiple resource records with a single shared name where that
behavior is desired. This consideration applies to all resource
records, not just address records (host names). In summary: It is
required that the protocol have the ability to detect and handle name
conflicts, but it is not required that this ability be used for every
record.
Expires 10th February 2007 Cheshire & Krochmal [Page 6]
Internet Draft Multicast DNS 10th August 2006
3.1 Governing Standards Body
Note that this use of the ".local." suffix falls under IETF/IANA
jurisdiction, not ICANN jurisdiction. DNS is an IETF network
protocol, governed by protocol rules defined by the IETF. These IETF
protocol rules dictate character set, maximum name length, packet
format, etc. ICANN determines additional rules that apply when the
IETF's DNS protocol is used on the public Internet. In contrast,
private uses of the DNS protocol on isolated private networks are not
governed by ICANN. Since this proposed change is a change to the core
DNS protocol rules, it affects everyone, not just those machines
using the ICANN-governed Internet. Hence this change falls into the
category of an IETF protocol rule, not an ICANN usage rule.
This allocation of responsibility is formally established in
"Memorandum of Understanding Concerning the Technical Work of the
Internet Assigned Numbers Authority" [RFC 2860]. Exception (a) of
clause 4.3 states that the IETF has the authority to instruct IANA
to reserve pseudo-TLDs as required for protocol design purposes.
For example, "Reserved Top Level DNS Names" [RFC 2606] defines
the following pseudo-TLDs:
.test
.example
.invalid
.localhost
3.2 Private DNS Namespaces
Note also that the special treatment of names ending in ".local." has
been implemented in Macintosh computers since the days of Mac OS 9,
and continues today in Mac OS X. There are also implementations for
Linux and other platforms [dotlocal]. Operators setting up private
internal networks ("intranets") are advised that their lives may be
easier if they avoid using the suffix ".local." in names in their
private internal DNS server. Alternative possibilities include:
.intranet
.internal
.private
.corp
.home
.lan
Another alternative naming scheme, advocated by Professor D. J.
Bernstein, is to use a numerical suffix, such as ".6." [djbdl].
Expires 10th February 2007 Cheshire & Krochmal [Page 7]
Internet Draft Multicast DNS 10th August 2006
3.3 Maximum Multicast DNS Name Length
RFC 1034 says:
"the total number of octets that represent a domain name (i.e.,
the sum of all label octets and label lengths) is limited to 255."
This text implies that the final root label at the end of every name
is included in this count (a name can't be represented without it),
but the text does not explicitly state that. Implementations of
Multicast DNS MUST include the label length byte of the final root
label at the end of every name when enforcing the rule that no name
may be longer than 255 bytes. For example, the length of the name
"apple.com." is considered to be 11, which is the number of bytes it
takes to represent that name in a packet without using name
compression:
------------------------------------------------------
| 0x05 | a | p | p | l | e | 0x03 | c | o | m | 0x00 |
------------------------------------------------------
4. Source Address Check
All Multicast DNS responses (including responses sent via unicast)
SHOULD be sent with IP TTL set to 255. This is recommended to provide
backwards-compatibility with older Multicast DNS clients that check
the IP TTL on reception to determine whether the packet originated
on the local link. These older clients discard all packets with TTLs
other than 255.
A host sending Multicast DNS queries to a link-local destination
address (including the 224.0.0.251 link-local multicast address)
MUST only accept responses to that query that originate from the
local link, and silently discard any other response packets. Without
this check, it could be possible for remote rogue hosts to send
spoof answer packets (perhaps unicast to the victim host) which the
receiving machine could misinterpret as having originated on the
local link.
The test for whether a response originated on the local link
is done in two ways:
* All responses sent to the link-local multicast address 224.0.0.251
are necessarily deemed to have originated on the local link,
regardless of source IP address. This is essential to allow devices
to work correctly and reliably in unusual configurations, such as
multiple logical IP subnets overlayed on a single link, or in cases
of severe misconfiguration, where devices are physically connected
to the same link, but are currently misconfigured with completely
unrelated IP addresses and subnet masks.
Expires 10th February 2007 Cheshire & Krochmal [Page 8]
Internet Draft Multicast DNS 10th August 2006
* For responses sent to a unicast destination address, the source IP
address in the packet is checked to see if it is an address on a
local subnet. An address is determined to be on a local subnet if,
for (one of) the address(es) configured on the interface receiving
the packet, (I & M) == (P & M), where I and M are the interface
address and subnet mask respectively, P is the source IP address
from the packet, '&' represents the bitwise logical 'and'
operation, and '==' represents a bitwise equality test.
Since queriers will ignore responses apparently originating outside
the local subnet, responders SHOULD avoid generating responses that
it can reasonably predict will be ignored. This applies particularly
in the case of overlayed subnets. If a responder receives a query
addressed to the link-local multicast address 224.0.0.251, from a
source address not apparently on the same subnet as the responder,
then even if the query indicates that a unicast response is preferred
(see Section 6.5, "Questions Requesting Unicast Responses"), the
responder SHOULD elect to respond by multicast anyway, since it can
reasonably predict that a unicast response with an apparently
non-local source address will probably be ignored.
5. Reverse Address Mapping
Like ".local.", the IPv4 and IPv6 reverse mapping domains are also
defined to be link-local.
Any DNS query for a name ending with "254.169.in-addr.arpa." MUST
be sent to the mDNS multicast address 224.0.0.251. Since names under
this domain correspond to IPv4 link-local addresses, it is logical
that the local link is the best place to find information pertaining
to those names.
Likewise, any DNS query for a name within the reverse mapping domains
for IPv6 Link-Local addresses ("8.e.f.ip6.arpa.", "9.e.f.ip6.arpa.",
"a.e.f.ip6.arpa.", and "b.e.f.ip6.arpa.") MUST be sent to the IPv6
mDNS link-local multicast address FF02::FB.
Expires 10th February 2007 Cheshire & Krochmal [Page 9]
Internet Draft Multicast DNS 10th August 2006
6. Querying
There are three kinds of Multicast DNS Queries, one-shot queries of
the kind made by today's conventional DNS clients, one-shot queries
accumulating multiple responses made by multicast-aware DNS clients,
and continuous ongoing Multicast DNS Queries used by IP network
browser software.
A Multicast DNS Responder that is offering records that are intended
to be unique on the local link MUST also implement a Multicast DNS
Querier so that it can first verify the uniqueness of those records
before it begins answering queries for them.
6.1 One-Shot Multicast DNS Queries
An unsophisticated DNS client may simply send its DNS queries blindly
to 224.0.0.251:5353, without necessarily even being aware what a
multicast address is. This change can typically be implemented with
just a few lines of code in an existing DNS resolver library. Any
time the name being queried for falls within one of the reserved
mDNS domains (see Section 12 "Special Characteristics of Multicast
DNS Domains") the query is sent to 224.0.0.251:5353 instead of the
configured unicast DNS server address that would otherwise be used.
Typically the timeout would also be shortened to two or three
seconds, but it's possible to make a minimal mDNS client with no
other changes apart from these.
A simple DNS client like this will typically just take the first
response it receives. It will not listen for additional UDP
responses, but in many instances this may not be a serious problem.
If a user types "http://cheshire.local." into their Web browser and
gets to see the page they were hoping for, then the protocol has met
the user's needs in this case.
While an unsophisticated DNS client like this is perfectly adequate
for simple hostname lookup, it may not get ideal behavior in
other cases. Additional refinements that may be adopted by more
sophisticated clients are described below.
6.2 One-Shot Queries, Accumulating Multiple Responses
A more sophisticated DNS client should understand that Multicast DNS
is not exactly the same as unicast DNS, and should modify its
behavior in some simple ways.
As described above, there are some cases, such as looking up the
address associated with a unique host name, where a single response
is sufficient, and moreover may be all that is expected. However,
there are other DNS queries where more than one response is
Expires 10th February 2007 Cheshire & Krochmal [Page 10]
Internet Draft Multicast DNS 10th August 2006
possible, and for these queries a more sophisticated Multicast DNS
client should include the ability to wait for an appropriate period
of time to collect multiple responses.
A naive DNS client retransmits its query only so long as it has
received no response. A more sophisticated Multicast DNS client is
aware that having received one response is not necessarily an
indication that it might not receive others, and has the ability to
retransmit its query an appropriate number of times at appropriate
intervals until it is satisfied with the collection of responses it
has gathered.
A more sophisticated Multicast DNS client that is retransmitting
a query for which it has already received some responses, MUST
implement Known Answer Suppression, as described below in Section 7.1
"Known Answer Suppression". This indicates to responders who have
already replied that their responses have been received, and they
don't need to send them again in response to this repeated query. In
addition, when retransmitting queries, the interval between the first
two queries SHOULD be one second, and the intervals between
subsequent queries SHOULD double.
6.3 Continuous Multicast DNS Querying
In One-Shot Queries, with either a single or multiple responses,
the underlying assumption is that the transaction begins when the
application issues a query, and ends when all the desired responses
have been received. There is another type of operation which is more
akin to continuous monitoring.
iTunes users are accustomed to seeing a list of shared network music
libraries in the sidebar of the iTunes window. There is no "refresh"
button for the user to click because the list is always accurate,
always reflecting the currently available libraries. When a new
library becomes available it promptly appears in the list, and when
a library becomes unavailable it promptly disappears. It is vitally
important that this responsive user interface be achieved without
naive polling that would place an unreasonable burden on the network.
Therefore, when retransmitting mDNS queries to implement this kind
of continuous monitoring, the interval between the first two queries
SHOULD be one second, the intervals between the subsequent queries
SHOULD double, and the querier MUST implement Known Answer
Suppression, as described below in Section 7.1. When the interval
between queries reaches or exceeds 60 minutes, a querier MAY cap the
interval to a maximum of 60 minutes, and perform subsequent queries
at a steady-state rate of one query per hour. To avoid accidental
synchronization when for some reason multiple clients begin querying
at exactly the same moment (e.g. because of some common external
trigger event), a Multicast DNS Querier SHOULD also delay the first
Expires 10th February 2007 Cheshire & Krochmal [Page 11]
Internet Draft Multicast DNS 10th August 2006
query of the series by a randomly-chosen amount in the range
20-120ms.
When a Multicast DNS Querier receives an answer, the answer contains
a TTL value that indicates for how many seconds this answer is valid.
After this interval has passed, the answer will no longer be valid
and SHOULD be deleted from the cache. Before this time is reached,
a Multicast DNS Querier which has clients with an active interest in
the state of that record (e.g. a network browsing window displaying
a list of discovered services to the user) SHOULD re-issue its query
to determine whether the record is still valid.
To perform this cache maintenance, a Multicast DNS Querier should
plan to re-query for records after at least 50% of the record
lifetime has elapsed. This document recommends the following
specific strategy:
The Querier should plan to issue a query at 80% of the record
lifetime, and then if no answer is received, at 85%, 90% and 95%.
If an answer is received, then the remaining TTL is reset to the
value given in the answer, and this process repeats for as long as
the Multicast DNS Querier has an ongoing interest in the record.
If after four queries no answer is received, the record is deleted
when it reaches 100% of its lifetime. A Multicast DNS Querier MUST
NOT perform this cache maintenance for records for which it has no
clients with an active interest. If the expiry of a particular record
from the cache would result in no net effect to any client software
running on the Querier device, and no visible effect to the human
user, then there is no reason for the Multicast DNS Querier to
waste network bandwidth checking whether the record remains valid.
To avoid the case where multiple Multicast DNS Queriers on a network
all issue their queries simultaneously, a random variation of 2% of
the record TTL should be added, so that queries are scheduled to be
performed at 80-82%, 85-87%, 90-92% and then 95-97% of the TTL.
6.4 Multiple Questions per Query
Multicast DNS allows a querier to place multiple questions in the
Question Section of a single Multicast DNS query packet.
The semantics of a Multicast DNS query packet containing multiple
questions is identical to a series of individual DNS query packets
containing one question each. Combining multiple questions into a
single packet is purely an efficiency optimization, and has no other
semantic significance.
Expires 10th February 2007 Cheshire & Krochmal [Page 12]
Internet Draft Multicast DNS 10th August 2006
6.5 Questions Requesting Unicast Responses
Sending Multicast DNS responses via multicast has the benefit that
all the other hosts on the network get to see those responses, and
can keep their caches up to date, and detect conflicting responses.
However, there are situations where all the other hosts on the
network don't need to see every response. Some examples are a laptop
computer waking from sleep, or the Ethernet cable being connected to
a running machine, or a previously inactive interface being activated
through a configuration change. At the instant of wake-up or link
activation, the machine is a brand new participant on a new network.
Its Multicast DNS cache for that interface is empty, and it has no
knowledge of its peers on that link. It may have a significant number
of questions that it wants answered right away to discover
information about its new surroundings and present that information
to the user. As a new participant on the network, it has no idea
whether the exact same questions may have been asked and answered
just seconds ago. In this case, triggering a large sudden flood of
multicast responses may impose an unreasonable burden on the network.
To avoid large floods of potentially unnecessary responses in these
cases, Multicast DNS defines the top bit in the class field of a DNS
question as the "unicast response" bit. When this bit is set in a
question, it indicates that the Querier is willing to accept unicast
responses instead of the usual multicast responses. These questions
requesting unicast responses are referred to as "QU" questions, to
distinguish them from the more usual questions requesting multicast
responses ("QM" questions). A Multicast DNS Querier sending its
initial batch of questions immediately on wake from sleep or
interface activation SHOULD set the "QU" bit in those questions.
When a question is retransmitted (as described in Section 6.3
"Continuous Multicast DNS Querying") the "QU" bit SHOULD NOT be set
in subsequent retransmissions of that question. Subsequent
retransmissions SHOULD be usual "QM" questions. After the first
question has received its responses, the querier should have a large
known-answer list (see "Known Answer Suppression" below) so that
subsequent queries should elicit few, if any, further responses.
Reverting to multicast responses as soon as possible is important
because of the benefits that multicast responses provide (see
"Benefits of Multicast Responses" below). In addition, the "QU" bit
SHOULD be set only for questions that are active and ready to be sent
the moment of wake from sleep or interface activation. New questions
issued by clients afterwards should be treated as normal "QM"
questions and SHOULD NOT have the "QU" bit set on the first question
of the series.
When receiving a question with the "unicast response" bit set, a
responder SHOULD usually respond with a unicast packet directed back
to the querier. If the responder has not multicast that record
Expires 10th February 2007 Cheshire & Krochmal [Page 13]
Internet Draft Multicast DNS 10th August 2006
recently (within one quarter of its TTL), then the responder SHOULD
instead multicast the response so as to keep all the peer caches up
to date, and to permit passive conflict detection. In the case of
answering a probe question with the "unicast response" bit set, the
responder should always generate the requested unicast response, but
may also send a multicast announcement too if the time since the last
multicast announcement of that record is more than a quarter of its
TTL.
Except when defending a unique name against a probe from another host
unicast replies are subject to all the same packet generation rules
as multicast replies, including the cache flush bit (see Section
11.3, "Announcements to Flush Outdated Cache Entries") and randomized
delays to reduce network collisions (see Section 8, "Responding").
6.6 Delaying Initial Query
If a query is issued for which there already exist one or more
records in the local cache, and those record(s) were received with
the cache flush bit set (see Section 11.3, "Announcements to Flush
Outdated Cache Entries"), indicating that they form a unique RRSet,
then the host SHOULD delay its initial query by imposing a random
delay from 500-1000ms. This is to avoid the situation where a group
of hosts are synchronized by some external event and all perform
the same query simultaneously. This means that when the first host
(selected randomly by this algorithm) transmits its query, all the
other hosts that were about to transmit the same query can suppress
their superfluous queries, as described in "Duplicate Question
Suppression" below.
6.7 Direct Unicast Queries to port 5353
In specialized applications there may be rare situations where it
makes sense for a Multicast DNS Querier to send its query via unicast
to a specific machine. When a Multicast DNS Responder receives a
query via direct unicast, it SHOULD respond as it would for a
"QU" query, as described above in Section 6.5 "Questions Requesting
Unicast Responses". Since it is possible for a unicast query to be
received from a machine outside the local link, Responders SHOULD
check that the source address in the query packet matches the local
subnet for that link, and silently ignore the packet if not.
There may be specialized situations, outside the scope of this
document, where it is intended and desirable to create a Responder
that does answer queries originating outside the local link. Such
a Responder would need to ensure that these non-local queries are
always answered via unicast back to the Querier, since an answer sent
via link-local multicast would not reach a Querier outside the local
link.
Expires 10th February 2007 Cheshire & Krochmal [Page 14]
Internet Draft Multicast DNS 10th August 2006
7. Duplicate Suppression
A variety of techniques are used to reduce the amount of redundant
traffic on the network.
7.1 Known Answer Suppression
When a Multicast DNS Querier sends a query to which it already knows
some answers, it populates the Answer Section of the DNS message with
those answers.
A Multicast DNS Responder SHOULD NOT answer a Multicast DNS Query if
the answer it would give is already included in the Answer Section
with an RR TTL at least half the correct value. If the RR TTL of the
answer as given in the Answer Section is less than half of the true
RR TTL as known by the Multicast DNS Responder, the responder MUST
send an answer so as to update the Querier's cache before the record
becomes in danger of expiration.
Because a Multicast DNS Responder will respond if the remaining TTL
given in the known answer list is less than half the true TTL, it is
superfluous for the Querier to include such records in the known
answer list. Therefore a Multicast DNS Querier SHOULD NOT include
records in the known answer list whose remaining TTL is less than
half their original TTL. Doing so would simply consume space in the
packet without achieving the goal of suppressing responses, and would
therefore be a pointless waste of network bandwidth.
A Multicast DNS Querier MUST NOT cache resource records observed in
the Known Answer Section of other Multicast DNS Queries. The Answer
Section of Multicast DNS Queries is not authoritative. By placing
information in the Answer Section of a Multicast DNS Query the
querier is stating that it *believes* the information to be true.
It is not asserting that the information *is* true. Some of those
records may have come from other hosts that are no longer on the
network. Propagating that stale information to other Multicast DNS
Queriers on the network would not be helpful.
7.2 Multi-Packet Known Answer Suppression
Sometimes a Multicast DNS Querier will already have too many answers
to fit in the Known Answer Section of its query packets. In this
case, it should issue a Multicast DNS Query containing a question and
as many Known Answer records as will fit. It MUST then set the TC
(Truncated) bit in the header before sending the Query. It MUST then
immediately follow the packet with another query packet containing no
questions, and as many more Known Answer records as will fit. If
there are still too many records remaining to fit in the packet, it
again sets the TC bit and continues until all the Known Answer
records have been sent.
Expires 10th February 2007 Cheshire & Krochmal [Page 15]
Internet Draft Multicast DNS 10th August 2006
A Multicast DNS Responder seeing a Multicast DNS Query with the TC
bit set defers its response for a time period randomly selected in
the interval 400-500ms. This gives the Multicast DNS Querier time to
send additional Known Answer packets before the Responder responds.
If the Responder sees any of its answers listed in the Known Answer
lists of subsequent packets from the querying host, it SHOULD delete
that answer from the list of answers it is planning to give, provided
that no other host on the network is also waiting to receive the same
answer record.
If the Responder receives additional Known Answer packets with the TC
bit set, it SHOULD extend the delay as necessary to ensure a pause of
400-500ms after the last such packet before it sends its answer. This
opens the potential risk that a continuous stream of Known Answer
packets could, theoretically, prevent a Responder from answering
indefinitely. In practice answers are never actually delayed
significantly, and should a situation arise where significant delays
did happen, that would be a scenario where the network is so
overloaded that it would be desirable to err on the side of caution.
The consequence of delaying an answer may be that it takes a user
longer than usual to discover all the services on the local network;
in contrast the consequence of incorrectly answering before all the
Known Answer packets have been received would be wasting bandwidth
sending unnecessary answers on an already overloaded network. In this
(rare) situation, sacrificing speed to preserve reliable network
operation is the right trade-off.
7.3 Duplicate Question Suppression
If a host is planning to send a query, and it sees another host on
the network send a query containing the same question, and the Known
Answer Section of that query does not contain any records which this
host would not also put in its own Known Answer Section, then this
host should treat its own query as having been sent. When multiple
clients on the network are querying for the same resource records,
there is no need for them to all be repeatedly asking the same
question.
7.4 Duplicate Answer Suppression
If a host is planning to send an answer, and it sees another host on
the network send a response packet containing the same answer record,
and the TTL in that record is not less than the TTL this host would
have given, then this host should treat its own answer as having been
sent. When multiple responders on the network have the same data,
there is no need for all of them to respond.
This feature is particularly useful when multiple Sleep Proxy Servers
are deployed (see Section 17, "Multicast DNS and Power Management").
Expires 10th February 2007 Cheshire & Krochmal [Page 16]
Internet Draft Multicast DNS 10th August 2006
In the future it is possible that every general-purpose OS (Mac,
Windows, Linux, etc.) will implement Sleep Proxy Service as a matter
of course. In this case there could be a large number of Sleep Proxy
Servers on any given network, which is good for reliability and
fault-tolerance, but would be bad for the network if every Sleep
Proxy Server were to answer every query.
8. Responding
When a Multicast DNS Responder constructs and sends a Multicast DNS
response packet, the Answer Section of that packet must contain only
records for which that Responder is explicitly authoritative. These
answers may be generated because the record answers a question
received in a Multicast DNS query packet, or at certain other times
that the responder determines than an unsolicited announcement is
warranted. A Multicast DNS Responder MUST NOT place records from its
cache, which have been learned from other responders on the network,
in the Answer Section of outgoing response packets. Only an
authoritative source for a given record is allowed to issue responses
containing that record.
The determination of whether a given record answers a given question
is done using the standard DNS rules: The record name must match the
question name, the record rrtype must match the question qtype
(unless the qtype is "ANY"), and the record rrclass must match the
question qclass (unless the qclass is "ANY").
A Multicast DNS Responder MUST only respond when it has a positive
non-null response to send. Error responses must never be sent. The
non-existence of any name in a Multicast DNS Domain is ascertained by
the failure of any machine to respond to the Multicast DNS query, not
by NXDOMAIN errors.
Multicast DNS Responses MUST NOT contain any questions in the
Question Section. Any questions in the Question Section of a received
Multicast DNS Response MUST be silently ignored. Multicast DNS
Queriers receiving Multicast DNS Responses do not care what question
elicited the response; they care only that the information in the
response is true and accurate.
A Multicast DNS Responder on Ethernet [IEEE802] and similar shared
multiple access networks SHOULD have the capability of delaying its
responses by up to 500ms, as determined by the rules described below.
If a large number of Multicast DNS Responders were all to respond
immediately to a particular query, a collision would be virtually
guaranteed. By imposing a small random delay, the number of
collisions is dramatically reduced. On a full-sized Ethernet using
the maximum cable lengths allowed and the maximum number of repeaters
allowed, an Ethernet frame is vulnerable to collisions during the
transmission of its first 256 bits. On 10Mb/s Ethernet, this equates
to a vulnerable time window of 25.6us. On higher-speed variants of
Ethernet, the vulnerable time window is shorter.
Expires 10th February 2007 Cheshire & Krochmal [Page 17]
Internet Draft Multicast DNS 10th August 2006
In the case where a Multicast DNS Responder has good reason to
believe that it will be the only responder on the link with a
positive non-null response (i.e. because it is able to answer every
question in the query packet, and for all of those answer records it
has previously verified that the name, rrtype and rrclass are unique
on the link) it SHOULD NOT impose any random delay before responding,
and SHOULD normally generate its response within at most 10ms.
In particular, this applies to responding to probe queries with the
"unicast response" bit set. Since receiving a probe query gives a
clear indication that some other Responder is planning to start using