XEP-0156: Discovering Alternative XMPP Connection Methods

Abstract:This document defines a DNS TXT Resource Record format for use in discovering alternative methods of connecting to an XMPP server.
Authors:Joe Hildebrand, Peter Saint-Andre, Lance Stout
Copyright:© 1999 – 2018 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status:Draft
Type:Standards Track
Version:1.1.4
Last Updated:2018-09-30

NOTICE: The protocol defined herein is a Draft Standard of the XMPP Standards Foundation. Implementations are encouraged and the protocol is appropriate for deployment in production systems, but some changes to the protocol are possible before it becomes a Final Standard.


Table of Contents


1. Introduction
2. DNS Lookup Method
    2.1. Record Format
    2.2. Business Rules
    2.3. Examples
3. HTTP Lookup Method
    3.1. Link Format
    3.2. Business Rules
    3.3. Examples
4. Security Considerations
5. IANA Considerations
6. XMPP Registrar Considerations
    6.1. Namespaces
    6.2. Alternative Connection Methods Registry
       6.2.1. Process
       6.2.2. Registered Values

Appendices
    A: Document Information
    B: Author Information
    C: Legal Notices
    D: Relation to XMPP
    E: Discussion Venue
    F: Requirements Conformance
    G: Notes
    H: Revision History


1. Introduction

Although XMPP Core [1] specifies the use of TCP as the method of connecting to an XMPP server, alternative connection methods exist, including the BOSH (XEP-0124) [2] method (for which XMPP Over BOSH (XEP-0206) [3] is the XMPP profile) and the websocket subprotocol specified in RFC 7395 [4]. For some of these methods, it is necessary to discover further parameters before connecting, such as the HTTP URL of an alternative connection manager. Without ways to auto-discover alternative connection methods, the relevant information would need to be provided manually by a human user (which is cumbersome and error-prone) or hard-coded into XMPP software applications (which is brittle and not interoperable).

This document defines two ways to encapsulate information about alternative connection methods for auto-discovery:

  1. DNS TXT resource records
  2. Link entries in a server's "host-meta" file

2. DNS Lookup Method

2.1 Record Format

The following format for DNS TXT resource records is specified in RFC 1464:

<owner> <class> <ttl> <TXT> <"attribute name=attribute value">

This document specifies that the following additional rules apply for DNS TXT resource records used to specify alternative connection methods:

  1. It is RECOMMENDED for the owner to be "_xmppconnect".
  2. The class field SHOULD be IN.
  3. The ttl field is OPTIONAL.
  4. The attribute name SHOULD begin with the string "_xmpp-client-" or "_xmpp-server-" and SHOULD be registered as described in the XMPP Registrar Considerations section of this document.
  5. If the txt-data field contains only an attribute name (i.e., no unquoted "=" character followed by additional characters), the receiving application SHOULD interpret it as indicating the presence of the attribute or feature with no defined value.
  6. If the txt-data field contains an unquoted "=" character, it MUST also contain an attribute value.

2.2 Business Rules

The following business rules apply:

  1. TXT lookups MUST be used only as a fallback after the methods specified in RFC 6120 have been exhausted. [5]
  2. A domain SHOULD NOT present information in DNS TXT records that is available via the DNS SRV records defined in RFC 6120.
  3. The order of DNS TXT records SHOULD NOT be interpreted as significant by the presenting domain or the receiving entity.

2.3 Examples

The following examples show two DNS TXT resource records: the first indicates support for the XMPP Over BOSH connection method defined in XEP-0124 and XEP-0206 and the second indicates support for XMPP over WebSocket connections defined in RFC 7395;.

Example 1. TXT Resource Records

_xmppconnect IN TXT "_xmpp-client-xbosh=https://web.example.org:5280/bosh"
_xmppconnect IN TXT "_xmpp-client-websocket=wss://web.example.com:443/ws"

3. HTTP Lookup Method

3.1 Link Format

The HTTP lookup method uses Web Host Metadata RFC 6415 [6] to categorize and list the URIs of alternative connection methods. It is primarily intended for use by clients in environments where the ability to perform DNS queries is restricted, such as in web browsers.

Each alternative connection method is specified in the host-meta (XRD) file using a distinctive link relation RFC 5988 [7]. This specification defines several extension relation types:

3.2 Business Rules

The following business rules apply:

  1. HTTP queries for host-meta information MUST be used only as a fallback after the methods specified in RFC 6120 have been exhausted.
  2. A domain SHOULD NOT present information in host-meta link records that is available via the DNS SRV records defined in RFC 6120.
  3. The order of XMPP related link entries in the host-meta file SHOULD NOT be interpreted as significant by the presenting domain or the receiving entity.

3.3 Examples

The following examples show two host-meta link records: the first indicates support for the XMPP Over BOSH connection method defined in XEP-0124 and XEP-0206 and the second indicates support for the XMPP Over WebSocket connection method defined in RFC 7395 [4].

As specified in RFC 6120 §3, support for the XML encoding of the host-meta resource is REQUIRED while alternative representations such as JSON are OPTIONAL.

Example 2. Result for /.well-known/host-meta

<?xml version='1.0' encoding='utf-8'?>
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'>
  ...
  <Link rel="urn:xmpp:alt-connections:xbosh"
        href="https://web.example.com:5280/bosh" />
  <Link rel="urn:xmpp:alt-connections:websocket"
        href="wss://web.example.com:443/ws" />
  ...
</XRD>

It is possible to use an alternative JSON format for host-meta information, in which case the above example would be presented as:

Example 3. Result for /.well-known/host-meta.json

{
  ...
  "links": [
    ...
    {
      "rel": "urn:xmpp:alt-connections:xbosh",
      "href": "https://web.example.com:5280/bosh"
    },
    {
      "rel": "urn:xmpp:alt-connections:websocket",
      "href": "wss://web.example.com:443/ws"
    },
    ...
  ]
}

4. Security Considerations

It is possible that advertisement of alternative connection methods can introduce security vulnerabilities, since a connecting entity (usually a client) might deliberately seek to connect using the method with the weakest security mechanisms (e.g., no channel encryption or relatively weak authentication). Care needs to be taken in determining which alternative connection methods are appropriate to advertise.

Entities that use these connection methods MUST conform to the security considerations of each method, for example by preferring to use 'https' or 'wss' URLs that are protected using Transport Layer Security (TLS).

5. IANA Considerations

Because the link relations specified here are extension relation types rather than registered relation types (see Section 4 of RFC 5988), this document requires no interaction with the Internet Assigned Numbers Authority (IANA) [8].

6. XMPP Registrar Considerations

6.1 Namespaces

The XMPP Registrar [9] shall include 'urn:xmpp:alt-connections' in its registry of protocol namespaces (see <https://xmpp.org/registrar/namespaces.html>).

6.2 Alternative Connection Methods Registry

The XMPP Registrar [9] maintains a registry of attributes for use in DNS TXT resource records that advertise alternative XMPP connection methods (see <https://xmpp.org/registrar/alt-connections.html>).

6.2.1 Process

In order to submit new values to this registry, the registrant shall define an XML fragment of the following form and either include it in the relevant XMPP Extension Protocol or send it to the email address <registrar@xmpp.org>:

<method>
  <name>the name of the attribute to be used in DNS TXT records</name>
  <desc>a natural-language description of the alternative connection method</desc>
  <syntax>the syntax of the DNS TXT record attribute value</syntax>
  <doc>the document in which the alternative connection method is specified</doc>
</method>

The registrant can register more than one attribute at a time, each contained in a separate <method/> element.

6.2.2 Registered Values

This document registers the following values.

<method>
  <name>_xmpp-client-httppoll</name>
  <desc>HTTP Polling connection method</desc>
  <syntax>
    The http: or https: URL at which to contact the HTTP Polling connection manager or proxy
  </syntax>
  <doc>XEP-0025</doc>
</method>

<method>
  <name>_xmpp-client-websocket</name>
  <desc>XMPP Over WebSocket connection method</desc>
  <syntax>
    The ws: or wss: URL at which to contact the WebSocket connection manager or proxy
  </syntax>
  <doc>RFC 7395</doc>
</method>

<method>
  <name>_xmpp-client-xbosh</name>
  <desc>XMPP Over Bosh connection method</desc>
  <syntax>
    The http: or https: URL at which to contact the HTTP Binding (BOSH) connection manager or proxy
  </syntax>
  <doc>XEP-0206</doc>
</method>

Appendices


Appendix A: Document Information

Series: XEP
Number: 0156
Publisher: XMPP Standards Foundation
Status: Draft
Type: Standards Track
Version: 1.1.4
Last Updated: 2018-09-30
Approving Body: XMPP Council
Dependencies: XMPP Core, RFC 1464
Supersedes: None
Superseded By: None
Short Name: alt-connections
Registry: <http://xmpp.org/registrar/alt-connections.html>
Source Control: HTML
This document in other formats: XML  PDF


Appendix B: Author Information

Joe Hildebrand

Email: jhildebr@cisco.com
JabberID: hildjj@jabber.org

Peter Saint-Andre

Email: xsf@stpeter.im
JabberID: peter@jabber.org
URI: http://stpeter.im/

Lance Stout

Email: lance@andyet.com
JabberID: lance@lance.im


Appendix C: Legal Notices

Copyright

This XMPP Extension Protocol is copyright © 1999 – 2018 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).

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 <http://xmpp.org/about/discuss.shtml> for a complete list.

Given that this XMPP Extension Protocol normatively references IETF technologies, discussion on the <xsf-ietf@xmpp.org> list might also be appropriate.

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. RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core <http://tools.ietf.org/html/rfc6120>.

2. XEP-0124: Bidirectional-streams Over Synchronous HTTP <https://xmpp.org/extensions/xep-0124.html>.

3. XEP-0206: XMPP Over BOSH <https://xmpp.org/extensions/xep-0206.html>.

4. RFC 7395: An Extensible Messaging and Presence Protocol (XMPP) Subprotocol for WebSocket <http://tools.ietf.org/html/rfc7395>.

5. The point of this rule is to prevent someone from defining a new XEP-0156 connection method like "_xmpp-client-tcp" to override the SRV records defined in the core XMPP specification.

6. RFC 6415: Web Host Metadata <http://tools.ietf.org/html/rfc6415>.

7. RFC 5988: Web Linking <http://tools.ietf.org/html/rfc5988>.

8. 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/>.

9. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.


Appendix H: Revision History

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

Version 1.1.4 (2018-09-30)

Fix XML header on example.

(jsc)

Version 1.1.3 (2018-07-21)

Replace references to draft-ietf-xmpp-websocket with RFC7395 (XMPP over WebSocket).

(egp)

Version 1.1.2 (2016-06-07)

(XSF Editor: ssw)

Version 1.1.1 (2016-06-06)

Fix a small typo in one of the examples (UTF-9 encoding).

(XSF Editor: ssw)

Version 1.1 (2014-01-08)

Defined HTTP lookup methods using well-known URIs as specified in RFC 5785.

(ls/psa)

Version 1.0 (2007-06-12)

Per a vote of the XMPP Council, advanced status to Draft; XMPP Registrar assigned alt-connections shortname and created appropriate registry.

(psa)

Version 0.7 (2007-04-18)

Updated to reflect renaming of HTTP Binding to XMPP Over BOSH.

(psa)

Version 0.6 (2007-01-30)

Finally and definitively removed _xmpp-client-tcp and _xmpp-server-tcp attributes since clients and servers should use either SRV records or standard XMPP ports (5222 or 5269).

(psa)

Version 0.5 (2007-01-30)

Removed _xmpp-client-tcpssl attribute since use of the old-style SSL-only port is discouraged.

(psa)

Version 0.4 (2007-01-29)

Added _xmpp-client-tcpssl for old-style SSL connections; added discussion of IETF U-NAPTR technology.

(psa)

Version 0.3 (2006-05-16)

Clarified order of lookups; restored _xmpp-client-tcp and added _xmpp-server-tcp as optional records if SRV is not supported or accessible.

(psa)

Version 0.2 (2005-12-05)

Removed _xmpp-client-tcp from TXT records (belongs in SRV records only).

(psa)

Version 0.1 (2005-09-08)

Initial version.

(psa)

Version 0.0.3 (2005-09-07)

More fully specified the rationale for using DNS TXT records.

(psa)

Version 0.0.2 (2005-08-27)

Added security considerations and registrar considerations.

(psa)

Version 0.0.1 (2005-08-23)

First draft.

(psa/jh)

END