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-0037.xml 48KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859
  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>DSPS - Data Stream Proxy Service</title>
  10. <abstract>A proposal for proxy support in Jabber.</abstract>
  11. &PUBLICDOMAINNOTICE;
  12. <number>0037</number>
  13. <status>Rejected</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies/>
  17. <supersedes/>
  18. <supersededby/>
  19. <shortname>N/A</shortname>
  20. <author>
  21. <firstname>David</firstname>
  22. <surname>Sutton</surname>
  23. <email></email>
  24. <jid></jid>
  25. </author>
  26. <author>
  27. <firstname>"Bac9"</firstname>
  28. <surname></surname>
  29. <email>bac9@bac9.yi.org</email>
  30. <jid>bac9@jabber.org</jid>
  31. </author>
  32. <revision>
  33. <version>0.8.1</version>
  34. <date>2016-10-04</date>
  35. <initials>egp</initials>
  36. <remark><p>Made the revision’s version element include only the actual version.</p></remark>
  37. </revision>
  38. <revision>
  39. <version>0.8</version>
  40. <date>2002-09-18</date>
  41. <initials>Bac9</initials>
  42. <remark>Streamlined and enhanced handshake procedure, and cleaned up document.</remark>
  43. </revision>
  44. <revision>
  45. <version>0.7</version>
  46. <date>2002-08-20</date>
  47. <initials>Bac9</initials>
  48. <remark>Added public connections and reduced number of tags.</remark>
  49. </revision>
  50. <revision>
  51. <version>0.6</version>
  52. <date>2002-08-11</date>
  53. <initials>Bac9</initials>
  54. <remark>Added data tracking, inviting peer, auto-disconnect for slow peers, elaboration on protocol and suggested example of file transfer.</remark>
  55. </revision>
  56. <revision>
  57. <version>0.5</version>
  58. <date>2002-07-29</date>
  59. <initials>Bac9</initials>
  60. <remark>Elaborated on some functionality and cleaned up XML protocol.</remark>
  61. </revision>
  62. <revision>
  63. <version>0.4</version>
  64. <date>2002-07-11</date>
  65. <initials>lw</initials>
  66. <remark>Converted to XML format.</remark>
  67. </revision>
  68. <revision>
  69. <version>0.3</version>
  70. <date>2002-06-25</date>
  71. <initials>Bac9</initials>
  72. <remark>Added support for HTTP, SSL and throughput logging. Changed relay behaviour.</remark>
  73. </revision>
  74. <revision>
  75. <version>0.2</version>
  76. <date>2002-06-21</date>
  77. <initials>Bac9</initials>
  78. <remark>Revised, standardized and extended XML protocol structure.</remark>
  79. </revision>
  80. <revision>
  81. <version>0.1</version>
  82. <date></date>
  83. <initials>rn</initials>
  84. <remark>Initial version.</remark>
  85. </revision>
  86. </header>
  87. <section1 topic='Introduction'>
  88. <p>Data Stream Proxy Service (DSPS) is designed to be a common stream protocol for multicast (unicast as special case) over P2S2P (P2P as special case) connections.</p>
  89. </section1>
  90. <section1 topic='Startup'>
  91. <p>This document follows DSPS protocol version 0.5. Any XML data not explicitly defined or mentioned will be ignored without error. On startup, full fledged DSPS starts listening on port 5290 (and 80 if HTTP handshake implemented).</p>
  92. </section1>
  93. <section1 topic='General Operation'>
  94. <section2 topic='Stream Creation/Relay {optional}'>
  95. <p><em>(optional)</em> Creating or modifying stream is done like so:</p>
  96. <example>
  97. &lt;iq
  98. id='dsps1'
  99. type='get'
  100. from='rob@nauseum.org/dspsclient'
  101. to='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a44'&gt;
  102. &lt;query type='create'
  103. xmlns='jabber:iq:dsps'
  104. minthroughput='1.5KB'
  105. maxpublic='20'&gt;
  106. &lt;peer port='5290'&gt;
  107. dsps.myjabber.net/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33
  108. &lt;/peer&gt;
  109. &lt;comment&gt;public comment&lt;/comment&gt;
  110. &lt;/query&gt;
  111. &lt;/iq&gt;
  112. </example>
  113. <ul>
  114. <li><strong>&quot;to&quot;</strong> with resource implies reconnection to previous relay stream with previously supplied credentials and authentication as per section &quot;DSPS relay setup&quot;, otherwise implies creation of new stream where creator is granted &quot;master&quot; rights.</li>
  115. <li><strong>&quot;minthroughput&quot;</strong> <em>(optional)</em> is minimum 16 second average throughput below which peers will be disconnected (but not dropped). Checked after every unit of outgoing transfer against the fourth value returned by &quot;who&quot; query for each peer. Legal only upon initial creation of stream. If omitted or negative, 0 is assumed.</li>
  116. <li><strong>&quot;maxpublic&quot;</strong> <em>(optional)</em> is maximum number of peers that can join without invitation. If omitted or negative, 0 is assumed. If positive, DSPS generates globally unique id for public peers to acknowledge, reported within &quot;stats&quot; message. Said id remains constant for life of stream.</li>
  117. <li><strong>&lt;peer/&gt;</strong> <em>(optional)</em> full JID of stream on another DSPS. Relay stream will be treated using &quot;slave&quot; rights. Legal only upon initial creation of stream. Multiple such blocks tried in series until successful connection. First successful (last if all failed) remembered by DSPS, all successive &lt;peer/&gt; ignored.. On connection, DSPS initiates handshake using peer's full JID and contents of block for destination's full JID to the relay destination as per section &quot;Connecting to DSPS via default method&quot;. Authentication is done as per section &quot;DSPS relay setup&quot;. Upon successful handshake, DSPS sends presence notification to peer as per section &quot;Acknowledge of DSPS connection&quot;.</li>
  118. <li><strong>&quot;port&quot;</strong> <em>(optional)</em> for connecting to destination DSPS. If omitted, default is assumed.</li>
  119. <li><strong>&lt;comment/&gt;</strong> <em>(optional)</em> all such blocks reported in &quot;stats&quot; message. Multiple such blocks allowed. Block may contain a full XML stack of elements. No order implied for &quot;stats&quot; message.</li>
  120. </ul>
  121. <p>Possible failure messages:</p>
  122. <table>
  123. <tr><th>Code</th><th>Message</th><th>Description</th></tr>
  124. <tr><td>405</td><td>Method Not Allowed</td><td>Attempt at reconnect to relay without existing credentials, relay still connected, &lt;peer/&gt; block present in reconnect request, or feature not supported</td></tr>
  125. <tr><td>504</td><td>Gateway Timeout</td><td>All destination DSPS are unreachable.</td></tr>
  126. </table>
  127. </section2>
  128. <section2 topic='Connection waiting'>
  129. <p>DSPS creates &quot;id&quot; (empty string is legal), used in &quot;who&quot; replies and notifies client of waiting connection like so:</p>
  130. <example>
  131. &lt;iq
  132. id='dsps1'
  133. type='result'
  134. from='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
  135. to='rob@nauseum.org/dspsclient'&gt;
  136. &lt;query type='create' xmlns='jabber:iq:dsps'
  137. wait='10'
  138. host='dsps.jabber.org'
  139. port='5290'
  140. minthroughput='1.5KB'
  141. protocol='0.5'&gt;
  142. &lt;feature type='http' version='1.1'/&gt;
  143. &lt;feature type='ssl' version='3.0'/&gt;
  144. &lt;/query&gt;
  145. &lt;/iq&gt;
  146. </example>
  147. <ul>
  148. <li><strong>&quot;from&quot;</strong> full JID of DSPS, internally globally unique. Used in handshake and every subsequent communication with stream. May differ with the one specified in &quot;invite&quot; message.</li>
  149. <li><strong>&quot;wait&quot;</strong> amount of time in <strong>milliseconds</strong> that DSPS will wait for client to initiate handshake. If timeout occurs, DSPS will totally forget prepared connection and act accordingly.</li>
  150. <li><strong>&quot;host&quot;</strong> <em>(optional)</em> for handshake and data stream. If omitted default from the &quot;from&quot; is assumed. Intended for P2P connections to be able to report alternate hostname or IP for connection.</li>
  151. <li><strong>&quot;port&quot;</strong> <em>(optional)</em> for handshake and data stream. If omitted default is assumed.</li>
  152. <li><strong>&quot;minthroughput&quot;</strong> value from &quot;create&quot;.</li>
  153. <li><strong>&quot;protocol&quot;</strong> version this DSPS supports.</li>
  154. <li><strong>&lt;feature/&gt;</strong> <em>(optional)</em> supported by this DSPS. Type and version are properties and additional data stored in body. HTTP stream will not follow HTTP protocol. SSL handshake performed encrypted. Both HTTP and SSL connections are only between client and DSPS.</li>
  155. </ul>
  156. </section2>
  157. <section2 topic='Establishing prepared connection'>
  158. <p>Upon receipt of message as per section &quot;Connection waiting&quot;, client can either ignore it and connection will timeout, or connect to the DSPS directly via any supported connection method or via relay. There may be a maximum of 1 (one) established connection to DSPS from any Client_full_JID + DSPS_full_JID pair, deviations are handles as per section &quot;Connecting to DSPS via default method&quot;. DSPS will not discriminate method via which direct connection is made, even if prior to &quot;disconnect&quot; a different method was used. Any packet from an unauthorized connection is ignored without reporting an error.</p>
  159. <section3 topic='DSPS relay setup {optional}'>
  160. <p>Client may request another DSPS to relay this connection as per section &quot;Stream Creation/Relay&quot;, utilizing the &quot;create&quot; body. There is no limit on length of relay chain. Upon initiation of handshake with destination, DSPS reports key like so (message sequence unrelated to current DSPS handshake):</p>
  161. <example>
  162. &lt;iq
  163. id='dsps1'
  164. type='get'
  165. from='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
  166. to='rob@nauseum.org/dspsclient'&gt;
  167. &lt;query type='create' xmlns='jabber:iq:dsps'&gt;acDgH63I27Gb1&lt;/query&gt;
  168. &lt;/iq&gt;
  169. </example>
  170. <ul>
  171. <li><strong>&quot;get&quot;</strong> denotes request for auth key.</li>
  172. <li><strong>&quot;create&quot;</strong> body contains key returned by destination.</li>
  173. </ul>
  174. <p>Client must send said key to destination as per section &quot;Connecting to DSPS via default method&quot; and send response to DSPS (which will be transmitted to destination) like so:</p>
  175. <example>
  176. &lt;iq
  177. id='dsps1'
  178. type='result'
  179. from='rob@nauseum.org/dspsclient'
  180. to='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
  181. &lt;query type='create' xmlns='jabber:iq:dsps'&gt;acDgH63I27Gb1&lt;/query&gt;
  182. &lt;/iq&gt;
  183. </example>
  184. <ul>
  185. <li><strong>&quot;result&quot;</strong> denotes reply with auth key.</li>
  186. <li><strong>&quot;create&quot;</strong> body contains key returned by destination.</li>
  187. </ul>
  188. </section3>
  189. <section3 topic='Connecting to DSPS via HTTP method {optional}'>
  190. <p>Client must connect to DSPS on port 80 and initiate handshake. This may be attempted after &quot;create&quot; result received or &quot;disconnect&quot; occurred, and prior to &quot;wait&quot; timeout expiring, then send HTTP request like so:</p>
  191. <example>
  192. GET /DSPS/STREAM/ HTTP/1.0&lt;CR&gt;
  193. Host: dsps.server&lt;CR&gt;
  194. &lt;CR&gt;
  195. </example>
  196. <p>And will receive reply from DSPS before the start of data stream, like so:</p>
  197. <example>
  198. HTTP/1.0 200 OK&lt;CR&gt;
  199. Content-Type: application/octet-stream&lt;CR&gt;
  200. &lt;CR&gt;
  201. </example>
  202. <p>Upon completion, Client must resume DSPS handshake as per either section &quot;Connecting to DSPS via default method&quot; or section &quot;Connecting to DSPS via SSL method&quot; (if applicable). Subsequent data will not follow HTTP protocol. On error connection closed immediately with optional error messages.</p>
  203. <p>Possible failure messages:</p>
  204. <table>
  205. <tr><th>Code</th><th>Message</th><th>Description</th></tr>
  206. <tr><td>401</td><td>Unauthorized</td><td><em>(optional)</em> Returned if any error in HTTP handshake.</td></tr>
  207. </table>
  208. </section3>
  209. <section3 topic='Connecting to DSPS via SSL method {optional}'>
  210. <p>Client must connect to DSPS on specified port and initiate handshake. This may be attempted after &quot;create&quot; result received or &quot;disconnect&quot; occurred, and prior to &quot;wait&quot; timeout expiring, then send following on stream:</p>
  211. <example>starttls&lt;CR&gt;</example>
  212. <p>Next, regular TLS handshake is initiated. Upon completion, Client must resume DSPS handshake as per section &quot;Connecting to DSPS via default method&quot;. On error connection closed immediately with optional error messages.</p>
  213. <p>Possible failure messages:</p>
  214. <table>
  215. <tr><th>Code</th><th>Message</th><th>Description</th></tr>
  216. <tr><td>401</td><td>Unauthorized</td><td><em>(optional)</em> Returned if any error in SSL handshake.</td></tr>
  217. </table>
  218. </section3>
  219. <section3 topic='Connecting to DSPS via default method'>
  220. <p>Client must connect to DSPS on specified port and initiate handshake. May be attempted after &quot;create&quot; result received or &quot;disconnect&quot; occurred, and prior to &quot;wait&quot; timeout expiring. Standard and SSL handshakes are identical in decrypted state and take the form of:</p>
  221. <example>Client_full_JID DSPS_full_JID&lt;CR&gt;</example>
  222. <ul>
  223. <li><strong>&quot;Client_full_JID&quot;</strong> client full JID as supplied in either the &quot;create&quot; or &quot;acknowledge&quot; message.</li>
  224. <li><strong>&quot;DSPS_full_JID&quot;</strong> DSPS full JID as supplied in &quot;from&quot; field of &quot;create&quot; result message from section &quot;Connection waiting&quot;</li>
  225. <li><strong>&lt;CR&gt;</strong> regular carriage return, commonly referred to as the newline character.</li>
  226. </ul>
  227. <p>For example, the appropriate string for the above request would be:</p>
  228. <example>rob@nauseum.org/dspsclient dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33</example>
  229. <p>If Client_full_JID and DSPS_full_JID do not have an associated stream, are no longer valid, (e.g. timeout reached or client removed from stream), or connection from said Client_full_JID + DSPS_full_JID pair is in use (i.e. client is still connected to it), connection is closed immediately with possible optional error messages reported. Otherwise DSPS returns uniquely generated key followed by a &lt;CR&gt; like so:</p>
  230. <example>uGhhb74d21</example>
  231. <p>Client must now send key to DSPS via XML stream like so:</p>
  232. <example>
  233. &lt;iq
  234. id='dsps1'
  235. type='get'
  236. from='rob@nauseum.org/dspsclient'
  237. to='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'&gt;
  238. &lt;query type='auth' xmlns='jabber:iq:dsps'&gt;uGhhb74d21&lt;/query&gt;
  239. &lt;/iq&gt;
  240. </example>
  241. <ul>
  242. <li><strong>&quot;get&quot;</strong> denotes request for next auth key.</li>
  243. <li><strong>&quot;auth&quot;</strong> body contains key returned by DSPS.</li>
  244. </ul>
  245. <p>DSPS will now check key, if not valid, close connection, report possible optional error message and resume waiting on original key. If valid, generate new key and send to client like so:</p>
  246. <example>
  247. &lt;iq
  248. id='dsps1'
  249. type='result'
  250. from='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
  251. to='rob@nauseum.org/dspsclient'
  252. &lt;query type='auth' xmlns='jabber:iq:dsps'&gt;qgqB42Ij784&lt;/query&gt;
  253. &lt;/iq&gt;
  254. </example>
  255. <ul>
  256. <li><strong>&quot;result&quot;</strong> denotes return of next auth key.</li>
  257. <li><strong>&quot;auth&quot;</strong> body contains key returned by DSPS.</li>
  258. </ul>
  259. <p>Client must now send received key to DSPS via the stream followed by a &lt;CR&gt;. Once received, DSPS checks key, on mismatch connection is closed immediately with possible optional error messages reported, waiting on key is resumed. Upon successful handshake a message is sent to members of the stream in accordance with the following rules; If the client had type &quot;master&quot; connection, all members of the stream get notified. If the client had type &quot;slave&quot; connection, only other type &quot;master&quot; members get notified. The message takes the form of:</p>
  260. <example>
  261. &lt;iq
  262. id='dsps2'
  263. type='set'
  264. from='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
  265. to='foo@bar.com/resource'&gt;
  266. &lt;query type='presence' xmlns='jabber:iq:dsps'&gt;
  267. &lt;peer status='connect'&gt;JID&lt;/peer&gt;
  268. &lt;/query&gt;
  269. &lt;/iq&gt;
  270. </example>
  271. <ul>
  272. <li><strong>&quot;presence&quot;</strong> denotes presence change. Body may contain multiple &lt;peer/&gt; blocks where same JID peers must be placed in chronological order relative to each other from start to end of message.</li>
  273. <li><strong>&lt;peer/&gt;</strong> body is full JID of the joined peer unless peer of type &quot;relay&quot;, in which case the resource is not reported.</li>
  274. <li><strong>&quot;status&quot;</strong> is new status of peer.</li>
  275. </ul>
  276. <p>Possible failure messages:</p>
  277. <table>
  278. <tr><th>Code</th><th>Message</th><th>Description</th></tr>
  279. <tr><td>401</td><td>Unauthorized</td><td><em>(optional)</em> Returned if the DSPS is not aware of said Client_full_JID + DSPS_full_JID pair. Where &quot;from&quot; contains DSPS_full_JID that was used in the handshake and &quot;to&quot; contains Client_full_JID that was used in the handshake.</td></tr>
  280. <tr><td>409</td><td>Conflict</td><td><em>(optional)</em> Returned if connection from said full client JID and full DSPS JID is in use (i.e. client is still connected to it). Where &quot;from&quot; contains DSPS_full_JID that was used in the handshake and &quot;to&quot; contains Client_full_JID that was used in the handshake.</td></tr>
  281. </table>
  282. </section3>
  283. </section2>
  284. <section2 topic='Stream administration'>
  285. <p>DSPS protocol allows multiple peers to use the same stream. Manipulation of the authorized peer list is done through admin functionality described in next several subsections. DSPS protocol allows for three types of peer connections: &quot;master&quot;, &quot;slave&quot;, and &quot;relay&quot;. &quot;master&quot; peers get full control of the stream, &quot;slave&quot; peers get limited control of the stream, and &quot;relay&quot; are treated similar to &quot;slave&quot; except in reporting of JIDs where the resource must be omitted.</p>
  286. <p>&quot;master&quot; peers are allowed to invite any other user to the stream and drop any peer registered with the stream, including themselves. &quot;slave&quot; peers are only allowed to drop themselves from the stream. Any administrative changes coming from a &quot;slave&quot; peer that are not for the peer's own connection are ignored. Dropping one's own connection is the preferred way of permanently disconnecting from the stream.</p>
  287. <p>Any data received from a &quot;master&quot; gets copied to every other peer on the stream. Any data received from a &quot;slave&quot; peer gets copied to all &quot;master&quot; peers on the stream only.</p>
  288. <p>Stream administration request looks like so:</p>
  289. <example>
  290. &lt;iq
  291. id='dsps3'
  292. type='set'
  293. from='rob@nauseum.org/dspsclient'
  294. to='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'&gt;
  295. &lt;query type='admin' xmlns='jabber:iq:dsps' expire='20' wait='10'&gt;
  296. &lt;comment&gt;welcome to the stream&lt;/comment&gt;
  297. &lt;peer type='master'&gt;someone@somewhere.net&lt;/peer&gt;
  298. &lt;/query&gt;
  299. &lt;/iq&gt;
  300. </example>
  301. <ul>
  302. <li><strong>&quot;admin&quot;</strong> denotes administrative functions are to follow. Any properties within this block apply to this block alone. Multiple such blocks are allowed.</li>
  303. <li><strong>&quot;expire&quot;</strong> time DSPS should wait for the &quot;acknowledge&quot; message from any invited peer within block. An &quot;expire&quot; of 0 denotes no time limit. Actual value sent to peer as &quot;expire&quot; is <em>minimum</em> of this value and default value preset for DSPS. If value unparseable or not present, default is used.</li>
  304. <li><strong>&quot;wait&quot;</strong> time DSPS should wait for invited peer to connect to DSPS after &quot;acknowledge&quot; is received and message from section &quot;Connection waiting&quot;. is sent. A &quot;wait&quot; of 0 denotes no time limit. Actual value sent to peer as &quot;wait&quot; is <em>minimum</em> of this value and default value preset for DSPS. If the value unparseable or not present, default is used.</li>
  305. <li><strong>&lt;comment/&gt;</strong> <em>(optional)</em> block sent to each of the peers. Multiple such blocks are allowed. Block may contain a full XML stack of elements. All such blocks are sent to each of the invited peers as is. No guarantee is made on their order in the &lt;invite/&gt; message.</li>
  306. <li><strong>&lt;peer/&gt;</strong> JID to execute action upon. If invitation then body will not necessarily be same full JID as one that would respond. Multiple such blocks allowed.</li>
  307. <li><strong>&quot;type&quot;</strong> type of action to do. &quot;master&quot; denotes invitation, granting master rights. &quot;slave&quot; denotes invitation, granting slave rights. &quot;drop&quot; denotes request to drop peer from stream. &quot;relay&quot; peers may not be invited but may be dropped using this method.</li>
  308. </ul>
  309. <p>Possible optional errors include the following:</p>
  310. <example>
  311. &lt;iq
  312. id='dsps3'
  313. type='result'
  314. from='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
  315. to='user@server.org/resource'&gt;
  316. &lt;query type='admin' xmlns='jabber:iq:dsps'&gt;
  317. &lt;peer acknowledge='expire'&gt;abc@company.com/net&lt;/peer&gt;
  318. &lt;peer acknowledge='reject'&gt;friend@someplace.com/home&lt;/peer&gt;
  319. &lt;peer acknowledge='timeout'&gt;abd@company.com/net&lt;/peer&gt;
  320. &lt;peer acknowledge='missing'&gt;who@knows.org/winjab&lt;/peer&gt;
  321. &lt;/query&gt;
  322. &lt;/iq&gt;
  323. </example>
  324. <ul>
  325. <li><strong>&quot;admin&quot;</strong> denotes admin response, sent to sender of &quot;admin&quot; request for every peer in block. Peers may be combined from multiple &quot;admin&quot; requests or peers from single &quot;admin&quot; request may be split over multiple &quot;admin&quot; replies.</li>
  326. <li><strong>&lt;peer/&gt;</strong> peer in question. For &quot;expire&quot; JID is one from invite request. For &quot;reject&quot; JID is one from which reject received. For &quot;timeout&quot; JID is one from invite request. For &quot;missing&quot; is one from drop request. After this DSPS will totally forget about this peer.</li>
  327. <li><strong>&quot;acknowledge&quot;</strong> reason for failure. &quot;expire&quot; denotes &quot;expire&quot; timeout sent, has ended. &quot;reject&quot; denotes peer rejected invite. &quot;timeout&quot; denotes &quot;wait&quot; timeout sent, has ended. &quot;missing&quot; denotes peer marked for drop not found registered on tis stream.</li>
  328. </ul>
  329. <p>Possible failure messages:</p>
  330. <table>
  331. <tr><th>Code</th><th>Message</th><th>Description</th></tr>
  332. <tr><td>403</td><td>Forbidden</td><td><em>(optional)</em> Returned if peer with &quot;slave&quot; rights attempts to use &quot;master&quot; admin privileges.</td></tr>
  333. </table>
  334. <section3 topic='Invitation to stream {optional}'>
  335. <p>Upon invite DSPS will attempt to invite each of the peers like so:</p>
  336. <example>
  337. &lt;iq
  338. id='dsps4'
  339. type='get'
  340. from='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
  341. to='foo@bar.com/resource'&gt;
  342. &lt;query type='acknowledge'
  343. xmlns='jabber:iq:dsps'
  344. status='master'
  345. expire='20'&gt;
  346. &lt;peer&gt;rob@nauseum.org/dspsclient&lt;/peer&gt;
  347. &lt;comment&gt;some long comment block or structure&lt;/comment&gt;
  348. &lt;/query&gt;
  349. &lt;/iq&gt;
  350. </example>
  351. <ul>
  352. <li><strong>&quot;from&quot;</strong> is unique JID/resource pair generated for this JID, not necessarily same as JID/resource pair specified in section &quot;Connection waiting&quot;. It is used for identification of the &quot;acknowledge&quot; message.</li>
  353. <li><strong>&quot;acknowledge&quot;</strong> denotes request for invitation acknowledge.</li>
  354. <li><strong>&quot;status&quot;</strong> type of connection the client is granted. Same type as tag in invitation request.</li>
  355. <li><strong>&quot;expire&quot;</strong> time DSPS will wait for the &quot;acknowledge&quot; message.</li>
  356. <li><strong>&lt;peer/&gt;</strong> peer who initiated this invite. Multiple such blocks may exist if multiple distinct peers sent invitation that have not yet been received by the invitee.</li>
  357. <li><strong>&lt;comment/&gt;</strong> is &lt;comment/&gt; structure(s) sent in admin request, present if admin request contained it.</li>
  358. </ul>
  359. </section3>
  360. <section3 topic='Dropping from stream'>
  361. <p>Upon drop DSPS will immediately closes the connection to the dropped peer. It then will totally forget this peer right after sending it a notification message like so:</p>
  362. <example>
  363. &lt;iq
  364. id='dsps5'
  365. type='set'
  366. from='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
  367. to='foo@bar.com/resource'&gt;
  368. &lt;query type='acknowledge' xmlns='jabber:iq:dsps' status='drop'&gt;
  369. &lt;comment&gt;some long comment block or structure&lt;/comment&gt;
  370. &lt;/query&gt;
  371. &lt;/iq&gt;
  372. </example>
  373. <ul>
  374. <li><strong>&quot;from&quot;</strong> is the DSPS JID/resource pair which DSPS has associated with this connection.</li>
  375. <li><strong>&quot;acknowledge&quot;</strong> denotes drop notification. Despite the block name, this message does not require a reply.</li>
  376. <li><strong>&quot;status&quot;</strong> drop denotes a connection drop.</li>
  377. <li><strong>&lt;comment/&gt;</strong> is &lt;comment/&gt; structure(s) sent in admin request, preset if admin request contained it.</li>
  378. </ul>
  379. <p>For every successfully dropped peer a message is sent to all other stream members, following the rules stated for the &quot;presence&quot; message, and takes the form of:</p>
  380. <example>
  381. &lt;iq
  382. id='dsps6'
  383. type='set'
  384. from='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
  385. to='foo@bar.com/resource'&gt;
  386. &lt;query type='presence' xmlns='jabber:iq:dsps'&gt;
  387. &lt;peer status='drop'&gt;JID&lt;/peer&gt;
  388. &lt;/query&gt;
  389. &lt;/iq&gt;
  390. </example>
  391. <ul>
  392. <li><strong>&quot;from&quot;</strong> is the DSPS JID/resource pair which DSPS has associated with the connection of the recipient of the message.</li>
  393. <li><strong>&quot;presence&quot;</strong> denotes presence change. Body may contain multiple &lt;peer/&gt; blocks where same JID peers must be placed in chronological order relative to each other from start to end of message.</li>
  394. <li><strong>&lt;peer/&gt;</strong> body is full JID of the dropped peer registered on the stream, unless peer is of type &quot;relay&quot;, in which case the resource is not reported.</li>
  395. <li><strong>&quot;status&quot;</strong> is new status of peer.</li>
  396. </ul>
  397. </section3>
  398. </section2>
  399. <section2 topic='Invitation reply'>
  400. <p>An invited peer has the option to accept or reject an invitation to a stream.</p>
  401. <section3 topic='Accepting an invite'>
  402. <p>To accept an invitation to a stream, the peer must reply like so:</p>
  403. <example>
  404. &lt;iq
  405. id='dsps4'
  406. type='result'
  407. from='foo@bar.com/moredsps'
  408. to='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33&gt;
  409. &lt;query type='acknowledge' xmlns='jabber:iq:dsps' status='connect'/&gt;
  410. &lt;/iq&gt;
  411. </example>
  412. <ul>
  413. <li><strong>&quot;from&quot;</strong> is the JID/resource pair which will be associated with this connection, only it will be allowed to connect to this stream as this user. A peer may be registered to multiple streams from the same full JID, hence all DSPS full JIDs linked to a given peer must be unique.</li>
  414. <li><strong>&quot;to&quot;</strong> contains the DSPS JID/resource pair which was the source in the original &quot;acknowledge&quot; message.</li>
  415. <li><strong>&quot;acknowledge&quot;</strong> denotes acknowledgment to invitation.</li>
  416. <li><strong>&quot;status&quot;</strong> connect denotes an acceptance of invitation.</li>
  417. </ul>
  418. <p>Upon receipt of this reply the DSPS creates a unique resource for this client JID/resource pair. It then prepares the &quot;create&quot; message as described in section &quot;Connection waiting&quot;.</p>
  419. </section3>
  420. <section3 topic='Rejecting an invite'>
  421. <p>Rejecting an invitation can be done in two ways. A peer can forget about the invitation and let the invitation &quot;expire&quot;, or preferably a message can be sent like so:</p>
  422. <example>
  423. &lt;iq
  424. id='dsps4'
  425. type='result'
  426. from='foo@bar.com/moredsps'
  427. to='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33&gt;
  428. &lt;query type='acknowledge' xmlns='jabber:iq:dsps' status='drop'/&gt;
  429. &lt;/iq&gt;
  430. </example>
  431. <ul>
  432. <li><strong>&quot;to&quot;</strong> contains the DSPS JID/resource pair which was the source in the original &quot;acknowledge&quot; message.</li>
  433. <li><strong>&quot;acknowledge&quot;</strong> denotes acknowledgment to invitation.</li>
  434. <li><strong>&quot;status&quot;</strong> drop denotes an rejection of invitation.</li>
  435. </ul>
  436. <p>Regardless of the way a rejection was achieved a notification message is sent to the inviting peer, as was described in section &quot;Stream administration&quot;. If unknown &quot;type&quot; is sent, it will be interpreted as a reject. A maximum of one &quot;acknowledge&quot; is allowed during the lifetime of an invitation. If multiple such tags are sent, the first tag takes precedence. Any rejection of a public connection will be ignored.</p>
  437. </section3>
  438. </section2>
  439. <section2 topic='Disconnection handling'>
  440. <p>If a peer ever disconnects without first dropping themselves, the following policy applies:</p>
  441. <p>The peer may reconnect within the &quot;wait&quot; timeout provided in the &quot;create&quot; reply in section &quot;Connection waiting&quot;. The peer may choose any supported mode of reconnection supplied in &quot;create&quot; reply, regardless of mode previously used. The &quot;wait&quot; timeout is not cumulative over multiple disconnects. After reconnect, peer will not receive any data that exists on the stream while it was disconnected.</p>
  442. <p>Upon such disconnection DSPS notifies all other members of the stream, following the rules stated for the &quot;presence&quot; message, and takes the form of:</p>
  443. <example>
  444. &lt;iq
  445. id='dsps7'
  446. type='set'
  447. from='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
  448. to='foo@bar.com/resource'&gt;
  449. &lt;query type='presence' xmlns='jabber:iq:dsps'&gt;
  450. &lt;peer status='waiting'&gt;JID&lt;/peer&gt;
  451. &lt;/query&gt;
  452. &lt;/iq&gt;
  453. </example>
  454. <ul>
  455. <li><strong>&quot;from&quot;</strong> is the DSPS JID/resource pair which DSPS has associated with the connection of the recipient of the message.</li>
  456. <li><strong>&quot;presence&quot;</strong> denotes presence change. Body may contain multiple &lt;peer/&gt; blocks where same JID peers must be placed in chronological order relative to each other from start to end of message.</li>
  457. <li><strong>&lt;peer/&gt;</strong> body is full JID of the disconnected peer registered on the stream, unless peer is of type &quot;relay&quot;, in which case the resource is not reported.</li>
  458. <li><strong>&quot;status&quot;</strong> is new status of peer.</li>
  459. </ul>
  460. <p>Upon reaching &quot;wait&quot; timeout the procedure is the same if the peer dropped its own connection.</p>
  461. </section2>
  462. <section2 topic='Ending a connection'>
  463. <p>Permanent termination of connection can be done in two ways: peer may disconnect from the stream and let the &quot;wait&quot; timeout expire, or more preferably the peer will drop itself from the stream via an &quot;admin&quot; message. The &quot;admin&quot; is still allowed to contain multiple &quot;peer&quot; blocks.</p>
  464. </section2>
  465. <section2 topic='Stream use'>
  466. <p>The use policy for the stream follows the standard rules described in this document. Type and structure of the data must be negotiated by the peers separately (presumably via the normal XML message stream or within &lt;comment/&gt; blocks). The DSPS stream operates at the speed of the slowest connection (or slower if it is so configured in its internal configuration).</p>
  467. <p>Data read from peer in a unit of transfer (decided by DSPS) is sent to other peers in a format like so:</p>
  468. <example>0&lt;size&gt;&lt;CR&gt;&lt;id&gt;&lt;CR&gt;&lt;data&gt;</example>
  469. <ul>
  470. <li><strong>&quot;0&quot;</strong> at beginning for checking start of block.</li>
  471. <li><strong>&lt;size&gt;</strong> length in bytes including id and its trailing CR in form of [1-9][0-9]*[0-9A-Z], where last character is base 36 numerical equivalent power of 1024.</li>
  472. <li><strong>&lt;id&gt;</strong> id of the sender as per &quot;who&quot; query.</li>
  473. <li><strong>&lt;data&gt;</strong> data sent.</li>
  474. <li><strong>&lt;CR&gt;</strong> regular carriage return, commonly referred to as the newline character.</li>
  475. </ul>
  476. <p>For example, the appropriate string for the above block would be:</p>
  477. <example>
  478. 0340&lt;CR&gt;
  479. 010&lt;CR&gt;
  480. this is the data in ASCII form
  481. </example>
  482. <p>First block received after connection will always be full block. If discrepancy occurs, receiving peer should disconnect and reconnect back to stream.</p>
  483. </section2>
  484. <section2 topic='Stream information'>
  485. <p>Two mechanisms exists to gain information about the stream configuration and its members. They are described within next few subsections.</p>
  486. <section3 topic='Stream peer listing'>
  487. <p>To retrieve listing of all registered peers of this stream and their respective connection status any registered peer sends a message like so:</p>
  488. <example>
  489. &lt;iq
  490. id='dsps8'
  491. type='get'
  492. from='rob@nauseum.org/dspsclient'
  493. to='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'&gt;
  494. &lt;query type='who' xmlns='jabber:iq:dsps'/&gt;
  495. &lt;/iq&gt;
  496. </example>
  497. <ul>
  498. <li><strong>&quot;to&quot;</strong> has the usual meaning for this client when referring to this DSPS stream.</li>
  499. <li><strong>&quot;who&quot;</strong> denotes that this is a listing request. It may not contain a body or attributes, otherwise it will be ignored without error.</li>
  500. </ul>
  501. <p>The query follows the standard rules: query originating from a &quot;master&quot; peer will return listing of all registered peers and their associated statuses, query originating from a &quot;slave&quot; peer will only return listing of all registered &quot;master&quot; peers and their associated statuses. Returned results do not have any strict order. If multiple &quot;who&quot; queries were requested by a peer that have not yet received a reply, only one reply need be sent.</p>
  502. <p>The query reply is formatted like so:</p>
  503. <example>
  504. &lt;iq
  505. id='dsps8'
  506. type='result'
  507. from='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
  508. to='rob@nauseum.org/dspsclient'&gt;
  509. &lt;query type='who' xmlns='jabber:iq:dsps'&gt;
  510. &lt;peer
  511. type='master'
  512. id='0'
  513. status='connect'
  514. throughput='1KB////4.8KB//3KB'&gt;
  515. rob@nauseum.org/dspsclient
  516. &lt;/peer&gt;
  517. &lt;/query&gt;
  518. &lt;/iq&gt;
  519. </example>
  520. <ul>
  521. <li><strong>&quot;from&quot;</strong> is unique DSPS JID/resource pair for the peer receiving the result.</li>
  522. <li><strong>&lt;peer/&gt;</strong> body is full JID of registered peer, unless peer is of type &quot;relay&quot;, in which case the resource is not reported. A separate block exists for every viewable peer.</li>
  523. <li><strong>&quot;type&quot;</strong> the type of connection peer has. May contain value of &quot;master&quot;, &quot;slave&quot;, or &quot;relay&quot;.</li>
  524. <li><strong>&quot;id&quot;</strong> id prepended to data coming from this peer.</li>
  525. <li><strong>&quot;status&quot;</strong> current status of peer. &quot;connect&quot; denotes peer able to receive data. &quot;wait&quot; denotes peer registered but not connected. &quot;expire&quot; denotes peer was invited but no reply was received yet.</li>
  526. <li><strong>&quot;throughput&quot;</strong> shows the average throughput to that peer per second in the units specified after the number (e.g. B, KB, MB, GB, TB, EB) in capital letters. Time is measured only during data transfer. Value contains multiple fields delimited by slash (/). Each field represents time span of power of two (2), relative to its position from start of the string. Each filled-in field contains the average throughput over that timespan. e.g. (1B per sec in last sec)/(1.1B per sec in last 2 sec)/(0.9B per sec in last 4 sec). Only fields representing power of zero (2^0 sec) and power of four (2^4 sec) are required. Last field must be filled-in.</li>
  527. </ul>
  528. </section3>
  529. <section3 topic='Stream status listing'>
  530. <p>To retrieve listing of all stream configuration/statistics values or public streams, any registered peer sends a message like so:</p>
  531. <example>
  532. &lt;iq
  533. id='dsps9'
  534. type='get'
  535. from='rob@nauseum.org/dspsclient'
  536. to='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'&gt;
  537. &lt;query type='stats' xmlns='jabber:iq:dsps'/&gt;
  538. &lt;/iq&gt;
  539. </example>
  540. <ul>
  541. <li><strong>&quot;to&quot;</strong> if contains a resource, will return statistics for specified stream. Otherwise will return listing of public streams, i.e. any stream with &quot;maxpublic&quot; greater then 0.</li>
  542. <li><strong>&quot;stats&quot;</strong> denotes that this is a configuration/statistics request. It may not contain a body or attributes, otherwise it will be ignored without error.</li>
  543. </ul>
  544. <p>The query reply is formatted like so:</p>
  545. <example>
  546. &lt;iq
  547. id='dsps9'
  548. type='result'
  549. from='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
  550. to='rob@nauseum.org/dspsclient'&gt;
  551. &lt;query type='stats' xmlns='jabber:iq:dsps'
  552. init='00000000000000'
  553. protocol='0.5'
  554. port='5290'
  555. minthroughput='1.5KB'
  556. expiredefault='150'
  557. waitdefault='100'
  558. wait='10'
  559. public='5'
  560. maxpublic='25'
  561. mastercount='20'
  562. slavecount='40'
  563. relaycount='0'&gt;
  564. &lt;feature type='http' version='1.1'/&gt;
  565. &lt;feature type='ssl' version='3.0'/&gt;
  566. &lt;peer&gt;mydsps@jabber.org/8xd67f56df4f546fdgsfdg65f6g58f&lt;/peer&gt;
  567. &lt;comment&gt;some server comment&lt;/comment&gt;
  568. &lt;/query&gt;
  569. &lt;/iq&gt;
  570. </example>
  571. <ul>
  572. <li><strong>&quot;from&quot;</strong> the DSPS JID/resource pair for the peer receiving the result.</li>
  573. <li><strong>&quot;init&quot;</strong> UNIX timestamp of the date this stream was initiated.</li>
  574. <li><strong>&quot;protocol&quot;</strong> protocol version this DSPS supports.</li>
  575. <li><strong>&quot;port&quot;</strong> default port this DSPS listens for connections on.</li>
  576. <li><strong>&quot;minthroughput&quot;</strong> as defined in &quot;create&quot;.</li>
  577. <li><strong>&quot;expiredefault&quot;</strong> default time this DSPS will wait for an &quot;acknowledge&quot; response.</li>
  578. <li><strong>&quot;waitdefault&quot;</strong> default time this DSPS will wait for a connection to its default port after an invitation is accepted.</li>
  579. <li><strong>&quot;wait&quot;</strong> time this DSPS will wait for this particular client to reconnect if it ever gets disconnected. This is the same value as one sent in the &quot;create&quot; response.</li>
  580. <li><strong>&quot;public&quot;</strong> number of &quot;slave&quot; peers registered with stream without invitation.</li>
  581. <li><strong>&quot;maxpublic&quot;</strong> maximum number of &quot;slave&quot;peers allowed without invitation.</li>
  582. <li><strong>&quot;mastercount&quot;</strong> number of peers with a &quot;master&quot; connection registered on this stream.</li>
  583. <li><strong>&quot;slavecount&quot;</strong> number of peers with a &quot;slave&quot; connection registered on this stream.</li>
  584. <li><strong>&quot;relaycount&quot;</strong> number of peers with a &quot;relay&quot; connection registered on this stream.</li>
  585. <li><strong>&lt;feature/&gt;</strong> <em>(optional)</em> denotes a supported feature. All supported features must be listed.</li>
  586. <li><strong>&lt;peer/&gt;</strong> <em>(optional)</em> list of public stream connections where all reported statistics match. Present only if &quot;to&quot; in original request contained no resource. Multiple allowed where statistics match for all.</li>
  587. <li><strong>&lt;comment/&gt;</strong> <em>(optional)</em> parameter(s) with a comments from &quot;create&quot;. This block may contain full XML stack of elements. Multiple such blocks are allowed.</li>
  588. </ul>
  589. <p>All &quot;status&quot; attributes are required. Any other undefined blocks with any multiplicity, are legal in this block as long as their tags are not identical to any tag within the protocol. Results returned do not have any strict order. If &quot;to&quot; in original request contained no resource, multiple &quot;stats&quot; blocks are allowed, where each contains at least one &lt;peer/&gt; block which has &quot;maxpublic&quot; greater than 0. To join a public stream a client must send message as per section &quot;Accepting an invite&quot;.</p>
  590. </section3>
  591. </section2>
  592. <section2 topic='Stream shutdown'>
  593. <p>Stream exists from its &quot;create&quot;ion time to the time when there are no more &quot;master&quot; peers registered with the stream.</p>
  594. <p>When last &quot;master&quot; peer is dropped from the stream, DSPS will make sure that all the data sent by all the &quot;master&quot; peers was actually copied to all the &quot;slave&quot; peers still present. For every remaining &quot;slave&quot; peer DSPS will initiate a drop event. Once stream is void of any peers it will be totally forgotten by the DSPS and all associated data is released.</p>
  595. </section2>
  596. <section2 topic='Error message format'>
  597. <p>Error messages look like so:</p>
  598. <example>
  599. &lt;iq
  600. id='dsps9'
  601. type='error'
  602. from='dsps.jabber.org/0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'
  603. to='rob@nauseum.org/dspsclient'&gt;
  604. &lt;error code='405'&gt;Method Not Allowed&lt;/error&gt;
  605. &lt;/iq&gt;
  606. </example>
  607. <ul>
  608. <li><strong>&lt;error/&gt;</strong> denotes error block where body is text description.</li>
  609. <li><strong>&quot;code&quot;</strong> denotes error code.</li>
  610. </ul>
  611. </section2>
  612. </section1>
  613. <section1 topic='Possible applications'>
  614. <section2 topic='File transfer'>
  615. <p>File transfer can be easily accomplished over DSPS. Where one user invites another user to a DSPS stream. File details can be transfered in the invitation comment as such: &lt;meta type='file' name='myfile.txt' size='500K' crc32='12345' sha1='23451' mime='application/octet-stream' timestamp='12345' date='20020412T00:00:00'/&gt;. Where the &quot;size&quot; would be in bytes. All properties should reflect their appropriate values for this instance. Once the second peer has accepted, it can simply put a CR on the stream stating that transfer can begin. then the first party simply dumps the contents of file on the stream, closes the stream and &quot;drop&quot;s itself from the stream. DSPS will make sure the second party gets everything that the first party sent before closing the connection. If multiple recipients of the file are required, the sending client can save a lot of bandwidth and transmit only one copy if the file to the DSPS which in term will transmit the data over to all the other connected clients.</p>
  616. </section2>
  617. <section2 topic='VoIP'>
  618. <p>Same idea as the file transfer. However if more then two parties are involved, every party must have a &quot;master&quot; connection.</p>
  619. </section2>
  620. <section2 topic='Multicast'>
  621. <p>A server has a JID which it registers with a stream. Any client wishing to join the multicast sends an XML message to the server, which then invites the client with a &quot;slave&quot; connection. Thus everything the server sends is received by every client on the stream. If there are multiple back-up servers, they can be invited with a &quot;master&quot; connection, thus if one of them goes down, the others can take over.</p>
  622. </section2>
  623. <section2 topic='File Storage'>
  624. <p>It has long been discussed in many Jabber places that a file storage facility is desired. The communication with such a facility can be easily accommodated with DSPS, as such a facility would merely appear as a user to DSPS which can either be &quot;invite&quot;ed or &quot;invite&quot; other users onto personal streams to transfer files as described in 6.1.</p>
  625. </section2>
  626. </section1>
  627. <section1 topic='Why DSPS instead of PASS'>
  628. <p>PASS has the following design flaws that make it unsuitable for its stated purpose of providing raw data-streams to all classes of users, including those behind firewalls or NAT.</p>
  629. <section2 topic='Ports'>
  630. <p>PASS requires the use of a large number of individual ports, which on a heavily loaded server can lead to the number of spare ports dropping to zero, causing connections to be refused.</p>
  631. <p>This is also problematic if PASS is situated behind a firewall. Firewall administrators are typically loathe to allow incoming connections to a large range of ports.</p>
  632. <p>DSPS only uses one port, and so resolves the first problem, while making the second almost a non-issue.</p>
  633. </section2>
  634. <section2 topic='Knowledge of IP'>
  635. <p>PASS requires the client to have some knowledge of IP, which immediately forces the assumption that the XML stream's underlying protocol is in fact, IP. While at the time of writing this is always the case, it may not always be this way.</p>
  636. <p>DSPS uses the Jabber ID to do its routing, and so avoids these problems. And while DSPS does use the concept of a TCP connection and an IP port, this information is never actually used anywhere on the XML stream, making the actual connection to the DSPS implementation-defined.</p>
  637. </section2>
  638. <section2 topic='IP Addresses'>
  639. <p>PASS makes the IP address of the remote client available to the local client. While it is rare that this is an actual problem, many users and administrators prefer that IP address information is never actually revealed.</p>
  640. <p>DSPS never transmits IP address information across the XML stream, and so does not have this problem.</p>
  641. </section2>
  642. <section2 topic='Intuitiveness'>
  643. <p>PASS requires a client to initiate a connection by opening a (proxied) listening socket, and then soliciting connections. However, TCP works by having the client connect to a remote resource directly. This difference can make the operation of PASS difficult to understand. Also, it is left to the client to distribute the information about this listening socket, which places an additional burden on the client.</p>
  644. <p>DSPS, while it uses listening sockets to do its work, does all the work of setting up the connection after a client initiates it. All the initiating client has to do is request a connection, connect to the DSPS, and wait - everything else is handled automatically.</p>
  645. </section2>
  646. <section2 topic='Scalability'>
  647. <p>Due to the master/slave design, DSPS is already able to handle multicasts of streams or such, whilst PASS was only designed for simple p2p stream connections. This will becoming increasingly more important as more emphasis is made on streaming capabilities, for technologies such as audio and video conferencing.</p>
  648. <p>Due to DSPS generality, the protocol can be easily used for either P2P or P2S2P needs. This eliminates the need for a separate protocol for each of the tasks.</p>
  649. </section2>
  650. </section1>
  651. <section1 topic='DSPS with P2P'>
  652. <p>It is not mandated for DSPS to reside beside a Jabber server. It is entirely possible for any client to implement a stripped down version of such a server. In such a case the only sections that are required are any error reporting, invitation acknowledgment and statistical responses. Any other area of the protocol becomes optional since the recipient peer will not have the ability to use it anyway.</p>
  653. <p>Any client may, but is not required to utilize the striped down functionality. When utilizing such functionality the serving client sends an invitation to the recipient client to join the serving client's DSPS stream. Thus the &quot;create&quot; message would list the serving client as the DSPS and would utilize the &quot;host&quot; attribute to tell the recipient client where to connect to the DSPS.</p>
  654. <p>This ability is advantageous since the recipient client only needs to know one protocol for data transmission over P2P or P2S2P connections, and would not see a difference between the two. The proposed method is for one side to fist try serving a connection to the other. If that fails the other side may attempt to serve the connection. If the second attempt fails the clients may utilize an external DSPS server. The negotiation of who will serve is done outside DSPS protocol. DSPS has no functionality to decide when a P2P connection is possible or desirable, nor does it have enough information to do so reliably.</p>
  655. </section1>
  656. </xep>