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.
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.
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
XML Schema for jabber:iq:oob namespace: <http://www.xmpp.org/schemas/iq-oob.xsd>
XML Schema for jabber:x:oob namespace: <http://www.xmpp.org/schemas/x-oob.xsd>
Wiki Page: <http://wiki.jabber.org/index.php/Out of Band Data (XEP-0066)>
JabberID:
stpeter@jabber.org
URI:
https://stpeter.im/
The preferred venue for discussion of this document is the Standards discussion list: <http://mail.jabber.org/mailman/listinfo/standards>.
Errata may be sent to <editor@xmpp.org>.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) 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.
The following 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".
1. Introduction
2. jabber:iq:oob
3. jabber:x:oob
4. Determining Support
5. Use With Non-HTTP URI Schemes
6. Integration With Stream Initiation
7. Security Considerations
8. IANA Considerations
9. XMPP Registrar Considerations
10. XML Schemas
10.1. jabber:iq:oob
10.2. jabber:x:oob
Notes
Revision History
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.
The intent of the 'jabber:iq:oob' was to provide a "least common denominator" mechanism for basic file transfers. Although File Transfer [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 [2] and In-Band Bytestreams [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>
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>
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 [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>
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]).
This section is non-normative.
Stream Initiation [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'/>
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).
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [10].
The 'jabber:iq:oob' and 'jabber:x:oob' namespaces are included in the protocol namespaces registry maintained by the XMPP Registrar [11] (see <http://www.xmpp.org/registrar/namespaces.html>).
<?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>
<?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>
1. XEP-0096: File Transfer <http://www.xmpp.org/extensions/xep-0096.html>.
2. XEP-0065: SOCKS5 Bytestreams <http://www.xmpp.org/extensions/xep-0065.html>.
3. XEP-0047: In-Band Bytestreams <http://www.xmpp.org/extensions/xep-0047.html>.
4. XEP-0030: Service Discovery <http://www.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 <http://www.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 <http://www.xmpp.org/registrar/>.
Per a vote of the Jabber Council, converted to Standards Track.
(psa)Removed example of including URL in presence stanza.
(psa)Added non-normative section on integration with stream initiation (XEP-0095); added optional sid attribute to jabber:iq:oob schema.
(psa)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)Editorial adjustments and clarifications; added references to relevant RFCs.
(psa)Per a vote of the Jabber Council, changed status to Active.
(psa)Made several small editorial changes; added XML schemas.
(psa)Added information about non-HTTP URIs.
(psa)Initial version.
(psa)END