Abstract: | This specification defines a Jingle transport method that results in sending data via the SOCKS5 Bytestreams (S5B) protocol defined in XEP-0065. Essentially this transport method reuses XEP-0065 semantics for sending the data and defines native Jingle methods for starting and ending an S5B session. |
Authors: | Peter Saint-Andre, Dirk Meyer |
Copyright: | © 1999 - 2009 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Experimental |
Type: | Standards Track |
Version: | 0.2 |
Last Updated: | 2009-03-09 |
WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems should not deploy implementations of this protocol until it advances to a status of Draft.
1. Introduction
2. Protocol
3. Fallback to IBB
4. Processing Rules and Usage Guidelines
5. Determining Support
6. Security Considerations
6.1. Sharing IP Addresses
6.2. Encryption of Media
7. IANA Considerations
8. XMPP Registrar Considerations
8.1. Jingle Transport Methods
9. 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
Jingle [1] defines a framework for negotiating and managing data sessions over XMPP. In order to provide a flexible framework, the base Jingle specification defines neither data transport methods nor application formats, leaving that up to separate specifications. The current document defines a transport method for establishing and managing data exchanges between XMPP entities using the existing SOCKS5 Bytestreams (S5B) protocol specified in SOCKS5 Bytestreams [2]. This "jingle-s5b" method results in a streaming transport method suitable for use in Jingle application types where packet loss cannot be tolerated (e.g., file transfer).
It is RECOMMENDED that a client offers as much <streamhost/> elements with itself as StreamHost as possible. This includes opening the TCP port on all available interfaces the user wants to use (e.g. maybe not an expensive UMTS link), both the IPv4 and IPv6 of that interface (if available), and using an assisting NAT protocol if possible. If the client knows it is behind and the router announces UPnP IGD or NAT-PMP support, the client SHOULD map the open port to the external interface of the router and include the public IP address and port information in the <streamhost/> offers. To increase the chance of success without using a proxy, this specification allows the responder to also send offers.
Romeo Juliet | | | session-initiate | | (with S5B info) | |--------------------------------->| | ack | |<---------------------------------| | session-accept | | (with S5B info) | |<---------------------------------| | ack | |--------------------------------->| | streamhost transport-info | |<---------------------------------| | ack | |--------------------------------->| | streamhost-used transport-info | |--------------------------------->| | ack | |<---------------------------------| | S5B "SESSION" | |<================================>| | session-terminate | |<---------------------------------| | ack | |--------------------------------->| | |
This flow is illustrated in the following examples (to prevent confusion these use a "stub" transport instead of a real application type).
First the initiator sends a Jingle session-initiate request that contains one or more transport candidates, which in jingle-s5b are XEP-0065 streamhosts.
<iq from='romeo@montague.lit/orchard' id='xn28s7gk' to='juliet@capulet.lit/balcony' type='set'> <jingle xmlns='urn:xmpp:jingle:1'> action='session-initiate' 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:s5b:0' sid='vj3hs98y' mode='tcp'> <streamhost jid='romeo@montague.lit/orchard' host='192.168.4.1' port='5086'/> <streamhost jid='streamhostproxy.example.net' host='24.24.24.1' zeroconf='_jabber.bytestreams'/> </transport> </content> </jingle> </iq>
The responder immediately acknowledges receipt.
<iq from='juliet@capulet.lit/balcony' id='xn28s7gk' to='romeo@montague.lit/orchard' type='result'/>
Depending on the application type, a user agent controlled by a human user might need to wait for the user to affirm a desire to proceed with the session before continuing. When the user agent has received such affirmation (or if the user agent can automatically proceed for any reason, e.g. because no human intervention is expected or because a human user has configured the user agent to automatically accept sessions with a given entity), it returns a Jingle session-accept message. This message MUST contain a <transport/> element qualified by the 'urn:xmpp:jingle:transports:s5b:0' namespace, which SHOULD in turn contain one <streamhost/> element for each SOCKS5 Bytestreams candidate generated by or known to the responder, but MAY instead be empty if the responder does not wish to offer any streamhosts or wishes to send each candidate as the payload of a transport-info message.
Note: If the responder sends streamhost candidates, the chances of a successful connection are increased. For example, the initiator might be behind a NAT or might have no access to a proxy, whereas the responder might have a public IP address, might know about a streamhost proxy, or might have NAT penetration support like NAT-PMP in the router.
In the following example, Juliet's client is the StreamHost and opens one port. The provided <streamhost/> elements are the (private) IPv4 address of the interface, a (public) IPv6 address, and the public IPv4 address created by mapping the private IP address/port using NAT-PMP.
<iq from='juliet@capulet.lit/balcony' id='hwd987h' to='romeo@montague.lit/orchard' type='set'> <jingle xmlns='urn:xmpp:jingle:1'> 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:s5b:0' sid='vj3hs98y' mode='tcp'> <streamhost jid='juliet@capulet.lit/balcony' host='192.169.1.10' port='6539'/> <streamhost jid='juliet@capulet.lit/balcony' host='134.102.201.180' port='16453'/> <streamhost jid='juliet@capulet.lit/balcony' host='2001:638:708:30c9:219:d1ff:fea4:a17d' port='6539'/> </transport> </content> </jingle> </iq>
The initiator acknowledges receipt and tries to connect to the offered StreamHosts.
<iq from='romeo@montague.lit/orchard' id='hwd987h' to='juliet@capulet.lit/balcony' type='result'/>
Once one client has successfully created a connection with a StreamHost, it sends the <streamhost-used/> element defined in XEP-0065 to the peer; as a result, both clients will stop trying to connect to other candidates. [3]
<iq from='romeo@montague.lit/orchard' id='hjdi8' to='juliet@capulet.lit/balcony' type='set'> <jingle xmlns='urn:xmpp:jingle:1'> action='transport-info' initiator='romeo@montague.lit/orchard' sid='a73sjjvkla37jfea'> <content creator='initiator' name='stub'> <transport xmlns='urn:xmpp:jingle:transports:s5b:0' sid='vj3hs98y' mode='tcp'> <streamhost-used jid='juliet@capulet.lit/balcony' host='134.102.201.180' port='16453'/> </transport> </content> </jingle> </iq>
The peer immediately acknowledges receipt.
<iq from='juliet@capulet.lit/balcony' id='hjdi8' to='romeo@montague.lit/orchard' type='result'/>
The initiator can then immediately begin sending data over the SOCKS5 bytestream as described in XEP-0065 (in fact the streamhost is bidirectional, so the responder can use it as well).
Once the parties have finished using the bytestream (e.g., because a complete file has been sent), either party can send a Jingle session-terminate action.
<iq from='romeo@montague.lit/orchard' id='hz81vf48' to='juliet@capulet.lit/balcony' type='set'> <jingle xmlns='urn:xmpp:jingle:1' action='session-terminate' initiator='romeo@montague.lit/orchard' sid='a73sjjvkla37jfea'> <reason><success/></reason> </jingle> </iq>
The other party then acknowledges the session-terminate and the Jingle session is finished.
<iq from='juliet@capulet.lit/balcony' id='hz81vf48' to='romeo@montague.lit/orchard' type='result'/>
The session flow is as follows.
Romeo Juliet | | | session-initiate | | (with S5B info) | |--------------------------------->| | ack | |<---------------------------------| | session-accept | | (with S5B info) | |<---------------------------------| | [ SOCKS5 failure! ] | |x--------------------------------x| | transport-replace (IBB) | |--------------------------------->| | ack | |<---------------------------------| | IBB "SESSION" | |=================================>| | terminate | |<---------------------------------| | ack | |--------------------------------->| | |
The protocol flow is as follows.
First the initiator sends a Jingle session-initiate, in this case with a transport of SOCKS5 Bytestreams.
<iq from='romeo@montague.lit/orchard' id='jingle1' to='juliet@capulet.lit/balcony' type='set'> <jingle xmlns='urn:xmpp:jingle:1' action='session-initiate' initiator='romeo@montague.lit/orchard' sid='851ba2'> <content creator='initiator' name='a-file-offer'> <description xmlns='urn:xmpp:jingle:apps:stub:0'/> <transport xmlns='urn:xmpp:jingle:transports:s5b:0' sid='vj3hs98y' mode='tcp'> <streamhost jid='romeo@montague.lit/orchard' host='192.168.4.1' port='5086'/> <streamhost jid='streamer.shakespeare.lit' host='24.24.24.1' zeroconf='_jabber.bytestreams'/> </transport> </content> </jingle> </iq>
The responder acknowledges receipt of the session-initiate and sends a session-accept.
<iq from='juliet@capulet.lit/balcony' id='jingle1' to='romeo@montague.lit/orchard' type='result'/>
<iq from='juliet@capulet.lit/balcony' id='hwd987h' to='romeo@montague.lit/orchard' type='set'> <jingle xmlns='urn:xmpp:jingle:1'> 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:s5b:0' sid='vj3hs98y' mode='tcp'> <streamhost jid='juliet@capulet.lit/balcony' host='192.169.1.10' port='6539'/> <streamhost jid='juliet@capulet.lit/balcony' host='134.102.201.180' port='16453'/> <streamhost jid='juliet@capulet.lit/balcony' host='2001:638:708:30c9:219:d1ff:fea4:a17d' port='6539'/> </transport> </content> </jingle> </iq>
The initiator acknowledges receipt and tries to connect to the offered StreamHosts.
<iq from='romeo@montague.lit/orchard' id='hwd987h' to='juliet@capulet.lit/balcony' type='result'/>
If initiator or responder is unable to connect to any of the StreamHosts, it MUST send a <streamhost-error/> transport-info to the peer.
<iq from='juliet@capulet.lit/balcony' id='jfd75jk' to='romeo@montague.lit/orchard' type='set'> <jingle xmlns='urn:xmpp:jingle:1' action='transport-info' initiator='romeo@montague.lit/orchard' responder='juliet@capulet.lit/balcony' sid='a73sjjvkla37jfea'> <content creator='initiator' name='stub'> <transport xmlns='urn:xmpp:jingle:transports:s5b:0' sid='vj3hs98y' mode='tcp'> <streamhost-error/> </transport> </content> </jingle> </iq>
The peer immediately acknowledges receipt.
<iq from='romeo@montague.lit/orchard' id='jfd75jk' to='juliet@capulet.lit/balcony' type='result'/>
If the initiator receives such an error message from the responder and was also unable to connect to any StreamHosts (or did not receive any from the responder), it MUST either terminate the Jingle session with a Jingle reason of <connectivity-error/> or replace the transport by something else using the transport-replace action. Typically the fallback option is In-Band Bytestreams [4]. Therefore the initiator sends a transport-replace action including a transport of IBB.
<iq from='romeo@montague.lit/orchard' id='hs92n57' to='juliet@capulet.lit/balcony' type='set'> <jingle xmlns='urn:xmpp:jingle:1' action='transport-replace' initiator='romeo@montague.lit/orchard' sid='851ba2'> <content creator='initiator' name='a-file-offer'> <transport xmlns='urn:xmpp:jingle:transports:ibb:0' block-size='4096' sid='ch3d9s71'/> </content> </jingle> </iq>
The responder then acknowledges the transport-replace action.
<iq from='juliet@capulet.lit/balcony' id='hs92n57' to='romeo@montague.lit/orchard' type='result'/>
If the transport replacement is acceptable, the responder then sends a transport-accept action to the initiator (if not, the responder sends a transport-reject action).
<iq from='juliet@capulet.lit/balcony' id='is71ns63' to='romeo@montague.lit/orchard' type='set'> <jingle xmlns='urn:xmpp:jingle:1' action='transport-accept' initiator='romeo@montague.lit/orchard' sid='851ba2'> <content creator='initiator' name='a-file-offer'> <transport xmlns='urn:xmpp:jingle:transports:ibb:0' block-size='4096' sid='ch3d9s71'/> </content> </jingle> </iq>
The initiator acknowledges the Jingle transport-accept action.
<iq from='juliet@capulet.lit/balcony' id='is71ns63' to='romeo@montague.lit/orchard' type='result'/>
Now the initiator sends data using In-Band Bytestreams as defined in XEP-0047.
The same processing rules and usage guidelines defined in XEP-0065 apply to the Jingle S5B Transport Method. Additional implementation suggestions are:
To advertise its support for the Jingle SOCKS5 Bytestreams Transport Method, when replying to Service Discovery [5] information requests an entity MUST return URNs for any version of this protocol that the entity supports -- e.g., "urn:xmpp:jingle:transports:s5b:0" for this version (see Namespace Versioning regarding the possibility of incrementing the version number).
<iq from='romeo@montague.lit/orchard' id='uw72g176' to='juliet@capulet.lit/balcony' type='get'> <query xmlns='http://jabber.org/protocol/disco#info'/> </iq>
<iq from='juliet@capulet.lit/balcony' id='uw72g176' to='romeo@montague.lit/orchard' type='result'> <query xmlns='http://jabber.org/protocol/disco#info'> <feature var='urn:xmpp:jingle:1'/> <feature var='urn:xmpp:jingle:transports:s5b:1'/> </query> </iq>
In order for an application to determine whether an entity supports this protocol, where possible it SHOULD use the dynamic, presence-based profile of service discovery defined in Entity Capabilities [6]. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.
The exchange of StreamHosts might result in exposure of the sender's IP addresses, which comprise a form of personally identifying information. A Jingle client MUST enable a user to control which entities will be allowed to receive such information. If a human user explicitly accepts a session request, then the client SHOULD consider that action to imply approval of IP address sharing. However, waiting for a human user to explicitly accept the session request can result in delays during session setup, since it is more efficient to immediately begin sharing transport candidates. Therefore, it is RECOMMENDED for the client to immediately send transport candidates to a contact (without waiting for explicit user approval of the session request) in the following cases:
A Jingle implementation SHOULD support security preconditions that are enforced before application media is allowed to flow over the bytestream, such as those described in Jingle XTLS [8].
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [9].
The XMPP Registrar [10] shall add to its registry of Jingle transport methods a definition for the "jingle-s5b" transport method. The registry submission is as follows:
<transport> <name>s5b</name> <desc>A method for exchanging data over SOCKS5 Bytestreams.</desc> <type>streaming</type> <doc>XEP-0260</doc> </transport>
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='urn:xmpp:jingle:transports:s5b:0' xmlns='urn:xmpp:jingle:transports:s5b:0' elementFormDefault='qualified'> <xs:element name='transport'> <xs:complexType> <xs:choice> <xs:element ref='streamhost' minOccurs='0' maxOccurs='unbounded'/> </xs:choice> <xs:attribute name='sid' type='xs:string' use='optional'/> <xs:attribute name='mode' use='optional' default='tcp'> <xs:simpleType> <xs:restriction base='xs:NCName'> <xs:enumeration value='tcp'/> <xs:enumeration value='udp'/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> <xs:element name='streamhost'> <xs:complexType> <xs:simpleContent> <xs:extension base='empty'> <xs:attribute name='jid' type='xs:string' use='required'/> <xs:attribute name='host' type='xs:string' use='required'/> <xs:attribute name='zeroconf' type='xs:string' use='optional'/> <xs:attribute name='port' type='xs:string' use='optional'/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name='streamhost-used'> <xs:complexType> <xs:simpleContent> <xs:extension base='empty'> <xs:attribute name='jid' type='xs:string' use='required'/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name='streamhost-error'/> <xs:simpleType name='empty'> <xs:restriction base='xs:string'> <xs:enumeration value=''/> </xs:restriction> </xs:simpleType> </xs:schema>
Series: XEP
Number: 0260
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.2
Last Updated: 2009-03-09
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0030, XEP-0065
Supersedes: None
Superseded By: None
Short Name: jingle-s5b
Source Control:
HTML
RSS
JabberID:
stpeter@jabber.org
URI:
https://stpeter.im/
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.
There exists a special venue for discussion related to the technology described in this document: the <jingle@xmpp.org> mailing list.
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 may 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-0166: Jingle <http://xmpp.org/extensions/xep-0166.html>.
2. XEP-0065: SOCKS5 Bytestreams <http://xmpp.org/extensions/xep-0065.html>.
3. If both clients happen to send the streamhost-used message at the same time (two connections are open), the StreamHost chosen by the initiator wins (consistent with the rules in XEP-0166) and the responder closes the streamhost connection it was able to establish.
4. XEP-0047: In-Band Bytestreams <http://xmpp.org/extensions/xep-0047.html>.
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. RFC 3921: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <http://tools.ietf.org/html/rfc3921>.
8. Extensible Messaging and Presence Protocol (XMPP) End-to-End Encryption Using Transport Layer Security ("XTLS") <http://tools.ietf.org/html/draft-meyer-xmpp-e2e-encryption>.
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/>.
Minor changes to track modifications to XEP-0166; updated security considerations for consistency with other transport methods; added section on service discovery.
(psa)Initial published version.
(psa)Clarified order of events to be consistent with raw-udp and ice-udp.
(psa)Add additional text to use NAT assisting protocols and allow the responder to also send <streamhost/> information. This change required the introduction of streamhost-used and streamhost-error.
(dm)Rough draft.
(psa)END