XEP-0066: Out of Band Data

Abstract
This specification defines two XMPP protocol extensions for communicating URIs, one for use in XMPP message stanzas and the other for use in a structured request-response interaction via XMPP IQ stanzas. Among other things, this enables one entity to inform another entity about a file that is available at an HTTP URL.
Author
Peter Saint-Andre
Copyright
© 1999 – 2020 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status

Draft

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.
Type
Standards Track
Version
1.5 (2006-08-16)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Draft
  4. Final

1. Introduction

This document defines two XMPP protocol extensions for communicating URIs between Jabber entities, where the data formats are qualified by the 'jabber:iq:oob' and 'jabber:x:oob' namespaces. Although these mechanisms were originally used for out-of-band (OOB) data transfer, they are also used more generally to exchange or communicate URIs.

2. jabber:iq:oob

The intent of the 'jabber:iq:oob' was to provide a "least common denominator" mechanism for basic file transfers. Although SI File Transfer (XEP-0096) [1] defines a more generic method for communicating file exchange options, the 'jabber:iq:oob' namespace can be included as one option therein since it provides a fallback mechanism when clients do not support file transfer options such as those defined in SOCKS5 Bytestreams (XEP-0065) [2] and In-Band Bytestreams (XEP-0047) [3].

To initiate an out-of-band file transfer with an intended recipient using the 'jabber:iq:oob' namespace (whether or not negotiated via XEP-0096), the sending application sends an <iq/> of type 'set' to the recipient containing a <query/> child element qualified by the 'jabber:iq:oob' namespace; the <query/> MUST in turn contain a <url/> child specifying the URL of the file to be transferred, and MAY contain an optional <desc/> child describing the file. This usage is shown in the following example.

Example 1. Sender Initiates Request-Response
<iq type='set'
    from='stpeter@jabber.org/work'
    to='MaineBoy@jabber.org/home'
    id='oob1'>
  <query xmlns='jabber:iq:oob'>
    <url>http://www.jabber.org/images/psa-license.jpg</url>
    <desc>A license to Jabber!</desc>
  </query>
</iq>

The expected result is for the recipient to retrieve the file via an HTTP GET request and to then inform the sender of successful receipt of the file. The receiving application MUST NOT send the IQ result until it has retrieved the complete file (e.g., it MUST NOT send the IQ result if it has merely attempted to retrieve the file or the URL provided seems to be valid):

Example 2. Recipient Informs Sender of Success
<iq type='result'
    from='MaineBoy@jabber.org/home'
    to='stpeter@jabber.org/work'
    id='oob1'/>

If the recipient attempts to retrieve the file but is unable to do so, the receiving application MUST return an <iq/> of type 'error' to the sender specifying a Not Found condition:

Example 3. Recipient Informs Sender of Failure
<iq type='error'
    from='MaineBoy@jabber.org/home'
    to='stpeter@jabber.org/work'
    id='oob1'>
  <query xmlns='jabber:iq:oob'>
    <url>http://www.jabber.org/images/psa-license.jpg</url>
    <desc>A license to Jabber!</desc>
  </query>
  <error code='404' type='cancel'>
    <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  </error>
</iq>

If the recipient rejects the request outright, the receiving application MUST return an <iq/> of type 'error' to the sender specifying a Not Acceptable condition:

Example 4. Recipient Rejects Request
<iq type='error'
    from='MaineBoy@jabber.org/home'
    to='stpeter@jabber.org/work'
    id='oob1'>
  <query xmlns='jabber:iq:oob'>
    <url>http://www.jabber.org/images/psa-license.jpg</url>
    <desc>A license to Jabber!</desc>
  </query>
  <error code='406' type='modify'>
    <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  </error>
</iq>

3. jabber:x:oob

The 'jabber:x:oob' namespace is used to communicate a URI to another user or application. This is done by including an <x/> child element qualified by the 'jabber:x:oob' namespace in either a <message/> and <presence/> stanza; the <x/> child MUST contain a <url/> child specifying the URL of the resource, and MAY contain an optional <desc/> child describing the resource.

Example 5. Sender Communicates a URI
<message from='stpeter@jabber.org/work'
         to='MaineBoy@jabber.org/home'>
  <body>Yeah, but do you have a license to Jabber?</body>
  <x xmlns='jabber:x:oob'>
    <url>http://www.jabber.org/images/psa-license.jpg</url>
  </x>
</message>

4. Determining Support

If an entity supports the out of band data protocol, it MUST report that by including a service discovery feature of "jabber:iq:oob" and/or "jabber:x:oob" in response to a Service Discovery (XEP-0030) [4] information request:

Example 6. Service Discovery information request
<iq type='get'
    from='juliet@capulet.lit/balcony'
    to='romeo@montague.lit/orchard'
    id='disco1'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
Example 7. Service Discovery information response
<iq type='result'
    from='romeo@montague.lit/orchard'
    to='juliet@capulet.lit/balcony'
    id='disco1'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    ...
    <feature var='jabber:iq:oob'/>
    <feature var='jabber:x:oob'/>
    ...
  </query>
</iq>

5. Use With Non-HTTP URI Schemes

The value of the <url/> element is not limited to URIs that conform to the http: URI scheme (as specified by RFC 2616 [5]). For example, file transfers could also be effected using ftp: URIs as (specified by RFC 959 [6]). Going further afield, several existing Jabber clients use the callto: URI scheme to initiate voice conferencing via NetMeeting or GnomeMeeting. Other out-of-band communications could be initiated in a similar way via URI schemes such as sip: (as specified by RFC 3261 [7]). All of these usages are allowed by the existing OOB namespaces, as long as the value of the <url/> element is a valid URI (as specified by RFC 3986 [8]).

6. Integration With Stream Initiation

This section is non-normative.

Stream Initiation (XEP-0095) [9] defines methods for negotiating content streams between any two entities, and XEP-0096 defines a profile of stream initiation for file transfer. Although the use of jabber:iq:oob is not recommended by XEP-0096, it could be offered as one option (e.g., a fallback if SOCKS5 Bytestreams and In-Band Bytestreams are not available). If so, the value of the feature negotiation option MUST be "jabber:iq:oob" and the <query/> element within the <iq/> stanza qualified by the 'jabber:iq:oob' namespace MUST possess a 'sid' attribute whose value is the StreamID negotiated by stream initiation.

A sample protocol flow is shown below.

Example 8. Stream Initiation Offer
    
<iq type='set'
    from='romeo@montague.net/orchard'
    to='juliet@capulet.com/chamber'
    id='offer1'>
  <si xmlns='http://jabber.org/protocol/si'
      id='a0'
      mime-type='text/plain'
      profile='http://jabber.org/protocol/si/profile/file-transfer'>
    <file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
          name='test.txt'
          size='1022'/>
    <feature xmlns='http://jabber.org/protocol/feature-neg'>
      <x xmlns='jabber:x:data' type='form'>
        <field var='stream-method' type='list-single'>
          <option><value>http://jabber.org/protocol/bytestreams</value></option>
          <option><value>http://jabber.org/protocol/ibb</value></option>
          <option><value>jabber:iq:oob</value></option>
        </field>
      </x>
    </feature>
  </si>
</iq>

  
Example 9. Stream Initiation Result
    
<iq type='result'
    from='juliet@capulet.com/chamber'>
    to='romeo@montague.net/orchard'
    id='offer1'>
  <si xmlns='http://jabber.org/protocol/si'
      id='a0'
      profile='http://jabber.org/protocol/si/profile/file-transfer'>
    <feature xmlns='http://jabber.org/protocol/feature-neg'>
      <x xmlns='jabber:x:data' type='submit'>
        <field var='stream-method'>
          <value>jabber:iq:oob</value>
        </field>
      </x>
    </feature>
  </si>
</iq>

  
Example 10. Sender Initiates Request-Response
<iq type='set'
    from='romeo@montague.net/orchard'
    to='juliet@capulet.com/chamber'>
    id='send1'>
  <query xmlns='jabber:iq:oob'
         sid='a0'>
    <url>http://www.shakespeare.lit/files/letter.txt</url>
  </query>
</iq>
Example 11. Recipient Informs Sender of Success
<iq type='result'
    from='juliet@capulet.com/chamber'
    to='romeo@montague.net/orchard'
    id='send1'/>

7. Security Considerations

As with any mechanism that communicates a URI, care must be taken by the receiving application to ensure that the resource retrieved does not contain harmful or malicious data (e.g., a virus-infected file).

8. IANA Considerations

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

9. XMPP Registrar Considerations

The 'jabber:iq:oob' and 'jabber:x:oob' namespaces are included in the protocol namespaces registry maintained by the XMPP Registrar [11] (see <https://xmpp.org/registrar/namespaces.html>).

10. XML Schemas

10.1 jabber:iq:oob

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

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='jabber:iq:oob'
    xmlns='jabber:iq:oob'
    elementFormDefault='qualified'>

  <xs:annotation>
    <xs:documentation>
      The protocol documented by this schema is defined in
      XEP-0066: http://www.xmpp.org/extensions/xep-0066.html
    </xs:documentation>
  </xs:annotation>

  <xs:element name='query'>
    <xs:complexType>
      <xs:sequence>
        <xs:element name='url' type='xs:string' minOccurs='1'/>
        <xs:element name='desc' type='xs:string' minOccurs='0'/>
      </xs:sequence>
      <xs:attribute name='sid' type='xs:string' use='optional'/>
    </xs:complexType>
  </xs:element>

</xs:schema>

10.2 jabber:x:oob

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

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='jabber:x:oob'
    xmlns='jabber:x:oob'
    elementFormDefault='qualified'>

  <xs:annotation>
    <xs:documentation>
      The protocol documented by this schema is defined in
      XEP-0066: http://www.xmpp.org/extensions/xep-0066.html
    </xs:documentation>
  </xs:annotation>

  <xs:element name='x'>
    <xs:complexType>
      <xs:sequence>
        <xs:element name='url' type='xs:string' minOccurs='1'/>
        <xs:element name='desc' type='xs:string' minOccurs='0'/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>

Appendices

Appendix A: Document Information

Series
XEP
Number
0066
Publisher
XMPP Standards Foundation
Status
Draft
Type
Standards Track
Version
1.5
Last Updated
2006-08-16
Approving Body
XMPP Council
Dependencies
XMPP Core
Supersedes
None
Superseded By
None
Short Name
oob
Schema
XML Schema for the 'jabber:iq:oob' namespace: <http://www.xmpp.org/schemas/iq-oob.xsd>
XML Schema for the 'jabber:x:oob' namespace: <http://www.xmpp.org/schemas/x-oob.xsd>
Source Control
HTML

This document in other formats: XML  PDF

Appendix B: Author Information

Peter Saint-Andre
Email
xsf@stpeter.im
JabberID
peter@jabber.org
URI
http://stpeter.im/

Copyright

This XMPP Extension Protocol is copyright © 1999 – 2020 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 <http://xmpp.org/about/discuss.shtml> 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-0096: SI File Transfer <https://xmpp.org/extensions/xep-0096.html>.

2. XEP-0065: SOCKS5 Bytestreams <https://xmpp.org/extensions/xep-0065.html>.

3. XEP-0047: In-Band Bytestreams <https://xmpp.org/extensions/xep-0047.html>.

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

5. RFC 2616: Hypertext Transport Protocol -- HTTP/1.1 <http://tools.ietf.org/html/rfc2616>.

6. RFC 959: File Transfer Protocol <http://tools.ietf.org/html/rfc0959>.

7. RFC 3261: Session Initiation Protocol (SIP) <http://tools.ietf.org/html/rfc3261>.

8. RFC 3986: Uniform Resource Identifiers (URI): Generic Syntax <http://tools.ietf.org/html/rfc3986>.

9. XEP-0095: Stream Initiation <https://xmpp.org/extensions/xep-0095.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/>.

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

  1. Version 1.5 (2006-08-16)

    Per a vote of the Jabber Council, converted to Standards Track.

    psa
  2. Version 1.4 (2006-01-11)

    Removed example of including URL in presence stanza.

    psa
  3. Version 1.3 (2004-10-18)

    Added non-normative section on integration with stream initiation (XEP-0095); added optional sid attribute to jabber:iq:oob schema.

    psa
  4. Version 1.2 (2004-04-13)

    Clarified that IQ use is for basic file transfer whereas message and presence use is for communication of URIs; added presence example; added references to file transfer specifications as well as related open issue.

    psa
  5. Version 1.1 (2004-02-10)

    Editorial adjustments and clarifications; added references to relevant RFCs.

    psa
  6. Version 1.0 (2003-10-08)

    Per a vote of the Jabber Council, changed status to Active.

    psa
  7. Version 0.3 (2003-06-22)

    Made several small editorial changes; added XML schemas.

    psa
  8. Version 0.2 (2003-01-08)

    Added information about non-HTTP URIs.

    psa
  9. Version 0.1 (2002-12-16)

    Initial version.

    psa

END