All examples are fictional and the information exchanged e. Architecture XMPP provides a technology for the asynchronous, end-to-end exchange of structured data by means of direct, persistent XML streams among a distributed network of globally addressable, presence-aware clients and servers. Because this architectural style involves ubiquitous knowledge of network availability and a conceptually unlimited number of concurrent information transactions in the context of a given client-to-server or server-to-server session, we label it "Availability for Concurrent Transactions" ACT to distinguish it from the "Representational State Transfer" [REST] Fielding, R.
The salient features of this ACTive architectural style are as follows. All XMPP entities are addressable on the network, most particularly clients and servers but also various additional services that can be accessed by clients and servers. Presence XMPP includes the ability for an entity to advertise its network availability or "presence" to other entities.
In XMPP, this availability for communication is signaled end-to-end by means of a dedicated communication primitive: Although knowledge of network availability is not strictly necessary for the exchange of XMPP messages, it facilitates real-time interaction because the originator of a message can know before initiating communication that the intended recipient is online and available.
Persistent Streams Availability for communication is also built into each point-to-point "hop" through the use of persistent XML streams over long-lived TCP connections. These "always-on" client-to-server and server-to-server streams enable each party to push data to the other party at any time for immediate routing or delivery.
The root element of a stanza includes routing attributes such as "from" and "to" addresses , and the child elements of the stanza contain a payload for delivery to the intended recipient. Distributed Network of Clients and Servers In practice, XMPP consists of a network of clients and servers that inter-communicate however, communication between any two given deployed servers is strictly discretionary and a matter of local service policy.
This pattern is familiar from messaging protocols that make use of global addresses, such as the email network see [SMTP] Klensin, J. As a result, end-to-end communication in XMPP is logically peer-to-peer but physically client-to-server-to-server-to-client, as illustrated in the following diagram. In addition, XML streams can be established end-to-end over any reliable transport, including extensions to XMPP itself; however, such methods are out of scope for this specification.
The following paragraphs describe the responsibilities of clients and servers on the network. A client is an entity that establishes an XML stream with a server by authenticating using the credentials of a registered account via SASL negotiation SASL Negotiation and that then completes resource binding Resource Binding in order to enable delivery of XML stanzas between the server and the client over the negotiated stream.
The client then uses XMPP to communicate with its server, other clients, and any other entities on the network, where the server is responsible for delivering stanzas to other connected clients at the same server or routing them to remote servers.
Multiple clients can connect simultaneously to a server on behalf of the same registered account, where each client is differentiated by the resourcepart of an XMPP address e. A server is an entity whose primary responsibilities are to: Depending on the application, the secondary responsibilities of an XMPP server can include: Storing data that is used by clients e.