draft-ietf-urn-naptr-rr-00.txt   draft-ietf-urn-naptr-rr-01.txt 
Network Working Group M. Mealling Network Working Group M. Mealling
draft-ietf-urn-naptr-rr-00.txt Network Solutions, Inc. draft-ietf-urn-naptr-rr-01.txt Network Solutions, Inc.
Category: Standards Track R. Daniel Category: Standards Track R. Daniel
Expires: May, 1999 DATAFUSION, Inc. Expires: August, 1999 DATAFUSION, Inc.
The Naming Authority Pointer (NAPTR) DNS Resource Record The Naming Authority Pointer (NAPTR) DNS Resource Record
Status of this Memo Status of this Memo
=================== ===================
This document is an Internet-Draft. Internet-Drafts are working This document is an Internet-Draft and is in full conformance
documents of the Internet Engineering Task Force (IETF), its with all provisions of Section 10 of RFC2026.
areas, and its working groups. Note that other groups may also
distribute working documents as Internet-Drafts. 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 Internet-Drafts are draft documents valid for a maximum of six
months and may be updated, replaced, or obsoleted by other months and may be updated, replaced, or obsoleted by other
documents at any time. It is inappropriate to use Internet- documents at any time. It is inappropriate to use Internet-
Drafts as reference material or to cite them other than as Drafts as reference material or to cite them other than as
"work in progress." "work in progress."
To view the entire list of current Internet-Drafts, please check The list of current Internet-Drafts can be accessed at
the "1id-abstracts.txt" listing contained in the Internet-Drafts http://www.ietf.org/ietf/1id-abstracts.txt
Shadow Directories on ftp.is.co.za (Africa), ftp.nordu.net
(Northern Europe), ftp.nis.garr.it (Southern Europe), The list of Internet-Draft Shadow Directories can be accessed at
munnari.oz.au (Pacific Rim), ftp.ietf.org (US East Coast), or http://www.ietf.org/shadow.html.
ftp.isi.edu (US West Coast).
Abstract: Abstract:
========= =========
This document describes a DNS Resource Record which specifies This document describes a DNS Resource Record (RR) which specifies
a rewrite rule that, when applied to an existing string a rewrite rule that, when applied to an existing string,
will produce a new domain. Reasons for rewriting a domain will produce a new domain. Reasons for rewriting a domain
vary from URN Resource Discovery Systems to moving out of date vary from URN Resource Discovery Systems to moving out-of-date
services to new domains. services to new domains.
This document updates the portions of RFC2168 specifically This document updates those portions of RFC2168 specifically
dealing with the definition of the NAPTR record. dealing with the definition of the NAPTR record.
Introduction: Introduction:
============= =============
This RR was originally produced by the URN [3] Working Group as This RR was originally produced by the URN [3] Working Group as
a way to encode rule-sets in DNS so that the delegated a way to encode rule-sets in DNS so that the delegated
sections of a URI could be decomposed in such a way that they sections of a URI could be decomposed in such a way that they
could be changed and re-delegated over time. The result was could be changed and re-delegated over time. The result was
a Resource Record that included a regular expression which would a Resource Record that included a regular expression that would
be used by a client program to rewrite a string into a domain-name. be used by a client program to rewrite a string into a domain name.
Regular expressions were chosen for their compactness to Regular expressions were chosen for their compactness to
expressivity ratio allowing for a great deal of information expressivity ratio allowing for a great deal of information
to be encoded in a rather small DNS packet. to be encoded in a rather small DNS packet.
The function of rewriting a string according to the rules in a the Mealling & Daniel [Page 1]
record has usefullness in several different applications. This The function of rewriting a string according to the rules in a
document defines the basic assumptions that all of those applications record has usefulness in several different applications. This
must adhere to. It does not define the reasons for why the rewrite document defines the basic assumptions to which all of those
is used or what the expected outcomes are or what they are used applications must adhere to. It does not define the reasons the
for. Those are specified by applications that define how they use rewrite is used, what the expected outcomes are, or what they are
the NAPTR record and algorithms within their contexts. used for. Those are specified by applications that define how they
use the NAPTR record and algorithms within their contexts.
Mealling & Daniel [Page X1]
Flags and other fields are also specified in the RR to control the Flags and other fields are also specified in the RR to control the
rewrite procedure in various ways or to provide information on how rewrite procedure in various ways or to provide information on how
to communicate with the host at the domain-name that was the result to communicate with the host at the domain name that was the result
of the rewrite. of the rewrite.
The final result is a RR that has several fields which interact The final result is a RR that has several fields that interact
in a non-trivial but implementable way. This document specifies in a non-trivial but implementable way. This document specifies
those fields and their values. those fields and their values.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in "OPTIONAL" in this document are to be interpreted as described in
RFC 2119. RFC 2119.
NAPTR RR Format NAPTR RR Format
=============== ===============
The format of the NAPTR RR is given below. The DNS type code for The format of the NAPTR RR is given below. The DNS type code for
NAPTR is 35. [1] [2] NAPTR is 35. [1] [2]
Domain TTL Class Order Preference Flags Service Regexp Domain TTL Class Order Preference Flags Service Regexp Replacement
Replacement
Domain Domain
The domain name this resource record refers to. This is the The domain name to which this resource record refers. This
'key' for this entry in the rule database. This value will is the 'key' for this entry in the rule database. This value
either be the first well known key (<something>.uri.net for will either be the first well known key (<something>.uri.net
example) or a new key that is the output of a replacement or for example) or a new key that is the output of a replacement
regexp rewrite. Beyond this it has the standard DNS or regexp rewrite. Beyond this, it has the standard DNS
requirements. [1] requirements. [1]
TTL TTL
Standard DNS meaning. [1] Standard DNS meaning. [1]
Class Class
Standard DNS meaning [1] Standard DNS meaning [1]
Order Order
A 16-bit integer specifying the order in which the NAPTR A 16-bit unsigned integer specifying the order in which
records MUST be processed to ensure the correct ordering of the NAPTR records MUST be processed to ensure the correct
rules. Low numbers are processed before high numbers, and ordering of rules. Low numbers are processed before high
once a NAPTR is found whose rule "matches" the target, numbers, and once a NAPTR is found whose rule "matches"
the client MUST NOT consider any NAPTRs with a higher the target, the client MUST NOT consider any NAPTRs with
value for order (except as noted below for the Flags field). a higher value for order (except as noted below for the
Flags field).
Mealling & Daniel [Page 2]
Preference Preference
A 16-bit integer which specifies the order in which NAPTR A 16-bit unsigned integer that specifies the order in
records with equal "order" values SHOULD be processed, low which NAPTR records with equal "order" values SHOULD be
numbers being processed before high numbers. This is similar processed, low numbers being processed before high numbers.
to the preference field in an MX record, and is used so domain This is similar to the preference field in an MX record, and
administrators can direct clients towards more capable hosts is used so domain administrators can direct clients towards
or lighter weight protocols. A client MAY look at records with more capable hosts or lighter weight protocols. A client MAY
higher preference values if it has a good reason to do so look at records with higher preference values if it has a
such as no understanding the preferred protocol or service. good reason to do so such as not understanding the preferred
protocol or service.
Flags Flags
A String giving flags to control aspects of the rewriting and A <character-string> containing flags to control aspects of
interpretation of the fields in the record. Flags are single the rewriting and interpretation of the fields in the
characters from the set [A-Z0-9]. The case of the alphabetic record. Flags are single characters from the set [A-Z0-9].
characters is not significant. The case of the alphabetic characters is not significant.
Mealling & Daniel [Page X2] At this time only four flags, "S", "A", "U", and "P", are
At this time only three flags, "S", "A", and "P", are defined. defined. The "S", "A" and "U" flags denote a terminal lookup.
"S" means that the next lookup should be for SRV [4] records This means that this NAPTR record is the last one and that the
instead of NAPTR records. "A" means that the next lookup flag determines what the next stage should be. The "S" flag
should be for A records. The "P" flag says that the remainder means that the next lookup should be for SRV [4] records.
of the application side algorithm shall be carried out in "A" means that the next lookup should be for A records.
a Protocol-specific fashion. The new set of rules is The "U" flag means that the next step is not a DNS lookup
identified by the Protocol specified in the Services field. but that the output of the Regexp field is a URL [10].
The record that contains the 'P' flag is the last record
that is interpreted by the rules specified in this document. The "P" flag says that the remainder of the application side
The new rules are dependent on the application for which algorithm shall be carried out in a Protocol-specific
they are being used and the protocol specified. For example, fashion. The new set of rules is identified by the Protocol
if the application is a URI RDS and the protocol is WIRE specified in the Services field. The record that contains
then the new set of rules are governed by the algorithms the 'P' flag is the last record that is interpreted by the
surrounding the WIRE HTTP specification and not this rules specified in this document. The new rules are
document [17]. dependent on the application for which they are being used
and the protocol specified. For example, if the application
is a URI RDS and the protocol is WIRE then the new set of
rules are governed by the algorithms surrounding the WIRE
HTTP specification and not this document.
The remaining alphabetic flags are reserved for future The remaining alphabetic flags are reserved for future
versions of the NAPTR specification. The numeric flags versions of the NAPTR specification. The numeric flags
may be used for local experimentation. The S, A, and P flags may be used for local experimentation. The S, A, U and P flags
are all mutually exclusive, and resolution libraries MAY are all mutually exclusive, and resolution libraries MAY
signal an error if more than one is given. (Experimental code signal an error if more than one is given. (Experimental code
and code for assisting in the creation of NAPTRs would be more and code for assisting in the creation of NAPTRs would be more
likely to signal such an error than a client such as a likely to signal such an error than a client such as a
browser). We anticipate that multiple flags will be allowed in browser). It is anticipated that multiple flags will be
the future, so implementers MUST NOT assume that the flags allowed in the future, so implementers MUST NOT assume that
field can only contain 0 or 1 characters. Finally, if a client the flags field can only contain 0 or 1 characters. Finally,
encounters a record with an unknown flag, it MUST ignore it if a client encounters a record with an unknown flag, it MUST
and move to the next record. This test takes precedence even ignore it and move to the next record. This test takes
over the "order" field. Since flags can control the precedence even over the "order" field. Since flags can
interpretation placed on fields, a novel flag might change the control the interpretation placed on fields, a novel flag
interpretation of the regexp and/or replacement fields such might change the interpretation of the regexp and/or
that it is impossible to determine if a record matched a replacement fields such that it is impossible to determine
given target. if a record matched a given target.
The "S" and "A" flags are called 'terminal' flags since they Mealling & Daniel [Page 3]
halt any looping rewrite algorithms. If those flags are The "S", "A", and "U" flags are called 'terminal' flags
not present then clients may assume that another NAPTR RR since they halt any looping rewrite algorithms. If those
exists at the domain-name produced by the current rewrite flags are not present, clients may assume that another
rule. Since the "P" flag specifies a new algorithm, it may NAPTR RR exists at the domain name produced by the current
or may not be terminal, thus the client cannot assume that rewrite rule. Since the "P" flag specifies a new algorithm,
another NAPTR exists since this case is determined elsewhere. it may or may not be 'terminal'. Thus, the client cannot
assume that another NAPTR exists since this case is
determined elsewhere.
DNS servers MAY interpret these flags and values and use DNS servers MAY interpret these flags and values and use
that information to include appropriate SRV and A records that information to include appropriate SRV and A records
in the additional information portion of the DNS packet. in the additional information portion of the DNS packet.
Clients are encouraged to check for additional information Clients are encouraged to check for additional information
but are no required to do so. but are not required to do so.
Service Service
Specifies the service(s) available down this rewrite Specifies the service(s) available down this rewrite
path. It may also specify the particular protocol that path. It may also specify the particular protocol that
is used to talk with a service. A protocol MUST be specified is used to talk with a service. A protocol MUST be specified
if the flags field states that the NAPTR is terminal. If a if the flags field states that the NAPTR is terminal. If a
protocol is specified, but the flags field does not state that protocol is specified, but the flags field does not state that
the NAPTR is terminal, the next lookup MUST be for a NAPTR. the NAPTR is terminal, the next lookup MUST be for a NAPTR.
The client MAY choose not to perform the next lookup if the The client MAY choose not to perform the next lookup if the
protocol is unknown, but that behavior MUST NOT be relied protocol is unknown, but that behavior MUST NOT be relied
upon. upon.
The service field may take any of the values below (using the The service field may take any of the values below (using the
Augmented BNF of RFC 2234[5]): Augmented BNF of RFC 2234[5]):
Mealling & Daniel [Page X3]
service_field = [ [protocol] *("+" rs)] service_field = [ [protocol] *("+" rs)]
protocol = ALPHA *31ALPHANUM protocol = ALPHA *31ALPHANUM
rs = ALPHA *31ALPHANUM rs = ALPHA *31ALPHANUM
// The protocol and rs fields are limited to 32 ; The protocol and rs fields are limited to 32
// characters and must start with an alphabetic. ; characters and must start with an alphabetic.
i.e. an optional protocol specification followed by 0 or more For example, an optional protocol specification followed by 0
resolution services. Each resolution service is indicated by or more resolution services. Each resolution service is
an initial '+' character. indicated by an initial '+' character.
Note that the empty string is also a valid service field. This Note that the empty string is also a valid service field. This
will typically be seen at the beginning of a series of rules, will typically be seen at the beginning of a series of rules,
when it is impossible to know what services and protocols when it is impossible to know what services and protocols
will be offered by a particular service. will be offered by a particular service.
The actual format of the service request and response will be The actual format of the service request and response will be
determined by the resolution protocol, and is the subject for determined by the resolution protocol, and is the subject for
other documents. Protocols need not offer all services. The other documents. Protocols need not offer all services. The
labels for service requests shall be formed from the set of labels for service requests shall be formed from the set of
characters [A-Z0-9]. The case of the alphabetic characters is characters [A-Z0-9]. The case of the alphabetic characters is
not significant. not significant.
Mealling & Daniel [Page 4]
The list of "valid" protocols for any given NAPTR record is The list of "valid" protocols for any given NAPTR record is
any protocol that implements some or all of the services any protocol that implements some or all of the services
defined for a NAPTR application. Currently, THTTP [6] is defined for a NAPTR application. Currently, THTTP [6] is
the only protocol that is known to make that claim at the time the only protocol that is known to make that claim at the time
of publication. Any other protocol that is to be used must of publication. Any other protocol that is to be used must
have documentation specifying: have documentation specifying:
* how it implements the services of the application * how it implements the services of the application
* how it is to appear in the NAPTR record (i.e., the * how it is to appear in the NAPTR record (i.e., the
string id of the protocol) string id of the protocol)
The list of valid Resolution Services is defined by the The list of valid Resolution Services is defined by the
documents that specify individual NAPTR based applications. documents that specify individual NAPTR based applications.
One example is RFCXXXX, "Resolution of Uniform Resource One example is RFC-XXXX, "Resolution of Uniform Resource
Identifiers using the Domain Name System" [7], from which Identifiers using the Domain Name System" [7].
this document was extracted.
It is worth noting that the interpretation of this field It is worth noting that the interpretation of this field
is subject to being changed by new flags, and that the current is subject to being changed by new flags, and that the current
specification is oriented towards telling clients how to specification is oriented towards telling clients how to
talk with a URN resolver. talk with a URN resolver.
Regexp Regexp
A STRING containing a substitution expression that is applied A STRING containing a substitution expression that is applied
to the original string held by the client in order to to the original string held by the client in order to
construct the next domain name to lookup. The grammar of the construct the next domain name to lookup. The grammar of the
skipping to change at page 10, line ? skipping to change at page 10, line ?
The regular expressions MUST NOT be used in a cumulative The regular expressions MUST NOT be used in a cumulative
fashion, that is, they should only be applied to the original fashion, that is, they should only be applied to the original
string held by the client, never to the domain name produced string held by the client, never to the domain name produced
by a previous NAPTR rewrite. The latter is tempting in some by a previous NAPTR rewrite. The latter is tempting in some
applications but experience has shown such use to be applications but experience has shown such use to be
extremely fault sensitive, very error prone, and extremely extremely fault sensitive, very error prone, and extremely
difficult to debug. difficult to debug.
Replacement Replacement
The next NAME to query for NAPTR, SRV, or A records depending The next NAME to query for NAPTR, SRV, or A records depending
on the value of the flags field. This MUST be DNS compressed. on the value of the flags field. This MUST be a fully qualified
domain-name. Unless and until permitted by future standards
Mealling & Daniel [Page X4] action, name compression is not to be used for this field.
Substitution Expression Grammar: Substitution Expression Grammar:
================================ ================================
The content of the regexp field is a substitution expression. True The content of the regexp field is a substitution expression. True
sed(1) substitution expressions are not appropriate for use in this sed(1) substitution expressions are not appropriate for use in this
application for a variety of reasons, therefore the contents of the application for a variety of reasons, therefore the contents of the
regexp field MUST follow the grammar below: regexp field MUST follow the grammar below:
Mealling & Daniel [Page 5]
subst_expr = delim-char ere delim-char repl delim-char *flags subst_expr = delim-char ere delim-char repl delim-char *flags
delim-char = "/" / "!" / ... (Any non-digit or non-flag character delim-char = "/" / "!" / ... <Any non-digit or non-flag character
other than backslash '\'. All occurances of a delim_char other than backslash '\'. All occurances of a delim_char
in a subst_expr must be the same character.) in a subst_expr must be the same character.>
ere = POSIX Extended Regular Expression (see [6], section ere = POSIX Extended Regular Expression (see [8], section
2.8.4) 2.8.4)
repl = dns_str / backref / repl dns_str / repl backref repl = 1 * ( OCTET / backref )
dns_str = 1*DNS_CHAR
backref = "\" 1POS_DIGIT backref = "\" 1POS_DIGIT
flags = "i" flags = "i"
DNS_CHAR = "-" / "0" / ... / "9" / "a" / ... / "z" / "A" / ... / "Z" POS_DIGIT = %x31-39 ; 0 is not an allowed backref
POS_DIGIT = "1" / "2" / ... / "9" ; 0 is not an allowed backref
value domain name (see RFC-1123 [7]).
The result of applying the substitution expression to the original The result of applying the substitution expression to the original
URI MUST result in a string that obeys the syntax for DNS host names URI MUST result in either a string that obeys the syntax for DNS
[7]. Since it is possible for the regexp field to be improperly host names [1] or a URI [10] if the Flags field contains a 'U'.
Since it is possible for the regexp field to be improperly
specified, such that a non-conforming host name can be constructed, specified, such that a non-conforming host name can be constructed,
client software SHOULD verify that the result is a legal host name client software SHOULD verify that the result is a legal host name
before making queries on it. before making queries on it.
Backref expressions in the repl portion of the substitution Backref expressions in the repl portion of the substitution
expression are replaced by the (possibly empty) string of characters expression are replaced by the (possibly empty) string of characters
enclosed by '(' and ')' in the ERE portion of the substitution enclosed by '(' and ')' in the ERE portion of the substitution
expression. N is a single digit from 1 through 9, inclusive. It expression. N is a single digit from 1 through 9, inclusive. It
specifies the N'th backref expression, the one that begins with the specifies the N'th backref expression, the one that begins with the
N'th '(' and continues to the matching ')'. For example, the ERE N'th '(' and continues to the matching ')'. For example, the ERE
skipping to change at page 10, line ? skipping to change at page 10, line ?
\1 = ABCDEFG \1 = ABCDEFG
\2 = BCDE \2 = BCDE
\3 = C \3 = C
\4 = F \4 = F
\5..\9 = error - no matching subexpression \5..\9 = error - no matching subexpression
The "i" flag indicates that the ERE matching SHALL be performed in a The "i" flag indicates that the ERE matching SHALL be performed in a
case-insensitive fashion. Furthermore, any backref replacements MAY case-insensitive fashion. Furthermore, any backref replacements MAY
be normalized to lower case when the "i" flag is given. be normalized to lower case when the "i" flag is given.
Mealling & Daniel [Page X5]
The first character in the substitution expression shall be used as The first character in the substitution expression shall be used as
the character that delimits the components of the substitution the character that delimits the components of the substitution
expression. There must be exactly three non-escaped occurrences of expression. There must be exactly three non-escaped occurrences of
the delimiter character in a substitution expression. Since escaped the delimiter character in a substitution expression. Since escaped
occurrences of the delimiter character will be interpreted as occurrences of the delimiter character will be interpreted as
occurrences of that character, digits MUST NOT be used as delimiters. occurrences of that character, digits MUST NOT be used as delimiters.
Backrefs would be confused with literal digits were this allowed. Backrefs would be confused with literal digits were this allowed.
Similarly, if flags are specified in the substitution expression, the Similarly, if flags are specified in the substitution expression, the
delimiter character must not also be a flag character. delimiter character must not also be a flag character.
Mealling & Daniel [Page 6]
The Basic NAPTR Algorithm The Basic NAPTR Algorithm
============================================ ============================================
The behavior and meaning of the flags and services assume an The behavior and meaning of the flags and services assume an
algorithm where the output of one rewrite is a new key that points algorithm where the output of one rewrite is a new key that points
to another rule. This looping algorithm allows NAPTR records to to another rule. This looping algorithm allows NAPTR records to
incrementally specify a complete rule. These incremental rules incrementally specify a complete rule. These incremental rules
can be delegated which allows other entities to specify rules so can be delegated which allows other entities to specify rules so
that one entity does not need to understand _all_ rules. that one entity does not need to understand _all_ rules.
skipping to change at page 10, line ? skipping to change at page 10, line ?
is found. A record is considered a match iff: is found. A record is considered a match iff:
1) it has a Replacement field value instead of a Regexp field value. 1) it has a Replacement field value instead of a Regexp field value.
or or
2) the Regexp field matches the string held by the client. 2) the Regexp field matches the string held by the client.
The first match MUST be the match that is used. Once a match is The first match MUST be the match that is used. Once a match is
found, the Services field is examined for whether or not this rule found, the Services field is examined for whether or not this rule
advances toward the desired result. If so, then the rule is advances toward the desired result. If so, the rule is
applied to the target string. If not, the process halts. The domain applied to the target string. If not, the process halts. The domain
that results from the regular expression is then used as the that results from the regular expression is then used as the
domain of the next loop through the NAPTR algorithm. Note that domain of the next loop through the NAPTR algorithm. Note that
the same target string is used throughout the algorithm. the same target string is used throughout the algorithm.
This looping is extremely important since it is the method by This looping is extremely important since it is the method by
which complex rules are broken down into manageable delegated chunks. which complex rules are broken down into manageable delegated chunks.
The flags fields simply determine at which point the looping should The flags fields simply determine at which point the looping should
stop (or other specialized behavior). stop (or other specialized behavior).
Since flags are valid at any level of the algorithm, the degenerative Since flags are valid at any level of the algorithm, the degenerative
case is to never loop but to lookup the NATPR and then stop. In case is to never loop but to look up the NAPTR and then stop. In
many specialized cases this is all that is needed. Implementors many specialized cases this is all that is needed. Implementors
should be aware that the degenerative case should not become the should be aware that the degenerative case should not become the
common case. common case.
Mealling & Daniel [Page 7]
Application Specifications Application Specifications
========================== ==========================
It should be noted that the NAPTR algorithm is the basic assumption It should be noted that the NAPTR algorithm is the basic assumption
about how NAPTR works. The reasons for the rewrite and the expected about how NAPTR works. The reasons for the rewrite and the expected
output and its use are specified by documents that define what output and its use are specified by documents that define what
applicatiions the NAPTR record and algorithm are used for. Any applications the NAPTR record and algorithm are used for. Any
document that defines such an application must define the following: document that defines such an application must define the following:
* The first known key or how to build it * The first known key or how to build it
* The valid Services and Protocols * The valid Services and Protocols
* What the expected use is for the output of the last rewrite * What the expected use is for the output of the last rewrite
* The validity and/or behavior of any 'P' flag protocols. * The validity and/or behavior of any 'P' flag protocols.
* The general semantics surrounding why and how NAPTR and its * The general semantics surrounding why and how NAPTR and its
algorithm are being used. algorithm are being used.
Currently the only example of such a document is RFCXXXX, Currently the only example of such a document is RFC-XXXX,
"Resolution of Uniform Resource Identifiers using the Domain Name "Resolution of Uniform Resource Identifiers using the Domain Name
System" [7]. System" [7].
Mealling & Daniel [Page X6]
Examples Examples
============================================ ============================================
NOTE: These are examples only. They are taken from ongoing work and NOTE: These are examples only. They are taken from ongoing work and
may not represent the end result of that work. They are here for may not represent the end result of that work. They are here for
pedagogical reasons only. pedagogical reasons only.
Example 1 Example 1
--------- ---------
skipping to change at page 10, line ? skipping to change at page 10, line ?
The first step in the resolution process is to find out about the CID The first step in the resolution process is to find out about the CID
namespace. The namespace identifier [3], cid, is extracted from the namespace. The namespace identifier [3], cid, is extracted from the
URN, prepended to urn.net. 'cid.urn.net' then becomes the first URN, prepended to urn.net. 'cid.urn.net' then becomes the first
'known' key in the NAPTR algorithm. the NAPTR for cid.urn.net looked 'known' key in the NAPTR algorithm. the NAPTR for cid.urn.net looked
up and returns a record: up and returns a record:
cid.urn.net cid.urn.net
;; order pref flags service regexp replacement ;; order pref flags service regexp replacement
IN NAPTR 100 10 "" "" "/urn:cid:.+@([^\.]+\.)(.*)$/\2/i" . IN NAPTR 100 10 "" "" "/urn:cid:.+@([^\.]+\.)(.*)$/\2/i" .
We have only one NAPTR response, so ordering the responses is not a Mealling & Daniel [Page 8]
problem. The replacement field is empty, so we check the regexp There is only one NAPTR response, so ordering the responses is not a
field and use the pattern provided there. We apply that regexp to the problem. The replacement field is empty, so the pattern provided
in the regexp field is used . We apply that regexp to the
entire URN to see if it matches, which it does. The \2 part of the entire URN to see if it matches, which it does. The \2 part of the
substitution expression returns the string "gatech.edu". Since the substitution expression returns the string "gatech.edu". Since the
flags field does not contain "s" or "a", the lookup is not terminal flags field does not contain "s" or "a", the lookup is not terminal
and our next probe to DNS is for more NAPTR records where the new and our next probe to DNS is for more NAPTR records where the new
domain is 'gatech.edu' and the string is the same string as before. domain is 'gatech.edu' and the string is the same string as before.
Note that the rule does not extract the full domain name from the Note that the rule does not extract the full domain name from the
CID, instead it assumes the CID comes from a host and extracts its CID, instead it assumes the CID comes from a host and extracts its
domain. While all hosts, such as mordred, could have their very own domain. While all hosts, such as mordred, could have their very own
NAPTR, maintaining those records for all the machines at a site as NAPTR, maintaining those records for all the machines at a site as
large as Georgia Tech would be an intolerable burden. Wildcards are large as Georgia Tech would be an intolerable burden. Wildcards are
not appropriate here since they only return results when there is no not appropriate here since they only return results when there is no
exactly matching names already in the system. exactly matching names already in the system.
Mealling & Daniel [Page X7]
The record returned from the query on "gatech.edu" might look like: The record returned from the query on "gatech.edu" might look like:
gatech.edu IN NAPTR gatech.edu IN NAPTR
;; order pref flags service regexp replacement ;; order pref flags service regexp replacement
IN NAPTR 100 50 "s" "z3950+N2L+N2C" "" z3950.tcp.gatech.edu IN NAPTR 100 50 "s" "z3950+N2L+N2C" "" z3950.tcp.gatech.edu
IN NAPTR 100 50 "s" "rcds+N2C" "" rcds.udp.gatech.edu IN NAPTR 100 50 "s" "rcds+N2C" "" rcds.udp.gatech.edu
IN NAPTR 100 50 "s" "http+N2L+N2C+N2R" "" http.tcp.gatech.edu IN NAPTR 100 50 "s" "http+N2L+N2C+N2R" "" http.tcp.gatech.edu
Continuing with our example, we note that the values of the order and Continuing with the example, note that the values of the order and
preference fields are equal in all records, so the client is free to preference fields are equal in all records, so the client is free to
pick any record. The flags field tells us that these are the last pick any record. The flags field tells us that these are the last
NAPTR patterns we should see, and after the rewrite (a simple NAPTR patterns we should see, and after the rewrite (a simple
replacement in this case) we should look up SRV records to get replacement in this case) we should look up SRV records to get
information on the hosts that can provide the necessary service. information on the hosts that can provide the necessary service.
Assuming we prefer the Z39.50 protocol, our lookup might return: Assuming we prefer the Z39.50 protocol, our lookup might return:
;; Pref Weight Port Target ;; Pref Weight Port Target
z3950.tcp.gatech.edu IN SRV 0 0 1000 z3950.gatech.edu z3950.tcp.gatech.edu IN SRV 0 0 1000 z3950.gatech.edu
skipping to change at page 10, line ? skipping to change at page 10, line ?
Recall that the regular expression used \2 to extract a domain name Recall that the regular expression used \2 to extract a domain name
from the CID, and \. for matching the literal '.' characters from the CID, and \. for matching the literal '.' characters
separating the domain name components. Since '\' is the escape separating the domain name components. Since '\' is the escape
character, literal occurances of a backslash must be escaped by character, literal occurances of a backslash must be escaped by
another backslash. For the case of the cid.urn.net record above, the another backslash. For the case of the cid.urn.net record above, the
regular expression entered into the zone file should be regular expression entered into the zone file should be
"/urn:cid:.+@([^\\.]+\\.)(.*)$/\\2/i". When the client code actually "/urn:cid:.+@([^\\.]+\\.)(.*)$/\\2/i". When the client code actually
receives the record, the pattern will have been converted to receives the record, the pattern will have been converted to
"/urn:cid:.+@([^.]+\.)(.*)$/\2/i". "/urn:cid:.+@([^.]+\.)(.*)$/\2/i".
Mealling & Daniel [Page 9]
Example 2 Example 2
--------- ---------
Even if URN systems were in place now, there would still be a Even if URN systems were in place now, there would still be a
tremendous number of URLs. It should be possible to develop a URN tremendous number of URLs. It should be possible to develop a URN
resolution system that can also provide location independence for resolution system that can also provide location independence for
those URLs. This is related to the requirement that URNs be able to those URLs. This is related to the requirement that URNs be able to
grandfather in names from other naming systems, such as ISO Formal grandfather in names from other naming systems, such as ISO Formal
Public Identifiers, Library of Congress Call Numbers, ISBNs, ISSNs, Public Identifiers, Library of Congress Call Numbers, ISBNs, ISSNs,
etc. etc.
skipping to change at page 10, line ? skipping to change at page 10, line ?
The NAPTR RR could also be used for URLs that have already been The NAPTR RR could also be used for URLs that have already been
assigned. Assume we have the URL for a very popular piece of assigned. Assume we have the URL for a very popular piece of
software that the publisher wishes to mirror at multiple sites around software that the publisher wishes to mirror at multiple sites around
the world: the world:
http://www.foo.com/software/latest-beta.exe http://www.foo.com/software/latest-beta.exe
We extract the prefix, "http", and lookup NAPTR records for We extract the prefix, "http", and lookup NAPTR records for
http.uri.net. This might return a record of the form http.uri.net. This might return a record of the form
Mealling & Daniel [Page X8]
http.uri.net IN NAPTR http.uri.net IN NAPTR
;; order pref flags service regexp replacement ;; order pref flags service regexp replacement
100 90 "" "" "!http://([^/:]+)!\1!i" . 100 90 "" "" "!http://([^/:]+)!\1!i" .
This expression returns everything after the first double slash and This expression returns everything after the first double slash and
before the next slash or colon. (We use the '!' character to delimit before the next slash or colon. (We use the '!' character to delimit
the parts of the substitution expression. Otherwise we would have to the parts of the substitution expression. Otherwise we would have to
use backslashes to escape the forward slashes, and would have a use backslashes to escape the forward slashes and would have a
regexp in the zone file that looked like regexp in the zone file that looked like
"/http:\\/\\/([^\\/:]+)/\\1/i".). "/http:\\/\\/([^\\/:]+)/\\1/i".).
Applying this pattern to the URL extracts "www.foo.com". Looking up Applying this pattern to the URL extracts "www.foo.com". Looking up
NAPTR records for that might return: NAPTR records for that might return:
www.foo.com www.foo.com
;; order pref flags service regexp replacement ;; order pref flags service regexp replacement
IN NAPTR 100 100 "s" "http+L2R" "" http.tcp.foo.com IN NAPTR 100 100 "s" "http+L2R" "" http.tcp.foo.com
IN NAPTR 100 100 "s" "ftp+L2R" "" ftp.tcp.foo.com IN NAPTR 100 100 "s" "ftp+L2R" "" ftp.tcp.foo.com
skipping to change at page 10, line ? skipping to change at page 11, line 22
0.0.0.4.6.2.6.5.8.6.4.e164.int. 0.0.0.4.6.2.6.5.8.6.4.e164.int.
IN NAPTR 100 10 "s" "h323call+N2R" "" tele2.se. IN NAPTR 100 10 "s" "h323call+N2R" "" tele2.se.
IN NAPTR 102 10 "s" "potscall+N2R" "" tele2.se. IN NAPTR 102 10 "s" "potscall+N2R" "" tele2.se.
IN NAPTR 102 10 "s" "smtp+N2R" "" tele2.se. IN NAPTR 102 10 "s" "smtp+N2R" "" tele2.se.
In these examples the domain is an encoded E164 telephone number. In these examples the domain is an encoded E164 telephone number.
The services field specifies that, for this particular telephone The services field specifies that, for this particular telephone
number, the services that are available are h323call, potscall number, the services that are available are h323call, potscall
and smtp; and that "tele2.se" is the target that provides those and smtp; and that "tele2.se" is the target that provides those
services. Since the flag is "s" then the next step should be a services. Since the flag is "s", the next step should be a
query for an SRV record which will contain specific information query for an SRV record which will contain specific information
about the "tele2.se" domain. about the "tele2.se" domain.
Advice to domain administrators: DNS Packet Format
================================ =================
Beware of regular expressions. Not only are they a pain to get The packet format for the NAPTR record is as follows
1 1 1 1 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ORDER |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| PREFERENCE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/ FLAGS /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/ SERVICES /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/ REGEXP /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/ REPLACEMENT /
/ /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
where:
FLAGS A <character-string> which contains various flags.
SERVICES A <character-string> which contains protocol
and service identifiers.
REGEXP A <character-string> which contains a regular
expression.
REPLACEMENT A <domain-name> which specifies the new value in
the case where the regular expression is a simple
replacement operation.
Master File Format
==================
The master file format follows the standard rules in RFC-1035 [1].
Order and preference, being 16-bit unsigned integers, shall be
an integer between 0 and 65535. The Flags and Services and Regexp
fields are all <character-string>s that cannot contain spaces and
thus can be included in their above specified form. While the
Regexp field is also a <character-string> it can contain
numerous backslashes and thus should be treated with care.
Advice to domain administrators
===============================
Beware of regular expressions. Not only are they difficult to get
correct on their own, but there is the previously mentioned correct on their own, but there is the previously mentioned
interaction with DNS. Any backslashes in a regexp must be entered interaction with DNS. Any backslashes in a regexp must be entered
twice in a zone file in order to appear once in a query response. twice in a zone file in order to appear once in a query response.
More seriously, the need for double backslashes has probably not been More seriously, the need for double backslashes has probably not been
tested by all implementors of DNS servers. tested by all implementors of DNS servers.
Mealling & Daniel [Page X9]
The "a" flag allows the next lookup to be for A records rather than The "a" flag allows the next lookup to be for A records rather than
SRV records. Since there is no place for a port specification in the SRV records. Since there is no place for a port specification in the
NAPTR record, when the "A" flag is used the specified protocol must NAPTR record, when the "A" flag is used the specified protocol must
be running on its default port. be running on its default port.
The URN Syntax draft defines a canonical form for each URN, which The URN Syntax draft defines a canonical form for each URN, which
requires %encoding characters outside a limited repertoire. The requires %encoding characters outside a limited repertoire. The
regular expressions MUST be written to operate on that canonical regular expressions MUST be written to operate on that canonical
form. Since international character sets will end up with extensive form. Since international character sets will end up with extensive
use of %encoded characters, regular expressions operating on them use of %encoded characters, regular expressions operating on them
will be essentially impossible to read or write by hand. will be essentially impossible to read or write by hand.
Notes: Notes:
====== ======
- A client MUST process multiple NAPTR records in the order - A client MUST process multiple NAPTR records in the order
specified by the "order" field, it MUST NOT simply use the first specified by the "order" field, it MUST NOT simply use the first
record that provides a known protocol and service combination. record that provides a known protocol and service combination.
- When multiple RRs have the same "order", the client should use - When multiple RRs have the same "order", the client should use
the value of the preference field to select the next NAPTR to the value of the preference field to select the next NAPTR to
consider. However, because of preferred protocols or services, consider. However, because of preferred protocols or services as
estimates of network distance and bandwidth, etc. clients may well as estimates of network distance and bandwidth, clients may
use different criteria to sort the records. use different criteria to sort the records.
- If the lookup after a rewrite fails, clients are strongly - If the lookup after a rewrite fails, clients are strongly
encouraged to report a failure, rather than backing up to pursue encouraged to report a failure, rather than backing up to pursue
other rewrite paths. other rewrite paths.
- Note that SRV RRs impose additional requirements on clients. - Note that SRV RRs impose additional requirements on clients.
Acknowledgments: Acknowledgments:
================= =================
The editors would like to thank Keith Moore for all his consultations The editors would like to thank Keith Moore for all his consultations
skipping to change at page 10, line ? skipping to change at page 13, line 37
[4] Gulbrandsen, A. and P. Vixie, "A DNS RR for specifying [4] Gulbrandsen, A. and P. Vixie, "A DNS RR for specifying
the location of services (DNS SRV)", RFC-2052, October 1996. the location of services (DNS SRV)", RFC-2052, October 1996.
[5] Crocker, D., Overell, P. "Augmented BNF for Syntax [5] Crocker, D., Overell, P. "Augmented BNF for Syntax
Specifications: ABNF", RFC-2234, November 1997. Specifications: ABNF", RFC-2234, November 1997.
[6] Daniel R. "A Trivial Convention for using HTTP in URN Resolution". [6] Daniel R. "A Trivial Convention for using HTTP in URN Resolution".
RFC2169. June 1997. RFC2169. June 1997.
[7] Mealling, M., Daniel, R., "Resolution of Uniform Resource [7] Mealling, M., Daniel, R., "Resolution of Uniform Resource
Identifiers using the Domain Name System". RFCXXXX. November 1998. Identifiers using the Domain Name System", RFC-XXXX,
November 1998.
[8] IEEE Standard for Information Technology - Portable Operating [8] IEEE Standard for Information Technology - Portable Operating
System Interface (POSIX) - Part 2: Shell and Utilities (Vol. 1); System Interface (POSIX) - Part 2: Shell and Utilities (Vol. 1);
IEEE Std 1003.2-1992; The Institute of Electrical and IEEE Std 1003.2-1992; The Institute of Electrical and
Electronics Engineers; New York; 1993. ISBN:1-55937-255-9 Electronics Engineers; New York; 1993. ISBN:1-55937-255-9
[9] Braden, R., "Requirements for Internet Hosts - Application and [9] Braden, R., "Requirements for Internet Hosts - Application and
and Support", RFC-1123, Oct. 1989. and Support", RFC-1123, Oct. 1989.
[10] Berners-Lee, T., R. Fielding, L. Masinter. "Uniform Resource
Identifiers (URI): Generic Syntax", RFC-2396, August 1998.
IANA Considerations IANA Considerations
=================== ===================
The only registration function that impacts the IANA is for The only registration function that impacts the IANA is for
the values that are standardized for the Services and Flags fields. the values that are standardized for the Services and Flags fields.
To extend the valid values of the Flags field beyond what is To extend the valid values of the Flags field beyond what is
specified in this document requires a published specification that specified in this document requires a published specification that
is approved by the IESG. is approved by the IESG.
The values for the Services field will be determined by the The values for the Services field will be determined by the
 End of changes. 56 change blocks. 
132 lines changed or deleted 192 lines changed or added

This html diff was produced by rfcdiff 1.34. The latest version is available from http://tools.ietf.org/tools/rfcdiff/