Corrected TXT record format in conformance with draft-cheshire-dnsext-dns-sd.
Your chat client also wants to advertise some information about you (subject to your control so that you don't divulge private information). Therefore it invokes the mDNS daemon to also store some DNS TXT records (see &rfc1464;):
+Your chat client also wants to advertise some information about you (subject to your control so that you don't divulge private information). Therefore it invokes the mDNS daemon to also store a single DNS TXT record (see &rfc1464;) that encapsulates some strings of information, where the record name is the same as the SRV record and the record value follows the format defined in draft-cheshire-dnsext-dns-sd (note: the line breaks are provided only for the sake of readability).
Other people at the hotspot can also advertise similar DNS records for use on the local link. Essentially, the mDNS daemons running on all of the machines at the hotspot collectively manage the ".local." domain, which has meaning only at the hotspot (not across the broader Internet). Queries and responses for services on the local link occur via multicast DNS over UDP port 5353 instead of via normal DNS unicast over UDP port 53. When a new machine joins the local link, it can send out queries for any number of service types, to which the other machines will reply. For the purpose of serverless messaging we are interested only in the "presence" service, but many other services could exist on the local link (see dns-sd.org for a complete list).
-Now let us imagine that a fine young gentleman named Romeo joins the hotspot and that his chat client (actually his mDNS daemon) sends out multicast DNS queries for services of type "presence". To do this, his client essentially reverses the order of DNS record publication (explained above) by asking for pointers to presence services (i.e., PTR records that match "_presence._tcp.local."), querying each service for its service instance and port (i.e., SRV record), mapping each service instance to an IP address (i.e., A record), and finding out additional information about the entity using the service (i.e., TXT records). As a result, Romeo's client will discover any number of local presence services, among them a service named "juliet@pronto" (with some intriguing TXT records) at IP address 10.2.1.187 and port 5562. Being a romantic fellow, he then initiates a chat with you by opening an XML stream to the advertised IP address and port.
+Now let us imagine that a fine young gentleman named Romeo joins the hotspot and that his chat client (actually his mDNS daemon) sends out multicast DNS queries for services of type "presence". To do this, his client essentially reverses the order of DNS record publication (explained above) by asking for pointers to presence services (i.e., PTR records that match "_presence._tcp.local."), querying each service for its service instance and port (i.e., SRV record), mapping each service instance to an IP address (i.e., A record), and finding out additional information about the entity using the service (i.e., TXT record parameters). As a result, Romeo's client will discover any number of local presence services, among them a service named "juliet@pronto" (with some intriguing TXT record parameters) at IP address 10.2.1.187 and port 5562. Being a romantic fellow, he then initiates a chat with you by opening an XML stream to the advertised IP address and port.
An SRV record of the following form:
SRV port-number machine-name.local.
+username@machine-name._presence._tcp.local SRV port-number machine-name.local.
]]>
- Optionally, various TXT records of the following form, as further described in the TXT Records section of this document:
+ Optionally, a TXT record whose name is the same as the SRV record and whose value follows the format defined in draft-cheshire-dnsext-dns-sd, as further described in the TXT Record section of this document (note: the line breaks are provided only for the sake of readability):
IN TXT "txtvers=1"
- IN TXT "1st=user-first-name"
- IN TXT "email=user-email-address"
- IN TXT "hash=entity-capabilities-algorithm"
- IN TXT "jid=user-jabber-id"
- IN TXT "last=user-last-name"
- IN TXT "msg=freeform-availability-status"
- IN TXT "n=entity-capabilities-application-name"
- IN TXT "nick=user-nickname"
- IN TXT "node=application-identifier"
- IN TXT "n=entity-capabilities-operating-system"
- IN TXT "phsh=sha1-hash-of-avatar"
- IN TXT "port.p2pj=5562"
- IN TXT "status=avail-away-or-dnd"
- IN TXT "vc=capabilities-string"
- IN TXT "ver=entity-capabilities-identity"
+username@machine-name._presence._tcp.local. IN TXT "
+ 0x##txtvers=1
+ 0x##1st=user-first-name"
+ 0x##email=user-email-address"
+ 0x##hash=entity-capabilities-algorithm"
+ 0x##jid=user-jabber-id"
+ 0x##last=user-last-name"
+ 0x##msg=freeform-availability-status"
+ 0x##n=entity-capabilities-application-name"
+ 0x##nick=user-nickname"
+ 0x##node=application-identifier"
+ 0x##n=entity-capabilities-operating-system"
+ 0x##phsh=sha1-hash-of-avatar"
+ 0x##port.p2pj=5562"
+ 0x##status=avail-away-or-dnd"
+ 0x##vc=capabilities-string"
+ 0x##ver=entity-capabilities-identity"
+ "
]]>
- Note: In accordance with Section 6.7 of draft-cheshire-dnsext-dns-sd, the "txtvers" record SHOULD be the first record specified.
The "machine-name" is the name of the computer, the "username" is the system username of the principal currently logged into the computer, the "port" can be any unassigned port number, and the "ip-address" is the physical address of the computer on the local network.
@@ -309,43 +318,52 @@ juliet@pronto._presence._tcp.local. SRV 5562 pronto.local.
pronto.local. A 10.2.1.187
-juliet IN TXT "txtvers=1"
-juliet IN TXT "1st=Juliet"
-juliet IN TXT "email=juliet@capulet.lit"
-juliet IN TXT "hash=sha-1"
-juliet IN TXT "jid=juliet@capulet.lit"
-juliet IN TXT "last=Capulet"
-juliet IN TXT "msg=Hanging out downtown"
-juliet IN TXT "nick=JuliC"
-juliet IN TXT "node=http://www.adiumx.com"
-juliet IN TXT "phsh=a3839614e1a382bcfebbcf20464f519e81770813"
-juliet IN TXT "port.p2pj=5562"
-juliet IN TXT "status=avail"
-juliet IN TXT "vc=CA!"
-juliet IN TXT "ver=66/0NaeaBKkwk85efJTGmU47vXI="
-
+juliet@pronto._presence._tcp.local. IN TXT "
+ 0x09txtvers=1
+ 0x101st=Juliet
+ 0x1Eemail=juliet@capulet.lit
+ 0x10hash=sha-1
+ 0x1Cjid=juliet@capulet.lit
+ 0x12last=Capulet
+ 0x12msg=Hanging out downtown
+ 0x10nick=JuliC
+ 0x26node=http://www.adiumx.com
+ 0x45phsh=a3839614e1a382bcfebbcf20464f519e81770813
+ 0x14port.p2pj=5562
+ 0x12status=avail
+ 0x06vc=CA!
+ 0x33ver=66/0NaeaBKkwk85efJTGmU47vXI\=
+ "
]]>
The IPv4 and IPv6 addresses associated with a machine might vary depending on the local network to which the machine is connected. For example, on an Ethernet connection the physical address might be "192.168.0.100" but when the machine is connected to a wireless network the physical address might change to "10.10.1.187". See RFC 3927 for details.
If the machine name asserted by a client is already taken by another machine on the network, the client MUST assert a different machine name, which SHOULD be formed by adding the character "-" and digit "1" to the end of the machine name string (e.g., "pronto-1"), adding the character "-" and digit "2" if the resulting machine name is already taken (e.g., "pronto-2"), and similarly incrementing the digit until a unique machine name is constructed.
If the username asserted by a client is already taken by another application on the machine, the client MUST assert a different username, which SHOULD be formed by adding the character "-" and digit "1" to the end of the username string (e.g., "juliet-1"), adding the character "-" and digit "2" if the resulting username is already taken (e.g., "juliet-2"), and similarly incrementing the digit until a unique username is constructed.
-DNS-SD enables service definitions to include various TXT records that specify parameters to be used in the context of the relevant service type. The ®ISTRAR; maintains a registry of TXT records for use with the _presence._tcp service type, as specified in the XMPP Registrar Considerations section of this document.
-It is OPTIONAL to include any of these TXT records, and an implementation MUST NOT fail (i.e., MUST enable serverless messaging) even if none of the TXT records are provided by another entity.
-Most of the registered TXT records relate to human users, in which context certain records are of greater interest than others, e.g. "msg", "nick", and "status"; however, serverless messaging can be used by non-human entities (e.g., devices).
-Note: See the Security Considerations section of this document regarding the inclusion of information that can have an impact on personal privacy (e.g., the "1st", "last", "nick", "email", and "jid" records).
+DNS-SD enables service definitions to include a TXT record that specifies parameters to be used in the context of the relevant service type. The name of the TXT record is the same as that of the SRV record (i.e., "username@machine-name._presence._tcp.local."). The value of the TXT record is a binary object that contains one or more strings, where (1) each string is a parameter that usually takes the form of a key-value pair and (2) the parameters are separated by a single-length byte ("0x##") that specifies the length of the parameter itself.
+For detailed information about the format of the TXT record value, refer to the DNS-SD specification. The following truncated example illustrates the format.
+
+ Note: In accordance with Section 6.7 of draft-cheshire-dnsext-dns-sd, the first parameter in the TXT record value SHOULD be "txtvers".
+The ®ISTRAR; maintains a registry of the parameters that can be used in the TXT record value for the _presence._tcp service type, as specified in the XMPP Registrar Considerations section of this document. Those parameters are not listed here.
+It is OPTIONAL to include any of these TXT record parameters, and an implementation MUST NOT fail (i.e., MUST enable serverless messaging) even if none of the parameters are provided by another entity.
+Most of the registered TXT record parameters relate to human users, in which context certain parameters are of greater interest than others, e.g. "msg", "nick", and "status"; however, serverless messaging can be used by non-human entities (e.g., devices).
+Note: See the Security Considerations section of this document regarding the inclusion of information that can have an impact on personal privacy (e.g., the "1st", "last", "nick", "email", and "jid" parameters).
In order to discover other users, a client sends an mDNS request for PTR records that match "_presence._tcp.local.". The client then receives replies from all machines that advertise support for serverless messaging.
In order to discover other users, a client sends an mDNS request for PTR records that match "_presence._tcp.local.". The client then receives replies from all machines that advertise support for serverless messaging.
When the _presence._tcp service is used, presence is exchanged via the format described in the TXT Records section of this document. In particular, presence information is not pushed as in XMPP (see &rfc3921;). Instead, clients listen for presence announcements from other entities on the local link or wide-area network. Recommended rates for sending updates can be found in Multicast DNS.
+When the _presence._tcp service is used, presence is exchanged via the format described in the TXT Record section of this document. In particular, presence information is not pushed as in XMPP (see &rfc3921;). Instead, clients listen for presence announcements from other entities on the local link or wide-area network. Recommended rates for sending updates can be found in Multicast DNS.
Because serverless communication does not involve the exchange of XMPP presence, it is not possible to use &xep0115; for capabilities discovery. Therefore, it is RECOMMENDED to instead include the node, hash, and ver TXT records (and OPTIONAL to include the ext TXT record). The values of these records MUST be the same as the values for the 'node', 'hash', 'ver', and 'ext' attributes that are advertised for the application in normal XMPP presence (if any) via the Entity Capabilities protocol as described in XEP-0115.
+Because serverless communication does not involve the exchange of XMPP presence, it is not possible to use &xep0115; for capabilities discovery. Therefore, it is RECOMMENDED to instead include the node, hash, and ver TXT record parameters (and OPTIONAL to include the ext parameter). The values of these parameters MUST be the same as the values for the 'node', 'hash', 'ver', and 'ext' attributes that are advertised for the application in normal XMPP presence (if any) via the Entity Capabilities protocol as described in XEP-0115.
Because of fundamental differences between a true XMPP network and a serverless client "mesh", entities communicating via serverless messaging MUST NOT attempt to inject serverless traffic onto an XMPP network and an XMPP server MUST reject communications until an entity is properly authenticated in accordance with the rules defined in RFC 3920. However, a client on a serverless mesh MAY forward traffic to an XMPP network after having properly authenticated on such a network (e.g., to forward a message received on a serverless client mesh to a contact on an XMPP network).
Because there is no mechanism for validating the information that is published in DNS TXT records, it is possible for clients to "poison" this information (e.g., by publishing email addresses or Jabber IDs that are controlled by or associated with other users).
The TXT records optionally advertised as part of this protocol MAY result in exposure of privacy-sensitive information about a human user (such as full name, email address, and Jabber ID). A client MUST allow a user to disable publication of this personal information (e.g., via client configuration).
+The TXT record parameters optionally advertised as part of this protocol MAY result in exposure of privacy-sensitive information about a human user (such as full name, email address, and Jabber ID). A client MUST allow a user to disable publication of this personal information (e.g., via client configuration).
The ®ISTRAR; maintains a registry of TXT records advertised in the context of serverless messaging (see &LINKLOCAL;).
+The ®ISTRAR; maintains a registry of parameter strings contained in the TXT record advertised for serverless messaging (see &LINKLOCAL;).
- The attribute name of the TXT record.
- A natural-language description of the record.
+
+ The name of the parameter as used a key-value pair.
+ A natural-language description of the parameter.
The requirements status of the record. Should be one of:
- required
@@ -498,30 +516,30 @@ _presence._tcp.local. IN NULL raw-binary-data-here
- deprecated
- obsolete
-
+
]]>
- The registrant can register more than one TXT record at a time, each contained in a separate <record/> element.
+The registrant can register more than one parameter at a time, each contained in a separate <record/> element.
The following submission registers TXT records in use as of June 2007. Refer to the registry itself for a complete and current list of TXT records (this specification might or might not be revised when new TXT records are registered).
+The following submission registers parameters in use as of June 2007. Refer to the registry itself for a complete and current list of parameters (this specification might or might not be revised when new parameters are registered).
+
1st
The given or first name of the user.
optional
-
+
-
+
email
The email address of the user; can contain a space-separated list
of more than one email address.
optional
-
+
-
+
ext
A space-separated list of extensions; the value of this record MUST
@@ -529,49 +547,49 @@ _presence._tcp.local. IN NULL raw-binary-data-here
in the 'ext' attribute specified in Entity Capabilities (XEP-0115).
optional
-
+
-
+
hash
The hashing algorithm used to generated the 'ver' attribute in
- Entity Capabilities (XEP-0115) and therefore the ver TXT record
+ Entity Capabilities (XEP-0115) and therefore the ver parameter
in Link-Local Messaging.
recommended
-
+
-
+
jid
The Jabber ID of the user; can contain a space-separated list of
more than one JID.
recommended
-
+
-
+
last
The family or last name of the user.
optional
-
+
-
+
msg
Natural-language text describing the user's state. This is
equivalent to the XMPP <status/>; element.
optional
-
+
-
+
nick
A friendly or informal name for the user.
recommended
-
+
-
+
node
A unique identifier for the application; the value of this record MUST
@@ -579,9 +597,9 @@ _presence._tcp.local. IN NULL raw-binary-data-here
in the 'node' attribute specified in Entity Capabilities (XEP-0115).
recommended
-
+
-
+
phsh
The SHA-1 hash of the user's avatar icon or photo. This SHOULD be
@@ -593,22 +611,22 @@ _presence._tcp.local. IN NULL raw-binary-data-here
expiring avatar icons.
optional
-
+
-
+
port.p2pj
The port for serverless communication. This MUST be the same as the
value provided for SRV lookups. Clients MUST use the port discovered
- via SRV lookups and MUST ignore the value of this TXT record. However,
- clients SHOULD advertise this TXT record if it is important to ensure
+ via SRV lookups and MUST ignore the value of this parameter. However,
+ clients SHOULD advertise this parameter if it is important to ensure
backwards-compatibility with some existing implementations. (Note: In
some existing implementations this value was hardcoded to "5298".)
deprecated
-
+
-
+
status
The presence availability of the user. Allowable values are "avail",
@@ -618,19 +636,19 @@ _presence._tcp.local. IN NULL raw-binary-data-here
be assumed to be "avail".
recommended
-
+
-
+
txtvers
- The version of the TXT records supported by the client. For backwards
- compatibility this is hardcoded at "1". This TXT record SHOULD be the
+ The version of the TXT record supported by the client. For backwards
+ compatibility this is hardcoded at "1". This parameter SHOULD be the
first one provided, in accordance with the DNS-SD specification.
deprecated
-
+
-
+
vc
A flag advertising the user's ability to engage in audio or video
@@ -643,13 +661,13 @@ _presence._tcp.local. IN NULL raw-binary-data-here
the string MUST include the "!" character. The order of characters
in the string is immaterial. NOTE: This flag is included only for
backwards-compatibility; implementations SHOULD use the node, ver,
- and ext records for more robust capabilities discovery as described
+ and ext parameters for more robust capabilities discovery as described
in the Discovering Capabilities section of XEP-0174.
optional
-
+
-
+
ver
A hashed string that defines the XMPP service discovery (XEP-0030)
@@ -659,7 +677,7 @@ _presence._tcp.local. IN NULL raw-binary-data-here
the 'ver' attribute specified in Entity Capabilities (XEP-0115).
recommended
-
+
]]>