No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0177.xml 23KB

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Jingle Raw UDP Transport Method</title>
  10. <abstract>This specification defines a Jingle transport method that results in sending media data using raw datagram associations 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.</abstract>
  12. <number>0177</number>
  13. <status>Draft</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. <spec>XEP-0166</spec>
  20. </dependencies>
  21. <supersedes/>
  22. <supersededby/>
  23. <shortname>jingle-raw-udp</shortname>
  24. <schemaloc>
  25. <ns>jingle:transports:raw-udp</ns>
  26. <url></url>
  27. </schemaloc>
  28. <discuss>jingle</discuss>
  29. &joebeda;
  30. &stpeter;
  31. &scottlu;
  32. &hildjj;
  33. &seanegan;
  34. <revision>
  35. <version>1.1</version>
  36. <date>2009-12-23</date>
  37. <initials>psa</initials>
  38. <remark><p>Added type attribute to candidate element for consistency with XEP-0176.</p></remark>
  39. </revision>
  40. <revision>
  41. <version>1.0</version>
  42. <date>2009-06-10</date>
  43. <initials>psa</initials>
  44. <remark><p>Per a vote of the XMPP Council, advanced specification from Experimental to Draft.</p></remark>
  45. </revision>
  46. <revision>
  47. <version>0.17</version>
  48. <date>2009-04-04</date>
  49. <initials>psa</initials>
  50. <remark><p>Removed security consideration about sending IP address before session acceptance, since that functionality is no longer supported.</p></remark>
  51. </revision>
  52. <revision>
  53. <version>0.16</version>
  54. <date>2009-03-09</date>
  55. <initials>psa</initials>
  56. <remark><p>Minor changes to track modifications to XEP-0166; updated security considerations for consistency with XEP-0176.</p></remark>
  57. </revision>
  58. <revision>
  59. <version>0.15</version>
  60. <date>2009-02-11</date>
  61. <initials>psa</initials>
  62. <remark><p>Simplified flow by including responder candidate in session-accept.</p></remark>
  63. </revision>
  64. <revision>
  65. <version>0.14</version>
  66. <date>2008-12-16</date>
  67. <initials>psa</initials>
  68. <remark>
  69. <ul>
  70. <li>Removed the &lt;trying/&gt; info message.</li>
  71. <li>Because the removal of the &lt;trying/&gt; info message is backwards-incompatible, modified protocol version number from 0 to 1 and changed namespace from urn:xmpp:jingle:transports:raw-udp:0 to urn:xmpp:jingle:transports:raw-udp:1.</li>
  72. <li>Specified that media must be sent but only after session acceptance.</li>
  73. </ul>
  74. </remark>
  75. </revision>
  76. <revision>
  77. <version>0.13</version>
  78. <date>2008-12-07</date>
  79. <initials>psa</initials>
  80. <remark><p>Per list consensus, removed the &lt;received/&gt; info message.</p></remark>
  81. </revision>
  82. <revision>
  83. <version>0.12</version>
  84. <date>2008-10-20</date>
  85. <initials>psa</initials>
  86. <remark><p>For consistency with the ICE-UDP transport method, added component attribute to handle RTCP candidates and allowed multiple &lt;candidate/&gt; child elements.</p></remark>
  87. </revision>
  88. <revision>
  89. <version>0.11</version>
  90. <date>2008-09-30</date>
  91. <initials>psa</initials>
  92. <remark><p>Clarified protocol flow.</p></remark>
  93. </revision>
  94. <revision>
  95. <version>0.10</version>
  96. <date>2008-09-25</date>
  97. <initials>psa</initials>
  98. <remark>
  99. <ul>
  100. <li>Added an ID attribute to the candidate, trying, and received elements for tracking purposes.</li>
  101. <li>Specified that trying and received messages must be sent.</li>
  102. <li>Modified namespaces to incorporate namespace versioning.</li>
  103. <li>Cleaned up XML schemas.</li>
  104. </ul>
  105. </remark>
  106. </revision>
  107. <revision>
  108. <version>0.9</version>
  109. <date>2007-11-27</date>
  110. <initials>psa</initials>
  111. <remark><p>Further editorial review.</p></remark>
  112. </revision>
  113. <revision>
  114. <version>0.8</version>
  115. <date>2007-11-15</date>
  116. <initials>psa</initials>
  117. <remark><p>Editorial review and consistency check.</p></remark>
  118. </revision>
  119. <revision>
  120. <version>0.7</version>
  121. <date>2007-06-25</date>
  122. <initials>psa</initials>
  123. <remark><p>More clearly specified the hit-or-miss nature of the transport; corrected informational messages.</p></remark>
  124. </revision>
  125. <revision>
  126. <version>0.6</version>
  127. <date>2007-04-17</date>
  128. <initials>psa</initials>
  129. <remark><p>Specified Jingle conformance, including definition of transport type as datagram; added section on service discovery.</p></remark>
  130. </revision>
  131. <revision>
  132. <version>0.5</version>
  133. <date>2007-03-23</date>
  134. <initials>psa</initials>
  135. <remark><p>Updated to reflect changes to XEP-0166; clarified media data checking.</p></remark>
  136. </revision>
  137. <revision>
  138. <version>0.4</version>
  139. <date>2006-12-21</date>
  140. <initials>psa</initials>
  141. <remark><p>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).</p></remark>
  142. </revision>
  143. <revision>
  144. <version>0.3</version>
  145. <date>2006-10-31</date>
  146. <initials>psa</initials>
  147. <remark><p>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.</p></remark>
  148. </revision>
  149. <revision>
  150. <version>0.2</version>
  151. <date>2006-07-12</date>
  152. <initials>se/psa</initials>
  153. <remark><p>Removed candidate element and specified exchange of address information via transport-info messages; clarified usage of name attribute.</p></remark>
  154. </revision>
  155. <revision>
  156. <version>0.1</version>
  157. <date>2006-03-01</date>
  158. <initials>psa/jb</initials>
  159. <remark><p>Initial version (split from XEP-0166).</p></remark>
  160. </revision>
  161. </header>
  162. <section1 topic='Introduction' anchor='intro'>
  163. <p>&xep0166; 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) association (see &rfc0768;). 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).</p>
  164. <p>The Raw UDP transport does not provide end-to-end traversal of Network Address Translators (NATs), or even basic connectivity checks; if NAT traversal is needed, Jingle clients SHOULD use &ice; as described in &xep0176;. 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 &xep0167;).</p>
  165. </section1>
  166. <section1 topic='Requirements' anchor='reqs'>
  167. <p>The Jingle transport method defined herein is designed to meet the following requirements:</p>
  168. <ol>
  169. <li>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.</li>
  170. <li>Make it relatively easy to implement support in standard Jabber/XMPP clients.</li>
  171. <li>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.</li>
  172. </ol>
  173. </section1>
  174. <section1 topic='Jingle Conformance' anchor='conformance'>
  175. <p>In accordance with Section 10 of <cite>XEP-0166</cite>, this document specifies the following information related to the Jingle Raw UDP transport type:</p>
  176. <ol>
  177. <li><p>The transport negotiation process is defined in the <link url='#protocol'>Protocol Description</link> section of this document.</p></li>
  178. <li><p>The semantics of the &TRANSPORT; element are defined in the <link url='#initiate'>Transport Initiation</link> section of this document.</p></li>
  179. <li><p>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.</p></li>
  180. <li><p>If multiple components are to be communicated by the application type that uses the transport, the transport shall support those components and assign identifiers for them as described in the specification that defines the application type.</p></li>
  181. </ol>
  182. </section1>
  183. <section1 topic='Protocol Description' anchor='protocol'>
  184. <section2 topic='Flow' anchor='protocol-flow'>
  185. <p>The overall protocol flow for negotiation of the Jingle Raw UDP Transport Method is as follows.</p>
  186. <code><![CDATA[
  188. | |
  189. | session-initiate (w/candidate) |
  190. |----------------------------------->|
  191. | ack |
  192. |<-----------------------------------|
  193. | session-accept (w/candidate) |
  194. |<-----------------------------------|
  195. | ack |
  196. |----------------------------------->|
  197. |<========MEDIA NOW FLOWS===========>|
  198. | |
  199. ]]></code>
  200. <p>The following sections describe the protocol flow in detail.</p>
  201. </section2>
  202. <section2 topic='Transport Initiation' anchor='initiate'>
  203. <p>In order for the initiator in a Jingle exchange to start the negotiation, it sends a Jingle "session-initiate" stanza that includes at least one content type, as described in <cite>XEP-0166</cite>. 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:1' namespace &VNOTE;, which MUST <note>This is required to avoid a round trip and help expedite the negotiation.</note> 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).</p>
  204. <example caption="Initiation"><![CDATA[
  205. <iq from='romeo@montague.lit/orchard'
  206. id='tp2hd816'
  207. to='juliet@capulet.lit/balcony'
  208. type='set'>
  209. <jingle xmlns='urn:xmpp:jingle:1'
  210. action='session-initiate'
  211. initiator='romeo@montague.lit/orchard'
  212. sid='a73sjjvkla37jfea'>
  213. <content creator='initiator' name='voice'>
  214. <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
  215. <payload-type id='18' name='G729'/>
  216. </description>
  217. <transport xmlns='urn:xmpp:jingle:transports:raw-udp:1'>
  218. <candidate component='1'
  219. generation='0'
  220. id='a9j3mnbtu1'
  221. ip=''
  222. port='13540'/>
  223. </transport>
  224. </content>
  225. </jingle>
  226. </iq>
  227. ]]></example>
  228. <p>All attributes are REQUIRED. The 'ip' and 'port' attributes are self-explanatory. The 'component' attribute enables the parties to distinguish between different aspects of the media stream that each need to use a separate transport address (e.g., RTP and RTCP). The 'generation' attribute defines 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.</p>
  229. <p>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 the ICE specification. 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 <cite>ICE</cite>:</p>
  230. <table caption='Raw UDP Candidate Assignment'>
  231. <tr>
  232. <th>NAT Type</th>
  233. <th>Recommended Raw UDP Candidate Type</th>
  234. </tr>
  235. <tr>
  236. <td>None</td>
  237. <td>Host candidate</td>
  238. </tr>
  239. <tr>
  240. <td>Symmetric</td>
  241. <td>Relay candidate</td>
  242. </tr>
  243. <tr>
  244. <td>Permissive</td>
  245. <td>Server reflexive or peer reflexive candidate discovered via STUN (see &rfc5389;)</td>
  246. </tr>
  247. </table>
  248. <p>If the client is aware of which type of candidate it is sending, the candidate element MAY contain a 'type' attribute. Although this information is merely a hint about the candidate type, this information can help the recipient be aware of how permissive the peer's NAT or firewall is. The values of the 'type' attribute are "host", "prflx", "relay", and "srflx" (as in the ICE specification and <cite>XEP-0176</cite>).</p>
  249. </section2>
  250. <section2 topic='Responder Response' anchor='response'>
  251. <p>As described in <cite>XEP-0166</cite>, to acknowledge the session initiation request, the responder returns an IQ-result:</p>
  252. <example caption="Responder acknowledges the session-initiate request"><![CDATA[
  253. <iq from='juliet@capulet.lit/balcony'
  254. id='tp2hd816'
  255. to='romeo@montague.lit/orchard'
  256. type='result'/>
  257. ]]></example>
  258. <p>Depending on the application type, a user agent controlled by a human user might need to wait for the user to affirm a desire to proceed with the session before continuing. When the user agent has received such affirmation (or if the user agent can automatically proceed for any reason, e.g. because no human intervention is expected or because a human user has configured the user agent to automatically accept sessions with a given entity), it returns a Jingle session-accept message. This message MUST contain a &TRANSPORT; element qualified by the 'urn:xmpp:jingle:transports:raw-udp:1' namespace, which SHOULD in turn contain one &CANDIDATE; element for each Raw UDP candidate generated by or known to the responder.</p>
  259. <example caption="Responder definitively accepts the session"><![CDATA[
  260. <iq from='juliet@capulet.lit/balcony'
  261. id='hs81w639'
  262. to='romeo@montague.lit/orchard'
  263. type='set'>
  264. <jingle xmlns='urn:xmpp:jingle:1'
  265. action='session-accept'
  266. initiator='romeo@montague.lit/orchard'
  267. responder='juliet@capulet.lit/balcony'
  268. sid='a73sjjvkla37jfea'>
  269. <content creator='initiator' name='voice'>
  270. <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
  271. <payload-type id='18' name='G729'/>
  272. </description>
  273. <transport xmlns='urn:xmpp:jingle:transports:raw-udp:1'>
  274. <candidate component='1'
  275. generation='0'
  276. id='z7sdjb01hf'
  277. ip=''
  278. port='9876'/>
  279. <candidate component='2'
  280. generation='0'
  281. id='hg92lsn10b'
  282. ip=''
  283. port='9877'/>
  284. </transport>
  285. </content>
  286. </jingle>
  287. </iq>
  288. ]]></example>
  289. <p>(Notice that the foregoing example includes two &CANDIDATE; elements, one for RTP and the other for RTCP.)</p>
  290. <p>The initiator then acknowledges the session acceptance.</p>
  291. <example caption="Initiator acknowledges session acceptance"><![CDATA[
  292. <iq from='romeo@montague.lit/orchard'
  293. id='hs81w639'
  294. to='juliet@capulet.lit/balcony'
  295. type='result'/>
  296. ]]></example>
  297. </section2>
  298. <section2 topic='Sending Media' anchor='media'>
  299. <p>Upon sending the session-accept action, the responder MUST immediately attempt to send media to the initiator. Upon receiving the session-accept action, the initiator MUST immediately attempt to send media to the responder. The exact media to send depends on the application type being negotiated and therefore is out of scope for this specification (e.g., for Jingle RTP Sessions it would be appropriate to send comfort noise as specified in &rfc3389;).</p>
  300. <p>An implementation SHOULD enforce a timeout on receipt of media, such that if no media is received from the other party within a reasonable period of time, the implementation will consider the session to have failed and therefore send to the other party a Jingle "session-terminate" action with a reason code of &lt;timeout/&gt;.</p>
  301. <example caption="Responder terminates the session"><![CDATA[
  302. <iq from='juliet@capulet.lit/balcony'
  303. id='rig16s95'
  304. to='romeo@montague.lit/orchard'
  305. type='set'>
  306. <jingle xmlns='urn:xmpp:jingle:1'
  307. action='session-terminate'
  308. initiator='romeo@montague.lit/orchard'
  309. sid='a73sjjvkla37jfea'>
  310. <reason><timeout/></reason>
  311. </jingle>
  312. </iq>
  313. ]]></example>
  314. <p>The other party then acknowledges termination of the session.</p>
  315. <example caption="Initiator acknowledges termination"><![CDATA[
  316. <iq from='romeo@montague.lit/orchard'
  317. id='rig16s95'
  318. to='juliet@capulet.lit/balcony'
  319. type='result'/>
  320. ]]></example>
  321. </section2>
  322. </section1>
  323. <section1 topic='Determining Support' anchor='support'>
  324. <p>To advertise its support for the Jingle Raw UDP Transport Method, when replying to &xep0030; information requests an entity MUST return URNs for any version of this protocol that the entity supports -- e.g., "urn:xmpp:jingle:transports:raw-udp:1" for this version and "urn:xmpp:jingle:transports:raw-udp:0" for the previous version &VNOTE;.</p>
  325. <example caption="Service discovery information request"><![CDATA[
  326. <iq from='romeo@montague.lit/orchard'
  327. id='uw72g176'
  328. to='juliet@capulet.lit/balcony'
  329. type='get'>
  330. <query xmlns=''/>
  331. </iq>
  332. ]]></example>
  333. <example caption="Service discovery information response"><![CDATA[
  334. <iq from='juliet@capulet.lit/balcony'
  335. id='uw72g176'
  336. to='romeo@montague.lit/orchard'
  337. type='result'>
  338. <query xmlns=''>
  339. <feature var='urn:xmpp:jingle:1'/>
  340. <feature var='urn:xmpp:jingle:transports:raw-udp:0'/>
  341. <feature var='urn:xmpp:jingle:transports:raw-udp:1'/>
  342. <feature var='urn:xmpp:jingle:apps:rtp:1'/>
  343. <feature var='urn:xmpp:jingle:apps:rtp:audio'/>
  344. <feature var='urn:xmpp:jingle:apps:rtp:video'/>
  345. </query>
  346. </iq>
  347. ]]></example>
  348. <p>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 &xep0115;. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.</p>
  349. </section1>
  350. <section1 topic='Security Considerations' anchor='security'>
  351. <section2 topic='Encryption of Media' anchor='security-media'>
  352. <p>A Jingle implementation SHOULD support security preconditions that are enforced before application media is allowed to flow over a UDP association, such as those described in &xtls;.</p>
  353. <p>Application types that use the Jingle Raw UDP transport method MAY also define their own application-specific encryption methods, such as the Secure Real-time Transport Protocol (SRTP) for RTP exchanges as described in <cite>XEP-0167: Jingle RTP Sessions</cite>.</p>
  354. </section2>
  355. </section1>
  356. <section1 topic='IANA Considerations' anchor='iana'>
  357. <p>This document requires no interaction with &IANA;.</p>
  358. </section1>
  359. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  360. <section2 topic='Protocol Namespaces' anchor='registrar-ns'>
  361. <p>This specification defines the following XML namespace:</p>
  362. <ul>
  363. <li>urn:xmpp:jingle:transports:raw-udp:1</li>
  364. </ul>
  365. <p>The &REGISTRAR; includes the foregoing namespace in its registry at &NAMESPACES;, as governed by &xep0053;.</p>
  366. </section2>
  367. <section2 topic='Protocol Versioning' anchor='registrar-versioning'>
  368. &NSVER;
  369. </section2>
  370. <section2 topic='Jingle Transport Methods' anchor='registrar-transports'>
  371. <p>The XMPP Registrar includes "raw-udp" in its registry of Jingle transport methods at &JINGLETRANSPORTS;. The registry submission is as follows:</p>
  372. <code><![CDATA[
  373. <transport>
  374. <name>raw-udp</name>
  375. <desc>A method for exchanging data over raw UDP associations.</desc>
  376. <type>datagram</type>
  377. <doc>XEP-0177</doc>
  378. </transport>
  379. ]]></code>
  380. </section2>
  381. </section1>
  382. <section1 topic='XML Schema' anchor='schema'>
  383. <code><![CDATA[
  384. <?xml version='1.0' encoding='UTF-8'?>
  385. <xs:schema
  386. xmlns:xs=''
  387. targetNamespace='urn:xmpp:jingle:transports:raw-udp:1'
  388. xmlns='urn:xmpp:jingle:transports:raw-udp:1'
  389. elementFormDefault='qualified'>
  390. <xs:annotation>
  391. <xs:documentation>
  392. The protocol documented by this schema is defined in
  393. XEP-0177:
  394. </xs:documentation>
  395. </xs:annotation>
  396. <xs:element name='transport'>
  397. <xs:complexType>
  398. <xs:sequence>
  399. <xs:element name='candidate'
  400. type='candidateElementType'
  401. minOccurs='0'
  402. maxOccurs='unbounded'/>
  403. </xs:sequence>
  404. </xs:complexType>
  405. </xs:element>
  406. <xs:complexType name='candidateElementType'>
  407. <xs:simpleContent>
  408. <xs:extension base='empty'>
  409. <xs:attribute name='component' type='xs:unsignedByte' use='required'/>
  410. <xs:attribute name='generation' type='xs:unsignedByte' use='required'/>
  411. <xs:attribute name='id' type='xs:NCName' use='required'/>
  412. <xs:attribute name='ip' type='xs:string' use='required'/>
  413. <xs:attribute name='port' type='xs:unsignedShort' use='required'/>
  414. <xs:attribute name='type' use='required'>
  415. <xs:simpleType>
  416. <xs:restriction base='xs:NCName'>
  417. <xs:enumeration value='host'/>
  418. <xs:enumeration value='prflx'/>
  419. <xs:enumeration value='relay'/>
  420. <xs:enumeration value='srflx'/>
  421. </xs:restriction>
  422. </xs:simpleType>
  423. </xs:attribute>
  424. </xs:extension>
  425. </xs:simpleContent>
  426. </xs:complexType>
  427. <xs:simpleType name='empty'>
  428. <xs:restriction base='xs:string'>
  429. <xs:enumeration value=''/>
  430. </xs:restriction>
  431. </xs:simpleType>
  432. </xs:schema>
  433. ]]></code>
  434. </section1>
  435. <section1 topic='Acknowledgements' anchor='ack'>
  436. <p>Thanks to Thiago Camargo, Paul Chitescu, Diana Cionoiu, Olivier Cr&#234;te, Steffen Larsen, Robert McQueen, Mike Ruprecht, Jakob Schroeter, Justin Uberti, Unnikrishnan Vikrama Panicker, and Paul Witty for their feedback.</p>
  437. </section1>
  438. </xep>