1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-28 12:12:22 -05:00

0.2: added port support

This commit is contained in:
Peter Saint-Andre 2013-04-17 19:16:28 -06:00
parent a2fde41e35
commit 514c05ddb4

View File

@ -10,7 +10,7 @@
<abstract>This specification defines a simple XMPP extension that enables a client to discover its external IP address.</abstract> <abstract>This specification defines a simple XMPP extension that enables a client to discover its external IP address.</abstract>
&LEGALNOTICE; &LEGALNOTICE;
<number>0279</number> <number>0279</number>
<status>Deferred</status> <status>Experimental</status>
<type>Standards Track</type> <type>Standards Track</type>
<sig>Standards</sig> <sig>Standards</sig>
<approver>Council</approver> <approver>Council</approver>
@ -23,6 +23,12 @@
&stpeter; &stpeter;
&diana; &diana;
&thiago; &thiago;
<revision>
<version>0.2</version>
<date>2013-04-17</date>
<initials>psa</initials>
<remark><p>Modified XML format so server can return port as well as IP address; incremented protocol version from 0 to 1.</p></remark>
</revision>
<revision> <revision>
<version>0.1</version> <version>0.1</version>
<date>2010-03-05</date> <date>2010-03-05</date>
@ -44,7 +50,7 @@
</header> </header>
<section1 topic='Introduction' anchor='intro'> <section1 topic='Introduction' anchor='intro'>
<p>There are times when a client might want or need to discover what its external Internet Protocol (IP) address is, e.g. when gathering transport candidates for &xep0065; or &xep0176;. One way to do so is for the client to ask the XMPP server to which it has connected. This simple specification defines such a method. The information provided by the server cannot necessarily be relied upon because there might be intermediate entities between the client and the server, but if the IP address returned by the server is different from the client's notion of its IP address then at the very least the client has received a hint that it might be behind a network address translator (NAT) and therefore cannot usefully provide its private IP address as a candidate for use in multimedia negotiations.</p> <p>There are times when a client might want or need to discover what its external Internet Protocol (IP) address and port are, e.g. when gathering transport candidates for protocols such as &xep0065; or &xep0176;. One way to do so is for the client to ask the XMPP server to which it has connected. This specification defines such a method. The information provided by the server cannot necessarily be relied upon because there might be intermediate entities between the client and the server, but if the IP address and port returned by the server is different from the client's notion of its IP address and port then at the very least the client has received a hint that it might be behind a network address translator (NAT) and therefore cannot usefully provide its private IP address as a candidate for use in multimedia negotiations.</p>
</section1> </section1>
<section1 topic='Protocol' anchor='proto'> <section1 topic='Protocol' anchor='proto'>
@ -53,29 +59,34 @@
<iq from='romeo@montague.lit/orchard' <iq from='romeo@montague.lit/orchard'
id='ik2s7159' id='ik2s7159'
type='get'> type='get'>
<ip xmlns='urn:xmpp:sic:0'/> <address xmlns='urn:xmpp:sic:1'/>
</iq> </iq>
]]></example> ]]></example>
<p>The server then returns an IQ-result containing an &lt;ip/&gt; element whose XML character data specifies the client's IP address according to the server.</p> <p>The server then returns an IQ-result containing an &lt;address/&gt; element containing an &lt;ip/&gt; element specifying the client's external IP address and, optionally, a &lt;port/&gt; element specifying the client's external port.</p>
<example caption="Server returns IP address"><![CDATA[ <example caption="Server returns IP address and port"><![CDATA[
<iq id='ik2s7159' <iq id='ik2s7159'
to='romeo@montague.lit/orchard' to='romeo@montague.lit/orchard'
type='result'> type='result'>
<ip xmlns='urn:xmpp:sic:0'>192.168.4.1</ip> <address xmlns='urn:xmpp:sic:1'>
<ip>192.168.4.1</ip>
<port>12345</port>
</iq> </iq>
]]></example> ]]></example>
<p>The IP address could be IPv4 or IPv6.</p> <p>Note that the IP address could be IPv4 or IPv6.</p>
<example caption="Server returns IPv6 address"><![CDATA[ <example caption="Server returns IPv6 address"><![CDATA[
<iq id='ik2s7159' <iq id='ik2s7159'
to='romeo@montague.lit/orchard' to='romeo@montague.lit/orchard'
type='result'> type='result'>
<ip xmlns='urn:xmpp:sic:0'>2001:db8::9:1</ip> <address xmlns='urn:xmpp:sic:1'>
<ip>2001:db8::9:1</ip>
<port>12345</port>
</address>
</iq> </iq>
]]></example> ]]></example>
</section1> </section1>
<section1 topic='Determining Support' anchor='support'> <section1 topic='Determining Support' anchor='support'>
<p>If an entity supports this protocol, it MUST report that by including a service discovery feature of "urn:xmpp:sic:0" in response to disco#info requests &NSNOTE;.</p> <p>If an entity supports this protocol, it MUST report that by including a service discovery feature of "urn:xmpp:sic:1" in response to disco#info requests &NSNOTE;.</p>
<example caption="Service discovery information request"><![CDATA[ <example caption="Service discovery information request"><![CDATA[
<iq from='romeo@montague.lit/orchard' <iq from='romeo@montague.lit/orchard'
id='ux71f395' id='ux71f395'
@ -90,7 +101,7 @@
to='romeo@montague.lit/orchard' to='romeo@montague.lit/orchard'
type='result'> type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'> <query xmlns='http://jabber.org/protocol/disco#info'>
<feature var='urn:xmpp:sic:0'/> <feature var='urn:xmpp:sic:1'/>
</query> </query>
</iq> </iq>
]]></example> ]]></example>
@ -108,7 +119,7 @@
<section2 topic='Protocol Namespaces' anchor='registrar-ns'> <section2 topic='Protocol Namespaces' anchor='registrar-ns'>
<p>This specification defines the following XML namespace:</p> <p>This specification defines the following XML namespace:</p>
<ul> <ul>
<li>urn:xmpp:sic:0</li> <li>urn:xmpp:sic:1</li>
</ul> </ul>
<p>Upon advancement of this specification from a status of Experimental to a status of Draft, the &REGISTRAR; shall add the foregoing namespace to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.</p> <p>Upon advancement of this specification from a status of Experimental to a status of Draft, the &REGISTRAR; shall add the foregoing namespace to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.</p>
</section2> </section2>
@ -123,14 +134,26 @@
<xs:schema <xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:xmpp:sic:0' targetNamespace='urn:xmpp:sic:1'
xmlns='urn:xmpp:sic:0' xmlns='urn:xmpp:sic:1'
elementFormDefault='qualified'> elementFormDefault='qualified'>
<xs:element name='ip' type='xs:string'/> <xs:element name='address' type='xs:string'/>
<xs:element name='address'>
<xs:complexType>
<xs:sequence minOccurs='0'>
<xs:element name='ip' maxOccurs='unbounded' type='xs:string'/>
<xs:element name='port' maxOccurs='unbounded' type='xs:positiveInteger' use='optional'/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema> </xs:schema>
]]></code> ]]></code>
</section1> </section1>
<section1 topic='Acknowledgements' anchor='ack'>
<p>Thanks to Joe Hildebrand for his feedback.</p>
</section1>
</xep> </xep>