Abstract: | This specification defines a Jingle application type for establishing direct or mediated XML streams between two entities over any streaming transport. This technology thus enables two entities to establish a trusted connection for end-to-end encryption or for bypassing server limits on large volumes of XMPP traffic. |
Authors: | Peter Saint-Andre, Justin Karneges, Dirk Meyer |
Copyright: | © 1999 - 2010 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Deferred |
Type: | Standards Track |
Version: | 0.2 |
Last Updated: | 2009-02-20 |
WARNING: Consideration of this document has been Deferred by the XMPP Standards Foundation. Implementation of the protocol described herein is not recommended.
1. Introduction
2. Protocol
3. Implementation Notes
3.1. Mandatory to Implement Technologies
3.2. Preference Order of Transport Methods
4. IANA Considerations
5. XMPP Registrar Considerations
5.1. Protocol Namespaces
5.2. Protocol Versioning
5.3. Jingle Application Formats
6. XML Schema
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
The standard client-server architecture for XMPP communication provides a stable infrastructure for real-time communication. However, there are certain situations in which it is desirable to bypass the standard client-server architecture, including:
The first situation is addressed by Link-Local Messaging [1]. However, if the endpoints already have client-to-server connections but wish to bypass those connections or leverage those streams for a higher-level application such as end-to-end encryption, it is desirable for the two endpoints to negotiate an end-to-end XML stream. This specification defines methods for doing so, where the application format is an XML stream and the transport method is any direct or mediated streaming transport, such as Jingle In-Band Bytestreams Transport Method [2] (mediated), Jingle SOCKS5 Bytestreams Transport Method [3] (direct or mediated), or a future ice-tcp Jingle transport (direct or mediated) based on TCP Candidates with Interactive Connectivity Establishment (ICE) [4].
This section provides a friendly introduction to Jingle XML streams.
First, the party that wishes to initiate the stream determines the responder's capabilities (via Service Discovery [5] or Entity Capabilities [6]). Here we assume that the responder supports a service discovery feature of 'urn:xmpp:jingle:apps:xmlstream:0' (see Namespace Versioning regarding the possibility of incrementing the version number) corresponding to the Jingle XML stream functionality defined herein, as well as the 'urn:xmpp:jingle:transports:ibb:0' feature.
The initiator then sends a Jingle session-initiation request to the responder. The content-type of the request specifies three things:
An application type of "urn:xmpp:jingle:apps:xmlstream:0".
Options for the streaming transport method, such as In-Band Bytestreams ("IBB") as defined in XEP-0261 or SOCKS5 Bytestreams ("S5B") as defined in XEP-0260.
Note: It is STRONGLY RECOMMENDED to encrypt all end-to-end XML streams as described in Jingle-XTLS (currently located at <http://xmpp.org/extensions/inbox/jingle-xtls.html>). Those security flows are NOT described here.
In this example, the initiator is <romeo@montague.lit>, the responder is <juliet@capulet.lit>, and the initiation request specifies a transport method of "jingle-ibb" (i.e., XEP-0261).
The flow is as follows.
Romeo Juliet | | | session-initiate | |------------------------------>| | ack | |<------------------------------| | session-accept | |<------------------------------| | ack | |------------------------------>| | [ XML stream over IBB ] | |<----------------------------->| | terminate | |<------------------------------| | ack | |------------------------------>| | |
First the initiator sends a Jingle session-initiate.
<iq from='romeo@montague.lit/orchard' id='ty1bf726' to='juliet@capulet.lit/balcony' type='set'> <jingle xmlns='urn:xmpp:jingle:0' action='session-initiate' initiator='romeo@montague.lit/orchard' sid='851ba2'> <content creator='initiator' name='xmlstream'> <description xmlns='urn:xmpp:jingle:apps:xmlstream:0'/> <transport xmlns='urn:xmpp:jingle:transports:ibb:0' block-size='4096' sid='vj3hs98y'/> </content> </jingle> </iq>
The responder immediately acknowledges receipt of the Jingle session-initiate.
<iq from='juliet@capulet.lit/balcony' id='ty1bf726' to='romeo@montague.lit/orchard' type='result'/>
If the responding user accepts the session then her client sends a session-accept.
<iq from='juliet@capulet.lit/balcony' id='hwd987h' to='romeo@montague.lit/orchard' type='set'> <jingle xmlns='urn:xmpp:jingle:0'> action='session-accept' initiator='romeo@montague.lit/orchard' sid='a73sjjvkla37jfea'> <content creator='initiator' name='stub'> <description xmlns='urn:xmpp:jingle:apps:stub:0'/> <transport xmlns='urn:xmpp:jingle:transports:ibb:0' block-size='4096' sid='vj3hs98y'/> </content> </jingle> </iq>
The initiator acknowledges receipt.
<iq from='romeo@montague.lit/orchard' id='hwd987h' to='juliet@capulet.lit/balcony' type='result'/>
The clients can then begin to exchange XMPP data over the in-band bytestream. Because the transport is an in-band bytestream, the XMPP data is prepared as described in In-Band Bytestreams [7] (i.e., Base64-encoded).
First the initiator sends an initial stream header to the responder.
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='romeo@montague.lit/orchard' to='juliet@capulet.lit/balcony' version='1.0'>
Note: In accordance with rfc3921bis [8], the initial stream header SHOULD include the 'to' and 'from' attributes, which SHOULD specify the full JIDs of the clients. If the initiator supports stream features and the other stream-related aspects of XMPP 1.0 as specified in RFC 3920, then it SHOULD include the version='1.0' flag as shown in the previous example.
<iq from='romeo@montague.net/orchard' id='ur73n153' to='juliet@capulet.com/balcony' type='set'> <data xmlns='http://jabber.org/protocol/ibb' seq='0' sid='vj3hs98y'> PHN0cmVhbTpzdHJlYW0geG1sbnM9J2phYmJlcjpjbGllbnQnIHhtbG5zOnN0cmVh bT0naHR0cDovL2V0aGVyeC5qYWJiZXIub3JnL3N0cmVhbXMnIGZyb209J3JvbWVv QG1vbnRhZ3VlLmxpdC9vcmNoYXJkJyB0bz0nanVsaWV0QGNhcHVsZXQubGl0L2Jh bGNvbnknIHZlcnNpb249JzEuMCc+ </data> </iq> <iq from='juliet@capulet.com/balcony' id='ur73n153' to='romeo@montague.net/orchard' type='result'/>
The responder then sends a response stream header back to the initiator (because this stream header is sent in the other direction, the IBB 'seq' attribute has a value of zero, not 1).
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' from='juliet@capulet.lit/balcony' id='hs91gh1836d8s717' to='romeo@montague.lit/orchard' version='1.0'>
<iq from='juliet@capulet.com/balcony' id='pd61g397' to='romeo@montague.net/orchard' type='set'> <data xmlns='http://jabber.org/protocol/ibb' seq='1' sid='vj3hs98y'> PHN0cmVhbTpzdHJlYW0geG1sbnM9J2phYmJlcjpjbGllbnQnIHhtbG5zOnN0cmVh bT0naHR0cDovL2V0aGVyeC5qYWJiZXIub3JnL3N0cmVhbXMnIGZyb209J2p1bGll dEBjYXB1bGV0LmxpdC9iYWxjb255JyBpZD0naHM5MWdoMTgzNmQ4czcxNycgdG89 J3JvbWVvQG1vbnRhZ3VlLmxpdC9vcmNoYXJkJyB2ZXJzaW9uPScxLjAnPg== </data> </iq> <iq from='romeo@montague.net/orchard' id='pd61g397' to='juliet@capulet.com/balcony' type='result'/>
Once the streams are established, either entity then can send XMPP message, presence, and IQ stanzas, with or without 'to' and 'from' addresses.
<message from='romeo@montague.lit/orchard' to='juliet@capulet.lit/balcony'> <body>M'lady, I would be pleased to make your acquaintance.</body> </message>
<iq from='romeo@montague.net/orchard' id='iq7dh294' to='juliet@capulet.com/balcony' type='set'> <data xmlns='http://jabber.org/protocol/ibb' seq='1' sid='vj3hs98y'> PG1lc3NhZ2UgZnJvbT0ncm9tZW9AbW9udGFndWUubGl0L29yY2hhcmQnIHRvPSdq dWxpZXRAY2FwdWxldC5saXQvYmFsY29ueSc+PGJvZHk+TSZhcG9zO2xhZHksIEkg d291bGQgYmUgcGxlYXNlZCB0byBtYWtlIHlvdXIgYWNxdWFpbnRhbmNlLjwvYm9k eT48L21lc3NhZ2U+ </data> </iq> <iq from='juliet@capulet.com/balcony' id='iq7dh294' to='romeo@montague.net/orchard' type='result'/>
The responder could then send a reply.
<message from='juliet@capulet.lit/balcony' to='romeo@montague.lit/orchard'> <body>Art thou not Romeo, and a Montague?</body> </message>
<iq from='juliet@capulet.com/balcony' id='hr91hd63' to='romeo@montague.net/orchard' type='set'> <data xmlns='http://jabber.org/protocol/ibb' seq='1' sid='vj3hs98y'> PG1lc3NhZ2UgZnJvbT0nanVsaWV0QGNhcHVsZXQubGl0L2JhbGNvbnknIHRvPSdy b21lb0Btb250YWd1ZS5saXQvb3JjaGFyZCc+PGJvZHk+QXJ0IHRob3Ugbm90IFJv bWVvLCBhbmQgYSBNb250YWd1ZT88L2JvZHk+PC9tZXNzYWdlPg== </data> </iq> <iq from='romeo@montague.net/orchard' id='kr91n475' to='juliet@capulet.com/balcony' type='result'/>
To end the XML stream, either party sends a closing </stream:stream> element.
</stream:stream>
<iq from='juliet@capulet.com/balcony' id='kr91n475' to='romeo@montague.net/orchard' type='set'> <data xmlns='http://jabber.org/protocol/ibb' seq='2' sid='vj3hs98y'> PC9zdHJlYW06c3RyZWFtPg== </data> </iq> <iq from='romeo@montague.net/orchard' id='kr91n475' to='juliet@capulet.com/balcony' type='result'/>
However, even after the application-level XML stream is terminated, the negotiated Jingle transport (here in-band bytestream) continues and could be re-used. To completely terminate the Jingle session, the terminating party would then also send a Jingle session-terminate message.
<iq from='juliet@capulet.lit/balcony' id='psy617r4' to='romeo@montague.lit/orchard' type='set'> <jingle xmlns='urn:xmpp:jingle:0' action='session-terminate' initiator='romeo@montague.lit/orchard' sid='851ba2'/> </iq>
The other party then acknowledges the Jingle session-terminate.
<iq from='romeo@montague.lit/orchard' id='psy617r4' to='juliet@capulet.lit/balcony' type='result'/>
An implementations MUST support the Jingle IBB Transport Method (XEP-0261) as a dependable method of last resort. An implementation SHOULD support other streaming transport methods as well, such as the Jingle S5B Transport Method (XEP-0260).
An application MAY present transport methods in any order, except that the Jingle IBB Transport Method MUST be the lowest preference.
No interaction with the Internet Assigned Numbers Authority (IANA) [9] is required as a result of this document.
This specification defines the following XML namespace:
Upon advancement of this specification from a status of Experimental to a status of Draft, the XMPP Registrar [10] shall add the foregoing namespaces to the registry located at <http://xmpp.org/registrar/namespaces.html>, as described in Section 4 of XMPP Registrar Function [11].
If the protocol defined in this specification undergoes a revision that is not fully backwards-compatible with an older version, the XMPP Registrar shall increment the protocol version number found at the end of the XML namespaces defined herein, as described in Section 4 of XEP-0053.
The XMPP Registrar shall include "xmlstream" in its registry of Jingle application formats. The registry submission is as follows:
<application> <name>xmlstream</name> <desc>Jingle sessions for an end-to-end XML stream</desc> <transport>streaming</transport> <doc>XEP-0247</doc> </application>
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='urn:xmpp:jingle:apps:xmlstream:0' xmlns='urn:xmpp:jingle:apps:xmlstream:0' elementFormDefault='qualified'> <xs:element name='description' type='empty'/> <xs:simpleType name='empty'> <xs:restriction base='xs:string'> <xs:enumeration value=''/> </xs:restriction> </xs:simpleType> </xs:schema>
Series: XEP
Number: 0247
Publisher: XMPP Standards Foundation
Status:
Deferred
Type:
Standards Track
Version: 0.2
Last Updated: 2009-02-20
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0047, XEP-0065, XEP-0166, XEP-0246
Supersedes: None
Superseded By: None
Short Name: NOT_YET_ASSIGNED
Source Control:
HTML
RSS
Email:
stpeter@jabber.org
JabberID:
stpeter@jabber.org
URI:
https://stpeter.im/
Email:
justin@affinix.com
JabberID:
justin@andbit.net
Email:
dmeyer@tzi.de
JabberID:
dmeyer@jabber.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 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>.
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".
1. XEP-0174: Link-Local Messaging <http://xmpp.org/extensions/xep-0174.html>.
2. XEP-0261: Jingle In-Band Bytestreams Transport Method <http://xmpp.org/extensions/xep-0261.html>.
3. XEP-0260: Jingle SOCKS5 Bytestreams Transport Method <http://xmpp.org/extensions/xep-0260.html>.
4. TCP Candidates with Interactive Connectivity Establishment (ICE) <http://tools.ietf.org/html/draft-ietf-mmusic-ice-tcp>. Work in progress.
5. XEP-0030: Service Discovery <http://xmpp.org/extensions/xep-0030.html>.
6. XEP-0115: Entity Capabilities <http://xmpp.org/extensions/xep-0115.html>.
7. XEP-0047: In-Band Bytestreams <http://xmpp.org/extensions/xep-0047.html>.
8. rfc3921bis: proposed revisions to Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <http://tools.ietf.org/html/draft-ietf-xmpp-3921bis>. (work in progress)
9. 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/>.
10. 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://xmpp.org/registrar/>.
11. XEP-0053: XMPP Registrar Function <http://xmpp.org/extensions/xep-0053.html>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Adjusted text and examples to reflect Jingle-XTLS, Jingle-IBB, and Jingle-S5B; moved stream security to Jingle-XTLS; moved basic stream setup from XEP-0246 to this document; changed examples to use Jingle-IBB as the transport; clarified stream opening and closing as well as session termination.
(dm/psa)Initial published version.
(psa)END