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-0095.xml 19KB

  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>Stream Initiation</title>
  10. <abstract>This specification defines an XMPP protocol extension for initiating a data stream between any two XMPP entities. The protocol includes the ability to include metadata about the stream and provides a pluggable framework so that various profiles of stream initiation can be defined for particular use cases (such as file transfer).</abstract>
  12. <number>0095</number>
  13. <status>Deprecated</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>XEP-0030</spec>
  19. </dependencies>
  20. <supersedes/>
  21. <supersededby><spec>XEP-0166</spec></supersededby>
  22. <shortname>si</shortname>
  23. <schemaloc>
  24. <url></url>
  25. </schemaloc>
  26. <registry/>
  27. &temas;
  28. &linuxwolf;
  29. &reatmon;
  30. <revision>
  31. <version>1.2</version>
  32. <date>2017-11-29</date>
  33. <initials>XEP Editor (ssw)</initials>
  34. <remark>Deprecated by vote of the council.</remark>
  35. </revision>
  36. <revision>
  37. <version>1.1</version>
  38. <date>2004-04-13</date>
  39. <initials>psa</initials>
  40. <remark>More fully defined the XMPP Registrar considerations.</remark>
  41. </revision>
  42. <revision>
  43. <version>1.0</version>
  44. <date>2003-10-17</date>
  45. <initials>psa</initials>
  46. <remark>Per a vote of the Jabber Council, advanced status to Draft.</remark>
  47. </revision>
  48. <revision>
  49. <version>0.6</version>
  50. <date>2003-07-15</date>
  51. <initials>rwe</initials>
  52. <remark>Stream ids not needed on return results. Moved s5b, ibb, and url-data to the actual namespaces of the stream protocols.</remark>
  53. </revision>
  54. <revision>
  55. <version>0.5</version>
  56. <date>2003-07-06</date>
  57. <initials>lw</initials>
  58. <remark>Removed signalling; Strengthened the profile definition requirements; Allowed for optional feature negotiation under certain circumstances</remark>
  59. </revision>
  60. <revision>
  61. <version>0.4</version>
  62. <date>2003-06-30</date>
  63. <initials>lw</initials>
  64. <remark>Actually added XML schemas; Added clarifications/requirements for stream interaction.; Fixed various typos and inconsistencies</remark>
  65. </revision>
  66. <revision>
  67. <version>0.3</version>
  68. <date>2003-06-30</date>
  69. <initials>lw</initials>
  70. <remark>
  71. Added XML schemas; Added XMPP-style error conditions; Added signal/notification support; Moderate reorganization to accommodate changes
  72. </remark>
  73. </revision>
  74. <revision>
  75. <version>0.2</version>
  76. <date>2003-06-23</date>
  77. <initials>tjm</initials>
  78. <remark>
  79. Added linuxwolf as an author (should have been there from the start), form
  80. uses stream-method as the field var, clarified the stream interaction.
  81. </remark>
  82. </revision>
  83. <revision>
  84. <version>0.1</version>
  85. <date>2003-06-10</date>
  86. <initials>tjm</initials>
  87. <remark>Initial version.</remark>
  88. </revision>
  89. </header>
  90. <section1 topic='Introduction' anchor='intro'>
  91. <p>As the Jabber protocols are extended beyond basic messaging and presence, the need has arisen for a generic protocol that can be used to negotiate content streams between any two entities. Such streams might be in-band, but more likely will be out-of-band, binary streams used in applications such as file transfer, voice chat, and video conferencing. This document provides a method for negotiating such streams, including meta-information about the intended usage of the stream.</p>
  92. </section1>
  93. <section1 topic='Requirements' anchor='reqs'>
  94. <ul>
  95. <li>The defined protocol will allow for negotiation of a common stream.</li>
  96. <li>The defined protocol will allow for meta-information to be sent about the stream usage.</li>
  97. <li>The defined protocol will not be required for stream usage.</li>
  98. </ul>
  99. </section1>
  100. <section1 topic='Use Case' anchor='usecase'>
  101. <p>The process for stream negotiation is as follows:</p>
  102. <ol>
  103. <li>Sender discovers if Receiver implements the desired profile. [E1]</li>
  104. <li>Sender offers a stream initiation. [E2]</li>
  105. <li>Receiver accepts stream initiation.</li>
  106. <li>Sender and receiver prepare for using negotiated profile and stream, EUC</li>
  107. </ol>
  108. <p>Error Conditions:</p>
  109. <ol>
  110. <li>The Receiver does not support the desired profile, EUC</li>
  111. <li>Receiver rejects the stream initiation, EUC</li>
  112. </ol>
  113. <section2 topic='Discovery' anchor='usecase-disco'>
  114. <p>Before a Stream Initiation is attempted the Sender should be sure that the Receiver supports both Stream Initiation and the specific profile that they wish to use. This is typically accomplished using &xep0030;:</p>
  115. <example caption='Requesting Disco Information From Receiver'><![CDATA[
  116. <iq type='get'
  117. to=''
  118. from=''
  119. id='info1'>
  120. <query xmlns=''/>
  121. </iq>
  122. ]]></example>
  123. <p>The Receiver advertises the "" namespace as a feature to represent that they implement this document. The specific profiles are also announced this way; they can be found by looking for "". Shown in the result is a potential file transfer profile:</p>
  124. <example caption='Receiver Disco Information Result'><![CDATA[
  125. <iq type='result'
  126. to=''
  127. from=''
  128. id='info1'>
  129. <query xmlns=''>
  130. ...
  131. <feature var=''/>
  132. <feature var=''/>
  133. ...
  134. </query>
  135. </iq>
  136. ]]></example>
  137. </section2>
  138. <section2 topic='Negotiating Profile and Stream' anchor='usecase-neg'>
  139. <p>Once support is determined, the Sender starts the negotiation with the Receiver by sending an &IQ; stanza of type "set", such as in the following example from &xep0096;:</p>
  140. <example caption='Offer Stream Initiation'><![CDATA[
  141. <iq type='set' id='offer1' to=''>
  142. <si xmlns=''
  143. id='a0'
  144. mime-type='text/plain'
  145. profile=''>
  146. <file xmlns=''
  147. name='test.txt'
  148. size='1022'>
  149. <desc>This is info about the file.</desc>
  150. </file>
  151. <feature xmlns=''>
  152. <x xmlns='jabber:x:data' type='form'>
  153. <field var='stream-method' type='list-single'>
  154. <option><value></value></option>
  155. <option><value>jabber:iq:oob</value></option>
  156. <option><value></value></option>
  157. </field>
  158. </x>
  159. </feature>
  160. </si>
  161. </iq>
  162. ]]></example>
  163. <p>At this point the Receiver can view the profile and other information to decide if they wish to accept the Stream Initiation. If acceptable the Receiver MUST select one of the presented stream types to use.</p>
  164. <example caption='Accept Stream Initiation'>
  165. <![CDATA[
  166. <iq type='result' to='' id='offer1'>
  167. <si xmlns=''>
  168. <feature xmlns=''>
  169. <x xmlns='jabber:x:data' type='submit'>
  170. <field var='stream-method'>
  171. <value></value>
  172. </field>
  173. </x>
  174. </feature>
  175. </si>
  176. </iq>
  177. ]]></example>
  178. <p>If the profile describes data to be sent back in the result it MUST be present as described in the profile's specification.</p>
  179. <example caption='Accept Stream Initiation with Profile'><![CDATA[
  180. <iq type='result' to='' id='offer1'>
  181. <si xmlns=''>
  182. <file xmlns=''>
  183. <value>returned value</value>
  184. </file>
  185. <feature xmlns=''>
  186. <x xmlns='jabber:x:data' type='submit'>
  187. <field var='stream-method'>
  188. <value></value>
  189. </field>
  190. </x>
  191. </feature>
  192. </si>
  193. </iq>
  194. ]]></example>
  195. <p>If none of the stream types are acceptable, or if the profile is not understood, the Receiver MUST reply with a "bad request" error:</p>
  196. <example caption='No Valid Streams'><![CDATA[
  197. <iq type='error' to='' id='offer1'>
  198. <error code='400' type='cancel'>
  199. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  200. <no-valid-streams xmlns=''/>
  201. </error>
  202. </iq>
  203. ]]></example>
  204. <example caption='Profile not understood'><![CDATA[
  205. <iq type='error' to='' id='offer1'>
  206. <error code='400' type='cancel'>
  207. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  208. <bad-profile xmlns=''/>
  209. </error>
  210. </iq>
  211. ]]></example>
  212. <p>If the Receiver rejects the request, they reply with a "forbidden" error:</p>
  213. <example caption='Rejecting Stream Initiation'><![CDATA[
  214. <iq type='error' to='' id='offer1'>
  215. <error code='403' type='cancel'>
  216. <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  217. <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Offer Declined</text>
  218. </error>
  219. </iq>
  220. ]]></example>
  221. </section2>
  222. <section2 topic='Preparing the Transfer' anchor='usecase-transfer'>
  223. <p>At this point, the Sender and Receiver make any preparations necessary for the stream to be used. The exact process is specific to each protocol, and is beyond the scope of this document. This step now marks the end of SI's responsibilities.</p>
  224. </section2>
  225. </section1>
  226. <section1 topic='Formal Definition' anchor='def'>
  227. <section2 topic='&lt;si/&gt; Root Element' anchor='def-si'>
  228. <p>The &lt;si/&gt; element is the root element for this protocol. It is an identifiable container for all the information necessary for negotiation and signalling. It contains attributes for the identifier, intended MIME-type, and profile. The contents convey stream-negotation and profile information.</p>
  229. <p>The "id" attribute is an opaque identifier. This attribute MUST be present on type='set', and MUST be a valid string. This SHOULD NOT be sent back on type='result', since the &lt;iq/&gt; "id" attribute provides the only context needed. This value is generated by the Sender, and the same value MUST be used throughout a session when talking to the Receiver.</p>
  230. <p>The "mime-type" attribute identifies the MIME-type for the data across the stream. This attribute MUST be a valid MIME-type as registered with &IANA; (specifically, as listed at &lt;<link url=''></link>&gt;). During negotiation, this attribute SHOULD be present, and is otherwise not required. If not included during negotiation, its value is assumed to be "application/octet-stream".</p>
  231. <p>The "profile" attribute defines the SI profile in use. This value MUST be present during negotiation, and is the namespace of the profile to use.</p>
  232. <p>When the Sender first negotiates a Stream Initiation, all of the attributes SHOULD be present, and the id" and "profile" MUST be present. The contents MUST contain one profile, in the namespace declared in the "profile" attribute, and the feature negotiation for the stream. The feature negotiation MUST contain at least one option and use the field var "stream-method".</p>
  233. <p>When the Receiver accepts a Stream Initiation, the &lt;si/&gt; element SHOULD NOT possess any attributes. The selected stream MUST be in the feature negotiation for the stream. There MUST only be one selected stream.</p>
  234. </section2>
  235. <section2 topic='Error Codes' anchor='def-error'>
  236. <p>To simplify the discussion on error conditions, this document uses the following mapping between namespace URIs and namespace prefixes<note>This mapping is provided for the purpose of simplifying this discussion, and is not intended to be used in the actual protocol.</note>.</p>
  237. <table caption='Namespace Mappings'>
  238. <tr>
  239. <th>Prefix</th>
  240. <th>URI</th>
  241. </tr>
  242. <tr>
  243. <td>xmpp</td>
  244. <td>urn:ietf:params:xml:ns:xmpp-stanzas</td>
  245. </tr>
  246. <tr>
  247. <td>si</td>
  248. <td></td>
  249. </tr>
  250. </table>
  251. <p>Below are the most common errors that can result.</p>
  252. <table caption='Error Conditions/Codes'>
  253. <tr>
  254. <th>Error Code</th>
  255. <th>Error Type</th>
  256. <th>General Condition</th>
  257. <th>Specific Condition</th>
  258. <th>Description</th>
  259. </tr>
  260. <tr>
  261. <td>400</td>
  262. <td>cancel</td>
  263. <td>&lt;xmpp:bad-request/&gt;</td>
  264. <td>&lt;si:no-valid-streams/&gt;</td>
  265. <td>None of the available streams are acceptable.</td>
  266. </tr>
  267. <tr>
  268. <td>400</td>
  269. <td>modify</td>
  270. <td>&lt;xmpp:bad-request/&gt;</td>
  271. <td>&lt;si:bad-profile/&gt;</td>
  272. <td>The profile is not understood or invalid. The profile MAY supply a profile-specific error condition.</td>
  273. </tr>
  274. <tr>
  275. <td>403</td>
  276. <td>cancel</td>
  277. <td>&lt;xmpp:forbidden/&gt;</td>
  278. <td>NONE</td>
  279. <td>The stream is rejected.</td>
  280. </tr>
  281. </table>
  282. <p>For further information about the relationship between XMPP error handling and "legacy" (HTTP-style) error codes, refer to &xep0086;.</p>
  283. </section2>
  284. </section1>
  285. <section1 topic='Implementation Notes' anchor='impl'>
  286. <section2 topic='Profiles' anchor='impl-profiles'>
  287. <p>Stream Initiation on its own is of limited use; the Receiver almost always requires some reason for SI. Knowing this allows the Receiver to make a more educated choice about whether or not to accept the stream. This information is provided in Stream Initiation via a <em>profile</em>. A profile is a collection of information that describes the reason for and structure of the stream data, including what the data represents and what stream protocols are expected to be supported.</p>
  288. <p>The initial request for Stream Initiation MUST have only one profile, and this profile is in its own namespace. The profile is indicated not only by the presence of a "root" element in that particular namespace, but also be the "profile" attribute in &lt;si/&gt; The SUGGESTED format for profile namespaces is:</p>
  289. <code></code>
  290. <p>The information that the profile presents SHOULD be defined in an official XEP. The XEP defining the profile SHOULD contain explanations of what the profile consists of and MUST define the profile in a complete manner using DTD, Schema or another appropiate definition language.</p>
  291. <p>A profile SHOULD define what stream protocols MUST be supported, and MUST define what stream protocols MAY be supported. If a profile specifies only a single stream protocol that MUST be supported (even if others MAY also be supported), the "fneg" for the stream protocol may be omitted from the initial &lt;si/&gt;; the receiving entity then assumes the stream protocol that MUST be supported is the one to use.</p>
  292. <p>This document does not define any profiles, nor does it place any restrictions on what type of information a profile should detail. Other specifications will define profiles to be used with Stream Initiation.</p>
  293. </section2>
  294. <section2 topic='Stream Interaction' anchor='impl-stream'>
  295. <p>While Stream Initiation is not directly required for stream usage, it does provide many benefits. In order to fully appreciate these benefits, streams must link the Stream Initiation to the stream. The "id" attribute transported on the &lt;si/&gt; element is intended to do this. Once a session is fully negotiated, the value of the &lt;si/&gt; "id" attribute is used during the actual stream negotiation as the protocol's stream identifier attribute.</p>
  296. <p>To be compatible to this document, a stream protocol MUST define a stream identifier (typically "sid"), which MUST have a unique string representation. The stream protocol MUST be able to use any string identifier chosen during Stream Initiation, as long as the sending party does not use the same identifier more than once.</p>
  297. </section2>
  298. </section1>
  299. <section1 topic='Security Considerations' anchor='security'>
  300. <p>
  301. Data security concerns are left to the profiles to define. Wire security
  302. concerns are left to the stream definitions.
  303. </p>
  304. </section1>
  305. <section1 topic='IANA Considerations' anchor='iana'>
  306. <p>
  307. This document uses the MIME types as recorded by the IANA, but no direct
  308. interaction with the IANA is necessary.
  309. </p>
  310. </section1>
  311. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  312. <section2 topic='Protocol Namespaces' anchor='registrar-ns'>
  313. <p>The &REGISTRAR; includes the '' namespace in its registry of protocol namespaces.</p>
  314. </section2>
  315. <section2 topic='Registries' anchor='registrar-reg'>
  316. <section3 topic='Profiles Registry' anchor='registrar-reg-profiles'>
  317. <p>The XMPP Registrar shall maintain a registry of stream initiation profiles, located at &SIPROFILES;. Any such profile defined in a XMPP Extension Protocol specification MUST be submitted to the XMPP Registrar; profiles defined in non-standard protocol extensions SHOULD be submitted to the XMPP Registrar.</p>
  318. <section4 topic='Process' anchor='registrar-reg-profiles-process'>
  320. <code><![CDATA[
  321. <profile>
  322. <name>The profile name</name>
  323. <doc>The specification that defines the profile</doc>
  324. <desc>A natural-language description of the profile</desc>
  325. </profile>
  326. ]]></code>
  327. </section4>
  328. </section3>
  329. </section2>
  330. </section1>
  331. <section1 topic='XML Schema' anchor='schema'>
  332. <code><![CDATA[
  333. <?xml version='1.0' encoding='UTF-8'?>
  334. <xs:schema
  335. xmlns:xs=''
  336. targetNamespace=''
  337. xmlns=''
  338. elementFormDefault='qualified'>
  339. <xs:import
  340. namespace=''
  341. schemaLocation=''/>
  342. <xs:annotation>
  343. <xs:documentation>
  344. The protocol documented by this schema is defined in
  345. XEP-0095:
  346. </xs:documentation>
  347. </xs:annotation>
  348. <xs:element name='si'>
  349. <xs:annotation>
  350. <xs:documentation>
  351. This is the root content element. All other elements in
  352. this namespace are for communicating error information.
  353. </xs:documentation>
  354. </xs:annotation>
  355. <xs:complexType>
  356. <xs:sequence xmlns:fneg=''>
  357. <xs:any namespace='##other' minOccurs='0'/>
  358. <xs:element ref='fneg:feature'/>
  359. </xs:sequence>
  360. <xs:attribute name='id' type='xs:string' use='optional'/>
  361. <xs:attribute name='mime-type' type='xs:string' use='optional'/>
  362. <xs:attribute name='profile' type='xs:string' use='optional'/>
  363. </xs:complexType>
  364. </xs:element>
  365. <xs:element name='bad-profile' type='empty'/>
  366. <xs:element name='no-valid-streams' type='empty'/>
  367. <xs:simpleType name='empty'>
  368. <xs:restriction base='xs:string'>
  369. <xs:enumeration value=''/>
  370. </xs:restriction>
  371. </xs:simpleType>
  372. </xs:schema>
  373. ]]></code>
  374. </section1>
  375. </xep>