<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">

<?rfc toc="yes"?>

<rfc ipr="full2026">

	<front>
		<title>Jabber</title>

		<author initials="J." surname="Miller" fullname="Jeremie Miller">
			<organization>The Jabber.org Project</organization>
			<address>
				<postal>
					<street>414 DeLong St.</street>
					<city>Cascade</city> <region>IA</region>
					<code>52033</code>
					<country>US</country>
				</postal>
				<phone>319-852-3464</phone>
				<email>jeremie@jabber.org</email>
			</address>
		</author>

		<date month="June" year="2000" day="15"/>
		<area>Internet</area>

		<!-- tons of keywords.. we don't *have* to have any though -->
		<keyword>Jabber</keyword>
		<keyword>IM</keyword>
		<keyword>Instant</keyword>
		<keyword>Messaging</keyword>
		<keyword>Presence</keyword>
		<keyword>XML</keyword>
		<keyword>Extensible Markup Language</keyword>

		<abstract><t>
			This memo provides a comprehensive description of the Jabber architecture, design principles, and protocol.
		</t></abstract>

	</front>

	<middle>

	<section title="Introduction" anchor="intro">

		<section title="What is Jabber?" anchor="intro-what">
			<t>
				At the core, Jabber is an API to provide instant messaging and presence functionality independent of data exchanged between entities.
				The primary use of Jabber is to give existing applications instant connectivity through messaging and presence features, contact list capabilities, and
				back-end services that transparently enrich the available functionality.
			</t>
			<t>
				Essentially, Jabber defines an abstraction layer utilizing <xref target="ref-xml">XML</xref> to encode the common essential data types.
				This abstraction layer is managed by an intelligent server which routes data between the client APIs and the backend services that translate data from remote networks or protocols.
				By using this compatible abstraction layer, Jabber can provide many aspects of an Instant Messaging (IM) and/or Presence service in a simplified and uniform way.			
			</t>
		</section>

		<section title="Background and History" anchor="intro-history">
			<t>
				Jabber began in early 1998 as an open source project to both enable and ease the construction of compatible IM clients. The intention was that a client would only
				have to understand simple standard XML data types for messages and presence, and be able to focus on being an IM client, not on the complexity of dealing with
				the various IM networks. To avoid requiring the overhead of a typical "loadable module" API, the XML abstraction
				layer was made available to the client via a standard <xref target="ref-rfc793">TCP</xref> socket.
			</t>
			<t>
				The chosen model is essentially that of a typical client-server, where the clients utilizing the API access it as a server via TCP.
				Certain server components have a very high frequency of upgrades, based on the adapting protocols with which they translate.
				The server was also then shared on a single host to a group of users to reduce the maintenance requirements for the client API.
				This also significantly reduces the deployment overhead for clients, since they simply need a single TCP socket to the server.
			</t>
		</section>

		<section title="Evolution" anchor="intro-evolution">
			<t>
				As Jabber was developed and the architecture evolved, it became clear that a simple and flexible means of assigning identity to the various components was required.
				This started with clients, which are required to have a unique identity and be authorized to access the server API.  
				The server was also assigned a unique identity, as were the individual components on the server side.
			</t>
			<t>
				Due to the role that the server plays with respect to the clients, and and due to the need to have a clear and established
				means of identitfying individual entities, the natural evolution of the server was to simply become an intelligent router.
				Not only does the server manage and route the XML data between the client API and the abstraction layer, but it also
				routes data directly between clients acting as an independent IM server for all clients.
				By assigning server identity as a hostname, servers are also able to route data directly to each other
				and their connected clients, thereby creating a new, inherently open IM network out of all the individual installed servers and clients.
			</t>
			<t>
				Additionally, to simplify clients as well as to add functionality to the server, the server began to act as an XML repository by storing XML for the client.
				This enables the server to store the contact list (roster), offline messages, profile information such as a <xref target="ref-vcard">XML vCard</xref>, or custom client preferences and data (bookmarks, settings, etc.).
			</t>
		</section>

		<section title="Today" anchor="into-today">
			<t>
				After two years of full-time development by a large group of individuals around the world:
				<list style="symbols">
					<t>The abstraction layer and all APIs are fully implemented.</t>
					<t>The XML data types are well defined (<xref target="jabber-dtd"/>).</t>
					<t>Clients for all major platforms and environments are available or being developed. See http://jabbercentral.com/clients/ for a database of popular clients.</t>
					<t>The <xref target="ref-gpl">GPL</xref>/<xref target="ref-lgpl">LGPL</xref> licensed <eref target="http://jabber.org">Jabber Server</eref> is fully functional.</t>
					<t>Numerous working server-side components (transports) exist or are in public development for popular services such as ICQ, AOL IM,
						Microsoft Messenger, Yahoo! Messenger, IRC, SMTP, RSS (news headlines), and more.</t>
				</list>
				See <eref target="http://jabber.org/">http://jabber.org/</eref> for more information.
			</t>
		</section>

	</section>


	<section title="Architecture Overview" anchor="arch">
		<figure>
			<preamble>Connection Map</preamble>
			<artwork><![CDATA[
         T1 = N1 = C3
        /
C1 -- S1 - S2 = C4
     /  \
C2 -     T2

			]]></artwork>
		</figure>

		<t>
			Above is a map of the typical connections within the Jabber Architecture.
			<list style="symbols">
				<t>"-" represents the Jabber XML Protocol.</t>
				<t>"=" represents any other protocol.</t>
				<t>C1, C2 - Jabber Clients.</t>
				<t>C3 - Client on another IM Network.</t>
				<t>C4 - Client using an alternate protocol to access the Jabber Server.</t>
				<t>S1 - a Jabber Server.</t>
				<t>T1 - Transport, translating between the Jabber XML Protocol and the protocol used on another IM Network.</t>
				<t>T2 - Transport providing other real-time data to Jabber, such as log notifications or headline news feeds.</t>
				<t>N1 - third party IM Network.</t>
			</list>
		</t>

		<section title="Server" anchor="arch-server">
			<t>
				The Server acts as an intelligent abstraction layer, managing the authorized client connections and connections to other Servers and Transports.
				All of the XML data is routed to the appropriate entities, or handled directly via internal modules on behalf of an entity.
				Servers can also utilize their own protocol to provide access to their clients.
			</t>
		</section>

		<section title="Client" anchor="arch-client">
			<t>
				Clients may directly connect to the Server and use the XML Protocol to take full advantage of the functionality available.
				A client may also be customized to only operate with one server, or use an alternate protocol to access a custom server.
				Clients of alternate IM Networks are also part of the Architecture, made accessable via a Transport to that IM Network.
			</t>
		</section>

		<section title="Transport" anchor="arch-transport">
			<t>
				A Tranport is a special-purpose Server. The primary function of a Transport is to translate the Jabber XML protocol to the protocol of a third party IM Network as well as translate the return data back to XML.
				Transports may also function to provide access to additional back-end functionality such as a real-time alert system, device presence, pager delivery, language translation or other custom needs.
			</t>
		</section>

	</section>


	<section title="Entity Identification" anchor="entity">
		<section title="Three Tier" anchor="entity-tier">
			<t>
				The basic concept behind all identity within Jabber is a three-tier structure: the host, node, and resource.
				This allows a host to manage its nodes, and allows each node to have independent addressable resources.
				The most common use of this structure is as a server, user, and connection identifier.
			</t>
			<section title="Host (server)" anchor="entity-tier-host">
				<t>
					The basic required component of every ID is a Host. The Host is a standard DNS hostname and not case sensitive.
				</t>
			</section>
			<section title="Node (user)" anchor="entity-tier-node">
				<t>
					Each Host can be addressed with individual Nodes, or users. Each user is specific to the Host it is associated with,
					similar to email. Usernames are restricted to 255 characters, and the following ASCII characters are invalid: any character with a decimal value less than 33 or in the following set [:@&lt;&gt;'"&amp;].
					Case is preserved, but not used when comparing/matching. A Node address looks similar to email: node@host. Node addresses are intended
					to be human readable/usable in the same manner that email addresses are used today.
				</t>
			</section>
			<section title="Resource" anchor="entity-tier-resource">
				<t>
					Resources are specific to a Node. All characters are allowed and there are no restrictions. Resource addresses are similar to the path part of a URL.
					Resources are used to address specific connections (since a Jabber server allows a user to be connected from multiple resources simultaneously), devices, or inboxes. 
					An example Resource address: node@host/resource.
					Resource addresses are intended to be hidden from a user and only used at the software/protocol level.
				</t>
			</section>
		</section>
		<section title="URI" anchor="entity-uri">
			<t>
				A Jabber identifier conforms to <xref target="ref-rfc2396">RFC 2396</xref>, "Uniform Resource Identifiers (URI): Generic Syntax" by prepending a "jabber://" to any address.
				When compared to other URIs, it acts like a hybrid mailto: and http:// URI, offering both a user identity and an optional path/resource specification.
			</t>
			<t>
				Originally the abstraction layer used a Jabber URI within the protocol, but this was dropped until that use could undergo further review.
				Some of the reasoning was that the protocol was not capable of handling any other URI, in the sense that SMTP does not directly handle mailto: URIs within the protocol.
				Also, there was a tendency to want to create proprietary custom URIs (such as 'icq:' or 'talk:') within the protocol.
				Enabling the abstraction layer to use full URIs directly was deferred until such a use could be standardized and agreed upon.
			</t>
		</section>
	</section>


	<section title="XML" anchor="xml">
		<section title="Overview" anchor="xml-overview">
			<t>
				<xref target="ref-xml">XML</xref> is used to define the common basic data types: message and presence.
				Essentially, XML is the core enabling technology within the abstraction layer, providing a common language with which everything can communicate.
				XML allows for painless growth and expansion of the basic data types and almost infinite customization and extensibility anywhere within the data.
				Many solutions already exist for handling and parsing XML, and the XML Industry has invested significant time in understanding the technology and ensuring full internationalization.
			</t>
		</section>
		<section title="Namespaces" anchor="xml-namespaces">
			<t>
				<xref target="ref-xml-namespaces">XML Namespaces</xref> are used within all Jabber XML to create strict boundaries of data ownership.
				The basic function of namespaces is to separate different vocabularies of XML elements that are structurally mixed together.
				By ensuring that Jabber's XML is namespace-aware, it allows any XML defined by anyone to be structurally mixed with any data element within the protocol.
				This feature is relied upon frequently within the protocol to separate the XML that is processed by different components.
			</t>
		</section>
		<section title="Validation" anchor="xml-validation">
			<t>Provided with this specification is a reference DTD for Jabber. It is an important note that the Jabber server is not responsible for validating the XML elements forwarded to a new user - an implementation may choose to provide only validated data elements but is not required to.</t>
			<t>Clients should not rely on the ability to send data which does not conform to the DTD, and should handle any non-conformant elements or attributes on the incoming stream by ignoring them.</t>
		</section>
		<section title="&lt;message&gt; element" anchor="xml-message">
			<t>
				Messages are most similar in function to an email message.
			</t>
			<section title="Attributes">
				<t><list style="symbols">
					<t>to -
						Specifies to whom the message is intended to be delivered to.
					</t>
					<t>from -
						Specifies the sender of the message. Server set to prevent spoofing.
					</t>
					<t>type -
						Used to express the context as to what format the message should be displayed in.
						If no type is set, clients default to a type="normal". Values include:
						<list style="symbols">
							<t>normal - Single message dialog, similar to original ICQ messages.</t>
							<t>chat - Traditional two-way chat similar to AIM or IRC CTCP Chat.</t>
							<t>groupchat - Group interface similar to an IRC channel with multiple participants.</t>
							<t>headline - Ticker or active list of items (news, stock market).</t>
							<t>error - See <xref target="error">the error element</xref>.</t>
						</list>
					</t>
				</list></t>
			</section>
			<section title="Children">
				<t><list style="symbols">
					<t>body - Contains the textual contents of the message for user display. No attributes.</t>
					<t>subject - Contains the subject of the message. Similar to an email subject. No attributes.</t>
					<t>thread - 
						A random string generated by the originating client and copied back in replies. Used for tracking a conversation thread.
					</t>
					<t>error - See <xref target="error">the error element</xref>.</t>
				</list></t>
			</section>
			<section title="Examples">
				<t>The following examples have been server processed and contain the 'from' attribute.</t>
				<figure>
					<preamble>A simple message:</preamble>
					<artwork><![CDATA[
<message to="horatio@denmark" from="hamlet@denmark">
  <body>Angels and Ministers of Grace, defend us!</body>
</message>
					]]></artwork>
				</figure>
				<figure>
					<preamble>Complete chat message:</preamble>
					<artwork><![CDATA[
<message to="hamlet@denmark" from="horatio@denmark" type="chat">
  <subject>Plotting</subject>
  <body>Here, sweet lord, at your service.</body>
  <thread>100052</thread>
</message>
					]]></artwork>
				</figure>
			</section>
		</section>

		<section title="&lt;presence&gt; element" anchor="xml-presence">
			<t>
				Presence is used to express the current status from one entity to a group of entities.
				The characteristics of presence are most similar to that of a network game where the data travels from one host to the server, and then broadcast to the other hosts participating in that game.
			</t>
			<section title="Attributes">
				<t><list style="symbols">
					<t>to - Specifies for whom the presence is bound. If none is specified, the server receives the presence.</t>
					<t>from - Whom the presence is from. Server set to prevent spoofing.</t>
					<t>id - A unique identifier for the presence. Sender of the presence sets this attribute.</t>
					<t>type -
						Describes the type of presence. No 'type' attribute implies "available" presence or current status. Allowable types include:
						<list style="symbols">
							<t>unavailable - Signals that the user is no longer available.</t>
							<t>subscribe - An attempt to subscribe to the recipient's presence.</t>
							<t>subscribed - The sender has enabled the recipient to receive their presence.</t>
							<t>unsubscribe - An unsubscription request. The server handles the actual unsubscription, but clients
								receive a presence element for notification reasons.</t>
							<t>unsubscribed - The subscription has been cancelled.</t>
							<t>probe - A server-to-server query to request an entity's current presence.</t>
						</list>
					</t>
				</list></t>
			</section>
			<section title="Children">
				<t><list style="symbols">
					<t>show - Describes a user's exact availability. Must be one of:
						<list style="symbols">
							<t>away - User is away from the client software temporarily.</t>
							<t>chat - User is free to chat.</t>
							<t>xa - User is away for an extended period (eXtended Away).</t>
							<t>dnd - User does not wish to be disturbed (Do Not Disturb).</t>
						</list>
					</t>
					<t>status - Custom availability message. Used in conjunction with the show element to give a detailed description of availability.</t>
				</list></t>
			</section>
			<section title="Examples">
				<figure>
					<preamble>Initial presence sent to server upon login to express default availability:</preamble>
					<artwork><![CDATA[
<presence/>
					]]></artwork>
				</figure>
				<figure>
					<preamble>Full-blown presence:</preamble>
					<artwork><![CDATA[
<presence from="hamlet@denmark">
  <show>xa</show>
  <status>Gone to England</status>
</presence>
					]]></artwork>
				</figure>
			</section>
		</section>

		<section title="&lt;iq&gt; element" anchor="xml-iq">
			<t>
				Info/Query, or IQ, is a simple structured conversation wrapper.
				Just as HTTP is a request-response medium, IQ enables an entity to make a request and receive a response from another entity.
				The actual content of the request and response is defined by another namespace within the IQ.
			</t>
			<section title="Attributes">
				<t><list style="symbols">
					<t>to - Specifies for whom the IQ is bound.</t>
					<t>from - Specifies from whom the IQ is sent. Server set to prevent spoofing.</t>
					<t>id - A unique identifier for the IQ for tracking the query exchange. Sender of the IQ sets this attribute, which is returned in the response.</t>
					<t>type -
						The 'type' attribute has several preset values. Each indicates a distinct step within an IQ conversation.
						<list style="symbols">
							<t>get -
								Indicates that the current query is a question or search for information.
							</t>
							<t>set - This query contains data intended to set values or replace existing values.</t>
							<t>result - 
								This is a successful response to a get/set query. The IQ usually contains no further
								information on a successful result.
							</t>
							<t>error - The query failed. See <xref target="error">the error element</xref>.</t>
						</list>
					</t>
				</list></t>
			</section>
			<section title="Children">
				<t>
					In the strictest terms, the iq element contains no children since it is a vessel for XML in another namespace. In operation, a query element is usually
					contained within the iq element as defined by its own separate namespace. See <xref target="iq"/>.
				</t>
			</section>
			<section title="Examples" anchor="iq-examples">
				<t>The following examples are distinct parts of an IQ conversation for registration with <xref target="iq-register">jabber:iq:register</xref> namespace.</t>
				<figure>
					<preamble>Client request for registration information to a server service (service.denmark):</preamble>
					<artwork><![CDATA[
<iq type="get" id="1001" to="service.denmark">
  <query xmlns="jabber:iq:register"/>
</iq>
					]]></artwork>
				</figure>
				<figure>
					<preamble>Server response with registration fields required:</preamble>
					<artwork><![CDATA[
<iq type="result" from="service.denmark" to="hamlet@denmark" id="1001">
  <query xmlns="jabber:iq:register">
    <instructions>Choose a username and password to register with this server.</instructions>
    <name/>
    <email/>
    <password/>
    <key>106c0a7b5510f192a408a1d054150ed1065e255a</key>
  </query>
</iq>
					]]></artwork>
				</figure>
				<figure>
					<preamble>Client request to register for an account:</preamble>
					<artwork><![CDATA[
<iq type="set" to="service.denmark" from="hamlet@denmark" id="1002">
  <query xmlns="jabber:iq:register">
    <name>hamlet</name>
    <email>hamlet@denmark</email>
    <password>gertrude</password>
    <key>106c0a7b5510f192a408a1d054150ed1065e255a</key>
  </query>
</iq>
					]]></artwork>
				</figure>
				<figure>
					<preamble>Successful registration:</preamble>
					<artwork><![CDATA[
<iq type="result" from="service.denmark" to="hamlet@denmark" id="1002"/>
					]]></artwork>
				</figure>
				<figure>
					<preamble>Failed registration:</preamble>
					<artwork><![CDATA[
<iq type="error" from="service.denmark" to="hamlet@denmark" id="1002"/>
  <error code="406">Not Acceptable</error>
</iq>
					]]></artwork>
				</figure>
			</section>
		</section>

	</section>

	<section title="Client Access" anchor="client">
		<section title="TCP Socket" anchor="client-tcp">
			<t>
				Clients connect to the server on TCP port 5222.
				The connection from the client to the server is persistent and maintains the presence state of the client after authentication.
				The server delivers all data to the client via this socket.
				If it is broken because of a network error, a client should reasonably attempt to reestablish the link with the server.
				Clients are never required to accept an incoming network connection, or establish a connection to any host other than the server.
			</t>
		</section>
		<section title="Transport Layer" anchor="client-transportlayer">
			<t>
				An <xref target="xmlstream">XML Stream</xref> is simply the direct association of an XML document with a single TCP socket, and is used as the default transport layer to move data between clients and servers.
				When the socket is opened, the first data sent is the opening root element of the XML document representing that stream.
				All XML data within the document is continually parsed as available via the socket. 
				When a top-level element is closed, it can then be further processed by the application.
 				This simple streaming transport layer reduces the complexity of implementing applications that use Jabber, and satisfies all the demands of the communication with the server.
			</t>
		</section>

		<section title="Authentication" anchor="client-auth">
			<t>
				The client initially sends an IQ packet over the XML Stream to the server with the <xref target="iq-auth">jabber:iq:auth namespace</xref>.
				This provides the credentials to access the server, which are either returned with an error or accepted.
				After accepting the credentials, the connection is then authorized to send and receive data.
			</t>
		</section>

		<section title="Messages" anchor="client-message">
			<t>
				The client sends a message with a valid 'to' attribute. The server processes the 'to' address
				and adds a 'from' address, then attempts to deliver to the recipient. Messages that fail for
				any reason are returned as an error. Messages may be delivered to the client from the server at any time, with an appropriate 'from' attribute set.
			</t>
		</section>

		<section title="Presence" anchor="client-presence">
			<t>
				The current presence for the client is updated by sending presence to the server without a 'to' attribute.
				The server delivers this to the authorized recipients based on the subscription status as stored in the roster.
				The client will not receive presence from other entities until it has provided some form of available presence to the server.
			</t>
		</section>
		<section title="Roster" anchor="client-roster">
			<t>
				The client can send an IQ get with the <xref target="iq-roster">jabber:iq:roster namespace</xref> at any time, and will receive
				a result containing all the items that the server has stored for that user. Changes to any one item
				can be made by submitting that changed item via an IQ set in the same namespace.
			</t>
			<t>
				Since Jabber allows multiple connections for a single user, the roster may change by one connection and that change needs to be updated to the other connections.
				At any time, the server may do a "Roster Push" by sending an IQ set to the client containing the new/updated item[s].
			</t>
		</section>
		<section title="Presence Subscriptions" anchor="client-s10n">
			<t>
				Presence information is made available only to approved entites. This approval is managed by a simple subscription system, using the <xref target="xml-presence">presence element</xref>.
				There are four distinct types of subscription requests:
				<list>
					<t>subscribe - A request to be approved for receiving all future presence changes</t>
					<t>unsubscribe - A request to no longer receive any presence changes</t>
					<t>subscribed - A notice that a subscription has been created and all future presence changes will be sent</t>
					<t>unsubscribed - A notice that a subscription has been removed, and no further presence changes will be sent</t>
				</list>

				<figure>
					<preamble>Request to subscribe to a user's presence:</preamble>
					<artwork><![CDATA[
<presence to="horatio@denmark" type="subscribe"/>
					]]></artwork>
				</figure>
				<figure>
					<preamble>Response to a subscribe request:</preamble>
					<artwork><![CDATA[
<presence to="hamlet@denmark" type="subscribed"/>
					]]></artwork>
				</figure>
			</t>
		</section>
	</section>
			
	<section title="Servers" anchor="server">
		<t>
			The abstraction layer that Jabber provides includes the ability to individually address servers, and in fact relies on this ability for all external sources of data and functionality.
			This model then significantly expands the definition of a server to include intelligent agents, transports, device gateways, or any interactive data source.
			The additional expansion creates a need for flexibility in how server-side entities communicate.
		</t>
		<t>
			The server to server communication happens independent of the client, and can use any protocol or communication means available. The server may choose to implement
			a loadable module interface to allow components (which might be addressed as a server) to interact with clients, or two servers may choose to tunnel their data via an alternate transport layer.
			In fact, the Jabber Server uses an alternate communication library, libetherx, which manages connections between the server and trusted transports in a more efficient model.
			Although any protocol can be used between servers, at least one common basic one must exist so that there can be some guarantee of interoperability.
		</t>
		<section title="Connections">
			<t>
				Servers interconnect on TCP port 5269.
				There is no required state held between servers, so the connection is stateless and may be dropped at any time, but it is recommended that the connection persist based on the freqency of the interaction.
				Data is sent only over a locally originated connection to another server.
				All data from other servers is delivered via connections from those servers.
			</t>
		</section>
		<section title="DNS">
			<t>
				All connections are made directly to the IP address of the hostname in the <xref target="entity">Entity Identifier</xref>.
				If the connection to this host fails, servers attempt an MX record lookup.
				A connection attempt is made to each found MX record.
				In order to not conflict with SMTP and be able to operate a Jabber server on a separate host, a list of MX records is processed in reverse priority (highest number first).
			</t>
		</section>
	</section>

	<section title="Security Considerations" anchor="security">
		<section title="SSL" anchor="security-ssl">
			<t>
				Servers can optionally support normal <xref target="ref-ssl">SSL</xref> connections for added security on port 5223 for client connections and 5270 for server connections.
			</t>
		</section>
		<section title="Secure Identity and Encryption" anchor="security-clientclient">
			<t>
				Clients may optionally support signing and encrypting messages and presence by using <eref target="http://www.pgp.com">PGP</eref>/<eref target="http://www.gnupg.org">GnuPG</eref>.
			</t>
			<t>
				The Jabber model specifically does NOT require trust in the remote servers or server-server trust.
				Although there may be benefits to a trusted server model (this issue is hotly debated), the direct client-client trust is already in use in email and allows
				those who desire a higher level of security to use it without requiring the significant increase in complexity throughout the architecture.
			</t>
		</section>
		<section title="Client Connections" anchor="security-clientconn">
			<t>
				The IP address and method of access of clients is never made available, nor are any connections other than the original server connection required.
				This protects the client hosts from direct attack or identification by third parties, and allows
				the service provider to utilize an alternate protocol or provide another method of access to its clients.
			</t>
		</section>
		<section title="Presence" anchor="security-presence">
			<t>
				Presence subscriptions are enforced by the user's server. Only the approved entities are able to discover a user's availability.
			</t>
		</section>
	</section>

	<section title="Scaling Considerations" anchor="scaling">
		<section title="TCP Sockets" anchor="scaling-tcp">
			<t>
				A single, modern UNIX machine with proper tuning can handle 100,000 connections simultaneously. In <xref target="ref-c10k">c10k</xref>,
				Dan Kegel details how UNIX machines can be properly configured to handle large numbers of TCP connections.
			</t>
		</section>
		<section title="Server Farms" anchor="scaling-farms">
			<t>
				By sending the 302 redirect error as response to an authorization attempt, clients can be intelligently re-routed to a group of servers.
				A large-scale Jabber Server deployment will function in a manner very similar to that of a web server farm, with each server handling a moderate load and adding server hardware as demand grows.
			</t>
		</section>
		<section title="Client Optimizations" anchor="scaling-clientopt">
			<t>
				Custom clients can also make additional optimizations to reduce server load, such as idle auto-disconnect or local caching of server data that changes infrequently.
				These changes would be specific to the service requiring them and the clients supporting that service.
			</t>
		</section>
		<section title="Server Restrictions" anchor="scaling-serverrestrictions">
			<t>
				The server can apply limits to various aspects of the client functionality: roster size, offline message sizes, simultaneous session restrictions, rate limits, etc.
				These limits require no changes to clients and can be enforced on any server.
			</t>
		</section>
	</section>

	<section title="Extended Functionality" anchor="extrafunc">
		<section title="Services (Agents/Transports)" anchor="extrafunc-services">
			<t>
				The Jabber Architecture is designed to transparently provide access to independent data sources, so it is inherently geared to be extended in this way.
				Any server-side entity can easily participate in the real-time generation and delivery of XML.
				These entities can expose simple data sources such as instant calendaring events or log notifications, or enable access to an existing group of individuals by translating to an alternate protocol.
				All the new functionality is immediately available to any application utilizing Jabber or any entity available via the abstraction layer.
			</t>
		</section>
		<section title="MIME Transfers" anchor="extrafunc-mime">
			<t>
				All MIME objects, such as files, are transferred externally to the Jabber XML.
				<xref target="ref-rfc1521">MIME</xref> is the dominant and successful method for transferring such data, and accessible in almost every environment.
				The Jabber XML Protocol is used to exchange http:// URLs between entities needing to exchange a MIME object.
				The jabber:x:oob can be inserted into messages and presence to express a MIME attachment.
				The jabber:iq:oob can be sent directly to another entity to express a single immediate MIME transfer.
				Recipient entities are then able to make the judgment whether they are able to handle the MIME objects, before incurring the cost of retreiving them.
			</t>
		</section>
		<section title="XML Medium" anchor="extrafunc-xml">
			<t>
				As mentioned, the use of XML Namespaces allows any entity to insert any custom XML in an alternate namespace anywhere within the protocol.
				This flexibiliy is used frequently within clients and servers, and enables custom applications to utilize the access Jabber provides to instantly exchange structured data with each other.
			</t>
			<t>
				Because Jabber is an XML medium, many of the new XML data formats can be immediately deployed on top of Jabber.
				This includes <xref target="ref-vcard">vCard XML</xref>, <eref target="http://www.syncml.org">SyncML</eref>, <eref target="http://www.xmledi-group.org/">XML/EDI</eref>, <eref target="http://www.voicexml.org/">VoiceXML</eref>, and many more.
			</t>
			<t>
				The server can also act as an XML repository.
				The Jabber Server supports this via the jabber:iq:private namespace, which can contain any other XML that is stored on the server for the client.
				This can be used to store client preferences, bookmarks, game states, address books, notes, and any other structured data.
			</t>
			<figure>
				<preamble>
					A message with some custom XML included
				</preamble>
				<artwork><![CDATA[
<message to="horatio@denmark" from="hamlet@denmark">
  <body>Angels and Ministers of Grace, defend us!</body>
  <foo xmlns="http://www.foo.org/">
    <bar>ab<fb/>cd</bar>
  </foo>
</message>
				]]></artwork>
			</figure>
		</section>
		<section title="Session Initialization" anchor="extrafunc-sessioninit">
			<t>
				Users often use the existing presence and contact list to manually initiate other interactive software (e.g., "Hamlet, ready to start
				the game? I'm on and ready!"). By including custom XML or sending a URI, this could be automated within the client or application.
				Common uses are voice and video conferencing, games, collaborative tools, calendaring, and more.
			</t>
		</section>
		<section title="Client Access" anchor="extrafunc-clientaccess">
			<t>
				By utilizing the XML abstraction layer available as a client, additional gateways can be built to provide access to Jabber functionality for existing devices and software.
				Already, HTTP and IRC client gateways exist, with telnet and <eref target="http://www.wapforum.org/">WAP</eref> gateways under construction.
				In the future, devices with limited functionality or restricted access could use a custom gateway to access the messaging and presence features available on the server.
			</t>
		</section>
	</section>

	<section title="Examples">
		<t>All data is sent over the TCP socket to denmark:5222.</t>
		<t>SEND: indicates that the stream is going to the server while RECV: indicates that the stream is coming from the server to the client.</t>
		<section title="Minimal Client">
			<figure>
				<preamble>A simple example:</preamble>
				<artwork><![CDATA[
SEND: <stream:stream
SEND:   to="denmark"
SEND:   xmlns="jabber:client"
SEND:   xmlns:stream="http://etherx.jabber.org/streams">

RECV: <stream:stream
RECV:   from="denmark"
RECV:   id="1001"
RECV:   xmlns="jabber:client"
RECV:   xmlns:stream="http://etherx.jabber.org/streams">

SEND:   <iq id="1001" type="set">
SEND:     <query xmlns="jabber:iq:auth">
SEND:       <username>hamlet</username>
SEND:       <password>gertrude</password>
SEND:       <resource>Castle</resource>
SEND:     </query>
SEND:   </iq>

RECV:   <iq id="1001" type="result"/>

SEND:   <message to="horatio@denmark">
SEND:     <body>The air bites shrewdly; it is very cold.</body>
SEND:   </message>

RECV:   <message to="hamlet@denmark" from="horatio@denmark>
RECV:     <body>It is nipping and an eager air.</body>
RECV:   </message>

SEND: </stream:stream>
RECV: </stream:stream>
				]]></artwork>
			</figure>
		</section>
			
		<section title="Basic Client">
			<figure>
				<preamble>A basic client converation using presence, rosters (iq) and messages:</preamble>
				<artwork><![CDATA[
SEND: <stream:stream
SEND:   to="denmark"
SEND:   xmlns="jabber:client"
SEND:   xmlns:stream="http://etherx.jabber.org/streams">

RECV: <stream:stream
RECV:   from="denmark"
RECV:   id="1001"
RECV:   xmlns="jabber:client"
RECV:   xmlns:stream="http://etherx.jabber.org/streams">

SEND:   <iq id="1001" type="set">
SEND:     <query xmlns="jabber:iq:auth">
SEND:       <username>hamlet</username>
SEND:       <password>gertrude</password>
SEND:       <resource>Castle</resource>
SEND:     </query>
SEND:   </iq>
  
RECV:   <iq id="1001" type="result"/>

SEND:   <iq id="1002" type="get">
SEND:     <query xmlns="jabber:iq:roster"/>
SEND:   </iq>

RECV:   <iq id="1002" type="result">
RECV:     <query xmlns="jabber:iq:roster>
RECV:       <item jid="gertrude@denmark" name="Mother" subscription="both"/>
RECV:       <item jid="polonius@denmark" subscription="both"/>
RECV:       <item jid="horatio@denmark" name="Horatio" subscription="both">
RECV:         <group>Friends</group>
RECV:       </item> 
RECV:     </query>
RECV:   </iq>

SEND:   <presence/>

RECV:   <presence from="polonius@denmark/work" to="hamlet@denmark">
RECV:     <show>chat</show>
RECV:   </presence>

RECV:   <message from="polonius@denmark" to="hamlet@denmark">
RECV:     <body>How does my good Lord Hamlet?</body>
RECV:   </message>

SEND:   <message to="polonius@denmark">
SEND:     <body>Well, God-a-mercy.</body>
SEND:   </message>

RECV:   <message from="polonius@denmark" to="hamlet@denmark">
RECV:     <body>Do you know me, my lord?</body>
RECV:   </message>
  
SEND: </stream:stream>
RECV: </stream:stream>
	  			]]></artwork>
				<postamble>Note that only polonius@denmark is online at this time, thus no presence was received from other roster items.</postamble>
			</figure>
		</section>
		
		<section title="Extending">
			<figure>
				<preamble>A more advanced example that includes adding users to the roster, two new users coming online, a user changing status, and a client version request.</preamble>
				<artwork><![CDATA[
SEND: <stream:stream
SEND:   to="denmark"
SEND:   xmlns="jabber:client"
SEND:   xmlns:stream="http://etherx.jabber.org/streams">

RECV: <stream:stream
RECV:   from="denmark"
RECV:   id="1001"
RECV:   xmlns="jabber:client"
RECV:   xmlns:stream="http://etherx.jabber.org/streams">

SEND:   <iq id="1001" type="set">
SEND:     <query xmlns="jabber:iq:auth">
SEND:       <username>hamlet</username>
SEND:       <password>gertrude</password>
SEND:       <resource>Courtyard</resource>
SEND:     </query>
SEND:   </iq>
  
RECV:   <iq id="1001" type="result"/>

SEND:   <iq id="1002" type="get">
SEND:     <query xmlns="jabber:iq:roster"/>
SEND:   </iq>

RECV:   <iq id="1002" type="result">
RECV:     <query xmlns="jabber:iq:roster>
RECV:       <item jid="gertrude@denmark" name="Mother" subscription="both"/>
RECV:       <item jid="polonius@denmark" subscription="both"/>
RECV:       <item jid="horatio@denmark" name="Horatio" subscription="both">
RECV:         <group>Friends</group>
RECV:       </item> 
RECV:     </query>
RECV:   </iq>

SEND:   <presence/>

RECV:   <presence from="polonius@denmark/work" to="hamlet@denmark">
RECV:     <show>chat</show>
RECV:   </presence>

RECV:   <presence from="polonius@denmark/work" to="hamlet@denmark">
RECV:     <show>away</show>
RECV:     <status>Busy with project.</status>
RECV:   </presence>

RECV:   <presence from="rosencrantz@denmark" to="hamlet@denmark" type="subscribe"/>
RECV:   <presence from="guildenstern@denmark" to="hamlet@denmark" type="subscribe"/>

SEND:   <presence to="rosencrantz@denmark" type="subscribed"/>
SEND:   <presence to="guildenstern@denmark" type="subscribed"/>

RECV:   <iq type="set">
RECV:     <query xmlns="jabber:iq:roster">
RECV:       <item jid="rosencrantz@denmark" subscription="from"/>
RECV:     </query>
RECV:   </iq>

RECV:   <iq type="set">
RECV:     <query xmlns="jabber:iq:roster">
RECV:       <item jid="guildenstern@denmark" subscription="from"/>
RECV:     </query>
RECV:   </iq>

RECV:   <presence from="rosencrantz@denmark/trip" to="hamlet@denmark"/>
RECV:   <presence from="guildenstern@denmark/palmpilot" to="hamlet@denmark"/>

SEND:   <message to="polonius@denmark">
SEND:     <body>Well, God-a-mercy.</body>
SEND:   </message>

RECV:   <message from="guildenstern@denmark" to="hamlet@denmark">
RECV:     <body>My honoured lord!</body>
RECV:   </message>

RECV:   <message from="rosencrantz@denmark" to="hamlet@denmark">
RECV:     <body>My most dear lord!</body>
RECV:   </message>

SEND:   <iq id="1003" type="get" to="rosencrantz@denmark/trip">
SEND:     <query xmlns="jabber:iq:version"/>
SEND:   </iq>

RECV:   <iq type="result" from="rosencrantz@denmark/trip" to="hamlet@denmark" id="1003">
RECV:    <query xmlns="jabber:iq:version">
RECV:      <name>Gabber</name>
RECV:      <version>0.6.1</version>
RECV:      <os>Debian GNU/Linux 2.2.16</os>
RECV:    </query>
RECV:  </iq>

SEND: </stream:stream>
RECV: </stream:stream>
	  			]]></artwork>
			</figure>
		</section>
	</section>

	<section title="IMPP and Interoperability Notes">
		<section title="Requirements Conformance">
			<t>
				The implemented protocol presented in this memo is in near conformance to
				<xref target="ref-rfc2778">RFC 2778</xref>, "A Model for Presence and Instant Messaging" and
				<xref target="ref-rfc2779">RFC 2779</xref>, "Instant Messaging / Presence Protocol Requirements." Notable differences
				are outlined in the following section. It should be noted that the Jabber protocol
				has been in evolution for approximately two years as of the date of this memo, thus this protocol
				has not been designed in response to RFCs 2778 and 2779. 
			</t>
			<t><list style="symbols">
				<t>RFC 2779, section 2.5 - Complete conformance with these requirements can be obtained
				by using a standard public key infrastructure such as GnuPG or PGP.</t>
				<t>RFC 2779, section 4.1, paragraph 10 - all MIME data is delivered via HTTP.</t>
			</list></t>
		</section>
		<section title="Interoperability">
			<t>
				Jabber already provides complete interoperability, but at the cost of reverse engineering a 3rd party IM network protocol and operating a local translator to that protocol.
				The form of interoperability that Jabber offers is also restricted to the clients and requires the user to have a valid account on each IM network.
				It is the goal and desire of the Jabber development effort to increase the reach of the XML abstraction layer to overcome these limitations and reduce the reliance on local transports.
				The Jabber Development Team is ready and eager to interoperate directly at the server level with any other IM network and also willing to do much
				of the work to assist with this effort, as it reduces the complexity of the transport and adds significant new functionality to both sides.
			</t>
			<t>
				Using MSN Messenger as a example, full interoperability can be achieved with a relatively simple addition to their IM network.
				The MSN Messenger service would directly translate the Jabber XML to and from the native format at the server level, 
				as well as ensuring that the MSN Messenger client software would be able to address non-native users (it already utilizes a user@host based format, which may enable interoperability without any changes to client software).  
				The actual details of the translation depend on the native data format and accessibility within the network of servers, but the XML is well defined and functionality across both networks is similiar enough for an almost direct mapping.
				This level of interoperability enables all Jabber and MSN Messenger users to communicate
				instantly and transparently without modifying parts of either network.
			</t>
		</section>
	</section>

<!-- *sigh* .. all those tabs and they don't line up right -->
	</middle>

	<back>

		<references>

			<reference anchor="ref-xml" target="http://www.w3.org/TR/1998/REC-xml-19980210">
				<front>
					<title>Extensible Markup Language (XML) 1.0</title>
					<author>
						<organization abbrev="W3C">World Wide Web Consortium</organization>
					</author>
					<date month="February" year="1998"/>
				</front>
				<seriesInfo name="W3C" value="xml"/>
			</reference>

			<reference anchor="ref-rfc793" target="http://www.ietf.org/rfc/rfc0793.txt">
				<front>
					<title>Transmission Control Protocol</title>
					<author>
						<organization>University of Southern California</organization>
						<address>
							<postal>
								<street>4676 Admiralty Way</street>
								<city>Marina del Rey</city> <region>CA</region> <code>90291</code>
							</postal>
						</address>
					</author>
					<date month="September" year="1981"/>
				</front>
				<seriesInfo name="RFC" value="793"/>
			</reference>

			<reference anchor="ref-vcard" target="http://protocol.jabber.org/vcard-temp/">
				<front>
					<title>vCard XML</title>
					<author>
						<organization>The Jabber.org Project</organization>
						<address>
							<email>info@jabber.org</email>
						</address>
					</author>
					<date month="March" year="2000"/>
				</front>
			</reference>

			<reference anchor="ref-gpl" target="http://www.gnu.org/copyleft/gpl.html">
				<front>
					<title>GNU General Public License</title>
					<author>
						<organization>Free Software Foundation</organization>
					</author>
					<date month="June" year="1991"/>
				</front>
			</reference>
			
			<reference anchor="ref-lgpl" target="http://www.gnu.org/copyleft/lgpl.html">
				<front>
					<title>GNU Library General Public License</title>
					<author>
						<organization>Free Software Foundation</organization>
					</author>
					<date month="June" year="1991"/>
				</front>
			</reference>

			<reference anchor="ref-rfc2396" target="http://www.ietf.org/rfc/rfc2396.txt">
				<front>
					<title abbrev="URI">Uniform Resource Identifiers (URI): Generic Syntax</title>
					<author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
						<organization abbrev="W3C">World Wide Web Consortium</organization>
						<address>
							<email>timbl@w3.org</email>
						</address>
					</author>
					<author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
						<organization abbrev="UCI">University of California, Irvine</organization>
						<address>
							<email>fielding@ics.uci.edu</email>
						</address>
					</author>
					<author initials="L." surname="Masinter" fullname="Larry Masinter">
						<organization>Xerox PARC</organization>
						<address>
							<email>masinter@parc.xerox.com</email>
						</address>
					</author>
					<date month="August" year="1998"/>
				</front>
				<seriesInfo name="RFC" value="2396"/>
			</reference>
			
			<reference anchor="ref-xml-namespaces" target="http://www.w3.org/TR/1999/REC-xml-names-19990114/">
				<front>
					<title>Namespaces in XML</title>
					<author>
						<organization abbrev="W3C">World Wide Web Consortium</organization>
					</author>
					<date month="January" year="1999"/>
				</front>
				<seriesInfo name="W3C" value="xml-names"/>
			</reference>

			<reference anchor="ref-ssl" target="http://home.netscape.com/eng/ssl3/draft302.txt">
				<front>
					<title>The SSL Protocol - Version 3.0</title>
					<author initials='A.' surname='Freier' fullname='Alan O. Freier'>
						<organization>Netscape Communications</organization>
					</author>
					<author initials='P.' surname='Karlton' fullname='Philip Karlton'>
						<organization>Netscape Communications</organization>
					</author>
					<author initials='P.' surname='Kocher' fullname='Paul C. Kocher'>
						<organization>Independent Consultant</organization>
					</author>
					<date month="November" year="1996"/>
				</front>
			</reference>
			
			<reference anchor="ref-rfc2068" target="http://www.ietf.org/rfc/rfc2068.txt">
				<front>
					<title>Hypertext Transfer Protocol -- HTTP/1.1</title>
					<author initials='R.' surname='Fielding' fullname='R. Fielding'><organization/></author>
					<author initials='J.' surname='Gettys' fullname='J. Gettys'><organization/></author>
					<author initials='J.' surname='Mogul' fullname='J. Mogul'><organization/></author>
					<author initials='H.' surname='Frystyk' fullname='H. Frystyk'><organization/></author>
					<author initials='T.' surname='Berners-Lee' fullname='T. Berners-Lee'><organization/></author>
					<date month='January' year='1997'></date>
				</front>
				<seriesInfo name='RFC' value='2068' />
			</reference>

			<reference anchor="ref-c10k" target="http://www.kegel.com/c10k.html">
				<front>
					<title>The C10K Problem</title>
					<author initials="D." surname="Kegel" fullname="Dan Kegel">
						<organization/>
						<address>
							<email>dank@alumni.caltech.edu</email>
						</address>
					</author>
					<date month="June" year="2000"/>
				</front>
			</reference>
			
			<reference anchor='ref-rfc1521' target="http://www.ietf.org/rfc/rfc1521.txt">
				<front>
					<title abbrev="MIME">MIME (Multipurpose Internet Mail Extensions) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies</title>
					<author initials='N.' surname='Borenstein' fullname='N. Borenstein'>
						<organization>Bellcore</organization>
					</author>
					<author initials='N.' surname='Freed' fullname='N. Freed'>
						<organization>Innosoft</organization>
					</author>
					<date month='September' year='1993'/>
				</front>
				<seriesInfo name='RFC' value='1521'/>
			</reference>
			
			<reference anchor="ref-rfc2778" target="http://www.ietf.org/rfc/rfc2778.txt">
				<front>
					<title>A Model for Presence and Instant Messaging</title>
					<author initials="M." surname="Day" fullname="Mark Day">
						<organization>SightPath, Inc.</organization>
						<address>
							<email>mday@alum.mit.edu</email>
						</address>
					</author>
					<author initials="J." surname="Rosenberg" fullname="Jonathan Rosenberg">
						<organization>dynamicsoft</organization>
						<address>
							<email>jdrosen@dynamicsoft.com</email>
						</address>
					</author>
					<author initials="H." surname="Sugano" fullname="Hiroyasu Sugano">
						<organization>Fujitsu Laboratories Ltd.</organization>
						<address>
							<email>suga@flab.fujitsu.co.jp</email>
						</address>
					</author>
					<date month="February" year="2000"/>
				</front>
				<seriesInfo name="RFC" value="2778"/>
			</reference>
			
			<reference anchor="ref-rfc2779" target="http://www.ietf.org/rfc/rfc2779.txt">
				<front>
					<title>A Model for Presence and Instant Messaging</title>
					<author initials="M." surname="Day" fullname="Mark Day">
						<organization>SightPath, Inc.</organization>
						<address>
							<email>mday@alum.mit.edu</email>
						</address>
					</author>
					<author initials="S." surname="Aggarwal" fullname="Sonu Aggarwal">
						<organization>Microsoft Corporation</organization>
						<address>
							<email>sonuag@microsoft.com</email>
						</address>
					</author>
					<author initials="G." surname="Mohr" fullname="Gordon Mohr">
						<organization/>
						<address>
							<email>gojomo@usa.net</email>
						</address>
					</author>
					<author initials="J." surname="Vincent" fullname="Jesse Vincent">
						<organization>Into Networks, Inc.</organization>
						<address>
							<email>jesse@intonet.com</email>
						</address>
					</author>
					<date month="February" year="2000"/>
				</front>
				<seriesInfo name="RFC" value="2779"/>
			</reference>

		</references>
		
		<section title="The Jabber Protocol DTD" anchor="jabber-dtd">
			<figure>
				<artwork><![CDATA[
<!--
    Jabber XML DTD
    By Julian "X-ViRGE" Missig
    julian@linuxpower.org
-->

<!--=========== The Main Elements =============-->

<!-- jabber, the root element -->
<!-- note: the root element is not normally used due to the use of xmlstreams and namespaces -->
<!ELEMENT jabber ((presence | iq | message)*)>

<!-- presence, a subelement of jabber -->

<!ELEMENT presence ((status? | priority? | show?)*)>
<!ATTLIST presence
  to          CDATA             #IMPLIED
  from	      CDATA		#IMPLIED
  type        (subscribe | subscribed | unsubscribe | unsubscribed | unavailable | probe) #IMPLIED
  >

<!ELEMENT status (#PCDATA)>

<!ELEMENT priority (#PCDATA)>

<!ELEMENT show (#PCDATA)> <!-- standard options are: chat, away, xa and dnd -->


<!-- message, a subelement of jabber -->

<!ELEMENT message ((body? | error* | subject? | thread?)*)>
<!ATTLIST message
  to          CDATA             #IMPLIED
  from        CDATA             #IMPLIED
  id          ID
  type	      (normal | error | chat | groupchat | headline) #IMPLIED
  >

<!ELEMENT body (#PCDATA)>

<!ELEMENT error (#PCDATA)>

<!ATTLIST error
  code        CDATA        #IMPLIED
  >

<!ELEMENT subject (#PCDATA)>

<!ELEMENT thread (#PCDATA)>

<!ELEMENT x (#PCDATA)>


<!-- iq, a subelement of jabber -->

<!ELEMENT iq (#PCDATA)>
<!ATTLIST iq
  to          CDATA        #IMPLIED
  from        CDATA        #IMPLIED
  id          ID
  type	      (get | set | result | error)  #IMPLIED
  >
				]]></artwork>
			</figure>
		</section>

		<section title="XML Streams DTD" anchor="xmlstream">
			<figure>
				<artwork><![CDATA[
<!ELEMENT stream (error?)>
<!ATTLIST stream
  to              CDATA       #REQUIRED
  from            CDATA       #IMPLIED
  id              CDATA       #IMPLIED
  xmlns           CDATA       #REQUIRED
  xmlns:stream    CDATA       #REQUIRED 'http://etherx.jabber.org/streams'
  >
<!ELEMENT error (PCDATA)>
				]]></artwork>
			</figure>
		</section>

		<section title="&lt;error&gt; element" anchor="error">
			<t>
				A standard error element is used for failed processing of messages and iq. This element is a child of the failed element.
			</t>
			<section title="Attributes">
				<t><list style="symbols">
					<t>code - a numerical error code corresponding to a specific error description. The numerical codes used
						are nearly synchronous with HTTP error codes:
						<list style="symbols">
							<t>302 - Redirect</t>
							<t>400 - Bad Request</t>
							<t>401 - Unauthorized</t>
							<t>402 - Payment Required</t>
							<t>403 - Forbidden</t>
							<t>404 - Not Found</t>
							<t>405 - Not Allowed</t>
							<t>406 - Not Acceptable</t>
							<t>407 - Registration Required</t>
							<t>408 - Request Timeout</t>
							<t>500 - Internal Server Error</t>
							<t>501 - Not Implemented</t>
							<t>502 - Remote Server Error</t>
							<t>503 - Service Unavailable</t>
							<t>504 - Remote Server Timeout</t>
						</list>
					</t>
				</list></t>
			</section>
			<section title="Examples">
				<figure>
					<preamble>Message error:</preamble>
					<artwork><![CDATA[
<message to="hamlet@denmark" from="horatio@denmark" type="error">
  <body>Angels and Ministers of Grace, defend us!</body>
  <error code="404">Not Found</error>
</message>
					]]></artwork>
				</figure>
				<figure>
					<preamble>IQ Error:</preamble>
					<artwork><![CDATA[
<iq type="error" from="service.denmark" to="hamlet@denmark" id="1002">
  <query xmlns="jabber:iq:register">
    <name>hamlet</name>
    <email>hamlet@denmark</email>
    <password>gertrude</password>
    <key>106c0a7b5510f192a408a1d054150ed1065e255a</key>
  </query>
  <error code="502">Remote Server Error</error>
</iq>
					]]></artwork>
				</figure>
			</section>
		</section>

		<section title="Info/Query Namespaces" anchor="iq">
			<t>
				Numerous <xref target="xml-iq">Info/Query</xref> namespaces have been implemented to faciliate
				exchange of information between Jabber entities. Namespaces currently implemented within the
				Jabber server include:
				<list style="symbols">
					<t>Simple Client Authentication (jabber:iq:auth)</t>
					<t>Agent Properties (jabber:iq:agent)</t>
					<t>Registration Requests (jabber:iq:register)</t>
					<t>Roster (Contact List) Management (jabber:iq:roster)</t>
					<t>Available Agents List (jabber:iq:agents)</t>
					<t>Out Of Band Data (jabber:iq:oob)</t>
					<t>Client Time (jabber:iq:time)</t>
					<t>Client Version (jabber:iq:version)</t>
					<t>Temporary vCard (vcard-temp)</t>
				</list>
				Note that the Temporary vCard namespace is being used until the vCard XML standard has been
				finalized.
			</t>
			<t>The following subsections describe the three most fundamental extensions.</t>
			<section title="Simple Client Authentication - jabber:iq:auth" anchor="iq-auth">
			<t>
					The jabber:iq:auth namespaces provides a simple mechanism for clients to authenticate
					and create a resource representing their connection to the server.
				</t>
				<section title="Children">
					<t><list style="symbols">
						<t>username - the unique user name for this user.</t>
						<t>password - the secret key or passphrase for the user account.</t>
						<t>digest - send a password in a SHA1 hash instead of clear text password.</t>
						<t>resource - unique value to represent current connection.</t>
					</list></t>
				</section>
				<section title="Examples">
					<t>The following is a complete example of how a client authenticates with the server.</t>
					<figure>
						<preamble>Client sends user information:</preamble>
						<artwork><![CDATA[
<iq type="set" id="1001">
  <query xmlns="jabber:iq:auth">
    <username>hamlet</username>
    <password>gertrude</password>
	<resource>Castle</resource>
  </query>
</iq>
						]]></artwork>
					</figure>
					<figure>
						<preamble>Server confirms login:</preamble>
						<artwork><![CDATA[
<iq type="result" id="1001"/>
						]]></artwork>
					</figure>
				</section>
			</section>
			<section title="Roster (Contact List) Management - jabber:iq:roster" anchor="iq-roster">
				<t>
					Provides a simple method for server-side contact list management. Upon connecting to the
					server, clients should request for the roster using jabber:iq:roster. Since the roster
					may not be desirable for all clients (e.g., cellular phone client), the client request of
					the roster is optional.
				</t>
				<section title="Children">
					<t><list style="symbols">
						<t>item -
							a specific roster item (contact) has the following attributes:
							<list style="symbols">
								<t>jid - the complete JID (Jabber ID) of the user that this item represents</t>
								<t>subscription -
									the current status of the subscription related to this item. May have a value of:
									<list style="symbols">
										<t>none - no subscription.</t>
										<t>from - this entity has a subscription to the user.</t>
										<t>to - the user has a subscription to this entity.</t>
										<t>both - subscription is both to and from.</t>
										<t>remove - item is to be removed.</t>
									</list>
								</t>
								<t>ask -
									the current status of a request to this item. May be one of:
									<list style="symbols">
										<t>subscription - the user is asking this item for a subscription.</t>
										<t>unsubscription - the user is asking this item for an unsubscription.</t>
									</list>
								</t>
							</list>
							This element may contain one or more instances of the following element:
							<list style="symbols">
								<t>group - contains a user-specified user group name.</t>
							</list>
						</t>
					</list></t>
				</section>
				<section title="Examples">
					<figure>
						<preamble>Client request for current roster:</preamble>
						<artwork><![CDATA[
<iq type="get" id="1001">
  <query xmlns="jabber:iq:roster"/>
</iq>
						]]></artwork>
					</figure>
					<figure>
						<preamble>Server response to client query:</preamble>
						<artwork><![CDATA[
<iq type="result" id="1001">
  <query xmlns="jabber:iq:roster">
    <item jid="claudius@denmark" name="Uncle Claudius" subscription="from">
      <group>Family</group>
    </item>
    <item jid="horatio@denmark" name="Horatio" subscription="both">
      <group>Friends</group>
    </item> 
    <item jid="fortinbras@norway" name="Prince Fortinbras" subscription="none" ask="subscribe"/>
  </query>
</iq>
						]]></artwork>
					</figure>
					<figure>
						<preamble>Client adding new items and modifying an entry:</preamble>
						<artwork><![CDATA[
<iq type="set" id="1002">
  <query xmlns="jabber:iq:roster">  
    <item name="Rosencrantz" jid="rosencrantz@denmark">
      <group>Visitors</group>
    </item>
    <item name="Guildenstern" jid="guildenstern@denmark">
      <group>Visitors</group>
    </item>
    <item jid="claudius@denmark" name="King Claudius">
      <group>Family</group>
      <group>Royalty</group>
    </item>
  </group>
</iq>
						]]></artwork>
					</figure>
					<figure>
						<preamble>The server would then respond with the new roster information, plus an IQ result:</preamble>
						<artwork><![CDATA[
<iq type="set">
  <query xmlns="jabber:iq:roster">  
    <item jid="rosencrantz@denmark" name="Rosencrantz">
      <group>Visitors</group>
    </item>
    <item jid="guildenstern@denmark" name="Guildenstern" >
      <group>Visitors</group>
    </item>
    <item jid="claudius@denmark" name="King Claudius">
      <group>Family</group>
	  <group>Royalty</group>
    </item>
  </group>
</iq>
<iq type="result" id="1002"/>
						]]></artwork>
					</figure>
				</section>
			</section>
			<section title="Registration Request - jabber:iq:register" anchor="iq-register">
				<t>
					Through jabber:iq:register, clients can register with the Jabber server itself or with new
					services.
				</t>
				<section title="Children">
					<t>
						Note that while numerous fields are available, only the ones returned by the server
						are required for registration.
						<list style="symbols">
							<t>username</t>
							<t>password</t>
							<t>name</t>
							<t>email</t>
							<t>address</t>
							<t>city</t>
							<t>state</t>
							<t>zip</t>
							<t>phone</t>
							<t>url</t>
							<t>date</t>
							<t>misc</t>
							<t>text</t>
							<t>instructions - contains server provided instructions for registration.</t>
							<t>key - a unique key provided by the server, required for the entire registration process.</t>
						</list>
					</t>
				</section>
				<section title="Examples">
					<t>
						A complete example is provided in the <xref target="iq-examples">IQ examples</xref>.
					</t>
				</section>
			</section>
		</section>

		<section title="X Namespaces" anchor="x">
			<t>
				For sending information that does not require the IQ structure, the X namespace series has been
				implemented. Clients can use this type of namespace to send URLs, Roster (Contact List) items,
				Offline Options and other information. The following X namespaces have been implemented so far in the Jabber
				server:
				<list style="symbols">
					<t>Delay Logging (jabber:x:delay)</t>
					<t>Out Of Band Data (File Transfers) (jabber:x:oob)</t>
					<t>Embedded Roster Items (jabber:x:roster)</t>
				</list>
			</t>
			<section title="Examples">
				<figure>
					<preamble>Sending an embedded roster item to a user:</preamble>
					<artwork><![CDATA[
<message to="hamlet@denmark" from="horatio@denmark">
  <subject>Visitors</subject>
  <body>This message contains roster items.</body>
  <x xmlns="jabber:x:roster">  
    <item jid="rosencrantz@denmark" name="Rosencrantz"><group>Visitors</group></item>
    <item jid="guildenstern@denmark" name="Guildenstern"><group>Visitors</group></item>
  </x>
</message>
					]]></artwork>
				</figure>
			</section>
		</section>


		<section title="Acknowledgments">
			<t>
				While the entire Jabber.org team has been actively involved in the development of this protocol, the following individuals have significantly contributed:
				<list>
					<t>Eliot Landrum</t>
					<t>Thomas Muldowney</t>
					<t>Thomas Charron</t>
					<t>Julian Missig</t>
					<t>Peter Millard</t>
				</list>
			</t>
		</section>


	</back>

</rfc>
