3 Network Working Group L. Daigle
4 Internet-Draft A. Newton
5 Expires: August 15, 2004 VeriSign, Inc.
9 Domain-based Application Service Location Using SRV RRs and the
10 Dynamic Delegation Discovery Service (DDDS)
11 draft-daigle-napstr-04.txt
15 This document is an Internet-Draft and is in full conformance with
16 all provisions of Section 10 of RFC2026.
18 Internet-Drafts are working documents of the Internet Engineering
19 Task Force (IETF), its areas, and its working groups. Note that
20 other groups may also distribute working documents as Internet-
23 Internet-Drafts are draft documents valid for a maximum of six months
24 and may be updated, replaced, or obsoleted by other documents at any
25 time. It is inappropriate to use Internet-Drafts as reference
26 material or to cite them other than as "work in progress."
28 The list of current Internet-Drafts can be accessed at
29 http://www.ietf.org/ietf/1id-abstracts.txt.
31 The list of Internet-Draft Shadow Directories can be accessed at
32 http://www.ietf.org/shadow.html.
34 This Internet-Draft will expire on August 15, 2004.
38 Copyright (C) The Internet Society (2004). All Rights Reserved.
42 This memo defines a generalized mechanism for application service
43 naming that allows service location without relying on rigid domain
44 naming conventions (so-called name hacks). The proposal defines a
45 Dynamic Delegation Discovery System (DDDS) Application to map domain
46 name, application service name, and application protocol to target
47 server and port, dynamically.
55 Daigle & Newton Expires August 15, 2004 [Page 1]
57 Internet-Draft draft-daigle-napstr-04 February 2004
62 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
63 2. Straightforward-NAPTR (S-NAPTR) Specification . . . . . . . 4
64 2.1 Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . 4
65 2.2 S-NAPTR DDDS Application Usage . . . . . . . . . . . . . . . 5
66 2.2.1 Ordering and Preference . . . . . . . . . . . . . . . . . . 5
67 2.2.2 Matching and non-Matching NAPTR Records . . . . . . . . . . 5
68 2.2.3 Terminal and Non-Terminal NAPTR Records . . . . . . . . . . 5
69 2.2.4 S-NAPTR and Successive Resolution . . . . . . . . . . . . . 6
70 2.2.5 Clients Supporting Multiple Protocols . . . . . . . . . . . 6
71 3. Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . 7
72 3.1 Guidelines for Application Protocol Developers . . . . . . . 7
73 3.1.1 Registration of application service and protocol tags . . . 7
74 3.1.2 Definition of conditions for retry/failure . . . . . . . . . 8
75 3.1.3 Server identification and handshake . . . . . . . . . . . . 8
76 3.2 Guidelines for Domain Administrators . . . . . . . . . . . . 8
77 3.3 Guidelines for Client Software Writers . . . . . . . . . . . 9
78 4. Illustrations . . . . . . . . . . . . . . . . . . . . . . . 9
79 4.1 Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . 9
80 4.2 Service Discovery within a Domain . . . . . . . . . . . . . 10
81 4.3 Multiple Protocols . . . . . . . . . . . . . . . . . . . . . 10
82 4.4 Remote Hosting . . . . . . . . . . . . . . . . . . . . . . . 11
83 4.5 Sets of NAPTR RRs . . . . . . . . . . . . . . . . . . . . . 12
84 4.6 Sample sequence diagram . . . . . . . . . . . . . . . . . . 12
85 5. Motivation and Discussion . . . . . . . . . . . . . . . . . 14
86 5.1 So, why not just SRV records? . . . . . . . . . . . . . . . 15
87 5.2 So, why not just NAPTR records? . . . . . . . . . . . . . . 15
88 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . 16
89 7. Security Considerations . . . . . . . . . . . . . . . . . . 16
90 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 17
91 References . . . . . . . . . . . . . . . . . . . . . . . . . 17
92 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 18
93 A. Application Service Location Application of DDDS . . . . . . 18
94 A.1 Application Unique String . . . . . . . . . . . . . . . . . 18
95 A.2 First Well Known Rule . . . . . . . . . . . . . . . . . . . 18
96 A.3 Expected Output . . . . . . . . . . . . . . . . . . . . . . 18
97 A.4 Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
98 A.5 Service Parameters . . . . . . . . . . . . . . . . . . . . . 19
99 A.5.1 Application Services . . . . . . . . . . . . . . . . . . . . 19
100 A.5.2 Application Protocols . . . . . . . . . . . . . . . . . . . 20
101 A.6 Valid Rules . . . . . . . . . . . . . . . . . . . . . . . . 20
102 A.7 Valid Databases . . . . . . . . . . . . . . . . . . . . . . 20
103 B. Pseudo pseudocode for S-NAPTR . . . . . . . . . . . . . . . 20
104 B.1 Finding the first (best) target . . . . . . . . . . . . . . 20
105 B.2 Finding subsequent targets . . . . . . . . . . . . . . . . . 21
106 Full Copyright Statement . . . . . . . . . . . . . . . . . . 23
111 Daigle & Newton Expires August 15, 2004 [Page 2]
113 Internet-Draft draft-daigle-napstr-04 February 2004
118 This memo defines a generalized mechanism for application service
119 naming that allows service location without relying on rigid domain
120 naming conventions (so-called name hacks). The proposal defines a
121 Dynamic Delegation Discovery System (DDDS -- see [6]) Application to
122 map domain name, application service name, and application protocol
123 to target server and port, dynamically.
125 As discussed in Section 5, existing approaches to using DNS records
126 to dynamically determining the current host for a given application
127 service are limited in terms of the use cases supported. To address
128 some of the limitations, this document defines a DDDS Application to
129 map service+protocol+domain to specific server addresses using both
130 NAPTR [7] and SRV ([5]) DNS resource records. This can be viewed as
131 a more general version of the use of SRV and/or a very restricted
132 application of the use of NAPTR resource records.
134 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
135 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
136 document are to be interpreted as described in RFC2119 ([2]).
138 2. Straightforward-NAPTR (S-NAPTR) Specification
140 The precise details of the specification of this DDDS application are
141 given in Appendix A. This section defines the usage of the DDDS
146 An "application service" is a generic term for some type of
147 application, indpendent of the protocol that may be used to offer it.
148 Each application service will be associated with an IANA-registered
149 tag. For example, instant messaging is a type of application
150 service, which can be implemented by many different application-layer
151 protocols, and the tag "IM" (used as an illustration here) could be
154 An "application protocol" is used to implement the application
155 service. These are also associated with IANA-registered tags. In
156 the case where multiple transports are available for the application,
157 separate tags should be defined for each transport.
159 The intention is that the combination of application service and
160 protocol tags should be specific enough that finding a known pair
161 (e.g., "IM:ProtC") is sufficient for a client to identify a server
162 with which it can communicate.
167 Daigle & Newton Expires August 15, 2004 [Page 3]
169 Internet-Draft draft-daigle-napstr-04 February 2004
172 Some protocols support multiple application services. For example,
173 LDAP is an application protocol, and can be found supporting various
174 services (e.g., "whitepages", "directory enabled networking", etc).
176 2.2 S-NAPTR DDDS Application Usage
178 As outlined in Appendix A, NAPTR records are used to store
179 application service+protocol information for a given domain.
180 Following the DDDS standard, these records are looked up, and the
181 rewrite rules (contained in the NAPTR records) are used to determine
182 the successive DNS lookups, until a desirable target is found.
184 For the rest of this section, refer to the set of NAPTR resource
185 records for example.com shown in the figure below.
188 ;; order pref flags service regexp replacement
189 IN NAPTR 100 10 "" "WP:whois++" "" bunyip.example.
190 IN NAPTR 100 20 "s" "WP:ldap" "" _ldap._tcp.myldap.example.com.
191 IN NAPTR 200 10 "" "IM:protA" "" someisp.example.
192 IN NAPTR 200 30 "a" "IM:protB" "" myprotB.example.com.
195 2.2.1 Ordering and Preference
197 A client retrieves all of the NAPTR records associated with the
198 target domain name (example.com, above). These are to be sorted in
199 terms of increasing ORDER, and increasing PREF within each ORDER.
201 2.2.2 Matching and non-Matching NAPTR Records
203 Starting with the first sorted NAPTR record, the client examines the
204 SERVICE field to find a match. In the case of the S-NAPTR DDDS
205 application, that means a SERVICE field that includes the tags for
206 the desired application service and a supported application protocol.
208 If more than one NAPTR record matches, they are processed in
209 increasing sort order.
211 2.2.3 Terminal and Non-Terminal NAPTR Records
213 A NAPTR record with an empty FLAG field is "non-terminal". That is,
214 more NAPTR RR lookups are to be performed. Thus, to process a NAPTR
215 record with an empty FLAG field in S-NAPTR, the REPLACEMENT field is
216 used as the target of the next DNS lookup -- for NAPTR RRs.
218 In S-NAPTR, the only terminal flags are "S" and "A". These are
219 called "terminal" NAPTR lookups because they denote the end of the
223 Daigle & Newton Expires August 15, 2004 [Page 4]
225 Internet-Draft draft-daigle-napstr-04 February 2004
228 DDDS/NAPTR processing rules. In the case of an "S" flag, the
229 REPLACEMENT field is used as the target of a DNS query for SRV RRs,
230 and normal SRV processing is applied. In the case of an "A" flag, an
231 address record is sought for the REPLACEMENT field target (and the
232 default protocol port is assumed).
234 2.2.4 S-NAPTR and Successive Resolution
236 As shown in the example NAPTR RR set above, it is possible to have
237 multiple possible targets for a single application service+protocol
238 pair. These are to be pursued in order until a server is
239 successfully contacted or all possible matching NAPTR records have
240 been successively pursued to terminal lookups and servers contacted.
241 That is, a client must backtrack and attempt other resolution paths
242 in the case of failure.
244 "Failure" is declared, and backtracking must be used when
246 o the designated remote server (host and port) fail to provide
247 appropriate security credentials for the *originating* domain
249 o connection to the designated remote server otherwise fails -- the
250 specifics terms of which are defined when an application protocol
253 o the S-NAPTR-designated DNS lookup fails to yield expected results
254 -- e.g., no A RR for an "A" target, no SRV record for an "S"
255 target, or no NAPTR record with appropriate application service
256 and protocol for a NAPTR lookup. Except in the case of the very
257 first NAPTR lookup, this last is a configuration error: the fact
258 that example.com has a NAPTR record pointing to "bunyip.example"
259 for the "WP:Whois++" service and protocol means the administrator
260 of example.com believes that service exists. If bunyip.example
261 has no "WP:Whois++" NAPTR record, the application client MUST
262 backtrack and try the next available "WP:Whois++" option from
263 example.com. As there is none, the whole resolution fails.
265 An application client first queries for the NAPTR RRs for the domain
266 of a named application service. The application client MUST select
267 one protocol to choose The PREF field of the NAPTR RRs may be used by
268 the domain administrator to The first DNS query is for the NAPTR RRs
269 in the original target domain (example.com, above).
271 2.2.5 Clients Supporting Multiple Protocols
273 In the case of an application client that supports more than one
274 protocol for a given application service, it MUST pursue S-NAPTR
275 resolution completely for one protocol before trying another.j It MAY
279 Daigle & Newton Expires August 15, 2004 [Page 5]
281 Internet-Draft draft-daigle-napstr-04 February 2004
284 choose which protocol to try first based on its own preference, or
285 from the PREF ranking in the first set of NAPTR records (i.e., those
286 for the target named domain). However, the chosen protocol MUST be
287 listed in that first NAPTR RR set.
289 That is, what the client MUST NOT do is start looking for one
290 protocol, observe that a successive NAPTR RR set supports another of
291 its preferred protocols, and continue the S-NAPTR resolution based on
292 that protocol. For example, even if someisp.example offers the "IM"
293 service with protocol "ProtB", there is no reason to believe it does
294 so on behalf of example.com (since there is no such pointer in
295 example.com's NAPTR RR set).
299 3.1 Guidelines for Application Protocol Developers
301 The purpose of S-NAPTR is to provide application standards developers
302 with a more powerful framework (than SRV RRs alone) for naming
303 service targets, without requiring each application protocol (or
304 service) standard to define a separate DDDS application.
306 Note that this approach is intended specifically for use when it
307 makes sense to associate services with particular domain names (e.g.,
308 e-mail addresses, SIP addresses, etc). A non-goal is having all
309 manner of label mapped into domain names in order to use this.
311 Specifically not addressed in this document is how to select the
312 domain for which the service+protocol is being sought. It is up to
313 other conventions to define how that might be used (e.g., instant
314 messaging standards can define what domain to use from IM URIs, how
315 to step down from foobar.example.com to example.com, and so on, if
318 Although this document proposes a DDDS application that does not use
319 all the features of NAPTR resource records, it does not mean to imply
320 that DNS resolvers should fail to implement all aspects of the NAPTR
321 RR standard. A DDDS application is a client use convention.
323 The rest of this section outlines the specific elements that protocol
324 developers must determine and document in order to make use of S-
327 3.1.1 Registration of application service and protocol tags
329 Application protocol developers that wish to make use of S-NAPTR must
330 make provision to register any relevant application service and
331 application protocol tags, as described in Section 6.
335 Daigle & Newton Expires August 15, 2004 [Page 6]
337 Internet-Draft draft-daigle-napstr-04 February 2004
340 3.1.2 Definition of conditions for retry/failure
342 One other important aspect that must be defined is the expected
343 behaviour for interacting with the servers that are reached via S-
344 NAPTR. Specifically, under what circumstances should the client
345 retry a target that was found via S-NAPTR? What should it consider a
346 failure that causes it to return to the S-NAPTR process to determine
347 the next serviceable target (a less preferred target)?
349 For example, if the client gets a "connection refused" from a server,
350 should it retry for some (protocol-dependent) period of time? Or,
351 should it try the next-preferred target in the S-NAPTR chain of
352 resolution? Should it only try the next-preferred target if it
353 receives a protocol-specific permanent error message?
355 The most important thing is to select one expected behaviour and
356 document it as part of the use of S-NAPTR.
358 As noted earlier, failure to provide appropriate credentials to
359 identify the server as being authoritative for the original taret
360 domain is always considered a failure condition.
362 3.1.3 Server identification and handshake
364 As noted in Section 7, use of the DNS for server location increases
365 the importance of using protocol-specific handshakes to determine and
366 confirm the identity of the server that is eventually reached.
368 Therefore, application protocol developers using S-NAPTR should
369 identify the mechanics of the expected identification handshake when
370 the client connects to a server found through S-NAPTR.
372 3.2 Guidelines for Domain Administrators
374 Although S-NAPTR aims to provide a "straightforward" application of
375 DDDS and use of NAPTR records, it is still possible to create very
376 complex chains and dependencies with the NAPTR and SRV records.
378 Therefore, domain administrators are called upon to use S-NAPTR with
379 as much restraint as possible, while still achieving their service
382 The complete set of NAPTR, SRV and A RRs that are "reachable" through
383 the S-NAPTR process for a particular application service can be
384 thought of as a "tree". Each NAPTR RR retrieved points to more NAPTR
385 or SRV records; each SRV record points to several A record lookups.
386 Even though a particular client can "prune" the tree to use only
387 those records referring to application protocols supported by the
391 Daigle & Newton Expires August 15, 2004 [Page 7]
393 Internet-Draft draft-daigle-napstr-04 February 2004
396 client, the tree could be quite deep, and retracing the tree to retry
397 other targets can become expensive if the tree has many branches.
401 o Fewer branches is better: for both NAPTR and SRV records, provide
402 different targets with varying preferences where appropriate
403 (e.g., to provide backup services, etc), but don't look for
404 reasons to provide more.
406 o Shallower is better: avoid using NAPTR records to "rename"
407 services within a zone. Use NAPTR records to identify services
408 hosted elsewhere (i.e., where you cannot reasonably provide the
409 SRV records in your own zone).
412 3.3 Guidelines for Client Software Writers
414 To properly understand DDDS/NAPTR, an implementor must read [6].
415 However, the most important aspect to keep in mind is that, if one
416 target fails to work for the application, it is expected that the
417 application will continue through the S-NAPTR tree to try the (less
418 preferred) alternatives.
424 The basic intended use cases for which S-NAPTR has been developed
427 o Service discovery within a domain. For example, this can be used
428 to find the "authoritative" server for some type of service within
429 a domain (see the specific example in Section 4.2).
431 o Multiple protocols. This is increasingly common as new
432 application services are defined. This includes the case of
433 instant messaging (a service) which can be offered with multiple
434 protocols (see Section 4.3).
436 o Remote hosting. Each of the above use cases applies within the
437 administration of a single domain. However, one domain operator
438 may elect to engage another organization to provide an application
439 service. See Section 4.4 for an example that cannot be served by
447 Daigle & Newton Expires August 15, 2004 [Page 8]
449 Internet-Draft draft-daigle-napstr-04 February 2004
452 4.2 Service Discovery within a Domain
454 There are occasions when it is useful to be able to determine the
455 "authoritative" server for a given application service within a
456 domain. This is "discovery", because there is no a priori knowledge
457 as to whether or where the service is offered; it is therefore
458 important to determine the location and characteristics of the
461 For example, there is growing discussion of having a generic
462 mechanism for locating the keys or certificates associated with
463 particular application (servers) operated in (or for) a particular
464 domain. Here's a hypothetical case for storing application key or
465 certificate data for a given domain. The premise is that some
466 credentials registry (CredReg) service has been defined to be a leaf
467 node service holding the keys/certs for the servers operated by (or
468 for) the domain. Furthermore, it is assumed that more than one
469 protocol is available to provide the service for a particular domain.
470 This DDDS-based approach is used to find the CredReg server that
471 holds the information.
473 Thus, the set of NAPTR records for thinkingcat.example might look
477 ;; order pref flags service regexp replacement
478 IN NAPTR 100 10 "" "CREDREG:ldap:iris-beep" "" theserver.thinkingcat.example.
480 Note that another domain, offering the same application service,
481 might offer it using a different set of application protocols:
483 anotherdomain.example.
484 ;; order pref flags service regexp replacement
485 IN NAPTR 100 10 "" "CREDREG:iris-lw:iris-beep" "" foo.anotherdomain.example.
488 4.3 Multiple Protocols
490 As it stands, there are several different protocols proposed for
491 offering "instant message" services. Assuming that "IM" was
492 registered as an application service, this DDDS application could be
493 used to determine the available services for delivering to a target.
495 Two particular features of instant messaging should be noted:
497 1. gatewaying is expected to bridge communications across protocols
499 2. instant messaging servers are likely to be operated out of a
503 Daigle & Newton Expires August 15, 2004 [Page 9]
505 Internet-Draft draft-daigle-napstr-04 February 2004
508 different domain than the instant messaging address, and servers
509 of different protocols may be offered by independent
512 For example, "thinkingcat.example" may support its own servers for
513 the "ProtA" instant messaging protocol, but rely on outsourcing from
514 "example.com" for "ProtC" and "ProtB" servers.
516 Using this DDDS-based approach, thinkingcat.example can indicate a
517 preference ranking for the different types of servers for the instant
518 messaging service, and yet the out-sourcer can independently rank the
519 preference and ordering of servers. This independence is not
520 achievable through the use of SRV records alone.
522 Thus, to find the IM services for thinkingcat.example, the NAPTR
523 records for thinkingcat.example are retrieved:
526 ;; order pref flags service regexp replacement
527 IN NAPTR 100 10 "s" "IM:ProtA" "" _ProtA._tcp.thinkingcat.example.
528 IN NAPTR 100 20 "s" "IM:ProtB" "" _ProtB._tcp.example.com.
529 IN NAPTR 100 30 "s" "IM:ProtC" "" _ProtC._tcp.example.com.
531 and then the administrators at example.com can manage the preference
532 rankings of the servers they use to support the ProtB service:
534 _ProtB._tcp.example.com.
535 ;; Pref Weight Port Target
536 IN SRV 10 0 10001 bigiron.example.com
537 IN SRV 20 0 10001 backup.im.example.com
538 IN SRV 30 0 10001 nuclearfallout.australia-isp.example
543 In the Instant Message hosting example in Section 4.3, the service
544 owner (thinkingcat.example) had to host pointers to the hosting
545 service's SRV records in the thinkingcat.example domain.
547 A better way to approach this is to have one NAPTR RR in the
548 thinkingcat.example domain pointing to all the hosted services, and
549 the hosting domain has NAPTR records for each service to map them to
550 whatever local hosts it chooses (and may change from time to time).
559 Daigle & Newton Expires August 15, 2004 [Page 10]
561 Internet-Draft draft-daigle-napstr-04 February 2004
565 ;; order pref flags service regexp replacement
566 IN NAPTR 100 10 "s" "IM:ProtA" "" _ProtA._tcp.thinkingcat.example.
567 IN NAPTR 100 20 "" "IM:ProtB:ProtC" "" thinkingcat.example.com.
570 and then the administrators at example.com can break out the
571 individual application protocols and manage the preference rankings
572 of the servers they use to support the ProtB service (as before):
574 thinkingcat.example.com.
575 ;; order pref flags service regexp replacement
576 IN NAPTR 100 10 "s" "IM:ProtC" "" _ProtC._tcp.example.com.
577 IN NAPTR 100 20 "s" "IM:ProtB" "" _ProtB._tcp.example.com.
581 _ProtC._tcp.example.com.
582 ;; Pref Weight Port Target
583 IN SRV 10 0 10001 bigiron.example.com
584 IN SRV 20 0 10001 backup.im.example.com
585 IN SRV 30 0 10001 nuclearfallout.australia-isp.example
588 4.5 Sets of NAPTR RRs
590 Note that the above sections assumed that there was one service
591 available (via S-NAPTR) per domain. Often, that will not be the
592 case. Assuming thinkingcat.example had the CredReg service set up as
593 described in Section 4.2 and the instant messaging service set up as
594 described in Section 4.4, then a client querying for the NAPTR RR set
595 from thinkingcat.com would get the following answer:
598 ;; order pref flags service regexp replacement
599 IN NAPTR 100 10 "s" "IM:ProtA" "" _ProtA._tcp.thinkingcat.example.
600 IN NAPTR 100 20 "" "IM:ProtB:ProtC:" "" thinkingcat.example.com.
601 IN NAPTR 200 10 "" "CREDREG:ldap:iris-beep" "" bouncer.thinkingcat.example.
603 Sorting them by increasing "ORDER", the client would look through the
604 SERVICE strings to determine if there was a NAPTR RR that matched the
605 application service it was looking for, with an application protocol
606 it could use. The first (lowest PREF) record that so matched is the
607 one the client would use to continue.
609 4.6 Sample sequence diagram
611 Consider the example in Section 4.3. Visually, the sequence of steps
615 Daigle & Newton Expires August 15, 2004 [Page 11]
617 Internet-Draft draft-daigle-napstr-04 February 2004
620 required for the client to reach the final server for a "ProtB"
621 service for IM for the thinkingcat.example domain is as follows:
625 thinkingcat.example example.com backup.im.example.com
629 3 ------------------------------>| |
630 4 <------------------------------| |
631 5 ------------------------------>| |
632 6 <------------------------------| |
633 7 ------------------------------>| |
634 8 <------------------------------| |
635 9 ------------------------------------------------->|
636 10 <-------------------------------------------------|
637 11 ------------------------------------------------->|
638 12 <-------------------------------------------------|
643 1. the name server (NS) for thinkingcat.example is reached with a
644 request for all NAPTR records
646 2. the server responds with the NAPTR records shown in Section 4.3.
648 3. the second NAPTR record matches the desired criteria; that has an
649 "s" flag and a replacement fields of "_ProtB._tcp.example.com".
650 So, the client looks up SRV records for that target, ultimately
651 making the request of the NS for example.com.
653 4. the response includes the SRV records listed in Section 4.3.
655 5. the client attempts to reach the server with the lowest PREF in
656 the SRV list -- looking up the A record for the SRV record's
657 target (bigiron.example.com).
659 6. the example.com NS responds with an error message -- no such
662 7. the client attempts to reach the second server in the SRV list,
663 and looks up the A record for backup.im.example.com
665 8. the client gets the A record with the IP address for
666 backup.im.example.com from example.com's NS.
671 Daigle & Newton Expires August 15, 2004 [Page 12]
673 Internet-Draft draft-daigle-napstr-04 February 2004
676 9. the client connects to that IP address, on port 10001 (from the
677 SRV record), using ProtB over tcp.
679 10. the server responds with an "OK" message.
681 11. the client uses ProtB to challenge that this server has
682 credentials to operate the service for the original domain
683 (thinkingcat.example)
685 12. the server responds, and the rest is IM.
688 5. Motivation and Discussion
690 Increasingly, application protocol standards are using domain names
691 to identify server targets, and stipulating that clients should look
692 up SRV resource records to determine the host and port providing the
693 server. This enables a distinction between naming an application
694 service target and actually hosting the server. It also increases
695 flexibility in hosting the target service:
697 o the server may be operated by a completely different organization
698 without having to list the details of that organization's DNS
701 o multiple instances can be set up (e.g., for load balancing or
704 o it can be moved from time to time without disrupting clients'
707 This is quite useful, but Section 5.1 outlines some of the
708 limitations inherent in the approach.
710 That is, while SRV records can be used to map from a specific service
711 name and protocol for a specific domain to a specific server, SRV
712 records are limited to one layer of indirection, and are focused on
713 server administration rather than on application naming. And, while
714 the DDDS specification and use of NAPTR allows multiple levels of
715 redirection before locating the target server machine with an SRV
716 record, this proposal requires only a subset of NAPTR strictly bound
717 to domain names, without making use of the REGEXP field of NAPTR.
718 These restrictions make the client's resolution process much more
719 predictable and efficient than with some potential uses of NAPTR
720 records. This is dubbed "S-NAPTR" -- a "S"traightforward use of
727 Daigle & Newton Expires August 15, 2004 [Page 13]
729 Internet-Draft draft-daigle-napstr-04 February 2004
732 5.1 So, why not just SRV records?
734 An expected question at this point is: this is so similar in
735 structure to SRV records, why are we doing this with DDDS/NAPTR?
737 Limitations of SRV include:
739 o SRV provides a single layer of indirection -- the outcome of an
740 SRV lookup is a new domain name for which the A RR is to be found.
742 o the purpose of SRV is focused on individual server administration,
743 not application naming: as stated in [5] "The SRV RR allows
744 administrators to use several servers for a single domain, to move
745 services from host to host with little fuss, and to designate some
746 hosts as primary servers for a service and others as backups."
748 o target servers by "service" (e.g., "ldap") and "protocol" (e.g.,
749 "tcp") in a given domain. The definition of these terms implies
750 specific things (e.g., that protocol should be one of UDP or TCP)
751 without being precise. Restriction to UDP and TCP is insufficient
752 for the uses described here.
754 The basic answer is that SRV records provide mappings from protocol
755 names to host and port. The use cases described herein require an
756 additional layer -- from some service label to servers that may in
757 fact be hosted within different administrative domains. We could
758 tweak SRV to say that the next lookup could be something other than
759 an address record, but that is more complex than is necessary for
760 most applications of SRV.
762 5.2 So, why not just NAPTR records?
764 That's a trick question. NAPTR records cannot appear in the wild --
765 see [6]. They must be part of a DDDS application.
767 The purpose here is to define a single, common mechanism (the DDDS
768 application) to use NAPTR when all that is desired is simple DNS-
769 based location of services. This should be easy for applications to
770 use -- some simple IANA registrations and it's done.
772 Also, NAPTR has very powerful tools for expressing "rewrite" rules.
773 That power (==complexity) makes some protocol designers and service
774 administrators nervous. The concern is that it can translate into
775 unintelligible, noodle-like rule sets that are difficult to test and
778 This proposed DDDS application specifically uses a subset of NAPTR's
779 abilities. Only "replacement" expressions are allowed, not "regular
783 Daigle & Newton Expires August 15, 2004 [Page 14]
785 Internet-Draft draft-daigle-napstr-04 February 2004
790 6. IANA Considerations
792 This document calls for 2 IANA registries: one for application
793 service tags, and one for application protocol tags.
795 Application service and protocol tags should be defined in an RFC
796 (unless the "x-" experimental form is used, in which case they are
797 unregistered). There are no restrictions placed on the tags other
798 than that they must conform with the syntax defined below (Appendix
799 A.5). The IANA registries should list the tags and the RFC that
802 7. Security Considerations
804 The security of this approach to application service location is only
805 as good as the security of the DNS servers along the way. If any of
806 them is compromised, bogus NAPTR and SRV records could be inserted to
807 redirect clients to unintended destinations. This problem is hardly
808 unique to S-NAPTR (or NAPTR in general).
810 To protect against DNS-vectored attacks, applications should define
811 some form of end-to-end authentication to ensure that the correct
812 destination has been reached. Many application protocols such as
813 HTTPS, BEEP, IMAP, etc... define the necessary handshake mechansims
814 to accomplish this task.
816 The basic mechanism works in the following way:
818 1. During some portion of the protocol handshake, the client sends
819 to the server the original name of the desired destination (i.e.
820 no transformations that may have resulted from NAPTR
821 replacements, SRV targets, or CNAME changes). In certain cases
822 where the application protocol does not have such a feature but
823 TLS may be used, it is possible to use the "server_name" TLS
826 2. The server sends back to the client a credential with the
827 appropriate name. For X.509 certificates, the name would either
828 be in the subjectDN or subjectAltName fields. For Kerberos, the
829 name would be a service principle name.
831 3. Using the matching semantics defined by the application protocol,
832 the client compares the name in the credential with the name sent
835 4. If the names match, there is reasonable assurance that the
839 Daigle & Newton Expires August 15, 2004 [Page 15]
841 Internet-Draft draft-daigle-napstr-04 February 2004
844 correct end point has been reached.
846 It is important to note that this document does not define either the
847 handshake mechanism, the specific credenential naming fields, nor the
848 name matching semantics. Definitions of S-NAPTR for particular
849 application protocols MUST define these.
853 Many thanks to Dave Blacka, Patrik Faltstrom, Sally Floyd for
854 discussion and input that has (hopefully!) provoked clarifying
855 revisions of this document.
859 [1] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform Resource
860 Identifiers (URI): Generic Syntax", RFC 2396, August 1998.
862 [2] Bradner, S., "Key words for use in RFCs to Indicate Requirement
863 Levels", BCP 14, RFC 2119, March 1997.
865 [3] Crocker, D. and P. Overell, "Augmented BNF for Syntax
866 Specifications: ABNF", RFC 2234, November 1997.
868 [4] Eastlake, D., "Domain Name System Security Extensions", RFC
871 [5] Gulbrandsen, A., Vixie, P. and L. Esibov, "A DNS RR for
872 specifying the location of services (DNS SRV)", RFC 2782,
875 [6] Mealling, M., "Dynamic Delegation Discovery System (DDDS) Part
876 One: The Comprehensive DDDS", RFC 3401, October 2002.
878 [7] Mealling, M., "Dynamic Delegation Discovery System (DDDS) Part
879 Three: The Domain Name System (DNS) Database", RFC 3403, October
882 [8] Mealling, M., "Dynamic Delegation Discovery System (DDDS) Part
883 Four: The Uniform Resource Identifiers (URI)", RFC 3404, October
895 Daigle & Newton Expires August 15, 2004 [Page 16]
897 Internet-Draft draft-daigle-napstr-04 February 2004
904 21355 Ridgetop Circle
908 EMail: leslie@verisignlabs.com; leslie@thinkingcat.com
913 21355 Ridgetop Circle
917 EMail: anewton@verisignlabs.com
919 Appendix A. Application Service Location Application of DDDS
921 This section defines the DDDS application, as described in [6].
923 A.1 Application Unique String
925 The Application Unique String is domain label for which an
926 authoritative server for a particular service is sought.
928 A.2 First Well Known Rule
930 The "First Well Known Rule" is identity -- that is, the output of the
931 rule is the Application Unique String, the domain label for which the
932 authoritative server for a particular service is sought.
936 The expected output of this Application is the information necessary
937 to connect to authoritative server(s) (host, port, protocol) for an
938 application service within a given a given domain.
942 This DDDS Application uses only 2 of the Flags defined for the
943 URI/URN Resolution Application ([8]): "S" and "A". No other Flags
946 Both are for terminal lookups. This means that the Rule is the last
947 one and that the flag determines what the next stage should be. The
951 Daigle & Newton Expires August 15, 2004 [Page 17]
953 Internet-Draft draft-daigle-napstr-04 February 2004
956 "S" flag means that the output of this Rule is a domain label for
957 which one or more SRV [5] records exist. "A" means that the output
958 of the Rule is a domain name and should be used to lookup address
959 records for that domain.
961 Consistent with the DDDS algorithm, if the Flag string is empty the
962 next lookup is for another NAPTR record (for the replacement target).
964 A.5 Service Parameters
966 Service Parameters for this Application take the form of a string of
967 characters that follow this ABNF ([3]):
969 service-parms = [ [app-service] *(":" app-protocol)]
970 app-service = experimental-service / iana-registered-service
971 app-protocol = experimental-protocol / iana-registered-protocol
972 experimental-service = "x-" 1*30ALPHANUMSYM
973 experimental-protocol = "x-" 1*30ALPHANUMSYM
974 iana-registered-service = ALPHA *31ALPHANUMSYM
975 iana-registered-protocol = ALPHA *31ALPHANUM
976 ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
977 DIGIT = %x30-39 ; 0-9
978 SYM = %x2B / %x2D / %x2E ; "+" / "-" / "."
979 ALPHANUMSYM = ALPHA / DIGIT / SYM
980 ; The app-service and app-protocol tags are limited to 32
981 ; characters and must start with an alphabetic character.
982 ; The service-parms are considered case-insensitive.
984 Thus, the Service Parameters may consist of an empty string, just an
985 app-service, or an app-service with one or more app-protocol
986 specifications separated by the ":" symbol.
988 Note that this is similar to, but not the same as the syntax used in
989 the URI DDDS application ([8]). The DDDS DNS database requires each
990 DDDS application to define the syntax of allowable service strings.
991 The syntax here is expanded to allow the characters that are valid in
992 any URI scheme name (see [1]). Since "+" (the separator used in the
993 RFC3404 service parameter string) is an allowed character for URI
994 scheme names, ":" is chosen as the separator here.
996 A.5.1 Application Services
998 The "app-service" must be a registered service [this will be an IANA
999 registry; this is not the IANA port registry, because we want to
1000 define services for which there is no single protocol, and we don't
1001 want to use up port space for nothing].
1007 Daigle & Newton Expires August 15, 2004 [Page 18]
1009 Internet-Draft draft-daigle-napstr-04 February 2004
1012 A.5.2 Application Protocols
1014 The protocol identifiers that are valid for the "app-protocol"
1015 production are any standard, registered protocols [IANA registry
1016 again -- is this the list of well known/registered ports?].
1020 Only substitution Rules are permitted for this application. That is,
1021 no regular expressions are allowed.
1025 At present only one DDDS Database is specified for this Application.
1026 [7] specifies a DDDS Database that uses the NAPTR DNS resource record
1027 to contain the rewrite rules. The Keys for this database are encoded
1030 The First Well Known Rule produces a domain name, and this is the Key
1031 that is used for the first lookup -- the NAPTR records for that
1032 domain are requested.
1034 DNS servers MAY interpret Flag values and use that information to
1035 include appropriate NAPTR, SRV or A records in the Additional
1036 Information portion of the DNS packet. Clients are encouraged to
1037 check for additional information but are not required to do so. See
1038 the Additional Information Processing section of [7] for more
1039 information on NAPTR records and the Additional Information section
1040 of a DNS response packet.
1042 Appendix B. Pseudo pseudocode for S-NAPTR
1044 B.1 Finding the first (best) target
1046 Assuming the client supports 1 protocol for a particular application
1047 service, the following pseudocode outlines the expected process to
1048 find the first (best) target for the client, using S-NAPTR.
1051 target = [initial domain]
1054 while (not naptr-done)
1056 NAPTR-RRset = [DNSlookup of NAPTR RRs for target]
1057 [sort NAPTR-RRset by ORDER, and PREF within each ORDER]
1059 cur-rr = [first NAPTR RR]
1063 Daigle & Newton Expires August 15, 2004 [Page 19]
1065 Internet-Draft draft-daigle-napstr-04 February 2004
1069 if ([SERVICE field of cur-rr contains desired application
1070 service and application protocol])
1072 target= [REPLACEMENT target of NAPTR RR]
1074 cur-rr = [next rr in list]
1076 if (not empty [FLAG in cur-rr])
1082 if ([FLAG in cur-rr is "S"])
1084 SRV-RRset = [DNSlookup of SRV RRs for target]
1085 [sort SRV-RRset based on PREF]
1086 target = [target of first RR of SRV-RRset]
1087 port = [port in first RR of SRV-RRset]
1090 ; now, whether it was an "S" or an "A" in the NAPTR, we
1091 ; have the target for an A record lookup
1093 host = [DNSlookup of target]
1099 B.2 Finding subsequent targets
1101 The pseudocode in Appendix B is crafted to find the first, most
1102 preferred, host-port pair for a particular application service an
1103 protocol. If, for any reason, that host-port pair did not work
1104 (connection refused, application-level error), the client is expected
1105 to try the next host-port in the S-NAPTR tree.
1107 The pseudocode above does not permit retries -- once complete, it
1108 sheds all context of where in the S-NAPTR tree it finished.
1109 Therefore, client software writers could
1111 o entwine the application-specific protocol with the DNS lookup and
1112 RRset processing described in the pseudocode and continue the S-
1113 NAPTR processing if the application code fails to connect to a
1114 located host-port pair;
1119 Daigle & Newton Expires August 15, 2004 [Page 20]
1121 Internet-Draft draft-daigle-napstr-04 February 2004
1124 o use callbacks for the S-NAPTR processing;
1126 o use an S-NAPTR resolution routine that finds *all* valid servers
1127 for the required application service and protocol from the
1128 originating domain, and provides them in sorted order for the
1129 application to try in order.
1175 Daigle & Newton Expires August 15, 2004 [Page 21]
1177 Internet-Draft draft-daigle-napstr-04 February 2004
1180 Full Copyright Statement
1182 Copyright (C) The Internet Society (2004). All Rights Reserved.
1184 This document and translations of it may be copied and furnished to
1185 others, and derivative works that comment on or otherwise explain it
1186 or assist in its implementation may be prepared, copied, published
1187 and distributed, in whole or in part, without restriction of any
1188 kind, provided that the above copyright notice and this paragraph are
1189 included on all such copies and derivative works. However, this
1190 document itself may not be modified in any way, such as by removing
1191 the copyright notice or references to the Internet Society or other
1192 Internet organizations, except as needed for the purpose of
1193 developing Internet standards in which case the procedures for
1194 copyrights defined in the Internet Standards process must be
1195 followed, or as required to translate it into languages other than
1198 The limited permissions granted above are perpetual and will not be
1199 revoked by the Internet Society or its successors or assigns.
1201 This document and the information contained herein is provided on an
1202 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
1203 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
1204 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
1205 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
1206 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
1210 Funding for the RFC Editor function is currently provided by the
1231 Daigle & Newton Expires August 15, 2004 [Page 22]