Multi-User Chat (XEP-0045) [1] defines a full-featured technology for multi-user text conferencing in XMPP. By design, Multi-User Chat (XEP-0045) [1] assumes that a conference room is hosted at a single service, which can be accessed from any point on the network. However, this assumption introduces a single point of failure for the conference room, since if occupants at a using domain lose connectivity to the hosting domain then they also lose connectivity to the room. In some deployment scenarios (and even on the open Internet) this behavior is suboptimal. Therefore, this document attempts to define a technology for distributing MUC rooms across multiple services.
This specification addresses the following requirements:
The basic approach to distribution of MUC rooms is as follows:
The room IDs of source rooms SHOULD be opaque to users and unique across all possible peerhosts, for example by generating a UUID in accordance with RFC 4122 [2] or by hashing the human-readable name of the room using the SHA-256 algorithm in accordance with SHA [3].
This document adds the following terms to those defined in Multi-User Chat (XEP-0045) [1]:
In this document, the examples use the following entities.
When the original room owner creates the room (or subsequently configures the room), the service MAY simply default all rooms to "distributed".
Alternatively, the server MAY offer the option of making the room a "distributed room". This is done by including the "muc#roomconfig_distributed" feature in the room configuration form:
The room owner specifies a value of "1" or "true" [4] if room distribution is desired:
Alternatively, the firsthost can choose to perform room distribution in the background, rather than exposing the 'muc#roomconfig_distributed' option to the user.
When a firsthost would like a peerhost to provide a shadow, it sends a replication request to the peerhost.
If the peerhost is willing and able to replicate the room, it returns an IQ-result:
Several error cases are possible (the peerhost is resource constrained, the firsthost is forbidden to peer with the peerhost, etc.); these will be specified more fully in a future version of this specification.
Once the peerhost acknowledges that it is willing and able to replicate the room, four things happen:
The new shadow SHOULD request the room history. This is done by sending an IQ-get from the shadow to the source, containing a <history/> element qualified by the 'http://jabber.org/protocol/muc' namespace (the syntax and semantics of this element are described in Multi-User Chat (XEP-0045) [1]).
The history request MAY include any of the attributes specified in XEP-0045:: 'maxchars', 'maxstanzas', 'seconds', and 'since'.
The firsthost also informs other connected peerhosts about the new peerhost.
XEP-0045 specifies that rooms can be found on a chat service using Service Discovery (XEP-0030) [5].
A user at a peerhost could send a service discovery items ("disco#items") request to the firsthost in order to find the source room. However, this introduces a dependency on communication with the firsthost, and we have stipulated that such communication might not be available.
Alternatively, the peerhost could keep a list of the shadow rooms that it hosts. From the perspective of the user at the peerhost, these rooms are local in the sense that the user can join the shadow and thereby interact with the occupants of the shadow (and, if server-to-server communication is working, with the occupants of the source). This approach is RECOMMENDED.
Note: If the peerhost frequently loses communications with the firsthost and the list of rooms located at the firsthost is large, the peerhost will want to use a more efficient method of synchronizing its room list than sending disco#items requests and receiving large disco#items results. However, methods for optimizing this synchronization process are out of scope for this specification.
To find rooms on the peerhost, the local user sends a "disco#items" request to the peerhost.
The service returns a list of the public rooms it hosts, which includes any shadow rooms.
The user can then send a disco#info request to each room. If the room is a shadow, the service MUST include extended information about the room using the Service Discovery Extensions (XEP-0128) [6] format, specifically with a "http://jabber.org/protocol/muc#roominfo" FORM_TYPE and a (newly-defined) "dmuc-source" field.
This informs the user that the source room is "coven@chat.shakespeare.lit"; as a result, the user's client can trap any outbound requests destined for the source room (service discovery, room join, etc.) and redirect them to the shadow.
The process of joining a shadow is exactly as described in XEP-0045.
The shadow then informs the source (and any other shadows) of the user's presence; it does so by sending presence from the roomjid of the user at the shadow to a roomjid with the same roomnick at the source and shadow(s).
The source then delivers that presence stanza to its local users. (Note: The shadow needs to send only one presence stanza to the source, thus reducing the number of stanzas sent over the server-to-server link between the peerhost and the firsthost.)
If there is no local shadow available at the peerhost, or if the peerhost does not support extended service discovery information as described above, then the local user at the peerhost will end up sending a join request to the source room instead of the shadow room.
When this happens, the firsthost determines if it will invite the user to join a shadow at a peerhost instead. The process for determining when to send invitations is implementation specific and might be subject to configuration at the firsthost (e.g., the firsthost might send invitations only to users of a domain associated with the peerhost and only after a certain number of such users have joined the room at the firsthost).
To begin, a user at the peerhost attempts to join the source room at the firsthost:
The source room returns a <redirect/> presence error to the user and invites the user to join a shadow room instead.
Then the source invites the user to the shadow using the protocol defined in Direct MUC Invitations (XEP-0249) [7].
The user then joins the shadow.
The shadow then informs the source (and any other shadows) of the user's presence; it does so by sending presence from the roomjid of the user at the shadow to a roomjid with the same roomnick at the source and shadow(s).
The source then delivers that presence stanza to its local users. (Note: The shadow needs to send only one presence stanza to the source, thus reducing the number of stanzas sent over the server-to-server link between the peerhost and the firsthost.)
When a user sends a message to an instance, the instance sends the message to its local occupants and to other instances.
The source then delivers that message stanza to its local users. (Note: The shadow needs to send only one message stanza to the source, thus reducing the number of stanzas sent over the server-to-server link between the peerhost and the firsthost.)
To follow.
If a MUC service supports distributed rooms, it MUST return a feature of "urn:xmpp:dmuc:0" in response to service discovery information requests.
To follow.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [8].
This document requires no interaction with the XMPP Registrar [9].
Thanks to Jay Carlson, Boyd Fletcher, and Michael Krutsch for their early conversations regarding distributed chatrooms.
To follow.
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright © 1999 – 2024 by the XMPP Standards Foundation (XSF).
Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.
## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.
This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).
The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. XEP-0045: Multi-User Chat <https://xmpp.org/extensions/xep-0045.html>.
2. RFC 4122: A Universally Unique IDentifier (UUID) URN Namespace <http://tools.ietf.org/html/rfc4122>.
3. Secure Hash Standard: Federal Information Processing Standards Publication 180-2 <http://csrc.nist.gov/publications/fips/fips180-2/fips186-2withchangenotice.pdf>.
4. In accordance with Section 3.2.2.1 of XML Schema Part 2: Datatypes, the allowable lexical representations for the xs:boolean datatype are the strings "0" and "false" for the concept 'false' and the strings "1" and "true" for the concept 'true'; implementations MUST support both styles of lexical representation.
5. XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.
6. XEP-0128: Service Discovery Extensions <https://xmpp.org/extensions/xep-0128.html>.
7. XEP-0249: Direct MUC Invitations <https://xmpp.org/extensions/xep-0249.html>.
8. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
9. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.
Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/
Added protocol flows for finding and joining shadow rooms, thus removing dependency on communication with firsthost; changed examples to mimic XEP-0045.
Initial published version.
Simplified the protocol to use a master-slave approach; modified terminology.
First draft.
@report{saint-andre2007not-yet-assigned, title = {DMUC1: Distributed Multi-User Chat}, author = {Saint-Andre, Peter}, type = {XEP}, number = {0281}, version = {0.2}, institution = {XMPP Standards Foundation}, url = {https://xmpp.org/extensions/xep-0281.html}, date = {2007-06-01/2010-07-20}, }
END