The primary motivation for Distributed Multi-User Chat (DMUC) is to minimize the server-to-server (S2S) traffic that is required for Multi-User Chat (MUC). In constrained environments, the traffic on the S2S link can cause severe degradation of service. Much of the S2S message traffic can be eliminated if each local server keeps a mirror of the chat room and responds to its local users on behalf of the actual MUC room.
MUC uses lots of bandwidth. Sometimes the network link that S2S traffic is carried on is heavily constrained. This protocol reduces the amount of traffic going across S2S through local mirrors of remote MUC rooms. It needs no bandwidth for remote rooms without local occupants.
The following is a list of goals for the design of this extension:
The following JIDs are used in this document.
Support for Distributed MUC in a given server instance SHOULD be determined using Service Discovery (XEP-0030) [2]. A conforming server MUST respond to disco#info requests.
To determine if a server or service supports Distributed MUC, the requesting entity SHOULD send a disco#info request to it.
<iq type='get' from='raleigh.tridsys.com' to='conference.fairfax.tridsys.com' id='info1'> <query xmlns='http://jabber.org/protocol/disco#info'/> </iq>
If the server supports Distributed MUC, it MUST include a feature in the response.
<iq type='result' from='conference.fairfax.tridsys.com' to='raleigh.tridsys.com' id='info1'> <query xmlns='http://jabber.org/protocol/disco#info'> ... <feature var='http://tridsys.com/protocol/dmuc'/> ... </query> </iq>
User wayne@raleigh.tridsys.com/TransVerse wants to join MUC room chatroom@conference.fairfax.tridsys.com. At this point mirror.raleigh.tridsys.com knows nothing of the chatroom@conference.fairfax.tridsys.com MUC, and no existing mirror is in place beyond mirror.raleigh.tridsys.com being willing to mirror for wayne@raleigh.tridsys.com/TransVerse.
<presence from='wayne@raleigh.tridsys.com/TransVerse' to='chatroom@conference.fairfax.tridsys.com/Wayne'> <x xmlns='http://jabber.org/protocol/muc'/> </presence>
raleigh.tridsys.com determines that this message is bound for a MUC service supporting DMUC and sends it to the real MUC with an additional tag.
<presence from='wayne@raleigh.tridsys.com/TransVerse' to='chatroom@conference.fairfax.tridsys.com/Wayne'> <dmuc xmlns='http://tridsys.com/protocol/dmuc' from='mirror.raleigh.tridsys.com'/> </presence>
chatroom@conference.fairfax.tridsys.com recognises that the mirror service is now mirrorring it, and performs the usual ACL checks as if wayne@tridsys.com/TransVerse had joined directly, sending presence to all occupants. The master MUC will be able to take advantage of the fact that the rosters are being maintained by the distributed MUC services and send one presence with no <addresses/> (see Extended Stanza Addressing (XEP-0033) [1]) block to the mirrors. The mirrors can then forward the <presence/> to each of their locally attached users that are in the room.
If this mirror is unknown to the master, the room configuration MUST be sent to the new mirror. The room configuration will contain information like if the room is moderated, how much history, who is allowed in the room, etc.
<iq from='chatroom@conference.fairfax.tridsys.com/Wayne' to='mirror.raleigh.tridsys.com' id='iq1' type='set'> <config xmlns='urn:xmpp:dmuc:0'> <x xmlns='jabber:x:data' type='form'> <field type='hidden' var='FORM_TYPE'> <value>http://jabber.org/protocol/muc#roomconfig</value> </field> ... </x> </config> </iq>
Upon receiving the room configuration, the mirror MUST respond.
<iq from='mirror.raleigh.tridsys.com' to='chatroom@conference.fairfax.tridsys.com/Wayne' id='iq1' type='result'/>
The master room MUST now send the roster to the mirror.
<iq from='chatroom@conference.fairfax.tridsys.com' to='mirror.raleigh.tridsys.com' id='roster1' type='set'> <roster xmlns='urn:xmpp:dmuc:0'> <item affiliation='owner' jid='scott@fairfax.tridsys.com' name='Scott'/> <item affiliation='admin' jid='kevin@fairfax.tridsys.com' name='Kevin'/> <item affiliation='none' jid='wayne@raleigh.tridsys.com' name='Wayne'/> <item affiliation='none' jid='keith@raleigh.tridsys.com' name='Keith'/> </roster> </iq>
The mirror MUST send a response to the roster.
<iq from='mirror.raleigh.tridsys.com' to='chatroom@conference.fairfax.tridsys.com' type='result'/>
The new mirror SHOULD request room history. See Multi-User Chat (XEP-0045) [3] for details.
<iq from='mirror.raleigh.tridsys.com' to='chatroom@conference.fairfax.tridsys.com/Wayne' id='history' type='get'> <room xmlns='urn:xmpp:dmuc:0' id='chatroom@conference.fairfax.tridsys.com'> <history xmlns='http://jabber.org/protocol/muc'/> </room> </iq>
The history request MAY include any attributes specified in Multi-User Chat (XEP-0045) [3], such as 'maxchars', 'maxstanzas', 'seconds', and 'since'.
<iq from='chatroom@conference.fairfax.tridsys.com' to='mirror.raleigh.tridsys.com' id='history1' type='result'> <history xmlns='http://jabber.org/protocol/muc'> <message xmlns='jabber:client' from='chatroom@conference.fairfax.tridsys.com/Wayne' type='groupchat'> <body>All work and no play makes Jack a dull boy</body> <delay xmlns='urn:xmpp:delay' from='wayne@raleigh.tridsys.com/TransVerse' stamp='2011-01-19T08:02:43Z'/> </message> ... </message> <message xmlns='jabber:client' from='chatroom@conference.fairfax.tridsys.com/Scott' type='groupchat'> <body>All work and no play makes Jack a dull boy</body> <delay xmlns='urn:xmpp:delay' from='scott@fairfax.tridsys.com/TransVerse' stamp='2011-01-19T08:23:10Z'/> <body>All work and no play makes Jack a dull boy</body> </message> </history> </iq>
<presence from='chatroom@conference.fairfax.tridsys.com/Wayne' to='mirror.raleigh.tridsys.com'> <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='none' role='participant'/> </x> </presence>
<presence from='chatroom@conference.fairfax.tridsys.com/Wayne' to='scott@fairfax.tridsys.com/TransVerse' <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='none' role='participant'/> </x> </presence> <presence from='chatroom@conference.fairfax.tridsys.com/Wayne' to='kevin@fairfax.tridsys.com/TransVerse' <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='none' role='participant'/> </x> </presence>
The mirror service on raleigh.tridsys.com then relays the message to all of the room members that are in the raleigh.tridsys.com domain.
<presence from='chatroom@conference.fairfax.tridsys.com/Wayne' to='wayne@raleigh.tridsys.com/TransVerse'> <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='none' role='participant'/> </x> </presence> <presence from='chatroom@conference.fairfax.tridsys.com/Wayne' to='keith@raleigh.tridsys.com/TransVerse'> <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='none' role='participant'/> </x> </presence>
If the master doesn't allow the user to join, it sends the standard MUC error to the mirror. The mirror SHOULD only send the rejection to the user that failed to join. Other users don't need to know.
If a message is targeted to a specific user, JID Escaping (XEP-0106) [4] will be used to pass along the user's JID. The mirror service can then truncate the string just before the @ and convert the \40 to an @ and the \2f to a / to get the target user's JID and then forward the packet to that user.
<presence from='chatroom@conference.fairfax.tridsys.com' to='wayne\40raleigh.tridsys.com\2fTransVerse@mirror.raleigh.tridsys.com' type='error'> <x xmlns='http://jabber.org/protocol/muc'/> <error type='auth'> <registration-required xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> </error> </presence>
The mirror then extracts the user's JID and delivers the bad news to the user.
<presence from='chatroom@conference.fairfax.tridsys.com' to='wayne@raleigh.tridsys.com/TransVerse' type='error'> <x xmlns='http://jabber.org/protocol/muc'/> <error type='auth'> <registration-required xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> </error> </presence>
Now when a user joins the master directly it will do usual presence distribution to occupants (remembering the mirror is an occupant). Status codes are omitted from this example, see Multi-User Chat (XEP-0045) [3] for those.
<presence from='kevin@tridsys.com/TransVerse' to='chatroom@conference.fairfax.tridsys.com/Kevin'> <x xmlns='http://jabber.org/protocol/muc'/> </presence>
<presence from='chatroom@conference.fairfax.tridsys.com/Kevin' to='kevin@tridsys.com/TransVerse'> <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='owner' role='moderator'/> </x> </presence> <presence from='chatroom@conference.fairfax.tridsys.com/Kevin' to='scott@tridsys.com/TransVerse'> <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='owner' role='moderator'/> </x> </presence>
<presence from='chatroom@conference.fairfax.tridsys.com/Kevin' to='mirror.raleigh.tridsys.com'> <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='admin' role='moderator'/> </x> </presence>
<presence from='chatroom@conference.fairfax.tridsys.com/Kevin' to='wayne@raleigh.tridsys.com/TransVerse'> <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='owner' role='moderator'/> </x> </presence> <presence from='chatroom@conference.fairfax.tridsys.com/Kevin' to='keith@raleigh.tridsys.com/TransVerse'> <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='owner' role='moderator'/> </x> </presence>
The flow for a user leaving the mirror room is much the same as joining the mirror room:
<presence from='wayne@raleigh.tridsys.com/TransVerse' to='chatroom@conference.fairfax.tridsys.com/Wayne' type='unavailable'/>
<presence from='chatroom@conference.fairfax.tridsys.com/Wayne' to='wayne@raleigh.tridsys.com/TransVerse'' type='unavailable'> </presence> <presence from='chatroom@conference.fairfax.tridsys.com/Wayne' to='keith@raleigh.tridsys.com/TransVerse'' type='unavailable'> </presence>
<presence from='wayne@raleigh.tridsys.com/TransVerse' to='chatroom@conference.fairfax.tridsys.com/Wayne' type='unavailable'/>
The master needs to send the presence to locally attached users and mirrors that did not send this message.
<presence from='chatroom@conference.fairfax.tridsys.com/Wayne' to='kevin@tridsys.com/TransVerse' type='unavailable'> <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='none' role='none'/> </x> </presence> <presence from='chatroom@conference.fairfax.tridsys.com/Wayne' to='scott@tridsys.com/TransVerse' type='unavailable'> <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='none' role='none'/> </x> </presence>
<presence from='chatroom@conference.fairfax.tridsys.com/Wayne' to='mirror.raleigh.tridsys.com' type='unavailable'> <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='none' role='none'/> </x> </presence>
Distribution of presence for users parting when connected directly to the MUC is identical to distribution of presence for users joining directly to the MUC.
Distribution of presence for users changing status is the same as that for joining and parting.
Normal fan-out like presence
<message from='wayne@raleigh.tridsys.com/TransVerse' to='chatroom@conference.fairfax.tridsys.com/Wayne' type='groupchat'> <body>All work and no play makes Jack a dull boy.</body> </message>
<message from='chatroom@conference.fairfax.tridsys.com/Wayne' to='wayne@raleigh.tridsys.com/TransVerse' type='groupchat'> <body>All work and no play makes Jack a dull boy.</body> </message> <message from='chatroom@conference.fairfax.tridsys.com/Wayne' to='keith@raleigh.tridsys.com/TransVerse' type='groupchat'> <body>All work and no play makes Jack a dull boy.</body> </message>
<message from='wayne@raleigh.tridsys.com/TransVerse' to='chatroom@conference.fairfax.tridsys.com/Wayne' type='groupchat'> </message>
The local server sends out this message to local users.
<message from='chatroom@conference.fairfax.tridsys.com/Wayne' to='scott@fairfax.tridsys.com/TransVerse' type='groupchat'> <body>All work and no play makes Jack a dull boy.</body> </message> <message from='chatroom@conference.fairfax.tridsys.com/Wayne' to='kevin@fairfax.tridsys.com/TransVerse' type='groupchat'> <body>All work and no play makes Jack a dull boy.</body> </message>
If the connection is lost to the master MUC, the mirrors should be able to continue on.
It is the responsibility of the mirrored DMUC to send unavailable presence on behalf of any user that is not attached locally.
It is the responsibility of the master MUC to send unavailable presence on behalf of the users attached to the disconnected remote domain to all local users and affected mirrors.
When the connection is re-established, there will be a flood of queued up presences and messages. Because presence information is most likely out of date, the master MUC should send all current presence information to the mirror. The mirror, should also send presence for its users to the master MUC.
To perform administration of the MUC, connect directly to the MUC and follow the standard process.
This allows a MUC mirror to mirror for another JID, so should only be deployed in scenarios where either the mirror service is trusted, or it is known that the users of the mirror service are in the same security domain as the mirror service.
None.
Needs a namespace.
When advanced.
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright (c) 2011 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 shall the XMPP Standards Foundation or the authors of this Specification be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification. ##
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 out of the use or inability to use 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 may be found at <http://www.xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XSF, P.O. Box 1641, Denver, CO 80201 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-0033: Extended Stanza Addressing <https://xmpp.org/extensions/xep-0033.html>.
2. XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.
3. XEP-0045: Multi-User Chat <https://xmpp.org/extensions/xep-0045.html>.
4. XEP-0106: JID Escaping <https://xmpp.org/extensions/xep-0106.html>.
Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/
First draft.
@report{franklin2011dmuc, title = {DMUC3: Distributed MUC}, author = {Franklin, Wayne}, type = {XEP}, number = {xxxx}, version = {0.0.1}, institution = {XMPP Standards Foundation}, url = {https://xmpp.org/extensions/xep-xxxx.html}, date = {2011-01-25/2011-01-25}, }
END