<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>
<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>
<remark><p>Removed candidate element and specified exchange of address information via transport-info messages; clarified usage of name attribute.</p></remark>
<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 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 &rfc0768;).</p>
<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>
<li>Make it relatively easy to implement support in standard Jabber/XMPP clients.</li>
<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>
<p>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. If NAT traversal is needed, &xep0176; SHOULD be used.</p>
<p>In order for the initiating entity in a Jingle exchange to start the negotiation, it MUST send a Jingle "session-initiate" stanza as described in <cite>XEP-0166</cite>. This stanza MUST include at least one content type. If the initiating entity 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 <linkurl='#ns'>Protocol Namespaces</link>), which MUST <note>This is required to avoid a round trip and help expedite the negotiation.</note> include the initiating entity's Raw UDP candidate via the 'ip', 'port', 'generation', and 'name' attributes of the &CANDIDATE; element.</p>
<p>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).</p>
<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 "in-use" candidate as described in &ice;. <note>In older versions of XEP-0166, this was referrred to as the "default candidate".</note> 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 <cite>ICE</cite>:</p>
<tablecaption='Raw UDP Candidate Assignment'>
<tr>
<th>NAT Type</th>
<th>Recommended Raw UDP Candidate Type</th>
</tr>
<tr>
<td>None</td>
<td>Host candidate</td>
</tr>
<tr>
<td>Symmetric (not permissive)</td>
<td>Relay candidate</td>
</tr>
<tr>
<td>Permissive</td>
<td>Server reflexive or peer reflexive candidate discovered via &rfc3489;</td>
<p>Once the receiving entity provisionally accepts the session, it:</p>
<ul>
<li>MUST check the initiating entity's Raw UDP candidate by attempting to send media data to the specified IP and port.</li>
<li>SHOULD send its own Raw UDP candidate to the initiating entity via a Jingle "transport-info" message.</li>
<li>MAY send an informational message.</li>
</ul>
<p>These are done simultaneously in order to ensure that a connection can be made, since the initiating entity's Raw UDP candidate may not result in success.</p>
<section3topic='Checking the Initiating Entity's Candidate'anchor='response-check'>
<p>The receiving entity MUST immediately attempt to send media data to the IP and port specified in the initiation request. If media data can be delivered, the recipient MUST send a Jingle "transport-accept" action to the initiator (either explicitly, or implicitly via a "content-accept" or "session-accept" action.</p>
<section3topic='Sending A Candidate'anchor='response-candidate'>
<p>While checking the initiating entity's Raw UDP candidate, the receiving entity SHOULD its own Raw UDP candidate to the initiating entity by sending a transport-info message to the initiating entity, as shown in the following example.</p>
<examplecaption="Receiving Entity Sends Its Raw UDP Candidate"><![CDATA[
<p>Naturally, the intiating entity then MUST also check the receiving entity's Raw UDP candidate by following the checking procedure outlined above.</p>
</section3>
<section3topic='Sending An Informational Message'anchor='response-info'>
<p>While checking the initiating entity's Raw UDP candidate, the receiving entity 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 "transport-info", where the informational message is a payload element specified in the <linkurl='#info'>Informational Messages</link> section of this document.</p>
<p>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 "transport-info", where the informational message is a payload element qualified by the 'http://www.xmpp.org/extensions/xep-0177.html#ns-info' namespace (see <linkurl='#ns'>Protocol Namespaces</link>). The following payload elements are defined:</p>
<p>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).</p>
<p>In order to secure the data stream, implementations SHOULD use encryption methods appropriate to the transport method; in the case of UDP, that would include Datagram Transport Layer Security (DTLS) as specified in &rfc4347;.</p>
<p>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 ®ISTRAR; shall issue permanent namespaces in accordance with the process defined in Section 4 of &xep0053;.</p>