forked from xsf/xeps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxep-0409.xml
149 lines (149 loc) · 8.32 KB
/
xep-0409.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
%ents;
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep>
<header>
<title>IM Routing-NG</title>
<abstract>This specification provides a new set of routing rules for modern instant messaging.</abstract>
&LEGALNOTICE;
<number>0409</number>
<status>Deferred</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
<dependencies>
<spec>XMPP Core</spec>
<spec>XMPP IM</spec>
<spec>XEP-0030</spec>
<spec>Etc.</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>IM-NG</shortname>
&ksmith;
<revision>
<version>0.1.0</version>
<date>2018-06-05</date>
<initials>XEP Editor (jwi)</initials>
<remark>Accepted by vote of Council on 2018-04-11.</remark>
</revision>
<revision>
<version>0.0.2</version>
<date>2018-03-29</date>
<initials>kis</initials>
<remark><p>Fix various slips, mention reflection.</p></remark>
</revision>
<revision>
<version>0.0.1</version>
<date>2018-03-28</date>
<initials>kis</initials>
<remark><p>First draft.</p></remark>
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
<p>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.</p>
</section1>
<section1 topic='Requirements' anchor='reqs'>
<p>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).</p>
<p>Interoperate with contacts using non-IM-NG routing.</p>
</section1>
<!--<section1 topic='Glossary' anchor='glossary'>
<p>OPTIONAL.</p>
</section1>-->
<section1 topic='Use Cases' anchor='usecases'>
<section2 topic='Discovering Suport' anchor='discovery'>
<p>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 &xep0030; or section 6.3 of &xep0115;.</p>
<example caption='Client requests information about its own server'><![CDATA[
<iq xmlns='jabber:client'
from='[email protected]/garden'
id='info1'
to='montague.example'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>]]></example>
<example caption='Server responds with IM-NG feature'><![CDATA[
<iq xmlns='jabber:client'
from='montague.example'
id='info1'
to='[email protected]/garden'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'>
...
<feature var='urn:xmpp:im-ng:0'/>
...
</query>
</iq>]]></example>
</section2>
<section2 topic='Activation' anchor='activation'>
<p>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":</p>
<example caption='Client enables IM-NG'><![CDATA[
<iq xmlns='jabber:client'
from='[email protected]/garden'
id='enable1'
type='set'>
<enable xmlns='urn:xmpp:im-ng:0'/>
</iq>]]></example>
<p>The server will respond with an IQ-result when IM-NG is enabled:</p>
<example caption='Server acknowledges enabling IM-NG'><![CDATA[
<iq xmlns='jabber:client'
from='[email protected]'
id='enable1'
to='[email protected]/garden'
type='result'/>]]></example>
</section2>
<section2 topic='Sending messages' anchor='sending'>
<p>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.</p>
<example caption='Client sends a message that IM-NG will route to all resources'><![CDATA[
<message xmlns='jabber:client'
from='[email protected]/bas149a'
to='[email protected]'
id='342'
type='chat'>
<body>I neither know it nor can learn of him</body>
</message>]]></example>
<p>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/>").</p>
<example caption='Client sends a message that IM-NG will route to a single resource'><![CDATA[
<message xmlns='jabber:client'
from='[email protected]/bas149a'
to='[email protected]/csa003'
id='343'
type='chat'>
<im-ng xmlns='urn:xmpp:im-ng:0'/>
</message>]]></example>
</section2>
</section1>
<section1 topic='Business Rules' anchor='rules'>
<p>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).</p>
<p>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</p>
<p>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</p>
<p>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</p>
<p>A client activating IM-NG MUST NOT also activate Carbons.</p>
<p>An IM-NG client SHOULD send all IM-related messages to bare JIDs (as full-JID messages would not be distributed appropriately).</p>
<p>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).</p>
<p>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).</p>
</section1>
<!--<section1 topic='Implementation Notes' anchor='impl'>
<p>OPTIONAL.</p>
</section1>
<section1 topic='Accessibility Considerations' anchor='access'>
<p>OPTIONAL.</p>
</section1>
<section1 topic='Internationalization Considerations' anchor='i18n'>
<p>OPTIONAL.</p>
</section1>-->
<section1 topic='Security Considerations' anchor='security'>
<p>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.</p>
</section1>
<section1 topic='IANA Considerations' anchor='iana'>
<p>None.</p>
</section1>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<p>Register 'urn:xmpp:im-ng:0' on Draft.</p>
</section1>
<section1 topic='XML Schema' anchor='schema'>
<p>TODO: Before Draft.</p>
</section1>
</xep>