<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>
<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>
<section1topic='Overview'>
<section2topic='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>
<section2topic='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>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>
<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>
<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>
<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>
<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>
<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>