forked from xsf/xeps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xep-0041.xml
270 lines (242 loc) · 9.38 KB
/
xep-0041.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM "xep.ent">
%ents;
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep>
<header>
<title>Reliable Entity Link</title>
<abstract>Protocol for linking a bytestream between two Jabber entities.</abstract>
&LEGALNOTICE;
<number>0041</number>
<status>Retracted</status>
<type>Standards Track</type>
<sig>Standards</sig>
<dependencies>
<spec>XMPP Core</spec>
<spec>XEP-0020</spec>
<spec>XEP-0030</spec>
</dependencies>
<supersedes/>
<supersededby><spec>XEP-0065</spec></supersededby>
<shortname>rel</shortname>
<author>
<firstname>Justin</firstname>
<surname>Karneges</surname>
<email>justin@affinix.com</email>
<jid>justin@andbit.net</jid>
</author>
<revision>
<version>0.2</version>
<date>2003-09-30</date>
<initials>psa</initials>
<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>
</revision>
<revision>
<version>0.8</version>
<date>2003-06-26</date>
<initials>jk</initials>
<remark>Refactored to old jidlink roots</remark>
</revision>
<revision>
<version>0.7</version>
<date>2003-04-29</date>
<initials>jk</initials>
<remark>Overhaul and rename</remark>
</revision>
<revision>
<version>0.6</version>
<date>2002-11-23</date>
<initials>jk</initials>
<remark>Reflect changes to DTCP</remark>
</revision>
<revision>
<version>0.5</version>
<date>2002-10-10</date>
<initials>jk</initials>
<remark>Table of stream transports</remark>
</revision>
<revision>
<version>0.4</version>
<date>2002-10-10</date>
<initials>jk</initials>
<remark>New name, cleaned up the text, added test mode.</remark>
</revision>
<revision>
<version>0.3</version>
<date>2002-09-12</date>
<initials>jk</initials>
<remark>Changed the implementation.</remark>
</revision>
<revision>
<version>0.2</version>
<date>2002-08-16</date>
<initials>jk</initials>
<remark>Fixed spelling errors, simplified the document.</remark>
</revision>
<revision>
<version>0.1</version>
<date>2002-08-15</date>
<initials>jk</initials>
<remark>Initial version.</remark>
</revision>
</header>
<section1 topic='Overview'>
<section2 topic='Introduction'>
<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>
</section2>
<section2 topic='Stream transport properties'>
<p>A REL-compatible stream transport must have the following properties:</p>
<ul>
<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>
<li>Has link states from the following table.
</li>
<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>
</ul>
<table caption='Link states'>
<tr>
<th>Code</th>
<th>Description</th>
</tr>
<tr>
<td><tt>INIT</tt></td>
<td>Initiation</td>
</tr>
<tr>
<td><tt>GOOD</tt></td>
<td>Successful initiation (connected)</td>
</tr>
<tr>
<td><tt>BAD</tt></td>
<td>Unsuccessful initiation (stream is closed, no further state)</td>
</tr>
<tr>
<td><tt>CLOS</tt></td>
<td>Successful closure after establishment (stream is closed, no further state)</td>
</tr>
<tr>
<td><tt>ERR</tt></td>
<td>Link failure after establishment (stream is closed, no further state)</td>
</tr>
</table>
<p>The following stream transports that meet these guidelines are:</p>
<table caption='Supported streams'>
<tr>
<th>Short name</th>
<th>Protocol</th>
</tr>
<tr>
<td>ibb</td>
<td>&xep0047;</td>
</tr>
<tr>
<td>s5b</td>
<td>&xep0065;</td>
</tr>
</table>
</section2>
</section1>
<section1 topic='Usage'>
<section2 topic='Service discovery'>
<p>Before using REL, ensure it is a supported service of the remote entity by using &xep0030;:</p>
<example caption='Requesting disco information'><![CDATA[
<iq type="get" to="joe@blow.com/Home" id="sd_1">
<query xmlns="http://jabber.org/protocol/disco#info"/>
</iq>
]]></example>
<p>The remote entity will advertise the "http://jabber.org/protocol/rel" namespace as a feature to represent they implement this protocol.</p>
<example caption='Response'><![CDATA[
<iq type="result" from="joe@blow.com/Home" id="sd_1">
<query xmlns="http://jabber.org/protocol/disco#info">
<feature var="http://jabber.org/protocol/rel"/>
</query>
</iq>
]]></example>
</section2>
<section2 topic='Obtaining a REL context'>
<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>
<example caption='Possible File Transfer'><![CDATA[
<iq type="set" id="ft_1" to="joe@blow.com/Home">
<query xmlns="filexfer" filename="coolfile.txt"/>
</iq>
]]></example>
<example caption='Possible response'><![CDATA[
<iq type="result" id="ft_1" from="joe@blow.com/Home">
<query xmlns="filexfer">
<cid xmlns="http://jabber.org/protocol/rel" value="myCID"/>
</query>
</iq>
]]></example>
<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>
</section2>
<section2 topic='Selecting a Stream'>
<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>
<example caption='Selecting a stream'><![CDATA[
<iq type="get" id="rel_1" to="joe@blow.com/Home">
<query xmlns="http://jabber.org/protocol/rel" cid="myCID" keepAlive='true'>
<feature xmlns="http://jabber.org/protocol/feature-neg">
<x xmlns="jabber:x:data">
<field var="method" type="list-single">
<option><value>s5b</value></option>
<option><value>ibb</value></option>
</field>
</x>
</feature>
</query>
</iq>
]]></example>
<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>
<p>The remote entity will then agree on a method:</p>
<example caption='Possible response'><![CDATA[
<iq type="result" id="rel_1" from="joe@blow.com/Home">
<query xmlns="http://jabber.org/protocol/rel" cid="myCID">
<feature xmlns="http://jabber.org/protocol/feature-neg">
<x xmlns="jabber:x:data" type="submit">
<field var="method">
<value>s5b</value>
</field>
</x>
</feature>
</query>
</iq>
]]></example>
<p>Or maybe an error:</p>
<example caption='Error'><![CDATA[
<iq type="error" id="rel_1" from="joe@blow.com/Home">
<error code="501">No supported protocols.</error>
</iq>
]]></example>
<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>
<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>
<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>
<p>On <strong><tt>CLOS</tt></strong> or <strong><tt>ERR</tt></strong>, the REL cid is invalidated.</p>
</section2>
</section1>
<section1 topic='Security Considerations'>
<p>There are no security considerations.</p>
</section1>
<section1 topic='IANA Considerations'>
<p>This document requires no interaction with &IANA;.</p>
</section1>
<section1 topic='XMPP Registrar Considerations'>
<p>The ®ISTRAR; shall register the 'http://jabber.org/protocol/rel' namespace as a result of this document.</p>
</section1>
<section1 topic='XML Schema'>
<code><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='http://jabber.org/protocol/rel'
xmlns='http://jabber.org/protocol/rel'
elementFormDefault='qualified'>
<xs:element name='query'>
<xs:complexType>
<xs:attribute name='cid' type='xs:string' use='required'/>
<xs:attribute name='keepAlive' type='xs:boolean' use='optional'/>
</xs:complexType>
</xs:element>
</xs:schema>
]]></code>
</section1>
</xep>