XEP-0177: Jingle Raw UDP Transport

This document defines a Jingle transport method that results in sending data over a raw User Datagram Protocol (UDP) connection.


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.


Document Information

Series: XEP
Number: 0177
Publisher: XMPP Standards Foundation
Status: Experimental
Type: Standards Track
Version: 0.5
Last Updated: 2007-03-23
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0166
Supersedes: None
Superseded By: None
Short Name: TO BE ASSIGNED
Wiki Page: <http://wiki.jabber.org/index.php/Jingle Raw UDP Transport (XEP-0177)>

Author Information

Joe Beda

Email: jbeda@google.com
JabberID: jbeda@google.com

Peter Saint-Andre

Email: stpeter@jabber.org
JabberID: stpeter@jabber.org

Scott Ludwig

Email: scottlu@google.com
JabberID: scottlu@google.com

Joe Hildebrand

Email: jhildebrand@jabber.com
JabberID: hildjj@jabber.org

Sean Egan

Email: seanegan@google.com
JabberID: seanegan@google.com

Legal Notice

This XMPP Extension Protocol is copyright 1999 - 2007 by the XMPP Standards Foundation (XSF) and is in full conformance with the XSF's Intellectual Property Rights Policy <http://www.xmpp.org/extensions/ipr-policy.shtml>. This material may be distributed only subject to the terms and conditions set forth in the Creative Commons Attribution License (<http://creativecommons.org/licenses/by/2.5/>).

Discussion Venue

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

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. Requirements
3. Protocol Description
    3.1. Transport Initiation
    3.2. Responder Response
       3.2.1. Checking the Initiator's Candidate
       3.2.2. Sending A Candidate
       3.2.3. Sending An Informational Message
    3.3. Informational Messages
4. Security Considerations
5. IANA Considerations
6. XMPP Registrar Considerations
    6.1. Protocol Namespaces
    6.2. Jingle Transport Methods
7. XML Schema
Notes
Revision History


1. Introduction

Jingle [1] defines a framework for negotiating and managing out-of-band data sessions over XMPP. In order to provide a flexible framework, the base Jingle specification defines neither data transport methods nor content formats, leaving that up to separate specifications. The current document defines a transport method for establishing and managing data between XMPP entities using a raw User Datagram Protocol (UDP) connection (see RFC 768 [2]).

2. Requirements

The Jingle transport method defined herein is designed to meet the following requirements:

  1. Make it possible to establish and manage out-of-band connections between two XMPP entities over the IP address and port that the parties consider most likely to succeed.
  2. Make it relatively easy to implement support in standard Jabber/XMPP clients.
  3. Where communication with non-XMPP entities is needed, push as much complexity as possible onto server-side gateways between the XMPP network and the non-XMPP network.

Note: The Raw UDP transport does not provide traversal of Network Address Translators (NATs) and is provided only for the purpose of specifying the IP address and port that an entity considers most likely to succeed without the need for NAT traversal. [3] If NAT traversal is needed, Jingle ICE Transport Method [4] SHOULD be used.

3. Protocol Description

3.1 Transport Initiation

In order for the initiator in a Jingle exchange to start the negotiation, it MUST send a Jingle "session-initiate" stanza as described in XEP-0166. This stanza MUST include at least one content type. If the initiator wishes to negotiate the Raw UDP transport for a given content type, it MUST include a <transport/> child element qualified by the 'http://www.xmpp.org/extensions/xep-0177.html#ns' namespace (see Protocol Namespaces), which MUST [5] include the initiator's Raw UDP candidate via the 'ip', 'port', 'generation', and 'name' attributes of the <candidate/> element.

Example 1. Initiation Example

<iq from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony' id='jingle1' 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='this-is-the-audio-content'>
      <description ...>
      <transport xmlns='http://www.xmpp.org/extensions/xep-0177.html#ns'>
        <candidate ip='10.1.1.104' port='13540' generation='0'/>
      </transport>
    </content>
  </jingle>
</iq>
    

The 'generation', 'ip', and 'port' attributes are REQUIRED. The 'ip' and 'port' attributes are self-explanatory. The 'generation' attribute provides a tracking mechanism for determining which version of this candidate is in force (this is useful if the candidate is redefined mid-stream, for example if the port is changed).

Note: The "Raw UDP candidate" is the candidate that the entity has reason to believe will be most likely to succeed for that content type, and thus is equivalent to the "in-use" candidate as described in Interactive Connectivity Establishment (ICE) [6]. [7] This is not necessarily the entity's preferred address for communication, but instead is the "address most likely to succeed", i.e., the address that is assumed to be reachable by the vast majority of target entities. To determine reachability, the client needs classify ahead of time the permissiveness of the NAT or firewall it is behind, if any. It then SHOULD assign the Raw UDP candidate as follows, where the candidate types are as described in ICE:

Table 1: Raw UDP Candidate Assignment

NAT Type Recommended Raw UDP Candidate Type
None Host candidate
Symmetric (not permissive) Relay candidate
Permissive Server reflexive or peer reflexive candidate discovered via RFC 3489 [8]

3.2 Responder Response

As described in XEP-0166, to provisionally accept the session initiation request, the receiver returns an IQ-result:

Example 2. Responder Provisionally Accepts the Session Request

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

Once the responder provisionally accepts the session, it:

These are done simultaneously in order to ensure that a connection can be made, since the initiator's Raw UDP candidate may not result in success.

3.2.1 Checking the Initiator's Candidate

The responder MUST immediately attempt to send data to the IP and port specified in the initiation request. Because delivery of UDP data is not necessarily acknowledged, the data can be sent using RFC 862 [9]; if the data is echoed back, the recipient would then send a Jingle "content-accept" (or "session-accept") action to the initiator.

Example 3. Responder Returns Transport-Accept

<iq from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' type='set' id='accept1'>
  <jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
          action='content-accept'
          initiator='romeo@montague.net/orchard'
          sid='a73sjjvkla37jfea'>
    <content creator='initiator' name='this-is-the-audio-content'>
      <transport xmlns='http://www.xmpp.org/extensions/xep-0177.html#ns'>
        <candidate name='myvoicedata' ip='10.1.1.104' port='13540' generation='0'/>
      </transport>
    </content>
  </jingle>
</iq>
      

The initiator MUST then acknowledge acceptance by returning an IQ result (or a standard XMPP error).

Example 4. Initiator Acknowledges Transport Accept

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

3.2.2 Sending A Candidate

While checking the initiator's Raw UDP candidate, the responder SHOULD send its own Raw UDP candidate to the initiator by sending a transport-info message to the initiator, as shown in the following example.

Example 5. Responder Sends Its Raw UDP Candidate

<iq from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='jingle2' type='set'>
  <jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
          action='transport-info'
          initiator='romeo@montague.net/orchard'
          sid='a73sjjvkla37jfea'>
    <content creator='initiator' name='this-is-the-audio-content'>
      <transport xmlns='http://www.xmpp.org/extensions/xep-0177.html#ns'>
        <candidate ip='208.245.212.67' port='9876' generation='0'/>
      </transport>
    </content>
  </jingle>
</iq>
      

The initiator MUST then acknowledge receipt by returning an IQ result (or a standard XMPP error).

Example 6. Initiator Acknowledges Receipt of Candidate

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

Naturally, the initiator then MUST also check the responder's Raw UDP candidate by following the checking procedure outlined above.

3.2.3 Sending An Informational Message

While checking the initiator's Raw UDP candidate, the responder MAY send an informational message to communicate the status of transport checking. The informational message MUST be an IQ-set containing a <jingle/> element of type "session-info", where the informational message is a payload element specified in the Informational Messages section of this document.

3.3 Informational Messages

Informational messages MAY be sent by the receiver within the context of the Raw UDP transport to communicate the status of transport checking. The informational message MUST be an IQ-set containing a <jingle/> element of type "session-info", where the informational message is a payload element qualified by the 'http://www.xmpp.org/extensions/xep-0177.html#ns-info' namespace (see Protocol Namespaces). The following payload elements are defined:

Table 2: Information Payload Elements

Element Meaning
<failed/> Connectivity checks failed.
<succeeded/> Connectivity checks succeeded.
<trying/> Connectivity checks are underway.

Note: Because the informational message is sent in an IQ-set, the receiving party MUST return either an IQ-result or an IQ-error (normally only an IQ-result to acknowledge receipt; no error flows are defined or envisioned at this time).

4. Security Considerations

In order to secure the data stream that is negotiated via the Jingle ICE transport, implementations SHOULD use encryption methods appropriate to the transport method and media being exchanged (for details regarding audio and video exchanges via RTP, refer to XEP-0167 and XEP-0180).

5. IANA Considerations

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

6. XMPP Registrar Considerations

6.1 Protocol Namespaces

Until this specification advances to a status of Draft, its associated namespaces shall be "http://www.xmpp.org/extensions/xep-0177.html#ns" and "http://www.xmpp.org/extensions/xep-0177.html#ns-info"; upon advancement of this specification, the XMPP Registrar [11] shall issue permanent namespaces in accordance with the process defined in Section 4 of XMPP Registrar Function [12].

6.2 Jingle Transport Methods

The XMPP Registrar shall include "raw-udp" in its registry of Jingle transport methods. The registry submission is as follows:

<transport>
  <name>raw-udp</name>
  <desc>A method for exchanging data over a raw UDP connection.</desc>
  <doc>XEP-0176</doc>
</transport>
    

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-0177.html#ns'
    xmlns='http://www.xmpp.org/extensions/xep-0177.html#ns'
    elementFormDefault='qualified'>

  <xs:element name='transport'>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref='candidate' minOccurs='0' maxOccurs='1'/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name='candidate'>
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base='empty'>
          <xs:attribute name='generation' type='xs:unsignedByte' use='required'/>
          <xs:attribute name='ip' type='xs:string' use='required'/>
          <xs:attribute name='port' type='xs:unsignedShort' use='required'/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

  <xs:simpleType name='empty'>
    <xs:restriction base='xs:string'>
      <xs:enumeration value=''/>
    </xs:restriction>
  </xs:simpleType>

</xs:schema>
  

Notes

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

2. RFC 768: User Datagram Protocol <http://tools.ietf.org/html/rfc0768>.

3. This is also helpful for bootstrapping of Jingle implementation by developers working on a local network.

4. XEP-0176: Jingle ICE Transport Method <http://www.xmpp.org/extensions/xep-0176.html>.

5. This is required to avoid a round trip and help expedite the negotiation.

6. Interactive Connectivity Establishment (ICE): A Methodology for Network Address Translator (NAT) Traversal for Offer/Answer Protocols <http://www.ietf.org/internet-drafts/draft-ietf-mmusic-ice-14.txt>. Work in progress.

7. In older versions of XEP-0166, this was referrred to as the "default candidate".

8. RFC 3489: STUN - Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs) <http://tools.ietf.org/html/rfc3489>.

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

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://www.xmpp.org/registrar/>.

12. XEP-0053: XMPP Registrar Function <http://www.xmpp.org/extensions/xep-0053.html>.


Revision History

Version 0.5 (2007-03-23)

Updated to reflect changes to XEP-0166; clarified media data checking.

(psa)

Version 0.4 (2006-12-21)

Recommended sending of candidate in initiation request to save a round trip and expedite the negotiation; removed name attribute; clarified flow of negotiation; modified spec to use provisional namespace before advancement to Draft (per XEP-0053).

(psa)

Version 0.3 (2006-10-31)

Added informational messages; clarified connectivity checks and acceptance process; mentioned that the Raw UDP candidate is conceptually equivalent to the concept of an in-use candidate from the ICE specification; added reference to RFC 4347.

(psa)

Version 0.2 (2006-07-12)

Removed candidate element and specified exchange of address information via transport-info messages; clarified usage of name attribute.

(se/psa)

Version 0.1 (2006-03-01)

Initial version (split from XEP-0166).

(psa/jb)

END