XEP-0208: Bootstrapping Implementation of Jingle

This document provides guidelines to XMPP client developers for bootstrapping implementation of Jingle technologies.


WARNING: This Informational document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the best practice or protocol profile described herein is encouraged in exploratory implementations, although production systems should not deploy implementations of this protocol until it advances to a status of Draft.


Document Information

Series: XEP
Number: 0208
Publisher: XMPP Standards Foundation
Status: Experimental
Type: Informational
Version: 0.3
Last Updated: 2007-11-15
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0166
Supersedes: None
Superseded By: None
Short Name: N/A
Source Control: HTML  RSS


Author Information

Peter Saint-Andre

JabberID: stpeter@jabber.org
URI: https://stpeter.im/


Legal Notices

Copyright

This XMPP Extension Protocol is copyright (c) 1999 - 2008 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. In no event shall the XMPP Standards Foundation or the authors of this Specification be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising out of the use or inability to use the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which may be found at <http://xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XSF, P.O. Box 1641, Denver, CO 80201 USA).

Discussion Venue

The preferred venue for discussion of this document is the standards@xmpp.org discussion list:
<http://mail.jabber.org/mailman/listinfo/standards>

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

Relation to XMPP

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.

Conformance Terms

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


Table of Contents


1. Introduction
2. Resource Determination
3. Protocol Flow
4. Security Considerations
5. IANA Considerations
6. XMPP Registrar Considerations
    6.1. Protocol Namespaces
    6.2. Jingle Content Description Formats
7. XML Schema
Notes
Revision History


1. Introduction

Jingle [1] defines a framework for using XMPP to negotiate and manage out-of-band media sessions. Unfortunately, most developers of XMPP clients have limited experience with multimedia applications such as voice and video, making it difficult to get started with implementation of Jingle technologies. Therefore this document provides a simple application format that client developers can use to bootstrap Jingle implementations.

Note: The methods specified herein are provided for experimentation and unit testing only. They are not intended for inclusion in released software or production environments.

2. Resource Determination

In order to initiate a Jingle session, the initiator must determine which of the responder's XMPP resources is best for the desired application format. The following approach may be helpful to implementors:

  1. If the intended responder shares presence with the initiator (see XMPP IM [2]) and has only one available resource, the initiator SHOULD attempt to negotiate a Jingle session with that resource unless the initiator knows via Service Discovery [3] or Entity Capabilities [4] that the resource does not support Jingle and the desired application format. [5]

  2. If the intended responder shares presence with the initiator and has more than one available resource but only one of the resources supports Jingle and the desired application format, the initiator SHOULD initiate the Jingle session with that resource.

  3. If the intended responder shares presence with the initiator and has more than one available resource but more than one of the resources supports Jingle and the desired application format, the initiator SHOULD use Resource Application Priority [6] in order to determine which is the best resource with which to initiate the desired Jingle session.

  4. If the intended responder does not share presence with the initiator, the initiator SHOULD first send a Stanza Session Negotiation [7] request to the responder in order to initiate the exchange of XMPP stanzas. The request SHOULD include a RAP routing hint as specified in XEP-0168 and the <message/> stanza containing the request SHOULD be of type "headline" so that (typically) it is not stored offline for later delivery. The stanza session negotiation SHOULD result in temporary sharing of presence between the parties via the "presence" field as described in XEP-0155.

3. Protocol Flow

The intent of this simple Jingle profile is to enable exchange of data using the Echo Protocol specified in RFC 862 [8], but using a port other than 7 (the default port for this experimental usage is 17777). The protocol flow is as follows. (The following examples use Jingle Raw UDP Transport Method [9] as the transport protocol; although it is possible to complete echo protocol exchanges via TCP, that is deemed less useful and there is no Jingle transport method for direct TCP exchanges.)

Example 1. Initiation

<iq from='romeo@montague.net/orchard'
    id='jingle1'
    to='juliet@capulet.com/balcony'
    type='set'>
  <jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
          action='session-initiate'
          initiator='romeo@montague.net/orchard'
          sid='a73sjjvkla37jfea'>
    <content creator='initiator' name='echo-this'>
      <description xmlns='http://www.xmpp.org/extensions/xep-0208.html#ns'/>
      <transport xmlns='http://www.xmpp.org/extensions/xep-0177.html#ns'>
        <candidate ip='10.1.1.104' port='17777' generation='0'/>
      </transport>
    </content>
  </jingle>
</iq>
  

If none of the errors specified in XEP-0166 occurs, the responder acknowledges the session initiation request.

Example 2. Responder acknowledges session-initiate

<iq from='juliet@capulet.com/balcony'
    id='jingle1'
    to='romeo@montague.net/orchard'
    type='result'/>
  

If no negotiation is required (e.g., to modify the port number or transport method), the responder simply accepts the session. (Alternatively, if the responder wants to use a port other 17777, it SHOULD negotiate the port using a Jingle content-modify action; see XEP-0166 for details and examples.)

Example 3. Responder definitively accepts the session

<iq from='juliet@capulet.com/balcony'
    id='jingle2'
    to='romeo@montague.net/orchard'
    type='set'>
  <jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
          action='session-accept'
          initiator='romeo@montague.net/orchard'
          sid='a73sjjvkla37jfea'/>
</iq>
  

Example 4. Initiating entity acknowledges definitive acceptance

<iq from='romeo@montague.net/orchard'
    id='accept1'
    to='juliet@capulet.com/balcony'
    type='result'/>
  

The parties may now exchange data using the echo protocol in order to test the connection.

4. Security Considerations

As noted, the methods specified herein are provided for experimental use only and are not intended for inclusion in released software or production environments.

On some operating systems, access to the root or administrative user may be necessary in order to use the echo protocol over TCP or UDP port 7; therefore it is RECOMMENDED to use port 17777 instead.

5. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [10].

6. XMPP Registrar Considerations

6.1 Protocol Namespaces

Because this specification defines an experimental protocol that is to be used only for bootstrapping purposes, the XMPP Registrar [11] shall not issue a permanent namespace upon approval of this specification. Therefore, its associated namespace shall always be "http://www.xmpp.org/extensions/xep-0208.html#ns".

6.2 Jingle Content Description Formats

The XMPP Registrar shall include "echo" in its registry of Jingle content description formats. The registry submission is as follows:

<content>
  <name>echo</name>
  <desc>A bootstrapping method for exchanging echo protocol data (see RFC 862).</desc>
  <doc>XEP-0208</doc>
</content>
    

7. XML Schema

<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='http://www.xmpp.org/extensions/xep-0208.html#ns'
    xmlns='http://www.xmpp.org/extensions/xep-0208.html#ns'
    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>
  

Notes

1. XEP-0166: Jingle <http://xmpp.org/extensions/xep-0166.html>.

2. RFC 3921: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <http://tools.ietf.org/html/rfc3921>.

3. XEP-0030: Service Discovery <http://xmpp.org/extensions/xep-0030.html>.

4. XEP-0115: Entity Capabilities <http://xmpp.org/extensions/xep-0115.html>.

5. Naturally, instead of sending service discovery requests to every contact in a user's roster, it is more efficient to use Entity Capabilities, whereby support for Jingle and various Jingle application formats and transport methods is determined for a client version in general (rather than on a per-JID basis) and then cached. Refer to XEP-0115 for details.

6. XEP-0168: Resource Application Priority <http://xmpp.org/extensions/xep-0168.html>.

7. XEP-0155: Stanza Session Negotiation <http://xmpp.org/extensions/xep-0155.html>.

8. RFC 862: Echo Protocol <http://tools.ietf.org/html/rfc0862>.

9. XEP-0177: Jingle Raw UDP Transport Method <http://xmpp.org/extensions/xep-0177.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://xmpp.org/registrar/>.


Revision History

Version 0.3 (2007-11-15)

Editorial review and consistency check.

(psa)

Version 0.2 (2007-05-11)

Specified use of port 17777 as default.

(psa)

Version 0.1 (2007-04-10)

Initial published version.

(psa)

Version 0.0.2 (2007-03-23)

Changed echo namespace to be a content description format only; defined basic direct-tcp transport for bootstrapping purposes only.

(psa)

Version 0.0.1 (2007-02-27)

First draft.

(psa)

END