XEP-0409: IM Routing-NG

Abstract:This specification provides a new set of routing rules for modern instant messaging.
Author:Kevin Smith
Copyright:© 1999 – 2017 XMPP Standards Foundation. SEE LEGAL NOTICES.
Type:Standards Track
Last Updated:2018-06-05

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.

Table of Contents

1. Introduction
2. Requirements
3. Use Cases
    3.1. Discovering Suport
    3.2. Activation
    3.3. Sending messages
4. Business Rules
5. Security Considerations
6. IANA Considerations
7. XMPP Registrar Considerations
8. XML Schema

    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

Since the XMPP routing rules were originally defined, formalised in RFC 3920/3921 and refreshed in RFC 6120/6121, people's expectations of the behaviour of instant messaging systems has progressed. While the original rules encouraging routing to specific devices via full-JID routing is still very suited for some applications (particularly machine to machine communications) they are becoming less useful for IM, as the popularity of XEPs such as Carbons to adjust them and the workarounds needed for XEP-0045 have shown. Here a simpler opt-in model is proposed, whereby IM messages are sent to a bare JID, and all clients opting in to this new routing (referred to here as IM-NG) will receive them. Conversely, messages sent to a full-JID are no longer used for IM cases.

2. Requirements

Clients, both those online and offline, receive a consistent set of messages, such that it is possible to start conversations one device and continue them on another device without inconsistent delivery of messages (no client should receive only a subset of the conversation).

Interoperate with contacts using non-IM-NG routing.

3. Use Cases

3.1 Discovering Suport

A server advertises support for this protocol by including the "urn:xmpp:im-ng:0" feature in its service discovery information features as specified in Service Discovery (XEP-0030) [1] or section 6.3 of Entity Capabilities (XEP-0115) [2].

Example 1. Client requests information about its own server

      <iq xmlns='jabber:client'
        <query xmlns='http://jabber.org/protocol/disco#info'/>

Example 2. Server responds with IM-NG feature

        <iq xmlns='jabber:client'
        <query xmlns='http://jabber.org/protocol/disco#info'>
          <feature var='urn:xmpp:im-ng:0'/>

3.2 Activation

When a client wants to participate in the IM-NG protocol, it enables the protocol by sending an IQ-set containing a child element <enable/> qualified by the namespace "urn:xmpp:im-ng:0":

Example 3. Client enables IM-NG

      <iq xmlns='jabber:client'
        <enable xmlns='urn:xmpp:im-ng:0'/>

The server will respond with an IQ-result when IM-NG is enabled:

Example 4. Server acknowledges enabling IM-NG

        <iq xmlns='jabber:client'

3.3 Sending messages

When an entity wants to send a non-error message to be handled by all a user's IM-NG clients they will send it to the user's bare JID, which the receiving server then MUST send to all the contact's IM-NG resources, and the sending server must reflect to all the user's IM-NG resources.

Example 5. Client sends a message that IM-NG will route to all resources

      <message xmlns='jabber:client'
        <body>I neither know it nor can learn of him</body>

When an entity wants to send a non-error message to be received exclusively by a single resource, they include an <im-ng xmlns='urn:xmpp:im-ng:0'> element in the message. An IM-NG server receiving this MUST then send it to only the specified resource, if available, or respond with an error consistent with RFC-6121 ("return an error stanza to the sender, which SHOULD be <service-unavailable/>").

Example 6. Client sends a message that IM-NG will route to a single resource

      <message xmlns='jabber:client'
        <im-ng xmlns='urn:xmpp:im-ng:0'/>

4. Business Rules

Any message of normal type, or type 'chat', 'groupchat' or 'headline' sent to a bare JID is distributed to all IM-NG clients (error messages sent to the bare JID are in response to server-generated stanzas, and so are not routed to clients).

A message of type error, sent to a full JID without an <im-ng xmlns='urn:xmpp:im-ng:0'> element is to be distributed to all IM-NG clients

Any message that is routed to all IM-NG clients is stored in the MAM archive, where available, and any message that would not be routed to all IM-NG clients is not stored in the MAM archive

In order for interoperability with other entities (contacts, remote servers etc.) that don't support IM-NG, old-style full-JID messages also need to be handled. When a server receives a message with type other than than 'groupchat' or 'headline' that does not contain an <im-ng xmlns='urn:xmpp:im-ng:0'> element it is to be routed by the above rules as if they were sent to the bare JID

A client activating IM-NG MUST NOT also activate Carbons.

An IM-NG client SHOULD send all IM-related messages to bare JIDs (as full-JID messages would not be distributed appropriately).

An IM-NG client SHOULD ignore any IM-related messages that are sent to a full-JID with an <im-ng xmlns='urn:xmpp:im-ng:0'> element (see Security Considerations).

When reflecting an IM-NG client's outbound bare-JID messages, the server SHOULD reflect the archived version (i.e. after any transforms have taken place).

5. Security Considerations

Malicious clients could attempt to avoid having messages archived by causing them to be routed only to individual resources - this is mitigated by ensuring that clients receiving such a message will not process them.

6. IANA Considerations


7. XMPP Registrar Considerations

Register 'urn:xmpp:im-ng:0' on Draft.

8. XML Schema

TODO: Before Draft.


Appendix A: Document Information

Series: XEP
Number: 0409
Publisher: XMPP Standards Foundation
Status: Experimental
Type: Standards Track
Version: 0.1.0
Last Updated: 2018-06-05
Approving Body: XMPP Council
Dependencies: XMPP Core, XMPP IM, XEP-0030
Supersedes: None
Superseded By: None
Short Name: IM-NG
Source Control: HTML
This document in other formats: XML  PDF

Appendix B: Author Information

Kevin Smith

Email: kevin@kismith.co.uk
JabberID: kevin@doomsong.co.uk

Appendix C: Legal Notices


This XMPP Extension Protocol is copyright © 1999 – 2018 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.

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 <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).

Appendix D: Relation to XMPP

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.

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-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.

2. XEP-0115: Entity Capabilities <https://xmpp.org/extensions/xep-0115.html>.

Appendix H: Revision History

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

Version 0.1.0 (2018-06-05)

Accepted by vote of Council on 2018-04-11. (XEP Editor (jwi))

Version 0.0.2 (2018-03-29)

Fix various slips, mention reflection.


Version 0.0.1 (2018-03-28)

First draft.