<abstract>Note well: this document was superseded by RFC 3920, which in turn has been superseded by RFC 6122. This document defines the exact nature of a Jabber Identifier (JID).</abstract>
<p>Jabber Identifiers (JIDs) uniquely identify individual entities in the Jabber network. To date, their syntax has been defined by convention, existing implementations, and available documentation. As it exists, certain characters that are allowed in JIDs cause ambiguity, and the lack of a size limit on resources defies database schemas and causes some trivial JID operations to require dynamic memory allocation. This document seeks to both define and improve the existing JID syntax. This document will not explain the general usage or nature of JIDs, instead focusing on syntax.</p>
<p>A domain identifier is a standard DNS hostname as specified in RFC952 <note><linkurl='http://www.ietf.org/rfc/rfc952.txt'>http://www.ietf.org/rfc/rfc952.txt</link></note> and RFC1123. <note><linkurl='http://www.ietf.org/rfc/rfc1123.txt'>http://www.ietf.org/rfc/rfc1123.txt</link></note> It is case-insensitive 7-bit ASCII and limited to 255 bytes. It is the only required component of a JID.</p>
</section2>
<section2topic='Node Identifier'>
<p>Node identifiers are restricted to 256 bytes, They may contain any Unicode character higher than #x20 with the exception of the following:</p>
<p>Case is preserved, but comparisons will be made in case-normalized canonical form.</p>
</section2>
<section2topic='Resource Identifier'>
<p>Resources identifiers are case-sensitive and are limited to 256 bytes. They may include any Unicode character greater than #x20, except #xFFFE and #xFFFF.</p>
<p>To date, resource identifiers have not had a fixed limit on their length. This document seeks to limit it to 256 bytes for the following reasons:</p>
<li>In order to perform JID manipulations safely, one cannot use stack space if there is no limit. This forces temporary calculations onto the heap which is unnecessarily costly.</li>
<li>As a fixed length character field, a resource identifier is more easily stored in, searched on, and retrieved from a database. If an end user may store an encyclopedia's worth of information in their resource, then the only way it can be stored without truncating it is to store it as a large object (BLOB or CLOB). Depending on the database used, that makes it either grossly inefficient or impossible to search on.</li>
<li>There exist denial of service attacks stemming from an unlimited resource length.</li>
</ol>
<p>In a worst-case encoding, such as Han ideographs, 256 bytes will provide enough storage space for 64 character points. This provides a lower bound on the number of characters a node may have in its resource.</p>
<p>Specifying limits in terms of bytes instead of characters is somewhat arbitrary once a lower bound for characters is established. This document proposes limits in terms of bytes mainly because doing so results in parsing efficiency; specifically, an implementation does not have to un-encode the UTF-8 string for the sole purpose of further restricting character sets that require fewer than four bytes per character point. It is sufficient to have a lower bound on characters and an upper bound on bytes.</p>