XEP-0309: Service Directories

Abstract
This specification shows how to combine and extend a number of existing XMPP protocols for improved sharing of information about XMPP servers.
Author
Peter Saint-Andre
Copyright
© 2011 – 2012 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status

Deferred

WARNING: This document has been automatically Deferred after 12 months of inactivity in its previous Experimental state. Implementation of the protocol described herein is not recommended for production systems. However, exploratory implementations are encouraged to resume the standards process.
Type
Standards Track
Version
0.3 (2012-05-29)
Document Lifecycle
  1. Experimental
  2. Deferred
  3. Proposed
  4. Stable
  5. Final

1. Introduction

Several directories (e.g., at xmpp.net and jabberes.org) have long provided information about public XMPP services so that end users can more easily find servers to register with, add-on components to use for features such as Multi-User Chat (XEP-0045) [1], etc. These service directories tend to rely on humans to gather and in some cases verify the information they publish before providing it via the World Wide Web or the XMPP network for use by end users and IM client software. However, relying on humans to gather and verify such information can result in significant delays and errors. It would be better to automate the information-gathering functions as much as possible.

This document shows how to combine and extend a number of existing XMPP protocols for (mostly) automated gathering of information about public XMPP services. Widespread deployment of this specification will result in more timely, accurate information about the services available on the XMPP network.

2. Gathering Information

The following scenario involves two entities:

Note: Although the entity that gathers information for a directory could be a client or a component, here we assume that it is a server ("xmpp.net").

These two entities use Server Buddies (XEP-0267) [2], Service Discovery (XEP-0030) [3], and vCard4 over XMPP (XEP-0292) [4] in the following ways.

Directory                      Service
(xmpp.net)                   (jabber.org)
    |                             |
    |   [first, server learns     |
    |    identity of directory]   |
    |                             |
    |<---disco info request-------|
    |----disco info response----->|
    |                             |
    |   [second, entities become  |
    |    "buddies" per XEP-0267]  |
    |                             |
    |<---presence subscribe-------|
    |----presence subscribed----->|
    |----presence subscribe------>|
    |<---presence subscribed------|
    |                             |
    |   [third, directory         |
    |    gathers server data]     |
    |                             |
    |----disco info request------>|
    |<---disco info response------|
    |                             |
    |----vcard request----------->|
    |<---vcard response-----------|
    |                             |

2.1 Server Discovers Directory

In order to determine the exact identity of the directory, the server sends a service discovery information request to the directory.

Example 1. Server Queries Directory
<iq type='get'
    from='jabber.org'
    to='xmpp.net'
    id='xh1f37n5'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
Example 2. Directory Returns Disco Info
<iq type='result'
    from='xmpp.net'
    to='jabber.org'
    id='xh1f37n5'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <identity category='directory' type='server'/>
    <feature var='http://jabber.org/protocol/disco#info'/>
    <feature var='http://jabber.org/protocol/disco#items'/>
    <feature var='urn:xmpp:server-presence'/>
  </query>
</iq>

Note: Inclusion of the "directory/server" identity indicates that xmpp.net is a service directory.

2.2 Service Subscribes to Directory

If the service wishes to have its information aggregated, it sends a presence subscription request to the directory as described in XEP-0267.

Example 3. Service Sends Subscription Request to Directory
<presence from='jabber.org'
          to='xmpp.net'
          type='subscribe'/>

Upon receiving the presence subscription request, the directory approves it.

Example 4. Directory Sends Approval to Server
<presence from='xmpp.net'
          to='jabber.org'
          type='subscribed'/>

The directory also sends a subscription request to the server.

Example 5. Directory Sends Subscription Request to Server
<presence from='xmpp.net'
          to='jabber.org'
          type='subscribe'/>

The service then approves that subscription request, as well.

Example 6. Service Sends Approval to Directory
<presence from='jabber.org'
          to='xmpp.net'
          type='subscribed'/>

2.3 Directory Queries Server

After the subscription handshake has been completed, the directory queries the server for information. There are two aspects: service discovery ("disco") information and vCard information.

2.3.1 Disco Query

In order to determine the exact identity of the server, the directory sends a service discovery information request to the server.

Example 7. Directory Queries Server
<iq type='get'
    from='xmpp.net'
    to='jabber.org'
    id='i3vs51b9'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
Example 8. Server Returns Disco Info
<iq type='result'
    from='jabber.org'
    to='xmpp.net'
    id='i3vs51b9'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <identity category='server' type='im'/>
    <feature var='http://jabber.org/protocol/disco#info'/>
    <feature var='http://jabber.org/protocol/disco#items'/>
    <feature var='jabber:iq:register'/>
    <feature var='urn:xmpp:server-presence'/>
    <feature var='urn:xmpp:public-server'/>
  </query>
</iq>

Note: If the server is a public node on the XMPP network, it includes a service discovery feature of "urn:xmpp:public-server". This feature is defined below.

Note: If the server allows In-Band Registration (XEP-0077) [5], it includes a service discovery feature of "jabber:iq:register". If the server does not allow in-band registration but allows account registration at a website, it includes the registration URL in its vCard as described below.

The foregoing examples show the gathering of disco#info data (identity and supported features). A directory MAY also gather disco#items data about components and other services associated with the base XMPP service at a domain.

2.3.2 vCard Query

In order to gather additional information about the server, the directory sends a vCard information request to the server.

Note: Because vCard4 enables the XMPP community to more easily define extensions to vCard (e.g., for registration URLs), it is RECOMMENDED for servers to support vCard4 over XMPP (XEP-0292) [4] in addition to, or instead of, vcard-temp (XEP-0054) [6].

Example 9. Directory Requests vCard Data from Server
<iq from='xmpp.net'
    id='lw71bs73'
    to='jabber.org'
    type='get'>
  <vcard xmlns='urn:ietf:params:xml:ns:vcard-4.0'/>
</iq>
Example 10. Server Returns vCard Data
<iq from='jabber.org'
    id='lw71bs73'
    to='xmpp.net'
    type='result'>
  <vcard xmlns='urn:ietf:params:xml:ns:vcard-4.0'>
    <fn><text>jabber.org IM service</text></fn>
    <url><uri>http://www.jabber.org/</uri></url>
    <lang>
      <parameters><pref>1</pref></parameters>
      <language-tag>en</language-tag>
    </lang>
    <adr>
      <region>IA</region>
      <country>US</country>
    </adr>
    <email><text>xmpp@jabber.org</text></email>
    <impp><uri>xmpp:jabber.org</uri></impp>
    <logo><uri>http://www.jabber.org/images/logo.png</uri></logo>
    <geo><uri>geo:42.25,-91.05</uri></geo>
    <tz><text>America/Chicago</text></tz>
    <kind><text>application</text></kind>
    <registration xmlns='urn:xmpp:vcard:registration:1'>
      <uri>https://register.jabber.org/</uri>
    </registration>
  </vcard>
</iq>

It is RECOMMENDED for public server vCards to include the following information:

It is OPTIONAL for public server vCards to include the following information:

It is best for the server directory to discover the last two elements in-band (by means of TLS negotiation and software version, respectively), then add them to the contact vCard as described in the next section.

3. Publishing Information

Currently, service directories such as xmpp.net and jabberes.org publish their information on the World Wide Web, typically at a human-friendly website and sometimes also by means of machine-readable files at a well-known URI for use by IM clients to pre-populate drop-down boxes showing XMPP servers that allow in-band registration. (For example, the xmpp.net service publishes a file listing registered public servers using the Service Discovery (XEP-0030) [3] format.)

In addition to publishing such information on the web, this document defines a second publishing path: the XMPP network itself. The directory can do this by creating a public Publish-Subscribe (XEP-0060) [9] node at the directory's bare domain (e.g., xmpp.net) that pushes data in the vCard4 format, as described more fully in XEP-0292. Other entities can then subscribe to this node to receive updated information about services that are added to or removed from the directory.

For example, the following stanza shows an information push from the xmpp.net directory about the jabber.org service, sent to a subscriber at example.com.

Example 11. Directory Pushes Server Data to Subscriber
<message from='xmpp.net'
         to='example.com'
         type='headline'
         id='hx61cs8k'>
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='urn:xmpp:contacts'>
      <item id='3B55FBC7-8149-4693-A1A1-5367E2A49C83'>
        <vcard xmlns='urn:ietf:params:xml:ns:vcard-4.0'>
          <fn><text>jabber.org IM service</text></fn>
          <url><uri>http://www.jabber.org/</uri></url>
          <lang>
            <parameters><pref>1</pref></parameters>
            <language-tag>en</language-tag>
          </lang>
          <adr>
            <region>IA</region>
            <country>US</country>
          </adr>
          <email><text>xmpp@jabber.org</text></email>
          <impp><uri>xmpp:jabber.org</uri></impp>
          <logo><uri>http://www.jabber.org/images/logo.png</uri></logo>
          <geo><uri>geo:42.25,-91.05</uri></geo>
          <tz><text>America/Chicago</text></tz>
          <kind><text>application</text></kind>
          <registration xmlns='urn:xmpp:vcard:registration:1'>
            <uri>https://register.jabber.org/</uri>
          </registration>
          <ca xmlns='urn:xmpp:vcard:ca:0'>
            <name>StartSSL</uri>
            <uri>http://www.startssl.com/</uri>
          </ca>
          <name xmlns='jabber:iq:version'>Isode M-Link</name>
        </vcard>
      </item>
    </items>
  </event>
</message>

4. Security Considerations

Because a service directory does not know about an XMPP service unless the administrator of the service initiates a presence subscription to the directory, information leakage is minimized.

Use of the "urn:xmpp:public-server" service discovery feature provides a way for an XMPP server to explicitly indicate that its information is public.

Use of the "directory/server" service discovery identity provides a way for a service directory to explicitly indicate that it gathers service information obtained from XMPP servers that contact it.

5. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [10].

6. XMPP Registrar Considerations

6.1 Protocol Namespaces

This document registers the following XML namespaces:

The XMPP Registrar shall add these namespaces to its registry at <https://xmpp.org/registrar/namespaces.html>.

6.2 Service Discovery Category/Type

This document specifies that a service directory is identified by the "directory" category and the "server" type within XMPP Service Discovery.

The XMPP Registrar shall add the "server" type to the "directory" category already listed in the registry at <https://xmpp.org/registrar/disco-categories.html>. The registration is as follows.

Registry Submission
<category>
  <name>directory</name>
  <type>
    <name>server</name>
    <desc>A directory of XMPP servers</desc>
    <doc>XEP-0309</doc>
  </type>
</category>

6.3 Service Discovery Features

This document specifies that a public server on the XMPP network is identified by the "urn:xmpp:public-server" Service Discovery feature.

The XMPP Registrar shall add this feature to its registry at <https://xmpp.org/registrar/disco-features.html>. The registration is as follows.

Registry Submission
<var>
  <name>urn:xmpp:public-server</name>
  <desc>The server is a public node on the XMPP network</desc>
  <doc>XEP-0309</doc>
</var>

7. XML Schema

7.1 Registration URI

<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='urn:xmpp:vcard:registration:1'
    xmlns='urn:xmpp:vcard:registration:1'
    elementFormDefault='qualified'>

  <xs:element name='registration'>
    <xs:complexType>
      <xs:sequence>
        <xs:element name='uri' type='xs:anyURI'/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

</xs:schema>

7.2 Certification Authority Information

<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='urn:xmpp:vcard:ca:0'
    xmlns='urn:xmpp:vcard:ca:0'
    elementFormDefault='qualified'>

  <xs:element name='ca'>
    <xs:complexType>
      <xs:sequence>
        <xs:element name='name' type='xs:string'/>
        <xs:element name='uri' type='xs:anyURI'/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

</xs:schema>

Appendices

Appendix A: Document Information

Series
XEP
Number
0309
Publisher
XMPP Standards Foundation
Status
Deferred
Type
Standards Track
Version
0.3
Last Updated
2012-05-29
Approving Body
XMPP Council
Dependencies
XMPP Core
Supersedes
None
Superseded By
None
Short Name
NOT_YET_ASSIGNED
Source Control
HTML

This document in other formats: XML  PDF

Appendix B: Author Information

Peter Saint-Andre
Email
stpeter@stpeter.im
JabberID
stpeter@jabber.org
URI
https://stpeter.im/

Copyright

This XMPP Extension Protocol is copyright © 1999 – 2024 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).

Visual Presentation

The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.

Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.

Errata can be sent to <editor@xmpp.org>.

Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".

Appendix G: Notes

1. XEP-0045: Multi-User Chat <https://xmpp.org/extensions/xep-0045.html>.

2. XEP-0267: Server Buddies <https://xmpp.org/extensions/xep-0267.html>.

3. XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.

4. XEP-0292: vCard4 over XMPP <https://xmpp.org/extensions/xep-0292.html>.

5. XEP-0077: In-Band Registration <https://xmpp.org/extensions/xep-0077.html>.

6. XEP-0054: vcard-temp <https://xmpp.org/extensions/xep-0054.html>.

7. RFC 6473: vCard KIND:application <http://tools.ietf.org/html/rfc6351>.

8. XEP-0092: Software Version <https://xmpp.org/extensions/xep-0092.html>.

9. XEP-0060: Publish-Subscribe <https://xmpp.org/extensions/xep-0060.html>.

10. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

Appendix H: Revision History

Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/

  1. Version 0.3 (2012-05-29)

    Corrected a number of details in the text, examples, and XMPP Registrar considerations; removed an extraneous section that is better contained in XEP-0267.

    psa
  2. Version 0.2 (2012-01-25)

    Added vCard extension for certification authority information; showed how to include software name in a vCard; recommended that the CA information and software name be added by the service directory, not included by the server itself.

    psa
  3. Version 0.1 (2012-01-10)

    Initial published version.

    psa
  4. Version 0.0.3 (2012-01-09)

    Defined ad-hoc command for triggering outbound presence subscription.

    psa
  5. Version 0.0.2 (2012-01-09)

    Defined data sharing via PEP.

    psa
  6. Version 0.0.1 (2011-12-12)

    First draft.

    psa

Appendix I: Bib(La)TeX Entry

@report{saint-andre2011xep0309,
  title = {Service Directories},
  author = {Saint-Andre, Peter},
  type = {XEP},
  number = {0309},
  version = {0.3},
  institution = {XMPP Standards Foundation},
  url = {https://xmpp.org/extensions/xep-0309.html},
  date = {2011-12-12/2012-05-29},
}

END