1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-24 10:12:19 -05:00

editorial cleanup

This commit is contained in:
stpeter 2011-05-16 17:33:25 -06:00
parent 93eb26dd86
commit 0fc34a142d

View File

@ -42,7 +42,7 @@
<version>0.4</version>
<date>2010-02-17</date>
<initials>ml/psa</initials>
<remark><p>Added proxy-error action; added a block-size attribute in the transport-accept action when negotiating a fallback to IBB, analogous to changes in XEP-0261; editorial review.</p></remark>
<remark><p>Added proxy-error action; added a block-size attribute in the transport-accept action when negotiating fallback to another transport, analogous to changes in XEP-0261; editorial review.</p></remark>
</revision>
<revision>
<version>0.3</version>
@ -117,18 +117,18 @@ Initiator Responder
|--------------------------------->|
| |
]]></code>
<p>This flow is illustrated in the following examples (to simplify the presentation these use a "stub" application instead of a real application type).</p>
<p>This flow is illustrated in the following examples (to simplify the presentation these use an "example" application instead of a real application type).</p>
<section2 topic='Selecting Candidates' anchor='select'>
<p>It is RECOMMENDED that a client will offer as many &lt;candidate/&gt; elements as possible with itself as the host (i.e., non-proxy candidates). Such candidates might be found using the following methods:</p>
<ul>
<li>Opening the TCP port on all available interfaces the user wants to use (e.g., maybe not an expensive UMTS link), including the IPv4 and IPv6 addresses of that interface (if available).</li>
<li>Using the client's external IP address as discovered through an assisting NAT protocol or other means.</li>
</ul>
<p>If the client knows it is behind a NAT and the router announces UPnP IGD or NAT-PMP support, the client SHOULD map the open port to the external interface of the router and include the public IP address and port information in the &lt;candidate/&gt; offers. To increase the chance of success without using a proxy, this specification allows the responder to also send offers, effectively equivalent to the "fast-mode" for SOCKS5 Bytestreams as previously described at &lt;<link url='http://delta.affinix.com/specs/stream.html'>http://delta.affinix.com/specs/stream.html</link>&gt;.</p>
<p>If the client knows it is behind a NAT and the router announces UPnP IGD or NAT-PMP support, the client SHOULD map the open port to the external interface of the router and include the public IP address and port information in the &lt;candidate/&gt; offers. To increase the chance of success without using a proxy, this specification encourages the responder to also send offers, effectively equivalent to the "fast-mode" for SOCKS5 Bytestreams as previously described at &lt;<link url='http://delta.affinix.com/specs/stream.html'>http://delta.affinix.com/specs/stream.html</link>&gt;.</p>
</section2>
<section2 topic='Exchanging Candidates' anchor='exchange'>
<p>Once the initiator has a set of candidates, it sends a Jingle session-initiate request that contains one or more transport candidates which are a mixture of <cite>XEP-0065</cite> streamhosts and ICE candidates used in <cite>XEP-0176</cite>.</p>
<example caption="Initiator sends session-initiate (stub)"><![CDATA[
<example caption="Initiator sends session-initiate"><![CDATA[
<iq from='romeo@montague.lit/orchard'
id='xn28s7gk'
to='juliet@capulet.lit/balcony'
@ -137,8 +137,8 @@ Initiator Responder
action='session-initiate'
initiator='romeo@montague.lit/orchard'
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='stub'>
<description xmlns='urn:xmpp:jingle:apps:stub:0'/>
<content creator='initiator' name='ex'>
<description xmlns='urn:xmpp:example'/>
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
mode='tcp'
sid='vj3hs98y'>
@ -167,8 +167,8 @@ Initiator Responder
type='result'/>
]]></example>
<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:s5b:1' namespace, which SHOULD in turn contain one &lt;candidate/&gt; element for each SOCKS5 Bytestreams candidate generated by or known to the responder, but MAY instead be empty if the responder does not wish to offer any candidates or wishes to send each candidate as the payload of a transport-info message.</p>
<p>If the responder sends candidates in the session-accept, the chances of a successful connection are increased. For example, the initiator might be behind a NAT or might have no access to a proxy, whereas the responder might have a public IP address, might know about a proxy, or might have NAT penetration support like NAT-PMP in a router. (Whereas this "fast-mode" was a special extension previously, it is the default in jingle-s5b.) However, the responder MUST NOT offer as a candidate any host/port combination that has already been offered by the initiator; this helps to prevent failure of negotiation with the proxy.</p>
<p>In the following example, Juliet's client opens one port. The provided &lt;candidates/&gt; are the (private) IPv4 address of the interface, a (public) IPv6 address, and the public IPv4 address created by mapping the private IP address/port using NAT-PMP.</p>
<p>If the responder sends candidates in the session-accept, the chances of a successful connection are increased. For example, the initiator might be behind a NAT or might have no access to an S5B proxy, whereas the responder might have a public IP address, might know about a proxy, or might have NAT penetration support like NAT-PMP in a router. However, the responder MUST NOT offer as a candidate any host/port combination that has already been offered by the initiator; this helps to prevent failure of negotiation with S5B proxies.</p>
<p>In the following example, Juliet's client opens one port. The provided candidates are the (private) IPv4 address of the interface, a (public) IPv6 address, and the public IPv4 address created by mapping the private IP address/port using NAT-PMP.</p>
<example caption="Responder sends session-accept with candidates"><![CDATA[
<iq from='juliet@capulet.lit/balcony'
id='hwd987h'
@ -178,8 +178,8 @@ Initiator Responder
action='session-accept'
initiator='romeo@montague.lit/orchard'
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='stub'>
<description xmlns='urn:xmpp:jingle:apps:stub:0'/>
<content creator='initiator' name='ex'>
<description xmlns='urn:xmpp:example'/>
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
mode='tcp'
sid='vj3hs98y'>
@ -213,7 +213,7 @@ Initiator Responder
to='juliet@capulet.lit/balcony'
type='result'/>
]]></example>
<p>A client SHOULD check the offered candidates in order of their priority, starting with the highest value. How the priority is calculated depends on the actual available interfaces. It is RECOMMENDED to use the following formula:</p>
<p>A client SHOULD check the offered candidates in order of their priority, starting with the highest value. How the priority is calculated depends on the actual available interfaces. An implementation SHOULD use the following formula:</p>
<code>
priority = (2^16)*(type preference) + (local preference)
</code>
@ -248,7 +248,7 @@ priority = (2^16)*(type preference) + (local preference)
<p>The local preference is used to rate different candidates of the same type, e.g. a DSL link might be preferred over a VPN connection. The value of the local preference SHOULD be between 0 and 65535. The proposed values are only guidelines. If a client wants to increase or decrease the value of a specific candidate it is free to do so. For instance, a client might have an expensive UMTS link as a last resort and might rate this link lower than all SOCKS5 relays.</p>
</section2>
<section2 topic='Connecting to Candidates' anchor='connect'>
<p>After receiving its peer's candidates, a client start to connect to them in order of the priority. The protocol is described in <cite>XEP-0065</cite> in detail. Once one client has successfully created a connection, it sends the &lt;candidate-used/&gt; element to the peer inside a Jingle transport-info message. If a client receives a candidate-used notification it SHOULD continue trying to connect to candidates of its peer if it has not tried all candidates with a higher priority than the one successfully used by the peer.</p>
<p>After receiving its peer's candidates, a client start to connect to them in order of the priority. The protocol is described in <cite>XEP-0065</cite> in detail. Once one client has successfully created a connection, it sends the &lt;candidate-used/&gt; element to the peer inside a Jingle transport-info message. If a client receives a candidate-used notification it SHOULD continue trying to connect to candidates sent by its peer if it has not tried all candidates with a higher priority than the one successfully used by the peer.</p>
<example caption="Initiator sends candidate-used in Jingle transport-info"><![CDATA[
<iq from='romeo@montague.lit/orchard'
id='hjdi8'
@ -258,7 +258,7 @@ priority = (2^16)*(type preference) + (local preference)
action='transport-info'
initiator='romeo@montague.lit/orchard'
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='stub'>
<content creator='initiator' name='ex'>
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
sid='vj3hs98y'>
<candidate-used cid='hr65dqyd'/>
@ -284,7 +284,7 @@ priority = (2^16)*(type preference) + (local preference)
action='transport-info'
initiator='romeo@montague.lit/orchard'
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='stub'>
<content creator='initiator' name='ex'>
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
sid='vj3hs98y'>
<candidate-error/>
@ -304,9 +304,9 @@ priority = (2^16)*(type preference) + (local preference)
<section2 topic='Completing the Negotiation' anchor='complete'>
<p>The transport negotiation is completed in one of the following ways:</p>
<ol start='1'>
<li>If both parties send a candidate-error notification then the SOCKS5 negotiation has failed and the parties need to fall back to some other transport method, typically IBB; see the <link url='#fallback'>Fallback to IBB</link> section of this document for details.</li>
<li>If both parties send a candidate-error notification then the SOCKS5 negotiation has failed and the parties need to fall back to some other transport method, typically IBB; see the <link url='#fallback'>Fallback Methods</link> section of this document for details.</li>
<li>If one of the parties sends a candidate-error notification and the other party sends a candidate-used notification, then the candidate-used shall be considered the nominated candidate.</li>
<li>If both parties send a candidate-used notification but the candidates have a different priority, then the candidate with the lower priority shall be considered the nominated candidate.</li>
<li>If both parties send a candidate-used notification but the candidates have a different priority, then the candidate with the higher priority shall be considered the nominated candidate.</li>
<li>If both parties send a candidate-used notification with candidates having the same priority, then the candidate chosen by the initiator shall be considered the nominated candidate (this is consistent with the rules in <cite>XEP-0166</cite>).</li>
</ol>
<p>The parties shall use the nominated candidate for the data transfer. If the nominated candidate is of the proxy type, then the peer has no way to know when it can send data. Therefore the party that offered the nominated candidate MUST send an activated notification to the peer once it has activated the bytestream (as described in <cite>XEP-0065</cite>); it does so by sending a transport-info message containing an &lt;activated/&gt; element as follows.</p>
@ -319,7 +319,7 @@ priority = (2^16)*(type preference) + (local preference)
action='transport-info'
initiator='romeo@montague.lit/orchard'
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='stub'>
<content creator='initiator' name='ex'>
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
sid='vj3hs98y'>
<activated cid='xmdh4b7i'/>
@ -328,7 +328,7 @@ priority = (2^16)*(type preference) + (local preference)
</jingle>
</iq>
]]></example>
<p>If the nominated candidate is of the proxy type and either party cannot connect to the proxy (for example because of a restrictive firewall), the party shall send a transport-info message containing an &lt;proxy-error/&gt; element.</p>
<p>If the nominated candidate is of the proxy type and either party cannot connect to the proxy (for example because of a restrictive firewall), the failing party shall send a transport-info message containing an &lt;proxy-error/&gt; element.</p>
<example caption="Responder informs initiator of inability to connect to the proxy"><![CDATA[
<iq from='juliet@capulet.lit/balcony'
id='bv73bs91'
@ -338,7 +338,7 @@ priority = (2^16)*(type preference) + (local preference)
action='transport-info'
initiator='romeo@montague.lit/orchard'
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='stub'>
<content creator='initiator' name='ex'>
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
sid='vj3hs98y'>
<proxy-error/>
@ -347,7 +347,7 @@ priority = (2^16)*(type preference) + (local preference)
</jingle>
</iq>
]]></example>
<p>The parties shall then consider the bytestream unsuccessful and fall back to IBB as described in <link url='#fallback'>Fallback to IBB</link>.</p>
<p>The parties shall then consider the bytestream unsuccessful and SHOULD attempt to fall back to another transport as described in <link url='#fallback'>Fallback Methods</link>.</p>
</section2>
<section2 topic='Exchanging Data' anchor='data'>
<p>Once the parties have chosen (and if necessary activated) a streamhost, they can exchange data as defined in <cite>XEP-0065</cite>.</p>
@ -377,7 +377,7 @@ priority = (2^16)*(type preference) + (local preference)
</section2>
</section1>
<section1 topic='Fallback to IBB' anchor='fallback'>
<section1 topic='Fallback Methods' anchor='fallback'>
<p>If the SOCKS5 Bytestreams negotiation fails, the parties might want to "fall back" to the transport of last resort, which for a streaming transport is typically &xep0047; as described for Jingle in &xep0261;. The protocol flow is as follows.</p>
<code><![CDATA[
Romeo Juliet
@ -404,7 +404,7 @@ Romeo Juliet
|--------------------------------->|
| |
]]></code>
<p>First the initiator sends a Jingle session-initiate, in this case with a transport of SOCKS5 Bytestreams. The protocol flow is exactly the same as described above. If both clients are unable to connect to a candidate provided by the peer, both send candidate-error messages and SOCKS5 has failed. The initiator MUST either terminate the Jingle session with a Jingle reason of &lt;connectivity-error/&gt; or replace the transport with something else using the transport-replace action. Typically the fallback option is IBB (see, for example, &xep0234;). Therefore the initiator sends a transport-replace action including a transport of IBB.</p>
<p>First the initiator sends a Jingle session-initiate, in this case with a transport of SOCKS5 Bytestreams. The protocol flow is exactly the same as described above. If both parties are unable to connect to a candidate provided by the peer, they send candidate-error messages to indicate that SOCKS5 has failed. The initiator MUST either terminate the Jingle session with a Jingle reason of &lt;connectivity-error/&gt; or replace the transport with something else using the transport-replace action. Typically the fallback option is IBB (see, for example, &xep0234;). Therefore the initiator sends a transport-replace action including a transport of IBB.</p>
<example caption="Initiator replaces transport with IBB"><![CDATA[
<iq from='romeo@montague.lit/orchard'
id='hs92n57'
@ -414,8 +414,8 @@ Romeo Juliet
action='transport-replace'
initiator='romeo@montague.lit/orchard'
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='stub'>
<transport xmlns='urn:xmpp:jingle:transports:ibb:0'
<content creator='initiator' name='ex'>
<transport xmlns='urn:xmpp:jingle:transports:ibb:1'
block-size='4096'
sid='ch3d9s71'/>
</content>
@ -439,8 +439,8 @@ Romeo Juliet
action='transport-accept'
initiator='romeo@montague.lit/orchard'
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='stub'>
<transport xmlns='urn:xmpp:jingle:transports:ibb:0'
<content creator='initiator' name='ex'>
<transport xmlns='urn:xmpp:jingle:transports:ibb:1'
block-size='2048'
sid='ch3d9s71'/>
</content>
@ -460,9 +460,9 @@ Romeo Juliet
<section1 topic='Processing Rules and Usage Guidelines' anchor='rules'>
<p>The same processing rules and usage guidelines defined in XEP-0065 apply to the Jingle S5B Transport Method. Additional implementation suggestions are:</p>
<ol>
<li>A client SHOULD try the offered candidates in the order of their priority.</li>
<li>A client SHOULD try the offered candidates in the order of their priority, from highest to lowest.</li>
<li>If more than one &lt;candidate/&gt; element is present in a session-initiate or session-accept, a client SHOULD wait 200ms before trying the next one.</li>
<li>If the candidate has a JID attribute and that JID is not the one of the peer it indicates the usage of a proxy. If the client had offered direct connection information it MAY want to wait a little bit longer than 200ms before trying the first proxy.</li>
<li>If the other party offered a direct connection and a proxy connection, its peer MAY wait a little bit longer than 200ms before trying the first proxy.</li>
<li>A client SHOULD NOT wait for a TCP timeout on connect. If it is unable to connect to any candidate within 5 seconds it SHOULD send a candidate-error to the other party.</li>
</ol>
</section1>
@ -496,7 +496,7 @@ Romeo Juliet
<p>The exchange of candidates might result in exposure of the sender's IP addresses, which comprise a form of personally identifying information. A Jingle client MUST enable a user to control which entities will be allowed to receive such information. If a human user explicitly accepts a session request, then the client SHOULD consider that action to imply approval of IP address sharing. However, waiting for a human user to explicitly accept the session request can result in delays during session setup, since it is more efficient to immediately begin sharing transport candidates. Therefore, it is RECOMMENDED for the client to immediately send transport candidates to a contact (without waiting for explicit user approval of the session request) in the following cases:</p>
<ol>
<li>The user has permanently and formally authorized the contact to view the user's presence information via a presence subscription as reflected in an XMPP roster item (see &xmppim;).</li>
<li>The user has temporarily and dynamically shared presence with the contact via "directed presence" as described in <cite>RFC 3921</cite>.</li>
<li>The user has temporarily and dynamically shared presence with the contact via "directed presence" as described in <cite>RFC 6121</cite>.</li>
<li>The user has explicitly added the contact to a "whitelist" of entities who are allowed to access the user's personally-identifying information.</li>
</ol>
</section2>
@ -515,7 +515,9 @@ Romeo Juliet
<code><![CDATA[
<transport>
<name>s5b</name>
<desc>A method for negotiating data exchange over SOCKS5 Bytestreams.</desc>
<desc>
A method for negotiating data exchange over SOCKS5 Bytestreams.
</desc>
<type>streaming</type>
<doc>XEP-0260</doc>
</transport>
@ -536,11 +538,16 @@ Romeo Juliet
<xs:element name='transport'>
<xs:complexType>
<xs:choice>
<xs:element ref='activated' minOccurs='0' maxOccurs='1'/>
<xs:element ref='candidate' minOccurs='0' maxOccurs='unbounded'/>
<xs:element name='candidate-error' minOccurs='0' maxOccurs='1' type='empty'/>
<xs:element ref='candidate-used' minOccurs='0' maxOccurs='1'/>
<xs:element name='proxy-error' minOccurs='0' maxOccurs='1' type='empty'/>
<xs:element ref='activated'
minOccurs='0' maxOccurs='1'/>
<xs:element ref='candidate'
minOccurs='0' maxOccurs='unbounded'/>
<xs:element name='candidate-error'
minOccurs='0' maxOccurs='1' type='empty'/>
<xs:element ref='candidate-used'
minOccurs='0' maxOccurs='1'/>
<xs:element name='proxy-error'
minOccurs='0' maxOccurs='1' type='empty'/>
</xs:choice>
<xs:attribute name='mode' use='optional' default='tcp'>
<xs:attribute name='sid' type='xs:string' use='optional'/>
@ -558,12 +565,18 @@ Romeo Juliet
<xs:complexType>
<xs:simpleContent>
<xs:extension base='empty'>
<xs:attribute name='cid' type='xs:string' use='required'/>
<xs:attribute name='host' type='xs:string' use='required'/>
<xs:attribute name='jid' type='xs:string' use='required'/>
<xs:attribute name='port' type='xs:positiveInteger' use='optional'/>
<xs:attribute name='priority' type='xs:positiveInteger' use='required'/>
<xs:attribute name='type' use='optional' default='direct'>
<xs:attribute name='cid'
type='xs:string' use='required'/>
<xs:attribute name='host'
type='xs:string' use='required'/>
<xs:attribute name='jid'
type='xs:string' use='required'/>
<xs:attribute name='port'
type='xs:positiveInteger' use='optional'/>
<xs:attribute name='priority'
type='xs:positiveInteger' use='required'/>
<xs:attribute name='type'
use='optional' default='direct'>
<xs:simpleType>
<xs:restriction base='xs:NCName'>
<xs:enumeration value='assisted'/>