diff --git a/xep-0247.xml b/xep-0247.xml index 1790983f..593a7c26 100644 --- a/xep-0247.xml +++ b/xep-0247.xml @@ -7,7 +7,7 @@
Jingle XML Streams - This specification defines a Jingle application type for establishing direct or mediated XML streams between two entities over any reliable 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. + 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. &LEGALNOTICE; 0247 Experimental @@ -29,8 +29,8 @@ 0.2 2009-02-20 - dm -

Adjust to Jingle-XTLS, Jingle-S5B, and Jingle-IBB. The basic stream setup from XEP-0246 is now included in the document

+ dm/psa +

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.

0.1 @@ -53,47 +53,43 @@
  • Two endpoints want to enforce end-to-end encryption
  • Two endpoints want to send a high volume of XMPP traffic but the intermediate servers enforce rate limits
  • -

    The first situation is addressed by &xep0174;. 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 reliable transport, such as &xep0261; (mediated), &xep0260; (direct or mediated), or a future ice-tcp Jingle transport (direct or mediated) based on &ice-tcp;.

    +

    The first situation is addressed by &xep0174;. 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 &xep0261; (mediated), &xep0260; (direct or mediated), or a future ice-tcp Jingle transport (direct or mediated) based on &ice-tcp;.

    - +

    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 &xep0030; or &xep0115;). Here we assume that the responder supports a service discovery feature of 'urn:xmpp:tmp:jingle:apps:xmlstream:0' &NSNOTE; corresponding to the Jingle XML stream functionalited defined herein, as well as the 'urn:xmpp:jingle:transports:s5b:0' and 'urn:xmpp:jingle:transports:ibb:0' features.

    +

    First, the party that wishes to initiate the stream determines the responder's capabilities (via &xep0030; or &xep0115;). Here we assume that the responder supports a service discovery feature of 'urn:xmpp:jingle:apps:xmlstream:0' &VNOTE; 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:

      -
    1. An application type of "urn:xmpp:tmp:jingle:apps:xmlstream:0" &NSNOTE;, where the <description/> element specifies parameters for the XML stream and the parameters map to those provided in &xep0155; in a way that is consistent with &xep0116;.

    2. -
    3. Options for the reliable transport method, such as In-Band Bytestreams ("IBB") as defined in XEP-0261 or SOCKS5 Bytestreams ("S5B") as defined in XEP-0260.

    4. -
    5. A security element as defined by Jingle-XTLS.

    6. +
    7. An application type of "urn:xmpp:jingle:apps:xmlstream:0".

    8. +
    9. 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.

    -

    In this example, the initiator is <romeo@montague.lit>, the responder is <juliet@capulet.lit>, and the initiation request specifies Alice's desired stream parameters along with a transport method of "s5b" (i.e., 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.

    | - | ack | - |<----------------------------| - | session-accept | - |<----------------------------| - | ack | - |---------------------------->| - | [ SOCKS5 negotiation ] | - |<--------------------------->| - | [ TLS handshake ] | - |<--------------------------->| - | [ XML stream ] | - |<--------------------------->| - | terminate | - |<----------------------------| - | ack | - |---------------------------->| - | | + Romeo Juliet + | | + | session-initiate | + |------------------------------>| + | ack | + |<------------------------------| + | session-accept | + |<------------------------------| + | ack | + |------------------------------>| + | [ XML stream over IBB ] | + |<----------------------------->| + | terminate | + |<------------------------------| + | ack | + |------------------------------>| + | | ]]>

    First the initiator sends a Jingle session-initiate.

    - - - - - + + @@ -121,12 +108,12 @@

    The responder immediately acknowledges receipt of the Jingle session-initiate.

    ]]> -

    If the user accepts the session the responder sends a session-accept.

    - If the responding user accepts the session then her client sends a session-accept.

    + - - - - - - - - JulietX509CertificateHash - - - - + block-size='4096' + sid='vj3hs98y'/> ]]> -

    The initiator acknowledges receipt and tries to connect to the offered StreamHosts.

    +

    The initiator acknowledges receipt.

    ]]> -

    The clients MUST attempt to open a standard TCP socket on the network address of the StreamHost communicated by the peer. If more than one StreamHost was provided, the client SHOULD try to connect to them in the order they occur.

    -

    If the client is able to open a TCP socket on a StreamHost, it MUST utilize the SOCKS5 protocol specified in &rfc1928; to establish the connection with the StreamHost.

    - - -

    After one client has authenticated with the StreamHost, it MUST send a Jingle transport-info to the initiator indicating which StreamHost was used.

    - - - action='transport-info' - initiator='romeo@montague.lit/orchard' - sid='a73sjjvkla37jfea'> - - - - - - - - ]]> -

    The peer immediately acknowledges receipt.

    - - ]]> -

    Parallel to the SOCKS5 transport setup the initiator signals the TLS method to be used to the responder.

    - - - action='security-info' - initiator='romeo@montague.lit/orchard' - sid='a73sjjvkla37jfea'> - - - - - - ]]> -

    The responder acknowledges the receipt

    - - ]]> -

    After the transport stream is ready and the initiator received the acknowledment from the security-info it starts the four-way TLS handshake on the transport stream.

    -
    - - -

    If the TLS handshake is complete both clients send an initial <stream/> element to open a client-to-client stream

    - 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 &xep0047; (i.e., Base64-encoded).

    +

    First the initiator sends an initial stream header to the responder.

    + ]]> -

    In accordance with &rfc3921bis;, the initial stream header SHOULD include the 'to' and 'from' attributes. This should be the full JID 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.

    -
    +

    Note: In accordance with &rfc3921bis;, 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.

    + + + PHN0cmVhbTpzdHJlYW0geG1sbnM9J2phYmJlcjpjbGllbnQnIHhtbG5zOnN0cmVh + bT0naHR0cDovL2V0aGVyeC5qYWJiZXIub3JnL3N0cmVhbXMnIGZyb209J3JvbWVv + QG1vbnRhZ3VlLmxpdC9vcmNoYXJkJyB0bz0nanVsaWV0QGNhcHVsZXQubGl0L2Jh + bGNvbnknIHZlcnNpb249JzEuMCc+ + + - + + ]]> +

    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).

    + + ]]> + + + PHN0cmVhbTpzdHJlYW0geG1sbnM9J2phYmJlcjpjbGllbnQnIHhtbG5zOnN0cmVh + bT0naHR0cDovL2V0aGVyeC5qYWJiZXIub3JnL3N0cmVhbXMnIGZyb209J2p1bGll + dEBjYXB1bGV0LmxpdC9iYWxjb255JyBpZD0naHM5MWdoMTgzNmQ4czcxNycgdG89 + J3JvbWVvQG1vbnRhZ3VlLmxpdC9vcmNoYXJkJyB2ZXJzaW9uPScxLjAnPg== + + + + + ]]>

    Once the streams are established, either entity then can send XMPP message, presence, and IQ stanzas, with or without 'to' and 'from' addresses.

    - - M'lady, I would be pleased to make your acquaintance. + M'lady, I would be pleased to make your acquaintance. ]]> - + + PG1lc3NhZ2UgZnJvbT0ncm9tZW9AbW9udGFndWUubGl0L29yY2hhcmQnIHRvPSdq + dWxpZXRAY2FwdWxldC5saXQvYmFsY29ueSc+PGJvZHk+TSZhcG9zO2xhZHksIEkg + d291bGQgYmUgcGxlYXNlZCB0byBtYWtlIHlvdXIgYWNxdWFpbnRhbmNlLjwvYm9k + eT48L21lc3NhZ2U+ + + + + + ]]> +

    The responder could then send a reply.

    + Art thou not Romeo, and a Montague? ]]> + + + PG1lc3NhZ2UgZnJvbT0nanVsaWV0QGNhcHVsZXQubGl0L2JhbGNvbnknIHRvPSdy + b21lb0Btb250YWd1ZS5saXQvb3JjaGFyZCc+PGJvZHk+QXJ0IHRob3Ugbm90IFJv + bWVvLCBhbmQgYSBNb250YWd1ZT88L2JvZHk+PC9tZXNzYWdlPg== + + + + + ]]> +

    To end the XML stream, either party sends a closing </stream:stream> element.

    + + ]]> + + + PC9zdHJlYW06c3RyZWFtPg== + + + + + ]]> +

    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.

    + + + + ]]> +

    The other party then acknowledges the Jingle session-terminate.

    + + ]]>
    -

    All implementations MUST support the In-Band Bytestreams transport method as a reliable method of last resort. An implementation SHOULD support other transport methods as well.

    +

    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 In-Band Bytestreams method MUST be the lowest preference.

    +

    An application MAY present transport methods in any order, except that the Jingle IBB Transport Method MUST be the lowest preference.

    @@ -281,8 +296,15 @@ STATUS = X'00' - -

    Until this specification advances to a status of Draft, its associated namespaces shall be 'urn:xmpp:tmp:jingle:apps:xmlstream:0'. Upon advancement of this specification, the ®ISTRAR; shall issue a permanent namespace in accordance with the process defined in Section 4 of &xep0053;. The namespace 'urn:xmpp:jingle:apps:xmlstream' is requested and is thought to be unique per the XMPP Registrar's requirements.

    + +

    This specification defines the following XML namespace:

    +
      +
    • urn:xmpp:jingle:apps:xmlstream:0
    • +
    +

    Upon advancement of this specification from a status of Experimental to a status of Draft, the ®ISTRAR; shall add the foregoing namespaces to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.

    +
    + + &NSVER;

    The XMPP Registrar shall include "xmlstream" in its registry of Jingle application formats. The registry submission is as follows:

    @@ -290,8 +312,8 @@ STATUS = X'00' xmlstream Jingle sessions for an end-to-end XML stream - reliable - XEP-xxxx + streaming + XEP-0247 ]]>
    @@ -303,17 +325,17 @@ STATUS = X'00' - - - - - - - + + + + + + + ]]>