XEP-0177: Jingle Raw UDP Transport Method

This specification defines a Jingle transport method that results in sending media data using raw datagram sockets via the User Datagram Protocol (UDP). This simple transport method does not provide NAT traversal, and the ICE-UDP transport method should be used if NAT traversal is required.


NOTICE: This document is currently within Last Call or under consideration by the XMPP Council for advancement to the next stage in the XSF standards process.


Document Information

Series: XEP
Number: 0177
Publisher: XMPP Standards Foundation
Status: Proposed
Type: Standards Track
Version: 0.13
Last Updated: 2008-12-07
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0166
Supersedes: None
Superseded By: None
Short Name: NOT_YET_ASSIGNED
Source Control: HTML  RSS


Author Information

Joe Beda

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

Peter Saint-Andre

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

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 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. Requirements
3. Jingle Conformance
4. Protocol Description
    4.1. Flow
    4.2. Transport Initiation
    4.3. Responder Response
       4.3.1. Sending Media
       4.3.2. Sending a Trying Message
       4.3.3. Sending a Candidate
    4.4. Informational Messages
5. Determining Support
6. Security Considerations
7. IANA Considerations
8. XMPP Registrar Considerations
    8.1. Protocol Namespaces
    8.2. Protocol Versioning
    8.3. Jingle Transport Methods
9. XML Schema
    9.1. Transport
    9.2. Informational Messages
10. Acknowledgements
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 application 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]). This "raw-udp" method results in a datagram transport method suitable for use in media applications where some packet loss is tolerable (e.g., audio and video).

Note: The Raw UDP transport does not provide end-to-end traversal of Network Address Translators (NATs); if NAT traversal is needed, Jingle clients SHOULD use Interactive Connectivity Establishment (ICE) [3] as described in Jingle ICE-UDP Transport Method [4]. The Raw UDP transport method is defined only for the purpose of specifying the IP address and port that an entity considers "most likely to succeed" and is a "hit-or-miss" method that might work end-to-end in some circumstances (especially when the sending entity is a gateway or relay, for example when a back-to-back user agent or call manager sends an early media offer to the initiator on behalf of the responder, as described in Jingle RTP Sessions [5]).

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.

3. Jingle Conformance

In accordance with Section 10 of XEP-0166, this document specifies the following information related to the Jingle Raw UDP transport type:

  1. The transport negotiation process is defined in the Protocol Description section of this document.

  2. The semantics of the <transport/> element are defined in the Transport Initiation section of this document.

  3. Successful negotiation of the Raw UDP method results in use of a datagram transport that is suitable for applications where some packet loss is tolerable, such as audio and video.

  4. If multiple components are to be communicated over the transport in the context of the Real-time Transport Protocol (RTP; see RFC 3550 [6]), the component numbered "1" shall be associated with RTP and the component numbered "2" shall be associated with the Real Time Control Protocol (RTCP).

4. Protocol Description

4.1 Flow

The overall protocol flow for negotiation of the Jingle Raw UDP Transport Method is as follows (note: many of these events happen simultaneously, not in sequence).

INITIATOR                            RESPONDER
    |                                    |
    |  session-initiate (w/candidate)    |
    |----------------------------------->|
    |  ack                               |
    |<-----------------------------------|
    |  session-info: trying              |
    |<-----------------------------------|
    |  ack                               |
    |----------------------------------->|
    |  transport-info: candidate         |
    |<-----------------------------------|
    |  ack                               |
    |----------------------------------->|
    |  session-accept                    |
    |<-----------------------------------|
    |  ack                               |
    |----------------------------------->|
    |<========MEDIA NOW FLOWS===========>|
    |                                    |
    

4.2 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 'urn:xmpp:jingle:transports:raw-udp:0' namespace (see Namespace Versioning regarding the possibility of incrementing the version number), which MUST [7] include the initiator's Raw UDP candidate via the 'ip', 'port', 'generation', and 'id' attributes of the <candidate/> element. The <transport/> element MAY include more than one <candidate/> element (typically one for RTP and another for RTCP).

Example 1. Initiation

<iq from='romeo@montague.net/orchard'
    id='jingle1'
    to='juliet@capulet.com/balcony'
    type='set'>
  <jingle xmlns='urn:xmpp:jingle:0'
          action='session-initiate'
          initiator='romeo@montague.net/orchard'
          sid='a73sjjvkla37jfea'>
    <content creator='initiator' name='this-is-the-audio-content'>
      <description xmlns='urn:xmpp:jingle:apps:rtp:0' media='audio'>
        <payload-type id='18' name='G729'/>
      </description>
      <transport xmlns='urn:xmpp:jingle:transports:raw-udp:0'>
        <candidate component='1'
                   generation='0'
                   id='a9j3mnbtu1'
                   ip='10.1.1.104'
                   port='13540'/>
      </transport>
    </content>
  </jingle>
</iq>
    

All 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). The 'id' attribute uniquely identifies this candidate for tracking purposes.

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 "default" candidate as described in Interactive Connectivity Establishment (ICE) [8]. 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 sender needs to 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 STUN (see RFC 5389 [9])

4.3 Responder Response

As described in XEP-0166, to acknowledge the session initiation request, the responder returns an IQ-result:

Example 2. Responder acknowledges the session-initiate request

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

Once the responder acknowledges the session initiation request, it:

  1. MUST attempt to send media data via UDP to the IP and port specified in the initiator's Raw UDP candidate.
  2. MUST send an informational message of <trying/>.
  3. SHOULD send its own Raw UDP candidate to the initiator via a Jingle "transport-info" message.

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

4.3.1 Sending Media

The responder MUST immediately attempt to send data to the IP and port specified in the initiation request. If all goes well, the data will be received by the initiator and media will flow.

4.3.2 Sending a Trying Message

When it attempts to send data to a Raw UDP candidate, a party MUST send an informational message of <trying/>, including the candidate ID for tracking purposes.

Example 3. Responder sends trying message

<iq from='juliet@capulet.com/balcony'
    id='trying1'
    to='romeo@montague.net/orchard'
    type='set'>
  <jingle xmlns='urn:xmpp:jingle:0'
          action='session-info'
          initiator='romeo@montague.net/orchard'
          sid='a73sjjvkla37jfea'>
    <trying xmlns='urn:xmpp:jingle:transports:raw-udp:info:0'
            id='a9j3mnbtu1'/>
  </jingle>
</iq>
      

Example 4. Initiator acknowledges trying message

<iq from='romeo@montague.lit/orchard'
    id='trying1'
    to='juliet@capulet.lit/balcony'
    type='result'/>
      

4.3.3 Sending a Candidate

As noted, 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 (notice that this example includes two <candidate/> elements, one for RTP and the other for RTCP).

Example 5. Responder sends its Raw UDP candidate

<iq from='juliet@capulet.com/balcony'
    id='jingle2'
    to='romeo@montague.net/orchard'
    type='set'>
  <jingle xmlns='urn:xmpp:jingle:0'
          action='transport-info'
          initiator='romeo@montague.net/orchard'
          sid='a73sjjvkla37jfea'>
    <content creator='initiator' name='this-is-the-audio-content'>
      <transport xmlns='urn:xmpp:jingle:transports:raw-udp:0'>
        <candidate component='1'
                   generation='0'
                   id='z7sdjb01hf'
                   ip='208.68.163.214'
                   port='9876'/>
        <candidate component='2'
                   generation='0'
                   id='hg92lsn10b'
                   ip='208.68.163.214'
                   port='9877'/>
      </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'
    id='jingle2'
    to='juliet@capulet.com/balcony'
    type='result'/>
      

Naturally, the initiator SHOULD also attempt to send media to the responder as specified above. This media, too, might or might not get through.

4.4 Informational Messages

Informational messages are sent within the context of the Raw UDP transport to communicate whether the party has attempted to send media. 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 'urn:xmpp:jingle:transports:raw-udp:info:0' namespace (see Namespace Versioning regarding the possibility of incrementing the version number). Only the following payload element is defined:

Table 2: Information Payload Elements

Element Meaning
<trying/> The party is trying to send media.

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

5. Determining Support

If an entity supports the Jingle Raw UDP transport, it MUST return a feature of "urn:xmpp:jingle:transports:raw-udp:0" (see Namespace Versioning regarding the possibility of incrementing the version number) in response to Service Discovery [10] information requests.

Example 7. Service discovery information request

<iq from='romeo@montague.net/orchard'
    id='disco1'
    to='juliet@capulet.com/balcony'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
  

Example 8. Service discovery information response

<iq from='juliet@capulet.com/balcony'
    id='disco1'
    to='romeo@montague.net/orchard'
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    ...
    <feature var='urn:xmpp:jingle:transports:raw-udp:0'/>
    ...
  </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 [11]. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.

6. Security Considerations

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

7. IANA Considerations

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

8. XMPP Registrar Considerations

8.1 Protocol Namespaces

This specification defines the following XML namespaces:

Upon advancement of this specification from a status of Experimental to a status of Draft, the XMPP Registrar [13] shall add the foregoing namespaces to the registry located at <http://xmpp.org/registrar/namespaces.html>, as described in Section 4 of XMPP Registrar Function [14].

8.2 Protocol Versioning

If the protocol defined in this specification undergoes a major revision that is not fully backward-compatible with an older version, or that contains significant new features, the XMPP Registrar shall increment the protocol version number found at the end of the XML namespaces defined herein, as described in Section 4 of XEP-0053.

8.3 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 raw UDP datagrams.</desc>
  <type>datagram</type>
  <doc>XEP-0177</doc>
</transport>
    

9. XML Schema

9.1 Transport

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

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='urn:xmpp:jingle:transports:raw-udp:0'
    xmlns='urn:xmpp:jingle:transports:raw-udp:0'
    elementFormDefault='qualified'>

  <xs:element name='transport'>
    <xs:complexType>
      <xs:sequence>
        <xs:element name='candidate' 
                    type='candidateElementType'
                    minOccurs='0'
                    maxOccurs='unbounded'/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:complexType name='candidateElementType'>
    <xs:simpleContent>
      <xs:extension base='empty'>
        <xs:attribute name='component' type='xs:unsignedByte' use='required'/>
        <xs:attribute name='generation' type='xs:unsignedByte' use='required'/>
        <xs:attribute name='id' type='xs:NCName' 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:simpleType name='empty'>
    <xs:restriction base='xs:string'>
      <xs:enumeration value=''/>
    </xs:restriction>
  </xs:simpleType>

</xs:schema>
    

9.2 Informational Messages

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

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='urn:xmpp:jingle:transports:raw-udp:info:0'
    xmlns='urn:xmpp:jingle:transports:raw-udp:info:0'
    elementFormDefault='qualified'>

  <xs:element name='trying' type='infoElementType'/>

  <xs:complexType name='infoElementType'>
    <xs:simpleContent>
      <xs:extension base='empty'>
        <xs:attribute name='id' type='xs:NCName' use='required'/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

</xs:schema>
    

10. Acknowledgements

Thanks to Paul Chitescu, Diana Cionoiu, Olivier Crête, Steffen Larsen, Robert McQueen, Mike Ruprecht, and Paul Witty for their feedback.


Notes

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

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

3. Interactive Connectivity Establishment (ICE): A Methodology for Network Address Translator (NAT) Traversal for Offer/Answer Protocols <http://tools.ietf.org/html/draft-ietf-mmusic-ice>. Work in progress.

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

5. XEP-0167: Jingle RTP Sessions <http://xmpp.org/extensions/xep-0167.html>.

6. RFC 3550: RTP: A Transport Protocol for Real-Time Applications <http://tools.ietf.org/html/rfc3550>.

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

8. Interactive Connectivity Establishment (ICE): A Methodology for Network Address Translator (NAT) Traversal for Offer/Answer Protocols <http://tools.ietf.org/html/draft-ietf-mmusic-ice>. Work in progress.

9. RFC 5389: Session Traversal Utilities for NAT (STUN) <http://tools.ietf.org/html/rfc5389>.

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

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

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

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

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


Revision History

Version 0.13 (2008-12-07)

Per list consensus, removed the <received/> info message.

(psa)

Version 0.12 (2008-10-20)

For consistency with the ICE-UDP transport method, added component attribute to handle RTCP candidates and allowed multiple <candidate/> child elements.

(psa)

Version 0.11 (2008-09-30)

Clarified protocol flow.

(psa)

Version 0.10 (2008-09-25)

(psa)

Version 0.9 (2007-11-27)

Further editorial review.

(psa)

Version 0.8 (2007-11-15)

Editorial review and consistency check.

(psa)

Version 0.7 (2007-06-25)

More clearly specified the hit-or-miss nature of the transport; corrected informational messages.

(psa)

Version 0.6 (2007-04-17)

Specified Jingle conformance, including definition of transport type as datagram; added section on service discovery.

(psa)

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