Difference between revisions of "XMPP 2.0"

From XMPP WIKI
Jump to navigation Jump to search
m (→‎Current situation: link to RFC6120 for routing rules to bare JID)
m (→‎Current situation: put quotes around the massive qualifier for "multi-device use cases")
Line 9: Line 9:
=== Current situation ===
=== Current situation ===


The [https://xmpp.org/rfcs/rfc6121.html#rules-localpart-barejid routing rules for stanzas addressed to the bare JID as defined in RFC 6120] are blurry and don’t really match modern always-online but not necessarily in the view of the user multi-device use cases. This is why [https://xmpp.org/extensions/xep-0280.html Message Carbons (XEP-0280)] have been invented. They allow a device to tell the server that it wants to receive carbon-copies of all messages received by any resource of an account. This only affects typical chat-related <code>&lt;message/&gt;</code> stanzas (there are exceptions for certain message types; for presence, there is a well-defined broadcast-to-all-resources mechanism; and IQs can only be addressed to a single resource).
The [https://xmpp.org/rfcs/rfc6121.html#rules-localpart-barejid routing rules for stanzas addressed to the bare JID as defined in RFC 6120] are blurry and don’t really match "modern always-online but not necessarily in the view of the user" multi-device use cases. This is why [https://xmpp.org/extensions/xep-0280.html Message Carbons (XEP-0280)] have been invented. They allow a device to tell the server that it wants to receive carbon-copies of all messages received by any resource of an account. This only affects typical chat-related <code>&lt;message/&gt;</code> stanzas (there are exceptions for certain message types; for presence, there is a well-defined broadcast-to-all-resources mechanism; and IQs can only be addressed to a single resource).


However, throughout the history of XMPP, there have been XEPs which use messages to send data which is really only of interest for a single resource. Prime examples are [https://xmpp.org/extensions/xep-0047.html In-Band Bytestreams (XEP-0047)], privacy enhancing protocols such as the (in)famous OTR and (private messages from) [https://xmpp.org/extensions/xep-0045.html Multi-User Chat (XEP-0045)]. This led to Message Carbon rules being hand-wavy and blurry, some of the behaviour being implementation-defined, depending on co-operating clients which do not speak Message Carbons themselves and other unfortunaties.
However, throughout the history of XMPP, there have been XEPs which use messages to send data which is really only of interest for a single resource. Prime examples are [https://xmpp.org/extensions/xep-0047.html In-Band Bytestreams (XEP-0047)], privacy enhancing protocols such as the (in)famous OTR and (private messages from) [https://xmpp.org/extensions/xep-0045.html Multi-User Chat (XEP-0045)]. This led to Message Carbon rules being hand-wavy and blurry, some of the behaviour being implementation-defined, depending on co-operating clients which do not speak Message Carbons themselves and other unfortunaties.

Revision as of 15:48, 10 August 2017

This page summarizes a few ideas on things which could/should/may be in an eventual XMPP 2.0.

This page is a draft written by individuals who may or may not be XSF members. It does not necessarily reflect the view or intention of XSF Board, Council or the XSF as organization as a whole, if that’s a thing.

 Issues existing in XMPP 1.0

Routing rules

Current situation

The routing rules for stanzas addressed to the bare JID as defined in RFC 6120 are blurry and don’t really match "modern always-online but not necessarily in the view of the user" multi-device use cases. This is why Message Carbons (XEP-0280) have been invented. They allow a device to tell the server that it wants to receive carbon-copies of all messages received by any resource of an account. This only affects typical chat-related <message/> stanzas (there are exceptions for certain message types; for presence, there is a well-defined broadcast-to-all-resources mechanism; and IQs can only be addressed to a single resource).

However, throughout the history of XMPP, there have been XEPs which use messages to send data which is really only of interest for a single resource. Prime examples are In-Band Bytestreams (XEP-0047), privacy enhancing protocols such as the (in)famous OTR and (private messages from) Multi-User Chat (XEP-0045). This led to Message Carbon rules being hand-wavy and blurry, some of the behaviour being implementation-defined, depending on co-operating clients which do not speak Message Carbons themselves and other unfortunaties.

Proposed change

To make things simpler, routing rules (for messages) could be re-defined to the following:

  • If a message is addressed to a bare account JID, it is delivered to all online resources of the JID.
  • If a message is addressed to a full JID:
    • if an online resource exists at that full JID, the message is delivered to that resource
    • if no online resource exists, an error is returned (NOTE: privacy implications and possible resource scanning need to be thought through)

In addition, resource locking as described in RFC 6121 would be discouraged and deprecated, since it interferes with these rules. See below for considerations on resource locking.

Migration path in a hypothetical XMPP 2.0 Session

The server(s) would translate the semantics for non-XMPP-2.0 servers and clients. For this, the following transformations would be applied when talking to non-XMPP-2.0 nodes:


Resource locking

Current situation

RFC 6121, Section 5.1 and XEP-0296 describe the process of resource locking for one-on-one chats. In essence, once a response is received from a peer resource, the following messages must be sent to that resource.

The intent was that messages would always arrive at the device currently used by the conversation partner (since Message Carbons were not there), because the routing rules for message stanzas did not enforce that behaviour.

Furthermore, the features offered to a user are often limited by clients based on the capabilities (e.g. Last Message Correction) of the locked-to resource. This introduces race conditions and incompatibility when the chat partner switches devices or reads up the conversation from an offline storage / archive.

Proposed change

Eliminate resource locking in XMPP 2.0 entirely. Instead, always send conversational content to the bare JID. Messages sent to the full JID in XMPP 2.0 are specifically addressed to the resource and will not be carbon-copied, as described in the previous section.

Migration path in a hypothetical XMPP 2.0 Session

None needed. Chat conversations work fine without any resource locking today.