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-0041.xml 9.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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>Reliable Entity Link</title>
  10. <abstract>Protocol for linking a bytestream between two Jabber entities.</abstract>
  11. &LEGALNOTICE;
  12. <number>0041</number>
  13. <status>Retracted</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>XEP-0020</spec>
  19. <spec>XEP-0030</spec>
  20. </dependencies>
  21. <supersedes/>
  22. <supersededby><spec>XEP-0065</spec></supersededby>
  23. <shortname>rel</shortname>
  24. <author>
  25. <firstname>Justin</firstname>
  26. <surname>Karneges</surname>
  27. <email>justin@affinix.com</email>
  28. <jid>justin@andbit.net</jid>
  29. </author>
  30. <revision>
  31. <version>0.2</version>
  32. <date>2003-09-30</date>
  33. <initials>psa</initials>
  34. <remark>At the request of the author, the status of this specification has been changed to Retracted since it has been superseded by XEP-0065.</remark>
  35. </revision>
  36. <revision>
  37. <version>0.8</version>
  38. <date>2003-06-26</date>
  39. <initials>jk</initials>
  40. <remark>Refactored to old jidlink roots</remark>
  41. </revision>
  42. <revision>
  43. <version>0.7</version>
  44. <date>2003-04-29</date>
  45. <initials>jk</initials>
  46. <remark>Overhaul and rename</remark>
  47. </revision>
  48. <revision>
  49. <version>0.6</version>
  50. <date>2002-11-23</date>
  51. <initials>jk</initials>
  52. <remark>Reflect changes to DTCP</remark>
  53. </revision>
  54. <revision>
  55. <version>0.5</version>
  56. <date>2002-10-10</date>
  57. <initials>jk</initials>
  58. <remark>Table of stream transports</remark>
  59. </revision>
  60. <revision>
  61. <version>0.4</version>
  62. <date>2002-10-10</date>
  63. <initials>jk</initials>
  64. <remark>New name, cleaned up the text, added test mode.</remark>
  65. </revision>
  66. <revision>
  67. <version>0.3</version>
  68. <date>2002-09-12</date>
  69. <initials>jk</initials>
  70. <remark>Changed the implementation.</remark>
  71. </revision>
  72. <revision>
  73. <version>0.2</version>
  74. <date>2002-08-16</date>
  75. <initials>jk</initials>
  76. <remark>Fixed spelling errors, simplified the document.</remark>
  77. </revision>
  78. <revision>
  79. <version>0.1</version>
  80. <date>2002-08-15</date>
  81. <initials>jk</initials>
  82. <remark>Initial version.</remark>
  83. </revision>
  84. </header>
  85. <section1 topic='Overview'>
  86. <section2 topic='Introduction'>
  87. <p>Reliable Entity Link (or simply 'REL'), is a system for coordinating reliable bytestreams between two Jabber entities for the purpose of keeping applications (and application specifications) simple. However, this proposal does not define any specific bytestream protocol. It is expected that there will be multiple ways to obtain a bytestream between Jabber entities (thru-server and peer-to-peer are two methods that come to mind), but applications can refer to REL instead of some particular stream transport.</p>
  88. </section2>
  89. <section2 topic='Stream transport properties'>
  90. <p>A REL-compatible stream transport must have the following properties:</p>
  91. <ul>
  92. <li>Provides a reliable bytestream between two Jabber entities, which means that the bytestream transport handles all data delivery issues, such that the application need not worry about them.</li>
  93. <li>Has link states from the following table.
  94. </li>
  95. <li>Defines a stream identifier, which MUST have a unique ASCII representation. The stream protocol MUST be able to use any ASCII identifier chosen during REL negotiation, as long as the sending party doesn't use the same identifier more than once.</li>
  96. </ul>
  97. <table caption='Link states'>
  98. <tr>
  99. <th>Code</th>
  100. <th>Description</th>
  101. </tr>
  102. <tr>
  103. <td><tt>INIT</tt></td>
  104. <td>Initiation</td>
  105. </tr>
  106. <tr>
  107. <td><tt>GOOD</tt></td>
  108. <td>Successful initiation (connected)</td>
  109. </tr>
  110. <tr>
  111. <td><tt>BAD</tt></td>
  112. <td>Unsuccessful initiation (stream is closed, no further state)</td>
  113. </tr>
  114. <tr>
  115. <td><tt>CLOS</tt></td>
  116. <td>Successful closure after establishment (stream is closed, no further state)</td>
  117. </tr>
  118. <tr>
  119. <td><tt>ERR</tt></td>
  120. <td>Link failure after establishment (stream is closed, no further state)</td>
  121. </tr>
  122. </table>
  123. <p>The following stream transports that meet these guidelines are:</p>
  124. <table caption='Supported streams'>
  125. <tr>
  126. <th>Short name</th>
  127. <th>Protocol</th>
  128. </tr>
  129. <tr>
  130. <td>ibb</td>
  131. <td>&xep0047;</td>
  132. </tr>
  133. <tr>
  134. <td>s5b</td>
  135. <td>&xep0065;</td>
  136. </tr>
  137. </table>
  138. </section2>
  139. </section1>
  140. <section1 topic='Usage'>
  141. <section2 topic='Service discovery'>
  142. <p>Before using REL, ensure it is a supported service of the remote entity by using &xep0030;:</p>
  143. <example caption='Requesting disco information'><![CDATA[
  144. <iq type="get" to="joe@blow.com/Home" id="sd_1">
  145. <query xmlns="http://jabber.org/protocol/disco#info"/>
  146. </iq>
  147. ]]></example>
  148. <p>The remote entity will advertise the "http://jabber.org/protocol/rel" namespace as a feature to represent they implement this protocol.</p>
  149. <example caption='Response'><![CDATA[
  150. <iq type="result" from="joe@blow.com/Home" id="sd_1">
  151. <query xmlns="http://jabber.org/protocol/disco#info">
  152. <feature var="http://jabber.org/protocol/rel"/>
  153. </query>
  154. </iq>
  155. ]]></example>
  156. </section2>
  157. <section2 topic='Obtaining a REL context'>
  158. <p>To use REL, the entities must obtain a REL Context ID (or <em>cid</em>) through some action. A <em>cid</em> is simply an opaque alphanumeric string. For example, perhaps the link is needed for a file transfer:</p>
  159. <example caption='Possible File Transfer'><![CDATA[
  160. <iq type="set" id="ft_1" to="joe@blow.com/Home">
  161. <query xmlns="filexfer" filename="coolfile.txt"/>
  162. </iq>
  163. ]]></example>
  164. <example caption='Possible response'><![CDATA[
  165. <iq type="result" id="ft_1" from="joe@blow.com/Home">
  166. <query xmlns="filexfer">
  167. <cid xmlns="http://jabber.org/protocol/rel" value="myCID"/>
  168. </query>
  169. </iq>
  170. ]]></example>
  171. <p>All high-level protocols that use Reliable Entity Link MUST have a way of providing such a cid. The cid must be unique among all other REL cids between the two entities.</p>
  172. </section2>
  173. <section2 topic='Selecting a Stream'>
  174. <p>The next step is to ask the remote entity which stream method it would like to use. We will use &xep0020; for this. The streams are listed using the short names from the table of supported streams.</p>
  175. <example caption='Selecting a stream'><![CDATA[
  176. <iq type="get" id="rel_1" to="joe@blow.com/Home">
  177. <query xmlns="http://jabber.org/protocol/rel" cid="myCID" keepAlive='true'>
  178. <feature xmlns="http://jabber.org/protocol/feature-neg">
  179. <x xmlns="jabber:x:data">
  180. <field var="method" type="list-single">
  181. <option><value>s5b</value></option>
  182. <option><value>ibb</value></option>
  183. </field>
  184. </x>
  185. </feature>
  186. </query>
  187. </iq>
  188. ]]></example>
  189. <p>The keepAlive attribute indicates that the initiator is planning on trying another method if the one selected here is to fail. An entity SHOULD use keepAlive for all attempts but the last for a given application. If keepAlive is omitted, then it is considered false.</p>
  190. <p>The remote entity will then agree on a method:</p>
  191. <example caption='Possible response'><![CDATA[
  192. <iq type="result" id="rel_1" from="joe@blow.com/Home">
  193. <query xmlns="http://jabber.org/protocol/rel" cid="myCID">
  194. <feature xmlns="http://jabber.org/protocol/feature-neg">
  195. <x xmlns="jabber:x:data" type="submit">
  196. <field var="method">
  197. <value>s5b</value>
  198. </field>
  199. </x>
  200. </feature>
  201. </query>
  202. </iq>
  203. ]]></example>
  204. <p>Or maybe an error:</p>
  205. <example caption='Error'><![CDATA[
  206. <iq type="error" id="rel_1" from="joe@blow.com/Home">
  207. <error code="501">No supported protocols.</error>
  208. </iq>
  209. ]]></example>
  210. <p>If the entity returns error, then the REL cid is invalidated and the application fails. If a stream method has been chosen successfully, then now it must be initiated using the REL cid as the stream's identifier (the stream goes into <strong><tt>INIT</tt></strong> state).</p>
  211. <p>On <strong><tt>GOOD</tt></strong>: This indicates the stream is ready for use within the original context, and data exchanged over the stream is to be left up to the application.</p>
  212. <p>On <strong><tt>BAD</tt></strong>: If the keepAlive="true" attribute was specified, then the initiator MUST repeat this section over again to attempt with a different method. If keepAlive was not specified, then the REL cid is invalidated and the application fails.</p>
  213. <p>On <strong><tt>CLOS</tt></strong> or <strong><tt>ERR</tt></strong>, the REL cid is invalidated.</p>
  214. </section2>
  215. </section1>
  216. <section1 topic='Security Considerations'>
  217. <p>There are no security considerations.</p>
  218. </section1>
  219. <section1 topic='IANA Considerations'>
  220. <p>This document requires no interaction with &IANA;.</p>
  221. </section1>
  222. <section1 topic='XMPP Registrar Considerations'>
  223. <p>The &REGISTRAR; shall register the 'http://jabber.org/protocol/rel' namespace as a result of this document.</p>
  224. </section1>
  225. <section1 topic='XML Schema'>
  226. <code><![CDATA[
  227. <?xml version='1.0' encoding='UTF-8'?>
  228. <xs:schema
  229. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  230. targetNamespace='http://jabber.org/protocol/rel'
  231. xmlns='http://jabber.org/protocol/rel'
  232. elementFormDefault='qualified'>
  233. <xs:element name='query'>
  234. <xs:complexType>
  235. <xs:attribute name='cid' type='xs:string' use='required'/>
  236. <xs:attribute name='keepAlive' type='xs:boolean' use='optional'/>
  237. </xs:complexType>
  238. </xs:element>
  239. </xs:schema>
  240. ]]></code>
  241. </section1>
  242. </xep>