Abstract: | This protocol extension for XEP-0045 Multi User Chat allows clients to check whether they are still joined to a chatroom. |
Author: | Georg Lukas |
Copyright: | © 1999 – 2018 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Experimental |
Type: | Standards Track |
Version: | 0.1.0 |
Last Updated: | 2018-08-31 |
WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.
1. Introduction
2. Requirements
3. Client Self-Presence Check
3.1. Possible Protocol Approaches
3.2. Performing a Self-Ping
3.3. Server Optimization
4. Implementation Notes
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
The Multi-User Chat (XEP-0045) [1] protocol was not designed to handle s2s interruptions or message loss well. Rather often, the restart of a server or a component causes a client to believe that it is still joined to a given chatroom, while the chatroom service does not know of this participant.
Existing approaches for re-synchronization are either inefficient (presence updates and "silent" messages are reflected to all participants, totalling to O(N²) stanzas per time unit), or mask message / presence losses (the implicit join performed via the deprecated GC1.0 protocol).
This specification aims to provide the most efficient, albeit not the most elegant, way for clients to periodically check whether they are still joined to a chatroom.
This specification only makes sense in the context of Multi-User Chat (XEP-0045) [1] chatrooms. It makes use of XMPP Ping (XEP-0199) [2] to perform periodic self-pings.
Server support for this extension is optional, but will significantly improve the reliability with Multi-Session Nicks and mobile clients.
A typical connection between a client and a Multi-User-Chatroom (MUC) goes through the client-to-server link, possibly a server-to-server link and a typically local server-to-component link. If one of the involved servers or the MUC component is restarted, or one of the links is disturbed for some time, this can lead to the removal of some or all participants from the affected MUCs, without the clients being informed.
To a participant, this looks like the MUC is silent (there is no chat activity and no presence changes), making it hard to realize that the connection was interrupted.
To prevent the bad usability effect (message loss, lack of reaction from people in a chatroom), a client needs to actively check whether it is still joined to a MUC.
There are multiple alternative approaches for a client to test whether it is still joined to a MUC:
The private IQ is the most robust and traffic-efficient solution, and it does not rely on server support. The XMPP Ping (XEP-0199) [2] protocol is appropriate to use for this use case.
After an adequate amount of silence from a given MUC (e.g. 15 minutes), or from all MUCs from a given service domain, a client should initiate a self-ping. If Juliet is joined as JuliC in the characters@chat.shakespeare.lit MUC, her client will send the following ping IQ:
<iq from='juliet@capulet.lit/client' id='s2c1' type='get' to='characters@chat.shakespeare.lit/JuliC'> <ping xmlns='urn:xmpp:ping'/> </iq>
If Juliet's client is not joined, the MUC service will respond with a <not-acceptable> error. Thus, her client can automatically attempt a rejoin.
<iq from='characters@chat.shakespeare.lit/JuliC' id='s2c1' type='error' to='juliet@capulet.lit/client' > <error type="cancel"> <not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /> </error> </iq>
If her client is joined, the IQ request will be forwarded to any one of Juliet's joined clients.
<iq from='characters@chat.shakespeare.lit/JuliC' id='c0ffee-s2c1' type='get' to='juliet@capulet.lit/somerandomclient' > <ping xmlns='urn:xmpp:ping'/> </iq>
Depending on the other client implementation and its connection status, the IQ will be responded to eventually, in one of these ways, as delivered to the "client" resource:
The normal routing rules of the self-ping impose two round-trips: first the initial ping from the client to the MUC, then the reflection of the ping and its response (possibly to another client), and finally the response to the initial IQ. If the other client is experiencing network connectivity issues, which is often the case with mobile devices, the ping request might never be responded to.
Therefore, a MUC service supporting this protocol may directly respond to a participant's Ping request to the participant's own nickname, as opposed to routing it to any of the participant's clients.
In Multi-Session-Nick scenarios, where multiple clients of the same user are joined as the same participant, it is possible that another client initiates a nickname change while a ping request is pending. In that case, the ping might be responded to with <item-not-found>.
A client should not perform a self-ping after initiating a nickname change, and before receiving the response to the nickname change from the service, as it is not yet clear whether the new nickname will be accepted.
A MUC service implementation should not allow a non-participant to obtain information about participants. This is however true irregardless of implementing this specification.
REQUIRED.
REQUIRED.
REQUIRED for protocol specifications.
Series: XEP
Number: 0410
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.1.0
Last Updated: 2018-08-31
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0001, Etc.
Supersedes: None
Superseded By: None
Short Name: muc-selfping
Source Control:
HTML
This document in other formats:
XML
PDF
Email:
georg@op-co.de
JabberID:
georg@yax.im
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 <http://xmpp.org/about/discuss.shtml> 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. XEP-0199: XMPP Ping <https://xmpp.org/extensions/xep-0199.html>.
3. XEP-0085: Chat State Notifications <https://xmpp.org/extensions/xep-0085.html>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Add handling for another corner case, change title to Council’s liking
(gl)First draft.
(gl)END