XEP-xxxx: MUC Fast Reconnect

Abstract:This document provides a protocol that can be used for limiting the amount of presence history needed when rejoining a MUC room.
Author:Kevin Smith
Copyright:© 1999 - 2011 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status:ProtoXEP
Type:Standards Track
Version:0.0.1
Last Updated:2012-01-05

WARNING: This document has not yet been accepted for consideration or approved in any official manner by the XMPP Standards Foundation, and this document is not yet an XMPP Extension Protocol (XEP). If this document is accepted as a XEP by the XMPP Council, it will be published at <http://xmpp.org/extensions/> and announced on the <standards@xmpp.org> mailing list.


Table of Contents


1. Introduction
2. Requirements
3. Discovery
4. Use Cases
    4.1. Initial Join
    4.2. Fast rejoin
    4.3. Requesting only unseen messages
5. Security Considerations
6. IANA Considerations
7. XMPP Registrar Considerations
8. XML Schema

Appendices
    A: Document Information
    B: Author Information
    C: Legal Notices
    D: Relation to XMPP
    E: Discussion Venue
    F: Requirements Conformance
    G: Notes
    H: Revision History


1. Introduction

A client joining a Multi-User Chat [1] room involves the receipt of a significant volume of data in the form of presence from the current room occupants, and past ("context" or "history") messages. If the client has recently been in the room (for example if it has needed to reconnect only because of a networking error) it may already know most of the current state, and receipt of these data will redundant. XEP-0045 provides a method for limiting the context messages received when joining but no method for limiting the duplication of known presence; this document expands slightly upon the former and provides the latter.

2. Requirements

Reduce the volume of data sent to a client .

3. Discovery

MUC Rooms supporting this should have a disco feature of "urn:xmpp:mfr" in caps.

To avoid extra roundtrips for discovery, clients may speculatively send elements when initially joining a MUC, and treat the absense of appropriate elements in the responses to indicate a lack of support.

4. Use Cases

4.1 Initial Join

In this example, Romeo (romeo@montague.lit) is joining the MUC room orchard@chats.capulet.lit. To use MUC Fast Reconnect for future joins, the initial MUC join presence stanza must also contain a presence-session element in the namespace "urn:xmpp:presence-session:0" with no attributes.

Example 1. Romeo sends 'room join' presence

<presence
    from='romeo@montague.lit/lane'
    to='orchard@chat.capulet.lit/Romeo'>
  <x xmlns='http://jabber.org/protocol/muc'/>
  <presence-session xmlns="urn:xmpp:pressence-session:0"/>
</presence>

If a client has indicated that it's using MUC Fast Reconnect on its session, the MUC service MUST annotate the presence stanzas it sends with elements containing a presence-session element with namespace "urn:xmpp:presence-session:0", a "session" attribute and an "id" attribute, described below.

Example 2. Romeo receives an occupant's presence

<presence
    from='orchard@chat.capulet.lit/Juliet'
    to='romeo@montague.lit/lane'>
  <x xmlns='http://jabber.org/protocol/muc#user'>
    <item affiliation='owner' role='moderator'/>
  </x>
  <presence-session xmlns="urn:xmpp:pressence-session:0" session="u8e8t2thu" id="893oehh"/>
</presence>

Attributes:

4.2 Fast rejoin

If Romeo then leaves the room and wants to rejoin, his client can attempt a fast rejoin by requesting only the presence changes since he was last an occupant, by including in his room join stanza a presence-session-resume element, again with namespace "urn:xmpp:presence-session:0", and the session and id attributes of the last presence it received from the room prior to leaving.

Example 3. Romeo performs a fast rejoin on the room

<presence
    from='romeo@montague.lit/lane'
    to='orchard@chat.capulet.lit/Romeo'>
  <x xmlns='http://jabber.org/protocol/muc'/>
  <presence-session-resume xmlns="urn:xmpp:pressence-session:0" session="u8e8t2thu" id="893oehh"/>
</presence>

When the MUC room receives a room fast rejoin request, it must either first send an 'unavailable' presence from the room's bare JID, followed by a normal full join, as above, or instead of sending the full presence list for all occupants, only send those stanzas needed to get from the state represented by the client-provided session and id to the current state. All the presence stanzas (apart from the unavailable one used to reset state before a clean join) MUST contain the presence-session element as described above.

Example 4. Romeo receives an 'unavailable' presence from the room, indicating that it is a clean join.

<presence
    to='romeo@montague.lit/lane'
    from='orchard@chat.capulet.lit'
    type='unavailable'/>

The room SHOULD only send the unavailable presence, forcing a sending of all the occupants' presence, if it would either result in fewer transmitted stanzas than sending the necessary delta, or it is unable to provide the necessary delta (such as if too much time has past and it no longer has records of the old state).

4.3 Requesting only unseen messages

XEP-0045 provides several ways to limit the history/context messages received on join, but none of these allow a client to accurately request only the messages they have yet to see. This is done by the MUC annotating each message with an id (like in presence, above), and the client using it instead of maxchars/maxstanzas/seconds/since from -45 when it joins. And here I've just stopped writing.

Example 5. Romeo requests only unseen messages

Here

5. Security Considerations

To follow.

6. IANA Considerations

None.

7. XMPP Registrar Considerations

Needs a namespace.

8. XML Schema

When advanced.


Appendices


Appendix A: Document Information

Series: XEP
Number: xxxx
Publisher: XMPP Standards Foundation
Status: ProtoXEP
Type: Standards Track
Version: 0.0.1
Last Updated: 2012-01-05
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: None
Short Name: MFR
This document in other formats: XML  PDF


Appendix B: Author Information

Kevin Smith

Email: kevin.smith@isode.com
JabberID: kevin.smith@isode.com


Appendix C: Legal Notices

Copyright

This XMPP Extension Protocol is copyright © 1999 - 2011 by the XMPP Standards Foundation (XSF).

Permissions

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.

Disclaimer of Warranty

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

Limitation of Liability

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.

IPR Conformance

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 <http://xmpp.org/about-xmpp/xsf/xsf-ipr-policy/> or obtained by writing to XMPP Standards Foundation, 1899 Wynkoop Street, Suite 600, Denver, CO 80202 USA).

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) 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.


Appendix E: Discussion Venue

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 <http://xmpp.org/about/discuss.shtml> for a complete list.

Errata can be sent to <editor@xmpp.org>.


Appendix F: Requirements Conformance

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


Appendix G: Notes

1. XEP-0045: Multi-User Chat <http://xmpp.org/extensions/xep-0045.html>.


Appendix H: Revision History

Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/

Version 0.0.1 (2012-01-05)

Initial published version.

(kis)

END