diff --git a/xep-0281.xml b/xep-0281.xml new file mode 100644 index 00000000..6c86af6b --- /dev/null +++ b/xep-0281.xml @@ -0,0 +1,390 @@ + + +%ents; + + +]> + + +
+ DMUC1: Distributed Multi-User Chat + This document defines methods for distributing Multi-User Chat (MUC) rooms across multiple chat services. + &LEGALNOTICE; + 0281 + Experimental + Standards Track + Standards + + XEP-0045 + XEP-0030 + + + + NOT-YET-ASSIGNED + &stpeter; + + 0.1 + 2010-06-11 + psa +

Initial published version.

+
+ + 0.0.2 + 2010-02-05 + psa +

Simplified the protocol to use a master-slave approach; modified terminology.

+
+ + 0.0.1 + 2007-06-01 + psa +

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:

+
    +
  1. Enable distribution of a MUC room across multiple services.
  2. +
  3. Enable a service to determine which other services it will peer with.
  4. +
  5. Enable the room creator to specify if distribution is allowed.
  6. +
  7. Enable occupants to remain in an instance of the conference if connectivity is lost to other instances.
  8. +
  9. Enable syncing of history, configuration, and room rosters on reconnect.
  10. +
+
+ +

The basic approach to distribution of MUC rooms is as follows:

+
    +
  1. A user creates a room on a service and configures it as "distributed" (or the service assumes that the room is distributed based on local service policy); this first instance of the room is called a SOURCE and the service on which it is created is called a FIRSTHOST.
  2. +
  3. The firsthost can immediately request that other services (called PEERHOSTS) replicate the room by creating their own local instances (called SHADOWS); alternatively, the firsthost can wait to send the replication request until users from the peerhost have joined the room.
  4. +
  5. If a user from the peerhost attempts to join the source room after replication is established, the firsthost invites the user to join the shadow rather than the source by sending a direct invitation to the user.
  6. +
  7. As long as the peerhost and firsthost have connectivity, they share room messages, room rosters, and room configuration changes in real time. If any conflict arises, the firsthost's information rules since it is "first among equals".
  8. +
  9. If the peerhost loses connectivity to the firsthost, it maintains the shadow, including local room history, room roster, and room configuration, and if possible also maintains connectivity with other peerhosts.
  10. +
  11. Upon reconnecting to the firsthost, a peerhost exchanges room history and room rosters with the firsthost and receives room configuration data (if modified).
  12. +
+

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:

+
    +
  • Firsthost -- The MUC service at which a room is created.
  • +
  • Peerhost -- Any MUC service (other than the firsthost) that hosts an instance of the room.
  • +
  • Shadow -- An instance of the room at a peerhost.
  • +
  • Source -- The canonical instance of the room at the firsthost.
  • +
+
+ +

In this document, the examples use the following entities.

+
    +
  • Firsthost: firsthost.example.com
  • +
  • Peerhosts: peer1.example.net and peer2.example.org
  • +
  • Shadows: f609923deb78718a125b93d32609bd5265dd927242ac93a99eb366109df2bd39@peer1.example.net and f609923deb78718a125b93d32609bd5265dd927242ac93a99eb366109df2bd39@peer2.example.org
  • +
  • Source: f609923deb78718a125b93d32609bd5265dd927242ac93a99eb366109df2bd39@firsthost.example.com
  • +
+
+
+ + + +

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:

+ + + + + http://jabber.org/protocol/muc#roomconfig + + ... + + 0 + + ... + + + + ]]> +

The room owner specifies a value of "1" or "true" &BOOLEANNOTE; if room distribution is desired:

+ + + + + http://jabber.org/protocol/muc#roomconfig + + ... + + true + + ... + + + + ]]> +

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:

+
    +
  1. The source sends the room configuration to the shadow.
  2. +
  3. The source sends the room roster to the shadow.
  4. +
  5. The shadow optinoally requests the room history from the source.
  6. +
  7. The firsthost informs other peerhosts about the new peerhost.
  8. +
+ + + + + http://jabber.org/protocol/muc#roomconfig + + ... + + + + ]]> + + ]]> + + + + + + + + ]]> + + ]]> +

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'.

+ + + + Message 1. + + + + + Message 2. + + + + + Message 3. + + + + + ]]> + + ]]> +

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.

+ + + peer1.example.net + + + ]]> +

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.

+ + Message 4. + + ]]> + + Message 4. + + + + Message 4. + + ]]> +

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.

+
+ +
diff --git a/xep-0282.xml b/xep-0282.xml new file mode 100644 index 00000000..27f9df4a --- /dev/null +++ b/xep-0282.xml @@ -0,0 +1,666 @@ + + +%ents; +]> + + +
+ DMUC2: Distributed MUC + Multi-User Chats, distributed over several nodes in the XMPP network, using a master/slave architecture + &LEGALNOTICE; + 0282 + Experimental + Standards Track + Standards + Council + + XMPP Core + XEP-0045 + + + + NOT-YET-ASSIGNED + + Carlo + von Loesch + lynx@psyced.org + + + Philipp + Hancke + fippo@ve.symlynx.com + + + 0.1 + 2010-06-11 + psa +

Initial published version.

+
+ + 0.0.1 + 2010-03-15 + cvl/ph +

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 NicknameFull JIDRole
Wumpusargl@killrc.oulubox.irc/laptopModerator
Valdisvaldis@killrc.oulubox.irc/desktopParticipant
Phaedrusphaedrus@killrc.oulubox.irc/phoneParticipant
WiZsquit@eris.dclxvii.irc/jupiterModerator
Troytroy@eris.dclxvii.irc/screwdriverModerator
BigCheeserubenro@vesa.yeggmaex.irc/shaverParticipant
Efchenmsa@vesa.yeggmaex.irc/bicycleParticipant
+

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

+
    +
  • must be able to intercept any stanzas sent to the masters jid,
  • +
  • must be able to verify if a local user has sent directed presence to the masters jid,
  • +
  • must store room roster,
  • +
  • must store local room roster
  • +
  • must store room history (if desired by master)
  • +
+
+ +

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.

+ + + Phaedrus, we're all having a truly rotten time. +]]> + +
+ +

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.

+ + Phaedrus, we're all having a truly rotten time. + + + + + + Phaedrus, we're all having a truly rotten time. + + + + + + Phaedrus, we're all having a truly rotten time. + + + +]]> +

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:

+
    +
  • mark the slave as 'split', making sure that any further broadcasts are not sent to the affected slave
  • +
  • start sending pings to the slave with a higher frequency to get a timely notification if the slave reappears
  • +
  • resync when the slave reappears as described below
  • +
+

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:

+
    +
  • stop submitting messages to the master
  • +
  • react to people sending presence updates or leaving the room and broadcast those changes to local users
  • +
+

In addition, the slave MAY (and be careful when using this):

+
    +
  • enable local participants to continue their in-room conversation with other local participants
  • +
  • enable local participants to continue 1-1 messaging in the context of a room (such as private chat or vcard retrieval)
  • +
  • enable local users to enter the room (DANGER!!!)
  • +
  • enable moderators (as designated by the master) to kick participants
  • +
  • mark non-local users as away
  • +
+
+
+ +

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:

+ + Honest! He did!! + + + + Was that absolutely necessary???????? + + + + SUUUUUUURE he did + + + + He did. really truly he did. + + +]]> +
+ + + Phaedrus, we're all having a truly rotten time. +]]> +

The master will broadcast this message to all slaves:

+ + Phaedrus, we're all having a truly rotten time. + + + + + + Phaedrus, we're all having a truly rotten time. + + + + + + Phaedrus, we're all having a truly rotten time. + + + +]]> +

And each slave distributes to local occupants

+ + Phaedrus, we're all having a truly rotten time. + + + Phaedrus, we're all having a truly rotten time. + + + Phaedrus, we're all having a truly rotten time. +]]> + + Phaedrus, we're all having a truly rotten time. + + + Phaedrus, we're all having a truly rotten time. +]]> + + Phaedrus, we're all having a truly rotten time. + + + Phaedrus, we're all having a truly rotten time. +]]> +
+
+ +

to follow

+

Careful with channel overtakes :-)

+
+ +

This document requires no interaction with &IANA;.

+
+ +

This document requires no interaction with the ®ISTRAR;.

+
+ +

to follow

+
+