Initial published version.
Simplified the protocol to use a master-slave approach; modified terminology.
First draft.
This document is one of several proposals for distributing XMPP chat rooms across multiple chat services. It is expected that the various approaches will be refined and harmonized before a final protocol is developed.
+&xep0045; defines a full-featured technology for multi-user text conferencing in XMPP. By design, XEP-0045 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 &rfc4122; or by hashing the human-readable name of the room using the SHA-256 algorithm in accordance with &nistfips180-2;.
+This document adds the following terms to those defined in XEP-0045:
+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 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" &BOOLEANNOTE; 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 XEP-0045).
+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.
+When a user attempts to join a source room, 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 &xep0249;.
+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" &NSVER; in response to &xep0030; information requests.
+To follow.
+This document requires no interaction with &IANA;.
+This document requires no interaction with the ®ISTRAR;.
+Thanks to Jay Carlson, Boyd Fletcher, and Michael Krutsch for their early conversations regarding distributed chatrooms.
+To follow.
+Initial published version.
First draft.
This document is one of several proposals for distributing XMPP chat rooms across multiple chat services. It is expected that the various approaches will be refined and harmonized before a final protocol is developed.
+The architecture is that of a single root node, called MASTER and several repeater nodes, each called SLAVE. Every stanza is submitted via the slaves to the master, control is centralized there. The master then sends a copy of the stanza to each of the slaves where it is processed and then distributed to each of the slave's leaf nodes, local users at this point. During redistribution, the slave shall not change the stanza's 'from' attribute, which is only possible if the slave is in the same security domain as the user. The result of that is a decreased number of messages on the server-to-server links between the master's server and each of the slave servers.
+ vesa.yeggmaex.irc ----> wallops MUC ----> killrc.oulubox.irc ----> Wumpus
+ killrc.oulubox.irc ----> Phaedrus
+ killrc.oulubox.irc ----> Valdis
+ wallops MUC ----> eris.dclxvii.irc ----> WiZ
+ eris.dclxvii.irc ----> Troy
+ wallops MUC ----> vesa.yeggmaex.irc ----> BigCheese
+ vesa.yeggmaex.irc ----> Efchen
+]]>
+ Note that this only applies to stanzas that are directed to all occupants, such as the change of availability status and messages whose 'type' attribute is set to 'groupchat'.
+While 1-1 stanzas such as in-room private messages or vcard-temp requests may also travel along that path they are currently unaffected by this.
+This specification addresses the following requirements:
+Most of the examples in this document use the scenario of the 1990 war that split the Internet Relay Chat into several incompatible networks. The battlefield is represented here by the "wallops@channel.avalon.irc" chatroom. The characters are as follows:
+Room Nickname | +Full JID | +Role | +
---|---|---|
Wumpus | +argl@killrc.oulubox.irc/laptop | +Moderator | +
Valdis | +valdis@killrc.oulubox.irc/desktop | +Participant | +
Phaedrus | +phaedrus@killrc.oulubox.irc/phone | +Participant | +
WiZ | +squit@eris.dclxvii.irc/jupiter | +Moderator | +
Troy | +troy@eris.dclxvii.irc/screwdriver | +Moderator | +
BigCheese | +rubenro@vesa.yeggmaex.irc/shaver | +Participant | +
Efchen | +msa@vesa.yeggmaex.irc/bicycle | +Participant | +
In our example we are presuming that three slaves from three hosts have registered with the master for traffic redistribution. They are doing so using slave@host jids, but they could be using any temporary jid the implementor finds useful to choose.
+This section describes the protocol between the master and the slaves, the interaction between each slave and its users are described in the next section.
+ +The slave
+to follow
+Might include things like negotiation of keepalive frequency and amount of room might be useful to set some things like keepalive frequency, keeping/storing room history etc.
+ +After the creation of a new slave, the master must send the room roster (which at that time only consists of remote participants) to the slave:
+After the creation of a new slave, the master MAY also send the discussion history to the slave. The slave shall store this and deliver it to entering participants.
+from=masterjid to=slavejid?
+If a new occupant requests to enter the room, the master first sends a presence update to all participants to inform them of the presence of the new user. Then, the master sends the affected slave a stanza requesting it to add the user to the distribution list
+The slave MUST verify that the user has sent directed presence to the masters JID before. This helps to ensure that the user intended to enter the room. If this is ture, the slave shall add the user to the distribution list and send the room roster, occupants own presence in room and discussion history to the full jid of the added user.
+If an occupant sends an unavailable presence to the room, the master sends the affected slave a stanza requesting it to remove the user from the distribution list.
+The slave removes user and forwards the stanza to user.
+The master then sends a presence update to all slaves to announce the occupants departure.
+Presence updates are distributed by the master to all slaves.
+Note that the master MUST NOT send the full jid of the user to any slaves without members that are moderators.
+When rebroadcasting this stanza to its local occupants, the slave MUST remove the participants full JID subject to the rules of XEP-0045. In addition, the slave stores the resulting changes to the room roster, so that it can send the correct state to entering users.
+The slave may relay messages from local users to the master. When doing so, it MUST NOT modify the stanzas 'from' attribute but MUST retain the original address of the sender.
+ +When relaying a message, the master SHOULD add a urn:xmpp:delay element inside dmuc element so that the slave can provide proper timestamps to new users. The master then sends a copy of the stanza to each slave.
+After saving the stanza for the purpose of keeping a room history, the slave SHOULD remove the urn:xmpp:tmp:dmuc:0 element and send the stanza to each local user.
+To ensure a working connecting, the master SHOULD send an XMPP Ping stanza to each slave if there has been no traffic for a certain amount of time.
+Likewise, each slave should ping the master if there has been no traffic for more than the usual amount of time.
+A 'lost connection' can be detected by either slave or master when a stanza sent to the master or a slave respectively bounced.
+If the master receives a stanza with type=error from the slave JID, it MUST:
+In addition, the master MAY send a presence update for each user on the affected slave, marking them as away.
+If the slave receives a stanza with type=error from the master's JID, it MUST:
+In addition, the slave MAY (and be careful when using this):
+to follow
+This section narratively describes the master-slave protocol in context with client interactions.
+The user seeks to enter the wallops chatroom with the room nickname BigCheese:
+The master sends the presence update to each slave to inform the current occupants of BigCheese's arrival:
+Each slave then distributes this presence update:
+The master then informs the slave of the entered user about a new occupant:
+The slave sends presence from existing occupants to new occupant:
+and concludes the room roster by sending the new occupant's presence to the new occupant:
+After that, the slave will send the discussion history to the new occupant:
+The master will broadcast this message to all slaves:
+And each slave distributes to local occupants
+to follow
+Careful with channel overtakes :-)
+This document requires no interaction with &IANA;.
+This document requires no interaction with the ®ISTRAR;.
+to follow
+