diff --git a/xep-0247.xml b/xep-0247.xml index 9e8460f7..1790983f 100644 --- a/xep-0247.xml +++ b/xep-0247.xml @@ -26,6 +26,12 @@ &stpeter; &infiniti; &dmeyer; + + 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

+
0.1 2008-06-18 @@ -47,34 +53,37 @@
  • 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 &xep0047; (mediated), &xep0065; (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 reliable 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' &NSNOTE; corresponding to the Jingle XML stream functionalited defined herein, as well as the 'urn:xmpp:tmp:jingle:transports:bytestreams' and 'urn:xmpp:tmp:jingle:transports:ibb' features currently defined in &xep0234;.

    -

    The initiator then sends a Jingle session-initiation request to the responder. The content-type of the request specifies two things:

    +

    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.

    +

    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" &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-0047 or SOCKS5 Bytestreams ("S5B") as defined in XEP-0065.

    4. +
    5. 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;.

    6. +
    7. 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.

    8. +
    9. A security element as defined by Jingle-XTLS.

    -

    In this example, the initiator is <alice@example.org>, the responder is <bob@example.com>, and the initiation request specifies Alice's desired stream parameters along with a transport method of "bytestreams" (i.e., XEP-0065).

    +

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

    The flow is as follows.

    | | ack | |<----------------------------| - | [ SOCKS5 negotiation ] | - |<--------------------------->| | session-accept | |<----------------------------| | ack | |---------------------------->| + | [ SOCKS5 negotiation ] | + |<--------------------------->| + | [ TLS handshake ] | + |<--------------------------->| | [ XML stream ] | - |---------------------------->| + |<--------------------------->| | terminate | |<----------------------------| | ack | @@ -83,55 +92,88 @@ ]]>

    First the initiator sends a Jingle session-initiate.

    - - - + + + + + ]]>

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

    ]]> -

    The initiator then attempts to initiate a SOCKS5 Bytestream with the responder.

    - - - - - +

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

    + + + action='session-accept' + initiator='romeo@montague.lit/orchard' + sid='a73sjjvkla37jfea'> + + + + + + + + + + + JulietX509CertificateHash + + + + + + ]]> -

    If the responder is willing to accept the bytestream, it MUST attempt to open a standard TCP socket on the network address of the StreamHost communicated by the initiator. If the initiator provides more than one StreamHost, the responder SHOULD try to connect to them in the order they occur.

    -

    If the responder 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.

    +

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

    + + ]]> +

    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 the responder has authenticated with the StreamHost, it MUST send an IQ-result to the initiator indicating which StreamHost was used.

    - - - - - - ]]> -

    The responder then sends a Jingle session-accept.

    - 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 initiator acknowledges the Jingle session-accept.

    - The peer immediately acknowledges receipt.

    + ]]> -

    Now the parties start an XML stream over the negotiated bytestream, following the recommendations in &xep0246;.

    +

    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

    + + ]]> +

    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.

    +
    + + +

    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. + + ]]> + + Art thou not Romeo, and a Montague? + + ]]>
    @@ -193,17 +276,13 @@ STATUS = X'00' - -

    In order to secure the e2e XML stream, implementations SHOULD use the standard STARTTLS method defined in XMPP Core but MAY instead use a TLS encrypted port that provides immediate encryption rather than upgrading of the stream via STARTTLS.

    -
    -

    No interaction with &IANA; is required as a result of this document.

    -

    Until this specification advances to a status of Draft, its associated namespaces shall be 'urn:xmpp:tmp:jingle:apps:xmlstream'. 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.

    +

    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.

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

    @@ -224,48 +303,14 @@ STATUS = X'00' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +