From f465e5d1f667becf5a1c8b80f086906f2545a2fc Mon Sep 17 00:00:00 2001
From: Florian Schmaus A query consists of an &IQ; stanza of type='set' addressed to the account or server entity hosting
the archive, with a 'query' payload. On receiving the query, the server pushes to the client a
series of messages from the archive that match the client's given criteria, and finally returns
- a &MESSAGE; with a <fin/> tag to indicate that the query is completed.
The final &MESSAGE; response MUST include an RSM <set/> element indicating the UID of the first and last message of the (possibly limited) result set. This allows clients to accurately page through messages.
@@ -160,19 +160,21 @@To ensure that the client knows when the results are complete, the server MUST send a <fin> message. The client can optionally include a 'queryid' attribute in their query, which allows the client to match results to their initiating query, and if present in the client's query the server MUST include it in the <fin> response.
+To ensure that the client knows when the results are complete, the server MUST send the &IQ; result after the last message retrieved from the archive. The client can optionally include a 'queryid' attribute in their query, which allows the client to match results to their initiating query.
When querying a pubsub node's archive, the 'node' attribute is added to the <query> element.
Note: There is no concept of an "open query", and servers MUST be prepared to receive arbitrary page requests at any time.
-When the results returned by the server are complete (that is: when they are the last page of the result set), the server MUST include a 'complete' attribute on the <fin> element, with a value of 'true'. If it is not the last page of the result set, the server MUST either omit the 'complete' attribute, or give it a value of 'false'.
+When the results returned by the server are complete (that is: when they are the last page of the result set), the server MUST include a 'complete' attribute in the &IQ; result, with a value of 'true'. If it is not the last page of the result set, the server MUST either omit the 'complete' attribute, or give it a value of 'false'.
Sometimes (e.g. due to network or storage partitioning, or other transient errors) the server might return results to a client that are unstable (e.g. they might later change in sequence or content). In such a situation the server MUST stamp the <fin> element with a 'stable' attribute with a value of 'false'. If the server knows that the data it's serving are stable it MUST either stamp a 'stable' attribute with a value of 'true', or no such attribute. An example of when unstable might legitimately be returned is if the MAM service uses a clustered data store and a query covers a time period for which the data store has not yet converged; it the server could return best-guess results and tell the client that they may be unstable. A client SHOULD NOT cache unstable results long-term without later confirming (by reissuing appropriate queries) that they have become stable.
+Sometimes (e.g. due to network or storage partitioning, or other transient errors) the server might return results to a client that are unstable (e.g. they might later change in sequence or content). In such a situation the server MUST stamp the &IQ; result with a 'stable' attribute with a value of 'false'. If the server knows that the data it's serving are stable it MUST either stamp a 'stable' attribute with a value of 'true', or no such attribute. An example of when unstable might legitimately be returned is if the MAM service uses a clustered data store and a query covers a time period for which the data store has not yet converged; it the server could return best-guess results and tell the client that they may be unstable. A client SHOULD NOT cache unstable results long-term without later confirming (by reissuing appropriate queries) that they have become stable.
In order for the client find out about additional fields the server might support, it can send an iq stanza of type='get' addressed to the archive like this:
From bddd8a4177e55ba7f663b6ce113d630b8bad17bc Mon Sep 17 00:00:00 2001 From: "Matthew A. Miller"First draft.
+ XMPP as a protocol was designed before the wide spread adoption of mobile + devices, and is often cited as not being very mobile friendly as a result. + However, this mostly stems from undocumented lore and outdated notions of + how XMPP works. As the Internet and protocol design have changed to be more + accommodating for mobile, so has XMPP. +
++ This XEP aims to provide useful background knowledge of mobile handset + behavior, and those considerations that client and server designers can + take to ensure that bandwidth and battery are used efficiently. +
++ The two major constraints on mobile devices are power and bandwidth. With + the wide spread proliferation of 3G and LTE technologies, mobile bandwidth + and speeds have become broadly comparable to broadband. However, they are + still relatively expensive compared to traditional wired networks, and + should therefore still be considered. This XEP mostly focuses on LTE as it + already has a very wide deployment and will only continue to further + replace 3G technologies. +
++ XML, and by extension XMPP, is known to be highly compressible. In a simple + test of a small (266089 byte) XMPP stream (connection, stream + initialization, feature discovery, roster loading, several presence stanzas + sent and received, disconnect), the entropy of the stream was found to be + 5.616313 bits per byte. Using the `gzip` tool to apply Lempel-Ziv coding + (LZ77) without concern for server-side CPU usage resulted in a compression + ratio of 21% (a 79% reduction in bandwidth). In one test with a much larger + dataset typical of a corporate environment (many hundreds of users in the + roster), the ratio was as low as 13%, an 87% reduction in bandwidth! +
++ Compression of XMPP data can be achieved with the DEFLATE algorithm + (&rfc1951;) via TLS compression (&rfc3749;) or &xep0138;. While the + security implications of stream compression are beyond the scope of this + document (See the aforementioned RFC or XEP for more info), mitigating them + may affect compression ratios. The author does not recommend using TLS + compression with XMPP (or in general). If compression must be used, stream + level compression should be implemented instead. Compressing at the stream + level gives us the benefit of being able to flush the compression stream on + stanza boundaries to help prevent information from leaking. This, however, + may drastically increase compression ratios. +
++ While the CPU cost of compression directly translates to higher power + usage, it is vastly outweighed by the benefits of reduced network + utilization, especially on modern LTE networks which use a great deal more + power per bit than 3G networks as will be seen later in this document. + Setting security considerations aside and thinking only of power + consumption and bandwidth, supporting compression is highly recommended. +
+
+ While the wide spread adoption of LTE has dramatically increased available
+ bandwidth on mobile devices, it has also increased power consumption.
+ According to one study, early LTE devices consumed 5–20% more power than
+ their 3G counterparts
+
+ XMPP server and client implementers, bearing this increased power usage in
+ mind, and knowing a bit about how LTE radios work, can optimize their
+ traffic to minimize network usage. For the downlink, LTE user equipment
+ (UE) utilizes Orthogonal Frequency Division Multiplexing (OFDM), which is
+ somewhat inefficient
+
+ Whenever possible, data that is not strictly needed should not be + transmitted (by the server or client). Supporting &xep0352; is highly + recommended. Most importantly, XMPP pings should be kept as far apart as + possible and only used when necessary. Server operators are encouraged to + set high ping timeouts, and client implementors are advised to only send + pings when absolutely necessary to prevent the server from closing the + socket. +
++ If one is on 3G, transmitting a small amount of data will cause the radio + to enter FACH mode which is significantly cheaper than its high power + mode. On LTE radios, however, transmitting small amounts of data is + vastly more expensive per bit due to the significantly higher tail-times + (the time it takes for the radio to change state). On LTE radios, one + should transmit as much data as possible when the radio is already on + (eg. by placing messages in a send queue and executing the queue as a + batch). Similarly, when data is being received the radio is already in a + high power state and therefore any data that needs to be sent should be. +
++ These rules also apply to server operators: If you receive data, the + phones radio is already on therefore you should send anything you have. + Otherwise, batching data to be sent and sending it all at once (and as + much as possible) will help reduce power consumption. +
++ This section provides pointers to other documents which may be of interest + to those developing mobile clients, or considering support for them in + servers. +
+&xep0138; provides stream level compression.
++ &xep0115; provides a mechanism for caching, and hence eliding, the + disco#info requests needed to negotiate optional features. +
++ &xep0237; provides a relatively widely deployed extension for reducing + roster fetch sizes. +
++ &xep0198; allows the client to send and receive smaller keep-alive + messages, and resume existing sessions without the full handshake. Useful + on unstable connections. +
++ The original mobile XEP, &xep0286;, was written by Dave Cridland, and parts + of it were used when writing this XEP. +
+This document introduces no new security considerations.
++ This document requires no interaction with the Internet Assigned Numbers + Authority (IANA). +
++ No namespaces or parameters need to be registered with the XMPP Registrar + as a result of this document. +
+First draft.
This XEP does not attempt to implement Raft. Rather, based on the message exchanges defined in the Raft paper, it defines a complementary set of &MESSAGE; stanza elements to allow Raft messages to be transported cleanly over XMPP. The messages for Node to Node communication are well documented in the Raft paper and are reproduced here with minor additions to leverage the benefits of XMPP. However Client to Node communication is only hinted at and, as it does not use Raft natively it is outside the scope of this XEP.
+ +Raft is a consensus algorithm that is easy to understand and implement. When you want to keep a distributed system consistent, you will need some form of consensus algorithm. Raft was developed at Stanford University as an alternative to the incumbent consensus algorithm PAXOS. PAXOS is claimed to be very complex, hard to teach and even harder to implement. All of these are discussed in a paper here and additional information (including a graphical simulation of a cluster) can be found on the project's website: https://raftconsensus.github.io/.
+ + +Raft defines a set of core messages needed to implement the protocol. However, it does not specify the transport layer for this protocol. Most implementations have chosen to use vanilla TCP due to its simplicity. However if you want to run a cluster over the Internet, you are likely going to want more than what vanilla TCP provides. This is where XMPP would really shine as a transport layer for Raft. XMPP offers:
+ +These are all things that would traditionally have to be re-engineered each time somebody wanted to use Raft across the public Internet. By supporting Raft in XMPP, developers looking to use Raft would have a transport layer that's as easy to use and understand as the Raft protocol itself. As Raft does not offer its own transport protocol and has deliberately left that to the developer, there is no conflict in standardizing an XMPP based transport layer.
+ +Making databases or datastores available over the Internet has been the norm for many years. Databases containing PGP keys, certificates or other information can be found hosted by many different organizations. The problem with these systems is that as they become more critical to users, the impact of a server failing increases dramatically. For example, a server that provides a spam database that clients can verify email against, must be operational for those clients to be able to filter spam. Having a single server in this scenario is not acceptable; to provide redundancy there must be multiple servers.
+ +The problem then becomes how to keep the servers in sync. Raft partly solves this problem by providing the means to ensure the cluster maintains consensus i.e. maintains a consistent view of the data. As mentioned previously, it does not however provide a means for the nodes in the cluster to actually communicate with each other or clients.
+ +This is where being able to use Raft over XMPP would be highly beneficial. As it stands now, developers must implement their own transport and security, which although certainly possible, is not ideal. First, most developers are not security experts and a wealth of knowledge and experience is needed to properly design a secure system. Second, even with the required expertise, it takes a considerable amount of time and effort to actually implement and test any new implementation. Third, this extra work takes developers' focus away from the problem that they were trying to solve in the first place.
+ +So how could Raft over XMPP be applied in this instance? First, XMPP has an excellent history when it comes to security. Considerable time and effort was spent ensuring that XMPP was secure when XMPP Core was being standardized. By using XMPP, this hard work and battle tested approach can be leveraged by Raft. This means developers do not need to concern themselves with securing Raft messages, rather they now only need to concern themselves with using XMPP appropriately.
+ +Raft over XMPP further simplifies things by allowing developers to think at a higher level of abstraction. Nodes in the cluster can be communicated with simply by knowing their JID. It would not be necessary to know a node's IP address (which could change) or what TCP port the node is running on. In addition developers would not need to worry about which node connects to which, managing multiple TCP sockets and how to multiplex data across them.
+ +Lastly, integrating a Raft implementation with Raft over XMPP, would be relatively straight forward as Raft over XMPP defines and uses the same names as those provided by the Raft paper with few additions. This means that it could be much easier to get a Raft implementation up and running using Raft over XMPP than it would be to do so even with pure vanilla sockets.
+The author has designed Raft over XMPP with the following requirements in mind:
+ +This XEP defines a transport layer for Raft and not an actual implementation. That is, it does not seek to implement the Raft consensus algorithm within XMPP, but instead to simply define the means for Raft messages to be transported over XMPP.
+ +Node to Node communication is the back-bone of a Raft cluster. In operation, only the Leader or a Candidate will send messages. In all other cases, nodes will only reply to messages received. The two messages are AppendEntries and RequestVote.
+ +Note: These messages are Request/Response in nature but use the &MESSAGE; stanza rather than &IQ; because the handling of missing, delayed or repeated messages is handled by the Raft implementation and not by the transport layer.
+ + +When a Follower has not received a heartbeat from the Leader for a given period of time, it will determine that the Leader has failed and will seek to replace it. To do this it needs the support of the majority of nodes in the cluster. It can solicit support from other nodes by declaring itself a Candidate and sending a RequestVote message to all nodes in the cluster:
+ +A node will respond with a RequestVoteResponse:
+ +A node can either vote for a given Candidate (voteGranted="true") or against a Candidate voteGranted="false".
+ +If a node does not receive a reply, no special handling is required.
+ +The AppendEntries message is used by the Leader to tell Followers that they should append a new entry (or entries) to their logs. It contains additional information to allow a Follower to determine which log entries have been executed and committed on the Leader and also if it has dropped any messages. These features are implemented in Raft directly.
+ +The AppendEntries message is described as a simple array in the Raft paper and this has been expanded on in XMPP to take advantage of structured XML. In addition, Raft is designed to be able to replicate any form of command and this could be binary data rather than textual data. To accommodate this, an attribute has been added to the AppendEntries element to allow a sender to flag when the receiver needs to decode the Entry before passing it to the Raft implementation. The data is encoded using base64.
+ +When followers receive this message, they send a single AppendEntriesResponse in reply as follows:
+ +As before, if a message is missed in either direction, the transport layer does not need to take action.
+ + +It is not the responsibility of the transport layer to determine whether a node is a member of a cluster or not before delivering messages to the Raft implementation. The Raft implementation should ignore messages that it receives from nodes that aren't part of the cluster.
+This document requires no interaction with the Internet Assigned Numbers Authority (IANA).
+The ®ISTRAR; includes 'urn:xmpp:raft' in its registry of protocol namespaces.
+REQUIRED for protocol specifications.
+First draft.
- XMPP as a protocol was designed before the wide spread adoption of mobile - devices, and is often cited as not being very mobile friendly as a result. - However, this mostly stems from undocumented lore and outdated notions of - how XMPP works. As the Internet and protocol design have changed to be more - accommodating for mobile, so has XMPP. -
-- This XEP aims to provide useful background knowledge of mobile handset - behavior, and those considerations that client and server designers can - take to ensure that bandwidth and battery are used efficiently. -
-- The two major constraints on mobile devices are power and bandwidth. With - the wide spread proliferation of 3G and LTE technologies, mobile bandwidth - and speeds have become broadly comparable to broadband. However, they are - still relatively expensive compared to traditional wired networks, and - should therefore still be considered. This XEP mostly focuses on LTE as it - already has a very wide deployment and will only continue to further - replace 3G technologies. -
-- XML, and by extension XMPP, is known to be highly compressible. In a simple - test of a small (266089 byte) XMPP stream (connection, stream - initialization, feature discovery, roster loading, several presence stanzas - sent and received, disconnect), the entropy of the stream was found to be - 5.616313 bits per byte. Using the `gzip` tool to apply Lempel-Ziv coding - (LZ77) without concern for server-side CPU usage resulted in a compression - ratio of 21% (a 79% reduction in bandwidth). In one test with a much larger - dataset typical of a corporate environment (many hundreds of users in the - roster), the ratio was as low as 13%, an 87% reduction in bandwidth! -
-- Compression of XMPP data can be achieved with the DEFLATE algorithm - (&rfc1951;) via TLS compression (&rfc3749;) or &xep0138;. While the - security implications of stream compression are beyond the scope of this - document (See the aforementioned RFC or XEP for more info), mitigating them - may affect compression ratios. The author does not recommend using TLS - compression with XMPP (or in general). If compression must be used, stream - level compression should be implemented instead. Compressing at the stream - level gives us the benefit of being able to flush the compression stream on - stanza boundaries to help prevent information from leaking. This, however, - may drastically increase compression ratios. -
-- While the CPU cost of compression directly translates to higher power - usage, it is vastly outweighed by the benefits of reduced network - utilization, especially on modern LTE networks which use a great deal more - power per bit than 3G networks as will be seen later in this document. - Setting security considerations aside and thinking only of power - consumption and bandwidth, supporting compression is highly recommended. -
-
- While the wide spread adoption of LTE has dramatically increased available
- bandwidth on mobile devices, it has also increased power consumption.
- According to one study, early LTE devices consumed 5–20% more power than
- their 3G counterparts
-
- XMPP server and client implementers, bearing this increased power usage in
- mind, and knowing a bit about how LTE radios work, can optimize their
- traffic to minimize network usage. For the downlink, LTE user equipment
- (UE) utilizes Orthogonal Frequency Division Multiplexing (OFDM), which is
- somewhat inefficient
-
- Whenever possible, data that is not strictly needed should not be - transmitted (by the server or client). Supporting &xep0352; is highly - recommended. Most importantly, XMPP pings should be kept as far apart as - possible and only used when necessary. Server operators are encouraged to - set high ping timeouts, and client implementors are advised to only send - pings when absolutely necessary to prevent the server from closing the - socket. -
-- If one is on 3G, transmitting a small amount of data will cause the radio - to enter FACH mode which is significantly cheaper than its high power - mode. On LTE radios, however, transmitting small amounts of data is - vastly more expensive per bit due to the significantly higher tail-times - (the time it takes for the radio to change state). On LTE radios, one - should transmit as much data as possible when the radio is already on - (eg. by placing messages in a send queue and executing the queue as a - batch). Similarly, when data is being received the radio is already in a - high power state and therefore any data that needs to be sent should be. -
-- These rules also apply to server operators: If you receive data, the - phones radio is already on therefore you should send anything you have. - Otherwise, batching data to be sent and sending it all at once (and as - much as possible) will help reduce power consumption. -
-- This section provides pointers to other documents which may be of interest - to those developing mobile clients, or considering support for them in - servers. -
-&xep0138; provides stream level compression.
-- &xep0115; provides a mechanism for caching, and hence eliding, the - disco#info requests needed to negotiate optional features. -
-- &xep0237; provides a relatively widely deployed extension for reducing - roster fetch sizes. -
-- &xep0198; allows the client to send and receive smaller keep-alive - messages, and resume existing sessions without the full handshake. Useful - on unstable connections. -
-- The original mobile XEP, &xep0286;, was written by Dave Cridland, and parts - of it were used when writing this XEP. -
-This document introduces no new security considerations.
-- This document requires no interaction with the Internet Assigned Numbers - Authority (IANA). -
-- No namespaces or parameters need to be registered with the XMPP Registrar - as a result of this document. -
-Overhaul to include LTE.
The use of XMPP on mobile devices is little understood, since few XMPP implementors have good mobile knowledge, and few mobile engineers have good XMPP knowledge. In addition, as the mobile landscape has changed, optimal protocol designs and usage patterns have also changed. This has led to the sub-optimal combination of a large amount of mostly undocumented lore, as well as several outdated concepts being discussed as fact.
-This XEP aims to provide useful background knowledge of mobile handset behaviours, and essentially distills a number of conversations with experienced mobile engineers and XMPP implementors, providing useful background as general suggestions.
++ XMPP as a protocol was designed before the wide spread adoption of mobile + devices, and is often cited as not being very mobile friendly as a result. + However, this mostly stems from undocumented lore and outdated notions of + how XMPP works. As the Internet and protocol design have changed to be more + accommodating for mobile, so has XMPP. +
++ This XEP aims to provide useful background knowledge of mobile handset + behavior, and those considerations that client and server designers can + take to ensure that bandwidth and battery are used efficiently. +
Mobile handsets typically have two constraints - power and bandwidth. The advent of 3G technology and beyond has tended to mean that bandwidth is radically higher, and comparable to broadband speeds - however many operators still charge based on transferred data, hence bandwidth remains an important issue for cost purposes.
-The major cost of power in the handset for our purposes is the radio - here, too, bandwidth plays a part, but as this document will show, the time the radio is forced to be available to receive also costs substantially.
-Whilst this document refers to &rfc3920;, implementors are advised to take note of &rfc6120;.
++ The two major constraints on mobile devices are power and bandwidth. With + the wide spread proliferation of 3G and LTE technologies, mobile bandwidth + and speeds have become broadly comparable to broadband. However, they are + still relatively expensive compared to traditional wired networks, and + should therefore still be considered. This XEP mostly focuses on LTE as it + already has a very wide deployment and will only continue to further + replace 3G technologies. +
XMPP is known to compress well. Both TLS, part of &xmppcore;, and &xep0138; can provide access to the DEFLATE codec (RFC 1951
Compression ratios vary with usage, however, typical usage by a general client appears to show a 20% ratio (an 80% reduction in bandwidth) in longer sessions
At an exemplary point in one experiment, the author found the following figures
Window Bits | -Compression Ratio (approx) | -
---|---|
15 | -20% | -
14 | -22% | -
13 | -25% | -
12 | -30% | -
11 | -38% | -
10 | -43% | -
9 | -60% | -
Although there is an equal cost for the mobile device to compress, it is considered that the compression codec memory and CPU costs - while certainly translating into power cost - are outweighed by two factors. Firstly, they're likely to reduce the transmission cost by a greater amount, and secondly they will also reduce the encryption cost in TLS.
-Care, however, should be taken not to use XEP-0138 compression when TLS compression is in effect.
+ ++ XML, and by extension XMPP, is known to be highly compressible. In a simple + test of a small (266089 byte) XMPP stream (connection, stream + initialization, feature discovery, roster loading, several presence stanzas + sent and received, disconnect), the entropy of the stream was found to be + 5.616313 bits per byte. Using the `gzip` tool to apply Lempel-Ziv coding + (LZ77) without concern for server-side CPU usage resulted in a compression + ratio of 21% (a 79% reduction in bandwidth). In one test with a much larger + dataset typical of a corporate environment (many hundreds of users in the + roster), the ratio was as low as 13%, an 87% reduction in bandwidth! +
++ Compression of XMPP data can be achieved with the DEFLATE algorithm + (&rfc1951;) via TLS compression (&rfc3749;) or &xep0138;. While the + security implications of stream compression are beyond the scope of this + document (See the aforementioned RFC or XEP for more info), mitigating them + may affect compression ratios. The author does not recommend using TLS + compression with XMPP (or in general). If compression must be used, stream + level compression should be implemented instead. Compressing at the stream + level gives us the benefit of being able to flush the compression stream on + stanza boundaries to help prevent information from leaking. This, however, + may drastically increase compression ratios. +
++ While the CPU cost of compression directly translates to higher power + usage, it is vastly outweighed by the benefits of reduced network + utilization, especially on modern LTE networks which use a great deal more + power per bit than 3G networks as will be seen later in this document. +
++ Supporting compression and flushing on stanza boundaries is highly + recommended. +
Mobile handsets have a number of levels for radio activity. 3G radios can be either Idle, or else in an increasingly capable - and increasingly power-hungry - series of levels, through FACH to DCH.
-For the purposes of investigating this, power consumption (or rather battery depletion rate, as current) and timeouts where measured on the 3UK network, with a Nokia E71, using the Energy Profiler. A "typical handset" mentioned here has a 1000mAh battery - some smartphones have up to 1500mAh. Note that all timeouts are under the control of the network operator, not the handset or application.
-Idle state is when the radio is neither receiving nor transmitting. It may have live (although silent) TCP connections. The cost is low. There is also a PCH level, which is similarly low-power, and again is only used when the radio is silent.
-The current here was measured as 8mA - likely affected more by the energy profiler than much else.
-FACH uses a shared channel for low-bandwidth communications. Packet sizes must be small - around 128 octets maximum, although this is operator controlled. Raising to this state takes around 2.5 seconds before the data can flow - although the power cost rises instantly - and after the session has returned to silence, it will remain at FACH level for some time.
-Note that this threshold includes the overheads from TCP and TLS, which are 52 and 5 octets respectively, leaving around 70 octets for the payload data.
-Here, the current was measured as 140mA, and a timeout of 8 seconds - this timeout is at the lower end of the expected range, which could be up to around 2 minutes. On a typical handset, this will exhaust the battery in around 7 hours.
-DCH uses a dedicated channel for high bandwidth communications. Again, raising to this state takes 2.5 seconds at the DCH power level, and there is a timeout before dropping back. Some operators will drop back to FACH for the duration fo the FACH timeout - others will drop back to Idle/PCH.
-Sending more than the FACH threshold will raise the radio all the way to DCH - taking, again, 2.5 seconds.
-The measurements here were 380mA and 8 seconds - this is sufficient to flatten a typical handset battery in less than 3 hours, and the figures are considered normal.
-Transmission of data can use up to 2W
Experimentation suggests that uncompressed XMPP will never trigger the FACH state, leaping directly into the more costly DCH state. However, compression does make FACH possible, if rare.
+
+ While the wide spread adoption of LTE has dramatically increased available
+ bandwidth on mobile devices, it has also increased power consumption.
+ According to one study, early LTE devices consumed 5–20% more power
+ than their 3G counterparts
+
+ XMPP server and client implementers, bearing this increased power usage in
+ mind, and knowing a bit about how LTE radios work, can optimize their
+ traffic to minimize network usage. For the downlink, LTE user equipment
+ (UE) utilizes Orthogonal Frequency Division Multiplexing (OFDM), which is
+ somewhat inefficient
+
+ Whenever possible, data that is not strictly needed should not be + transmitted (by the server or client). Supporting &xep0352; is highly + recommended. Most importantly, XMPP pings should be kept as far apart as + possible and only used when necessary. Server operators are encouraged to + set high ping timeouts, and client implementors are advised to only send + pings when absolutely necessary to prevent the server from closing the + socket. +
++ If one is on 3G, transmitting a small amount of data will cause the radio + to enter FACH mode which is significantly cheaper than its high power + mode. On LTE radios, however, transmitting small amounts of data is + vastly more expensive per bit due to the significantly higher tail-times + (the time it takes for the radio to change state). On LTE radios, one + should transmit as much data as possible when the radio is already on + (eg. by placing messages in a send queue and executing the queue as a + batch). Similarly, when data is being received the radio is already in a + high power state and therefore any data that needs to be sent should be. +
++ These rules also apply to server operators: If you receive data, the + phones radio is already on therefore you should send anything you have. + Otherwise, batching data to be sent and sending it all at once (and as + much as possible) will help reduce power consumption. +
+As with anything, there are no hard and fast rules. If there were, they might look like these. First, for devices:
-And for servers, similar rules apply:
-Finally, protocol designers should aim to minimize any responses required from the handset, and ensure keepalive traffic, if any, fits inside FACH wherever possible.
-This section provides pointers to other documents which may be of interest to those developing mobile clients, or considering support for them in servers.
-&xep0138; provides application stream level compression, useful if the device TLS stack does not support TLS-based compression.
-&xep0115; provides a mechanism for caching, and hence eliding, the disco#info requests needed to negotiate optional features.
-&xep0237; provides a relatively widely deployed extension for reducing the roster fetch bandwidth, in most cases reducing it to a simple affirmation that the client has the current roster. This saves not only bandwidth, but also reduces local storage writes.
-&xep0198; provides session resumption over TCP, enabling a client to handle the case where the coverage is patchy. The <r/> and <a/> elements also provide a keepalive facility in a small number of octets.
-&xep0273; provides a mechanism which, amongst other things, would allow a presence "hush", buffering presence during certain states.
++ This section provides pointers to other documents which may be of interest + to those developing mobile clients, or considering support for them in + servers. +
+&xep0138; provides stream level compression.
++ &xep0115; provides a mechanism for caching, and hence eliding, the + disco#info requests needed to negotiate optional features. +
++ &xep0237; provides a relatively widely deployed extension for reducing + roster fetch sizes. +
++ &xep0198; allows the client to send and receive smaller keep-alive + messages, and resume existing sessions without the full handshake. Useful + on unstable connections. +
++ &xep0357; implements push notifications (third party message delivery), + which are often used on mobile devices and highly optimized to conserve + battery. Push notifications also allow delivery of notifications to + mobile clients that are currently offline (eg. in an XEP-0198 "zombie" + state). +
++ &xep0313; lets clients fetch messages which they missed (eg. due to poor + mobile coverage and a flakey network connection). +
The author is not a mobile expert, and relied on the knowledge and patient help of several others. In particular, thanks are due to Jussi Laako, Markku Vampari, and Markus Isomaki of Nokia, and Simon Tennant of Buddycloud.
-The attribution of any mistakes herein is zealously guarded by the author, however.
++ This XEP was originally written by Dave Cridland, and parts of his original + work were used in this rewrite. +
This document does not discuss a protocol, thus introduces no new security considerations.
+This document introduces no new security considerations.
None.
++ This document requires no interaction with the Internet Assigned Numbers + Authority (IANA). +
None.
++ No namespaces or parameters need to be registered with the XMPP Registrar + as a result of this document. +
Updates based on list and council feedback.
These are all things that would traditionally have to be re-engineered each time somebody wanted to use Raft across the public Internet. By supporting Raft in XMPP, developers looking to use Raft would have a transport layer that's as easy to use and understand as the Raft protocol itself. As Raft does not offer its own transport protocol and has deliberately left that to the developer, there is no conflict in standardizing an XMPP based transport layer.
+The Raft algorithm can be categorized as a request-response protocol. Normally this would make it a prime candidate for using &IQ; stanzas to handle the communication. However because Raft is designed to cope with message loss, it intrinsically supports automatic recovery. There is no need for the transport layer to report errors as even if the transport layer provided them (such as an &IQ; 'error' response), the Raft implementation cannot use it.
+ +This has a number of benefits. First, it makes Raft adaptable to lossy transport layers where packets can (and do) get lost. Raft is able to automatically recover in this scenario because the next message the Leader sends will allow a Follower to detect that it has missed a message and ask for it to be sent again. The Leader has no way to deal with an error condition caused by sending a message to a Follower.
+ +Second, when it comes to implementing Raft over XMPP, using &MESSAGE; instead of &IQ; greatly simplifies the implementation. As &IQ; stanzas require a reply, the implementation would need to handle detecting and reporting errors conditions back to the sender. This could mean adding arbitrary timers to try to determine if a Follower has 'timed out'. This adds complexity and uncertainty to the system, and given that Raft itself cannot make use of this information, using &IQ; does not add any value to the Raft over XMPP protocol.
+ +Making databases or datastores available over the Internet has been the norm for many years. Databases containing PGP keys, certificates or other information can be found hosted by many different organizations. The problem with these systems is that as they become more critical to users, the impact of a server failing increases dramatically. For example, a server that provides a spam database that clients can verify email against, must be operational for those clients to be able to filter spam. Having a single server in this scenario is not acceptable; to provide redundancy there must be multiple servers.
@@ -96,59 +111,56 @@This XEP defines a transport layer for Raft and not an actual implementation. That is, it does not seek to implement the Raft consensus algorithm within XMPP, but instead to simply define the means for Raft messages to be transported over XMPP.
+This XEP defines a transport layer for Raft and not an actual implementation. That is, it does not seek to implement the Raft consensus algorithm within XMPP, but instead to simply define the means for Raft messages to be transported over XMPP. To facilitate this, both the message name used in the Raft spec (shown in camel case) and the corresponding element name are mentioned together where appropriate.
Node to Node communication is the back-bone of a Raft cluster. In operation, only the Leader or a Candidate will send messages. In all other cases, nodes will only reply to messages received. The two messages are AppendEntries and RequestVote.
-Note: These messages are Request/Response in nature but use the &MESSAGE; stanza rather than &IQ; because the handling of missing, delayed or repeated messages is handled by the Raft implementation and not by the transport layer.
- -When a Follower has not received a heartbeat from the Leader for a given period of time, it will determine that the Leader has failed and will seek to replace it. To do this it needs the support of the majority of nodes in the cluster. It can solicit support from other nodes by declaring itself a Candidate and sending a RequestVote message to all nodes in the cluster:
+When a Follower has not received a heartbeat from the Leader for a given period of time, it will determine that the Leader has failed and will seek to replace it. To do this it needs the support of the majority of nodes in the cluster. It can solicit support from other nodes by declaring itself a Candidate and sending a 'request-vote' (RequestVote) message to all nodes in the cluster:
A node will respond with a RequestVoteResponse:
+A node will respond with a 'vote' (RequestVoteResponse) message:
A node can either vote for a given Candidate (voteGranted="true") or against a Candidate voteGranted="false".
+A node can either vote for a given Candidate (vote-granted="true") or against a Candidate (vote-granted="false").
If a node does not receive a reply, no special handling is required.
The AppendEntries message is used by the Leader to tell Followers that they should append a new entry (or entries) to their logs. It contains additional information to allow a Follower to determine which log entries have been executed and committed on the Leader and also if it has dropped any messages. These features are implemented in Raft directly.
+The 'append' (AppendEntries) message is used by the Leader to tell Followers that they should append a new entry (or entries) to their logs. It contains additional information to allow a Follower to determine which log entries have been executed and committed on the Leader and also if it has dropped any messages. These features are implemented in Raft directly.
-The AppendEntries message is described as a simple array in the Raft paper and this has been expanded on in XMPP to take advantage of structured XML. In addition, Raft is designed to be able to replicate any form of command and this could be binary data rather than textual data. To accommodate this, an attribute has been added to the AppendEntries element to allow a sender to flag when the receiver needs to decode the Entry before passing it to the Raft implementation. The data is encoded using base64.
+The AppendEntries message is described as a simple array in the Raft paper and this has been expanded on in XMPP to take advantage of structured XML. In addition, Raft is designed to be able to replicate any form of command and this could be binary data rather than textual data. To accommodate this, an attribute has been added to the 'append-entries' element to allow a sender to flag when the receiver needs to decode the Entry before passing it to the Raft implementation. The data is encoded using base64.
-When followers receive this message, they send a single AppendEntriesResponse in reply as follows:
+When followers receive this message, they send a single 'append-response' (AppendEntriesResponse) in reply as follows:
-The first situation is addressed by &xep0174;. However, if the endpoints already have client-to-server connections but wish to bypass those connections or leverage those streams for a higher-level application such as end-to-end encryption, it is desirable for the two endpoints to negotiate an end-to-end XML stream. This specification defines methods for doing so, where the application format is an XML stream and the transport method is any direct or mediated streaming transport, such as &xep0261; (mediated), &xep0260; (direct or mediated), or a future ice-tcp Jingle transport (direct or mediated) based on &ice-tcp;.
+The first situation is addressed by &xep0174;. However, if the endpoints already have client-to-server connections but wish to bypass those connections or leverage those streams for a higher-level application such as end-to-end encryption, it is desirable for the two endpoints to negotiate an end-to-end XML stream. This specification defines methods for doing so, where the application format is an XML stream and the transport method is any direct or mediated streaming transport, such as &xep0261; (mediated), &xep0260; (direct or mediated), or a future ice-tcp Jingle transport (direct or mediated) based on &rfc6544;.
The following acronyms and characters are used herein to represent time-related concepts:
Term | Definition | ||
---|---|---|---|
CCYY | four-digit year portion of Date | ||
CCYY | four-digit year portion of Date | ||
MM | two-digit month portion of Date | ||
DD | two-digit day portion of Date | ||
- | ISO 8601 separator among Date portions |
Content Creator | +Content Senders | +Who Sends Download Candidates | +Who performs HTTP GET | +
---|---|---|---|
initiator | +initiator | +initiator | +responder | +
responder | +responder | +initiator | +|
both | +both | +both | +|
none | +none | +none | +|
responder | +initiator | +initiator | +responder | +
responder | +responder | +initiator | +|
both | +both | +both | +|
none | +none | +none | +
Negotiating HTTP uploads is done by using a &TRANSPORT; element with the 'urn:xmpp:jingle:transports:http:upload:0' namespace, &VNOTE;. This element MAY include a <candidate/> element which represents a URI where data can be uploaded. The <candidate/> element MUST include a 'uri' attribute, and MAY contain <header/> elements whose 'name' attribute is an HTTP header and whose text content is the HTTP header value.
+
+
+ Bearer 7472327205ffb74d10b11363044d8c24e3ddba12
+
+]]>
+ The generation of candidates is based on the Jingle content senders, and only the parties specified to receive data SHOULD provide candidates.
+Upon receiving an HTTP upload candidate, parties that are to send data (based on the Jingle content senders) SHOULD use an HTTP PUT request to the candidate URI, where the request body is the data to be transferred.
+ +Content Creator | +Content Senders | +Who Sends Upload Candidates | +Who Performs HTTP PUT | +
---|---|---|---|
initiator | +initiator | +responder | +initiator | +
responder | +initiator | +responder | +|
both | +both | +both | +|
none | +none | +none | +|
responder | +initiator | +responder | +initiator | +
responder | +initiator | +responder | +|
both | +both | +both | +|
none | +none | +none | +
See Upload Complete for signaling that the upload process has been completed.
+A common case for using http-upload is to delegate the storage of the uploaded data to an external hosting service, which means that the receiver might not have the direct ability to know when the uploaded data is ready.
+As such, when an upload transfer is used, the party uploading content SHOULD signal when the upload has completed by sending a Jingle session-info event that includes a <uploaded/> element qualified by the 'urn:xmpp:transports:http:info:0' namespace and SHOULD include 'creator' and 'name' attributes identifying the content for which the upload was completed.
+Here, Romeo is offering to send a file to Juliet, so he includes a download URI candidate with his session-initiate.
+Juliet accepts the offer, and then performs an HTTP GET to retrieve the file.
+Here Romeo is requesting Juliet to send a file by sharing a download URI.
+Juliet accepts the request, and includes a download URI in her session-accept.
+Romeo then retrieves the file using an HTTP GET request.
+In this case, Romeo is offering a file to Juliet but wishes to upload it to her.
+Juliet accepts, and provides a candidate with an upload URI that includes an authorization header.
+Romeo now uses an HTTP PUT to upload his file. Once the upload is complete, he informs Juliet so she knows the file is ready for to read.
+Here Romeo asks Juliet to upload a file.
+Juliet accepts the session, and begins uploading the file data with an HTTP PUT request.
+Once the upload is complete, she informs Romeo that she has completed the upload so that he knows he can access the data he requested.
+To advertise its support for the Jingle HTTP Transport Method, when replying to &xep0030; information requests an entity MUST return URNs for any version of this protocol that the entity supports -- e.g., "urn:xmpp:jingle:transports:http:0" for this version &VNOTE;.
+In order for an application to determine whether an entity supports this protocol, where possible it SHOULD use the dynamic, presence-based profile of service discovery defined in &xep0115;. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.
+HTTP URI candidates SHOULD use the "https://" URI scheme instead of "http://", and entities MAY refuse to process URIs that are not "https://".
+Certain HTTP headers can cause unintended behaviour, such as using the 'Upgrade' header to trigger a conversion to WebSocket (&rfc6455;).
+No interaction with &IANA; is required as a result of this document.
+This specification defines the following XML namespaces:
+The ®ISTRAR; includes the foregoing namespace in its registry of protocol namespaces at &NAMESPACES;, as described in Section 4 of &xep0053;.
+The ®ISTRAR; includes "http-download" in its registry of Jingle transport methods at &JINGLETRANSPORTS;. The registry submission is as follows:
+
+ http-download
+
+ A method for negotiating data exchange via HTTP URI retrieval.
+
+ streaming
+ XEP-XXXX
+]]>
+ The ®ISTRAR; includes "http-upload" in its registry of Jingle transport methods at &JINGLETRANSPORTS;. The registry submission is as follows:
+
+ http-upload
+
+ A method for negotiating data exchange via uploading to HTTP URIs.
+
+ streaming
+ XEP-XXXX
+]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ]]>
+ First draft.
Occasionally, a &xep0045; room moderator or admin might wish to remove certain chat messages from the room history as part of an effort to address and remedy issues such as message spam, indecent language for the venue, exposing private third-party personal information, etc. However, as with any content moderation tool, the removal request can only be considered as a hint and by itself can not prevent or undo any potential damage caused by the offending message, as clients which don't support message deletion are not obligated to enforce the deletion request and people could have seen or copied the message content already.
+If a client or service implements message deletion, it MUST specify the 'urn:xmpp:message-delete:0' feature in its service discovery information features as specified in &xep0030; and the Entity Capabilities profile specified in &xep0115;.
+When a user indicates to the client that a sent message (or a received message for MUC room moderators) is meant to be deleted, the client will send a new message containing a <remove /> element with the "urn:xmpp:message-delete:0" namespace, with an id attribute set to the id of the message to be removed.
+A receiving client can choose to remove the indicated message from whatever display is used for messages, from any stored history, or choose to display the fact that a message has been removed in another way.
+A MUC or other service that supports message removal SHOULD prevent further distribution of the message by the service (e.g., by not replaying the message to new occupants joining the room, or omitting the message from history archive requests where possible).
+A client MAY inform the user that a no-longer displayed message did previously exist and has been removed.
+Clients and services MUST set the 'id' attribute on messages if they allow for message deletion.
+The Sender MUST NOT send a removal request for a message with non-messaging payloads. For example, a sender MUST NOT send a removal for a roster item exchange request or a file transfer part.
+A removal MUST only be processed when both the original message and removal request are received from the same full-JID (or from a JID of an appropriate admin or moderator in the case of a MUC room.)
+There can never be a guarantee that a removed message was never seen or otherwise distributed, and it is encouraged for clients and services when possible to inform users that no such guarantee exists.
+When used in a &xep0045; context, removals send by non-moderators must not be allowed (by the receiver) for messages received before the sender joined the room - particularly a full JID leaving the room then rejoining and removing a message SHOULD be disallowed, as the entity behind the full JID in the MUC may have changed.
+None.
+The ®ISTRAR; includes 'urn:xmpp:message-delete:0' in its registry of protocol namespaces (see &NAMESPACES;).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ]]>
+Other people at the hotspot can also advertise similar DNS records for use on the local link. Essentially, the mDNS daemons running on all of the machines at the hotspot collectively manage the ".local." domain, which has meaning only at the hotspot (not across the broader Internet). Queries and responses for services on the local link occur via multicast DNS over UDP port 5353 instead of via normal DNS unicast over UDP port 53. When a new machine joins the local link, it can send out queries for any number of service types, to which the other machines will reply. For the purpose of serverless messaging we are interested only in the "presence" service, but many other services could exist on the local link (see dns-sd.org for a complete list).
Now let us imagine that a fine young gentleman named Romeo joins the hotspot and that his chat client (actually his mDNS daemon) sends out multicast DNS queries for services of type "presence". To do this, his client essentially reverses the order of DNS record publication (explained above) by asking for pointers to presence services (i.e., PTR records that match "_presence._tcp.local."), querying each service for its service instance and port (i.e., SRV record), mapping each service instance to an IP address (i.e., A record), and finding out additional information about the entity using the service (i.e., TXT record parameters).
Your client then responds with a response stream header.
In order to exchange serverless messages, the initiator and recipient MUST first establish XML streams between themselves, as is familiar from RFC 6120.
First, the initiator opens a TCP connection at the IP address and port discovered via the DNS lookup for an entity and opens an XML stream to the recipient, which SHOULD include 'to' and 'from' address:
+ Note: If the initiator supports stream features and the other stream-related aspects of XMPP 1.0 as specified in RFC 6120, then it SHOULD include the version='1.0' flag as shown in the previous example.
The recipient then responds with a stream header as well:
+
As with Entity Capabilities over native XMPP networks, a client might not know the &xep0030; features associated with the 'ver' value advertised by another entity. However, in the case of serverless messaging there is no way for the client to discover the entity's supported features without initiating an XML stream to that entity and then sending a Service Discovery information ("disco#info") request over the negotiated stream.
Unfortunately, full stream negotiation (including TLS and SASL if appropriate) can require a large number of packets. Therefore, as an optimization, it is RECOMMENDED for the receiving entity in a serverless XML stream negotiation to include its disco#info data (including node) as a stream feature, as shown in the following examples.
+
]]>
+
Date: Fri, 21 Aug 2015 10:18:59 +0200
Subject: [PATCH 033/106] Added reference to XEP1 in README
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index d2fdef89..4a876ca3 100644
--- a/README.md
+++ b/README.md
@@ -23,5 +23,7 @@ page:
http://xmpp.org/xmpp-protocols/xmpp-extensions/submitting-a-xep/
+[XEP-0001: XMPP Extension Protocols](http://xmpp.org/extensions/xep-0001.html) defines the standards process followed by the XMPP Standards Foundation.
+
Thanks!
From 2a382b1b9b1e102b8f7d717230ade852545e4a4c Mon Sep 17 00:00:00 2001
From: Kevin Smith
Date: Mon, 17 Aug 2015 14:31:32 +0100
Subject: [PATCH 034/106] Change Carbons delivery rules to 'all IM traffic'
After discussion on the standards list at the time of Last Call, it
became clear that servers were not generally implementing Carbons as
specified. This patch updates the text to be more forgiving of such
discrepancies, and to try to reflect general consensus between
implementations of what should be eligible for carbons delivery.
---
xep-0280.xml | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/xep-0280.xml b/xep-0280.xml
index 14abeb56..39136cbb 100644
--- a/xep-0280.xml
+++ b/xep-0280.xml
@@ -124,9 +124,9 @@
Clients that do not implement the new protocol MUST NOT
receive protocol they do not expect
All clients that turn on the new protocol MUST be able to see
- all inbound chat-type messages.
+ all inbound instant messaging messages.
All clients that turn on the new protocol MUST be able to see
- all outbound chat-type messages from all of the resources of the
+ all outbound instant messaging messages from all of the resources of the
user, regardless of whether the clients for the other resources
have implemented the new protocol.
@@ -227,10 +227,24 @@
See the section Handling Multiple Enable/Disable Requests for considerations when a client attempts to disable Carbons multiple times.
-
+
+
+
+ The focus of this specification is instant messaging applications and so those (and only those) &MESSAGE; stanzas used for instant messaging SHOULD be delivered as Carbons. Defining precisely which messages are used for instant messaging and which are not is difficult, as future specifications may add additional payloads used for, or not used for, instant messaging; as such, the rules for which messages are eligible for carbons delivery is left as an implementation detail for servers. The following is a suggested set of rules a server MAY use, or it MAY use its own; in either case it SHOULD follow the general intent of these rules:
+ Possible delivery rules:
+
+ - A &MESSAGE; is eligible for carbons delivery if it is of type "chat".
+ - A &MESSAGE; is eligible for carbons delivery if it is of type "normal" and it contains a <body> element.
+ - A &MESSAGE; is not eligible for carbons delivery if it is determined to have been sent by a MUC room or service, even if it would be otherwise eligible.
+ - A &MESSAGE; is not eligible for carbons delivery if it does not meet any of these criteria.
+
+
+ Future specifications may have more precise requirements on which messages need to be eligible for carbons delivery; such future specifications will provide their own discovery and negotiation mechanisms, such that a client negotiating Carbons using the protocol defined in this specification will cause the server to consider messages eligible for Carbons delivery based on the requirements described herein.
+ Note: previous versions of this specification limited eligible messages to those of type "chat" - however, this was generally found to be inadequate due to the proliferation of type "normal" messages used in instant messaging.
+
- When the server receives a &MESSAGE; of type "chat" addressed to a bare JID (localpart@domainpart), it delivers a copy to each Carbons-enabled resource for the bare JID – in addition to delivering according to RFC 6121 § 8.5.2. This process is sometimes called "forking".
+ When the server receives a &MESSAGE; eligible for carbons delivery addressed to a bare JID (localpart@domainpart), it first delivers it according to RFC 6121 § 8.5.2, and then delivers a copy to each Carbons-enabled resource for the bare JID that did not receive it due to the RFC 6121 delivery rules. This process is sometimes called "forking".
The receiving server MUST deliver a copy to every Carbons-enabled resource, even if that resource normally would not receive &MESSAGE; stanzas addressed to the bare JID (e.g., resources which have broadcast &PRESENCE; with a negative priority). A Carbons-enabled resource MUST NOT receive more than one copy of the &MESSAGE;.
- When the server receives a &MESSAGE; of type "chat" addressed to a full JID (localpart@domainpart/resourcepart), it delivers the &MESSAGE; according to RFC 6121 § 8.5.3, and delivers a forwarded copy to each Carbons-enabled resource for the matching bare JID recipient.
+ When the server receives a &MESSAGE; eligible for carbons delivery addressed to a full JID (localpart@domainpart/resourcepart), it delivers the &MESSAGE; according to RFC 6121 § 8.5.3, and then delivers a forwarded copy to each Carbons-enabled resource for the matching bare JID recipient that did not receive it under the RFC 6121 delivery rules. Note that the RFC 6121 delivery rules can cause a &MESSAGE; addressed to a full JID to be delivered using bare JID delivery rules; in this case the server should also apply the bare JID rules for Carbons.
Each forwarded copy is wrapped using &xep0297;. The wrapping message SHOULD maintain the same 'type' attribute value; the 'from' attribute MUST be the Carbons-enabled user's bare JID (e.g., "localpart@domainpart"); and the 'to' attribute MUST be the full JID of the resource receiving the copy. The content of the wrapping message MUST contain a <received/> element qualified by the namespace "urn:xmpp:carbons:2", which itself contains a <forwarded/> element qualified by the namespace "urn:xmpp:forward:0" that contains the original &MESSAGE;.
]]>
- The receiving server MUST NOT send a forwarded copy to the full JID the original &MESSAGE; stanza was addressed to, as that recipient receives the original &MESSAGE; stanza.
+ The receiving server MUST NOT send a forwarded copy to the client(s) receiving full JID the original &MESSAGE; stanza was addressed to, as that recipient receives the original &MESSAGE; stanza.
- When a client sends a &MESSAGE; of type "chat", its sending server delivers the &MESSAGE; according to RFC 6120 and RFC 6121, and delivers a forwarded copy to each Carbons-enabled resource for the matching bare JID sender.
+ When a client sends a &MESSAGE; eligible for carbons delivery, its sending server delivers the &MESSAGE; according to RFC 6120 and RFC 6121, and delivers a forwarded copy to each Carbons-enabled resource for the matching bare JID sender. Note that this happens irrespective of whether the sending client has carbons enabled.
Each forwarded copy is wrapped using &xep0297;. The wrapping message SHOULD maintain the same 'type' attribute value; the 'from' attribute MUST be the Carbons-enabled user's bare JID (e.g., "localpart@domainpart"); and the 'to' attribute SHOULD be the full JID of the resource receiving the copy. The content of the wrapping message MUST contain a <sent/> element qualified by the namespace "urn:xmpp:carbons:2", which itself contains a <forwarded/> qualified by the namespace "urn:xmpp:forward:0" that contains the original &MESSAGE; stanza.
- If a client is permitted to enable Carbons during its login session, the server MUST allow the client enable and disable the protocol multiple times within a session. The server SHOULD NOT treat multiple enable requests (without an intermediate disable request) as an error; it SHOULD simply return an IQ-result (if the protocol is already enabled) or an IQ-error (if the client is not permitted to enable Carbons) for any subsequent requests after the first. Similarly, the server SHOULD NOT treat multiple disable requests (without an intermediate enable request) as an error; it SHOULD return an IQ-result (if the protocols is already disabled) or an IQ-error (if the client's request failed previously) for any subsequent requests after the first.
+ If a client is permitted to enable Carbons during its login session, the server MUST allow the client to enable and disable the protocol multiple times within a session. The server SHOULD NOT treat multiple enable requests (without an intermediate disable request) as an error; it SHOULD simply return an IQ-result (if the protocol is already enabled) or an IQ-error (if the client is not permitted to enable Carbons) for any subsequent requests after the first. Similarly, the server SHOULD NOT treat multiple disable requests (without an intermediate enable request) as an error; it SHOULD return an IQ-result (if the protocols is already disabled) or an IQ-error (if the client's request failed previously) for any subsequent requests after the first.
Note that &xep0085; recommends sending chat state
From 846803d9b9e95b8ff54a4befc2bf7830f95e8ac3 Mon Sep 17 00:00:00 2001
From: Kevin Smith
Date: Mon, 17 Aug 2015 14:43:48 +0100
Subject: [PATCH 035/106] Further tweak Carbons text after community discussion
---
xep-0280.xml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/xep-0280.xml b/xep-0280.xml
index 39136cbb..d6ac9196 100644
--- a/xep-0280.xml
+++ b/xep-0280.xml
@@ -235,10 +235,12 @@
- A &MESSAGE; is eligible for carbons delivery if it is of type "chat".
- A &MESSAGE; is eligible for carbons delivery if it is of type "normal" and it contains a <body> element.
+ - A &MESSAGE; is eligible for carbons delivery if it is of type "error" and sent in response to a &MESSAGE; that was itself eligible for carbons delivery (Note that as this would require message tracking and correlation on the server, it is unlikely to be generally appropriate for most implementations).
- A &MESSAGE; is not eligible for carbons delivery if it is determined to have been sent by a MUC room or service, even if it would be otherwise eligible.
- A &MESSAGE; is not eligible for carbons delivery if it does not meet any of these criteria.
+ As this is a implementation detail of servers, clients MUST NOT rely on the server implementing a particular set of rules for which messages are eligible for Carbons delivery.
Future specifications may have more precise requirements on which messages need to be eligible for carbons delivery; such future specifications will provide their own discovery and negotiation mechanisms, such that a client negotiating Carbons using the protocol defined in this specification will cause the server to consider messages eligible for Carbons delivery based on the requirements described herein.
Note: previous versions of this specification limited eligible messages to those of type "chat" - however, this was generally found to be inadequate due to the proliferation of type "normal" messages used in instant messaging.
From c568aeecc3ca0c91b79f10819c98bde4a1b49a0c Mon Sep 17 00:00:00 2001
From: Georg Lukas
Date: Mon, 17 Aug 2015 18:45:05 +0200
Subject: [PATCH 036/106] Minor Carbons clarifications
---
xep-0280.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xep-0280.xml b/xep-0280.xml
index d6ac9196..8f7a2f39 100644
--- a/xep-0280.xml
+++ b/xep-0280.xml
@@ -236,7 +236,7 @@
A &MESSAGE; is eligible for carbons delivery if it is of type "chat".
A &MESSAGE; is eligible for carbons delivery if it is of type "normal" and it contains a <body> element.
A &MESSAGE; is eligible for carbons delivery if it is of type "error" and sent in response to a &MESSAGE; that was itself eligible for carbons delivery (Note that as this would require message tracking and correlation on the server, it is unlikely to be generally appropriate for most implementations).
- A &MESSAGE; is not eligible for carbons delivery if it is determined to have been sent by a MUC room or service, even if it would be otherwise eligible.
+ A &MESSAGE; is not eligible for carbons delivery if it is determined to have been sent by a MUC room or service, even if it would be otherwise eligible (this also includes private messages from MUC participants).
A &MESSAGE; is not eligible for carbons delivery if it does not meet any of these criteria.
@@ -311,7 +311,7 @@
The receiving server MUST NOT send a forwarded copy to the client(s) receiving full JID the original &MESSAGE; stanza was addressed to, as that recipient receives the original &MESSAGE; stanza.
- When a client sends a &MESSAGE; eligible for carbons delivery, its sending server delivers the &MESSAGE; according to RFC 6120 and RFC 6121, and delivers a forwarded copy to each Carbons-enabled resource for the matching bare JID sender. Note that this happens irrespective of whether the sending client has carbons enabled.
+ When a client sends a &MESSAGE; eligible for carbons delivery, its sending server delivers the &MESSAGE; according to RFC 6120 and RFC 6121, and delivers a forwarded copy to each Carbons-enabled resource for the matching bare JID sender, excluding the sending client. Note that this happens irrespective of whether the sending client has carbons enabled.
Each forwarded copy is wrapped using &xep0297;. The wrapping message SHOULD maintain the same 'type' attribute value; the 'from' attribute MUST be the Carbons-enabled user's bare JID (e.g., "localpart@domainpart"); and the 'to' attribute SHOULD be the full JID of the resource receiving the copy. The content of the wrapping message MUST contain a <sent/> element qualified by the namespace "urn:xmpp:carbons:2", which itself contains a <forwarded/> qualified by the namespace "urn:xmpp:forward:0" that contains the original &MESSAGE; stanza.
Date: Mon, 17 Aug 2015 18:53:57 +0200
Subject: [PATCH 037/106] Carbons: remove bare-JID special case
---
xep-0280.xml | 37 +++----------------------------------
1 file changed, 3 insertions(+), 34 deletions(-)
diff --git a/xep-0280.xml b/xep-0280.xml
index 8f7a2f39..d2bae197 100644
--- a/xep-0280.xml
+++ b/xep-0280.xml
@@ -245,39 +245,8 @@
Note: previous versions of this specification limited eligible messages to those of type "chat" - however, this was generally found to be inadequate due to the proliferation of type "normal" messages used in instant messaging.
-
- When the server receives a &MESSAGE; eligible for carbons delivery addressed to a bare JID (localpart@domainpart), it first delivers it according to RFC 6121 § 8.5.2, and then delivers a copy to each Carbons-enabled resource for the bare JID that did not receive it due to the RFC 6121 delivery rules. This process is sometimes called "forking".
-
-
- Wherefore art thou, Romeo?
- 0e3141cd80894871a68e6fe6b1ec56fa
-]]>
-
-
- Wherefore art thou, Romeo?
- 0e3141cd80894871a68e6fe6b1ec56fa
-
-
-
- Wherefore art thou, Romeo?
- 0e3141cd80894871a68e6fe6b1ec56fa
- ]]>
-
- The receiving server MUST deliver a copy to every Carbons-enabled resource, even if that resource normally would not receive &MESSAGE; stanzas addressed to the bare JID (e.g., resources which have broadcast &PRESENCE; with a negative priority). A Carbons-enabled resource MUST NOT receive more than one copy of the &MESSAGE;.
-
-
- When the server receives a &MESSAGE; eligible for carbons delivery addressed to a full JID (localpart@domainpart/resourcepart), it delivers the &MESSAGE; according to RFC 6121 § 8.5.3, and then delivers a forwarded copy to each Carbons-enabled resource for the matching bare JID recipient that did not receive it under the RFC 6121 delivery rules. Note that the RFC 6121 delivery rules can cause a &MESSAGE; addressed to a full JID to be delivered using bare JID delivery rules; in this case the server should also apply the bare JID rules for Carbons.
+
+ When the server receives a &MESSAGE; eligible for carbons delivery addressed to a client JID (either bare or full), it delivers the &MESSAGE; according to RFC 6121 § 8.5.3, and then delivers a forwarded copy to each Carbons-enabled resource for the matching bare JID recipient that did not receive it under the RFC 6121 delivery rules.
Each forwarded copy is wrapped using &xep0297;. The wrapping message SHOULD maintain the same 'type' attribute value; the 'from' attribute MUST be the Carbons-enabled user's bare JID (e.g., "localpart@domainpart"); and the 'to' attribute MUST be the full JID of the resource receiving the copy. The content of the wrapping message MUST contain a <received/> element qualified by the namespace "urn:xmpp:carbons:2", which itself contains a <forwarded/> element qualified by the namespace "urn:xmpp:forward:0" that contains the original &MESSAGE;.
]]>
- The receiving server MUST NOT send a forwarded copy to the client(s) receiving full JID the original &MESSAGE; stanza was addressed to, as that recipient receives the original &MESSAGE; stanza.
+ The receiving server MUST NOT send a forwarded copy to the client(s) the original &MESSAGE; stanza was addressed to, as these recipients receive the original &MESSAGE; stanza.
When a client sends a &MESSAGE; eligible for carbons delivery, its sending server delivers the &MESSAGE; according to RFC 6120 and RFC 6121, and delivers a forwarded copy to each Carbons-enabled resource for the matching bare JID sender, excluding the sending client. Note that this happens irrespective of whether the sending client has carbons enabled.
From 756e38b9c2c9b7eff8edde6bfa3da789e2dd7d99 Mon Sep 17 00:00:00 2001
From: "Matthew A. Miller"
Date: Mon, 24 Aug 2015 08:36:34 -0600
Subject: [PATCH 038/106] Update revision and fix typos
---
xep-0280.xml | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/xep-0280.xml b/xep-0280.xml
index d2bae197..f1d8b79b 100644
--- a/xep-0280.xml
+++ b/xep-0280.xml
@@ -40,6 +40,15 @@
linuxwolf@outer-planes.net
linuxwolf@outer-planes.net
+
+ 0.10
+ 2015-08-24
+ mm (editor)
+
+ Removed distinction between full-JID and bare-JID when receiving messages (Georg Lukas).
+ Define rules around "elible messages", and provide reasonable default guidelines (Kevin Smith).
+
+
0.9
2013-10-17
@@ -341,7 +350,7 @@
Note: if the private &MESSAGE; stanza is addressed to a bare JID, the receiving server still delivers it according to RFC 6121. This might result in a copy being delivered to each resource for the recipient, which effectively negates the behavior of the <private/> element for recipients.
-
+
If a client is permitted to enable Carbons during its login session, the server MUST allow the client to enable and disable the protocol multiple times within a session. The server SHOULD NOT treat multiple enable requests (without an intermediate disable request) as an error; it SHOULD simply return an IQ-result (if the protocol is already enabled) or an IQ-error (if the client is not permitted to enable Carbons) for any subsequent requests after the first. Similarly, the server SHOULD NOT treat multiple disable requests (without an intermediate enable request) as an error; it SHOULD return an IQ-result (if the protocols is already disabled) or an IQ-error (if the client's request failed previously) for any subsequent requests after the first.
From a4ce22fefb45fa6b472c94206faed7ebd1cfb769 Mon Sep 17 00:00:00 2001
From: Steve Kille
Date: Fri, 21 Aug 2015 15:49:33 +0100
Subject: [PATCH 039/106] Initial X2X over S5066
---
inbox/s2s-over-s5066.xml | 135 +++++++++++++++++++++++++++++++++++++++
1 file changed, 135 insertions(+)
create mode 100644 inbox/s2s-over-s5066.xml
diff --git a/inbox/s2s-over-s5066.xml b/inbox/s2s-over-s5066.xml
new file mode 100644
index 00000000..bb11b5ac
--- /dev/null
+++ b/inbox/s2s-over-s5066.xml
@@ -0,0 +1,135 @@
+
+
+%ents;
+]>
+
+
+
+ Server to Server communication over STANAG 50666 ARQ
+
+ This specification defines operation over XMPP over the NATO STANAG 5066 data link service for point to point links (ARQ). This enables optimized XMPP performance over HF Radio (which STANAG 5066 was designed for) and over other data links using STANAG 5066.
+
+
+
+ This XMPP Extension Protocol is copyright (c) 1999 - 2015 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.
+ ## 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. In no event shall the XMPP Standards Foundation or the authors of this Specification be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification. ##
+ 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 out of the use or inability to use 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.
+ This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which may be found at <http://xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XSF, P.O. Box 1641, Denver, CO 80201 USA).
+
+ xxxx
+ ProtoXEP
+ Informational
+ Standards
+ Council
+
+
+ XEP 0361
+ STANAG 5066
+
+
+
+ S5066
+
+ Steve
+ Kille
+ steve.kille@isode.com
+ steve.kille@isode.com
+
+
+ 0.0.1
+ 2015-08-19
+ sek
+ First draft.
+
+
+
+
+ This specification arose from requirements to operate over HF Radio, which has exceedingly high latency (sometimes minutes) low data rates (down to 75 bits/second) and poor reliablity. STANAG 5066 is a widely used link level protocol. Direct use of STANAG 5066 enables elimination of all extraneous end to end handshaking, which is important to optimize performance. It also enables use of STANAG 5066 flow control, which is important for reslience.
+
+
+
+ The solution is based on XEP-0361 "Zero Handshake Server to Server Protocol" and requires peer configuration to be established according to XEP-0361. The data exchanged between the XMPP servers follows exactly what is specified in XEP-0316. The data is transferred using STANAG 5066 rather than using TCP.
+
+
+
+
+
+ This specification can be considered as a profile for server to server XMPP communication, to enable XMPP deployment over HF Radio using STANAG 5066. This profile MUST only be used where its use has been pre-agreed and configured for both participating servers.
+
+
+
+
+
+ An example scenario where this protocol is important is where two ships connected by HF Surface Wave communication only need to exchange XMPP messages. A reliable link (Soft Link) can be established using STANAG 5066 and XMPP communicated efficiently and reliably.
+
+
+
+
+
+
+
+ Because of potentially very low bandwidth sending server MAY perform traffic optimisation, such as selective removal of stanzas that are not adding sufficient value, like CSNs, or strip selected elements such as xhtml-im.
+
+
+ Applications sending data over STANAG 5066 need to be aware of increased delays and any application level timers (e.g., IQ response timers) need to be set accordingly.
+
+
+
+
+ XEP-0361 transfer of data between a pair of XMPP servers is a byte stream flowing in each direction over TCP. There is no other protocol or hand shaking.
+ When carried instead over STANAG 5066, these byte streams are transmitted as a sequence of blocks transferred in order
+ Each block is an XML stanza, holding message, presence or iq. Essentially the stream is broken into blocks (stanzas) at natural boundaries XMPP boundaries, and then reassembled on reception into the original stream.
+
+
+
+
+ XEP-0198 Stream Management MUST not be used over STANAG 5066, as reliability of stanza transfer is handled by use of STANAG 5066. Application-layer keepalives and timeout detection such as white-space pings and XEP-0199 MUST NOT be used.
+
+
+
+
+
+
+ Each stanza is transferred using the RCOP (Reliable Connection Oriented Protocol) defined in Section F.8 of Annex F of STANAG 5066. This reliably transfers the block of data to the destination. If a soft link needs to be established this will be done by the STANAG 5066 service. The XEP-0361 peer agreement is supported by a flow of stanzas in each direction being transferred by RCOP. The peer agreement will use this flow of stanzas to provide a service equivalent to the TCP connection or connections of XEP-0361.
+
+
+ STANAG 5066 SIS Delivery Confirmation MAY be set to NODE DELIVERY, as this gives optimum network performance. CLIENT DELIVERY MAY be used, which increases reliability as stanza delivery to the peer XMPP server is guaranteed and the sending server will receive acknowledgements equivalent to XEP-0198 support. In the event of delivery failure, the whole RCOP PDU (Stanza) MUST be retransmitted.
+
+
+
+
+
+ The peer addressing of the STANAG 5066 end points will be configured as part of the XEP-03161 peer agreement.
+
+
+ The STANAG 5066 SAP MAY be set to any mutually agreed value. It is RECOMMENDED that 2 is used. This is the standard SAP for RCOP.
+
+
+ The RCOP connection ID number will be set to a mutually agreed value. It is RECOMMENDED that 0 is used as the preferred value.
+
+
+
+
+
+
+
+ Security Considerations of XEP-0361 apply. STANAG 5066 will frequently be employed in conjunction with link level crypto devices, which SHOULD be done when appropriate to provide data confidentiality.
+
+
+
+
+ This specification uses STANAG 5066 Edition 3 "PROFILE FOR HF RADIO DATA COMMUNICATIONS" (December 2010).
+ STANAG 5066 is a NATO UNCLASSIFED (Releasable to the Public) document that may circulated freely. The author has requested permission form NATO to enable publishing of this document on the Web.
+
+
+
+
+ Curtis King designed and validated the approach documented in this XEP.
+
+
+ Kevin Smith provided useful comments on this specification.
+
+
+
From 43257f6b9a3d179ed5119aea72aaa3f684c8c742 Mon Sep 17 00:00:00 2001
From: Steve Kille
Date: Fri, 21 Aug 2015 16:14:22 +0100
Subject: [PATCH 040/106] Fix to Standards Track
---
inbox/s2s-over-s5066.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/inbox/s2s-over-s5066.xml b/inbox/s2s-over-s5066.xml
index bb11b5ac..8ffae14d 100644
--- a/inbox/s2s-over-s5066.xml
+++ b/inbox/s2s-over-s5066.xml
@@ -20,7 +20,7 @@
xxxx
ProtoXEP
- Informational
+ Standards Track
Standards
Council
From 3ec99b2c0491616e08e0fcef76597f1ce22d0457 Mon Sep 17 00:00:00 2001
From: "Matthew A. Miller"
Date: Mon, 24 Aug 2015 16:34:49 -0600
Subject: [PATCH 041/106] fix typo in title
---
inbox/s2s-over-s5066.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/inbox/s2s-over-s5066.xml b/inbox/s2s-over-s5066.xml
index 8ffae14d..2dc99ade 100644
--- a/inbox/s2s-over-s5066.xml
+++ b/inbox/s2s-over-s5066.xml
@@ -6,7 +6,7 @@
- Server to Server communication over STANAG 50666 ARQ
+ Server to Server communication over STANAG 5066 ARQ
This specification defines operation over XMPP over the NATO STANAG 5066 data link service for point to point links (ARQ). This enables optimized XMPP performance over HF Radio (which STANAG 5066 was designed for) and over other data links using STANAG 5066.
From 9bc45ee51ed449eced0702764e26591ca684538e Mon Sep 17 00:00:00 2001
From: "Matthew A. Miller"
Date: Wed, 26 Aug 2015 09:45:54 -0600
Subject: [PATCH 042/106] Last Call of XEP-0320 v0.2
---
xep-0320.xml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/xep-0320.xml b/xep-0320.xml
index 828652b4..d2dd17c5 100644
--- a/xep-0320.xml
+++ b/xep-0320.xml
@@ -10,7 +10,8 @@
This specification defines how to use DTLS-SRTP (RFC 5763) in the Jingle application type for the Real-time Transport Protocol (RTP) as a way to negotiate media path key agreement for secure RTP in one-to-one media sessions.
&LEGALNOTICE;
0320
- Experimental
+ Proposed
+ 2015-09-07
Standards Track
Standards
Council
From f1d3d763f36532d7c3c2825a30a1d699788e48bc Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Mon, 27 Jul 2015 16:20:57 -0500
Subject: [PATCH 043/106] Move XEP-0352 (CSI) to "Proposed"
---
xep-0352.xml | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/xep-0352.xml b/xep-0352.xml
index aee6331b..cb3aa52e 100644
--- a/xep-0352.xml
+++ b/xep-0352.xml
@@ -10,7 +10,8 @@
This document defines a way for the client to indicate its active/inactive state.
&LEGALNOTICE;
0352
- Experimental
+ Proposed
+ 2015-09-07
Standards Track
Standards
Council
@@ -55,10 +56,10 @@
Juliet has an XMPP client on her phone, which is available to receive messages. However most of the time
Juliet has her phone screen turned off and is not interested in the status of her contacts unless they are
communicating with her.
-
+
Juliet's client informs the server when Juliet is not interacting with it. The server uses this information to
suppress or reduce stanzas that are unimportant, such as status updates.
-
+
When Juliet returns to her IM client, the client again informs the server, this time to report that it is active
again. The server then disables its traffic optimisations and restores the stream to its normal state.
@@ -96,12 +97,12 @@
]]>
-
+
As might be anticipated, when the client is active again it sends an <active/> element:
]]>
-
+
There is no reply from the server to either of these elements (though they may indirectly cause the server to
send stanzas, e.g., to update presence information when the client becomes active after a period of inactivity).
@@ -109,10 +110,10 @@
As this protocol is for indication only, clients MUST NOT make assumptions about how the server
will use the active/inactive state information.
-
+
The server MUST assume all clients to be in the 'active' state until the client indicates otherwise. Also the
CSI active/inactive state is unrelated to the user's presence, the server MUST treat the two independently.
-
+
This protocol is intended primarily for clients with human interaction. Due to the open-ended nature of
the possible optimisations implemented by the server, it may not be suitable for non-IM purposes where the
fully standard behaviour of XMPP is required.
From 4d3a3baacc121483e11f075e17a80c3c53da3053 Mon Sep 17 00:00:00 2001
From: Lance Stout
Date: Wed, 26 Aug 2015 13:28:21 -0700
Subject: [PATCH 044/106] Update XEP-0264 to allow non-cid URIs, and expand
scope
---
xep-0264.xml | 198 ++++++++++++++++++++++++++++-----------------------
1 file changed, 107 insertions(+), 91 deletions(-)
diff --git a/xep-0264.xml b/xep-0264.xml
index 7ca8722c..68684a6c 100644
--- a/xep-0264.xml
+++ b/xep-0264.xml
@@ -6,11 +6,11 @@
- File Transfer Thumbnails
- This specification defines a way for a client supply a preview image for a file transfer.
+ Jingle Content Thumbnails
+ This specification defines a way for a client to supply a preview image for Jingle content.
&LEGALNOTICE;
0264
- Deferred
+ Experimental
Standards Track
Standards
Council
@@ -28,6 +28,17 @@
ml@update.uu.se
mlundblad@jabber.org
+ &lance;
+
+ 0.4
+ 2015-08-26
+ ljts
+
+ Changed format to use generic 'uri' attribute to allow for 'https:' and 'http:' URIs in addition to BoB 'cid:' URIs.
+ Indicated that multiple thumbnails may be present.
+ Expanded scope of use cases to be Jingle content in general, not just file transfer.
+
+
0.3
2009-04-27
@@ -69,43 +80,15 @@ Added missing namespace on thumnail elements.
- The current methods for file transfers include basic meta data about the
-file being offered (name, size, and date). There currently is no way to provide an image thumbnail for files such as photos.
+ When offering a Jingle session, it can be helpful to provide a small preview of the offered content to help the session responder decide whether to accept or reject the session.
+ This is particularly useful for file transfer content (especially image files), but can also be used for things such as video (e.g. using a still frame from the stream as the preview thumbnail), and even audio by using a small image of album cover art.
- This documents defines a way to include a thumbnail image as an additional metadata in a file transfer.
+ This documents defines a way to include a thumbnail image as an additional metadata in a Jingle content description.
-
- When a client wishes to supply a thumbnail in a transfer offer, it can do so by including an extra ]]> element as shown in the following exaples.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ]]>
-
- The receiver MAY now request the data using the protocol defined in &xep0231;.
-
+ When a client wishes to supply a thumbnail in a content offer, it can do so by including an extra <thumbnail/> element as shown in the following example:
+
-
-
-
- This is a test. If this were a real file...
-
-
-
+
+
+ image/jpeg
+ image.jpg
+ 3032449
+ 552da749930852c69ae5d2141d3766b1
+ This is a test. If this were a real file...
+
+
- ...
+
-
-]]>
-
-
- The following attributes are defined for the <thumbnail/> element.
-
-
- Attribute
- Description
- Inclusion
-
-
- cid
- A Content-ID that can be mapped to a cid: URL as specified in &rfc2111;. The 'cid' value SHOULD be of the form algo+hash@bob.xmpp.org, where the "algo" is the hashing algorithm used (e.g., "sha1" for the SHA-1 algorithm as specified in &rfc3174;) and the "hash" is the hex output of the algorithm applied to the binary data itself.
- REQUIRED
-
-
- mime-type
- The value of the 'mime-type' attribute MUST match the syntax specified in &rfc2045;. That is, the value MUST include a top-level media type, the "/" character, and a subtype; in addition, it MAY include one or more optional parameters (e.g., the "audio/ogg" MIME type in the example shown below includes a "codecs" parameter as specified in &rfc4281;). The "type/subtype" string SHOULD be registered in the &ianamedia;, but MAY be an unregistered or yet-to-be-registered value.
- RECOMMENDED
-
-
- width
- The intended display width of the thumbnail image. Used as a hint for the receiving client to prepare i.e. a dialog window.
- OPTIONAL
-
-
- height
- The intended display height of the thumbnail image. Used as a hint for the receiving client to prepare i.e. a dialog window.
- OPTIONAL
-
-
+]]>
-
+ Thumbnails MAY be included for Jingle content other than file transfer. For example, with Jingle RTP video a thumbnail could be included to show who is calling (either by capturing a still frame from the input stream or by using an existing profile image):
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 128
+
+
+
+
+
+]]>
+
+ Multiple <thumbnail/> elements MAY be included to provide thumbnails of different sizes, media types, or URIs.
+
+ If the provided URI has the scheme 'cid', then the thumbnail data MAY be requested using &xep0231;.
+
+
+
+ The following attributes are defined for the <thumbnail/> element.
+
+
+ Attribute
+ Description
+ Inclusion
+
+
+ uri
+ A URI where the thumbnail data can be accessed (typically by using a URI scheme of 'cid:', 'https:', or 'http:'). If the URI scheme is 'cid:' then the identifier MUST refer to a bit of binary data as described in &xep0231;
+ REQUIRED
+
+
+ media-type
+ The value of the 'media-type' attribute MUST match the syntax specified in &rfc2045;. That is, the value MUST include a top-level media type, the "/" character, and a subtype; in addition, it MAY include one or more optional parameters. The "type/subtype" string SHOULD be registered in the &ianamedia;, but MAY be an unregistered or yet-to-be-registered value.
+ RECOMMENDED
+
+
+ width
+ The intended display width of the thumbnail image. Used as a hint for the receiving client to prepare the appropriate UI, such as a dialog window.
+ OPTIONAL
+
+
+ height
+ The intended display height of the thumbnail image. Used as a hint for the receiving client to prepare the appropriate UI, such as a dialog window.
+ OPTIONAL
+
+
The inclusion of an image thumbnail may leak information about a transfer
otherwise taking place on an e2e encrypted file transfer stream. A client MAY
wish to not include a thumbnail.
- A client MUST NOT rely on the values specified for the width and height of a thumbnail to allocate a bitmap data buffer for the thumbnail, to prevent possible DoS attacks. Also a client SHOULD apply implementation-specific limits on the thumbnails, if using these values to pepare a UI element for the thumbnail image, of f.ex. 128x128 pixels, values exceeding these would then be truncated and the thumbnail image scaled down when received.
+ A client MUST NOT rely on the values specified for the width and height of a thumbnail to allocate a bitmap data buffer for the thumbnail, to prevent possible DoS attacks. Also a client SHOULD apply implementation-specific limits on the thumbnails, if using these values to pepare a UI element for the thumbnail image, e.g. with dimensions of 128x128 pixels, values exceeding these would then be truncated and the thumbnail image scaled down when received.
This document requires no interaction with &IANA;.
@@ -183,7 +199,7 @@ wish to not include a thumbnail.
This specification defines the following XML namespace:
- - urn:xmpp:thumbs:0
+ - urn:xmpp:thumbs:1
The ®ISTRAR; includes this namespace in the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.
@@ -210,8 +226,8 @@ wish to not include a thumbnail.
-
-
+
+
From 7aa9a1979009e2cbbdcdfa635663c3f0daa76b9f Mon Sep 17 00:00:00 2001
From: "Matthew A. Miller"
Date: Thu, 27 Aug 2015 09:49:51 -0600
Subject: [PATCH 045/106] XEP-0363 v0.1 -- Advanced to Experimental
---
inbox/http-upload.xml => xep-0363.xml | 10 ++++++++--
xep.ent | 1 +
2 files changed, 9 insertions(+), 2 deletions(-)
rename inbox/http-upload.xml => xep-0363.xml (97%)
diff --git a/inbox/http-upload.xml b/xep-0363.xml
similarity index 97%
rename from inbox/http-upload.xml
rename to xep-0363.xml
index 8a24f2f5..aed6e4c0 100644
--- a/inbox/http-upload.xml
+++ b/xep-0363.xml
@@ -9,8 +9,8 @@
HTTP File Upload
This specification defines a protocol to request permissions from another entity to upload a file to a specific path on an HTTP server and at the same time receive a URL from which that file can later be downloaded again.
&LEGALNOTICE;
- xxxx
- ProtoXEP
+ 0363
+ Experimental
Standards Track
Standards
Council
@@ -28,6 +28,12 @@
daniel@gultsch.de
daniel@gultsch.de
+
+ 0.1
+ 2015-08-27
+ XEP Editor (mam)
+ Initial published version approved by the XMPP Council.
+
0.0.1
2015-07-25
diff --git a/xep.ent b/xep.ent
index 9b7c2aaf..6bcb4544 100644
--- a/xep.ent
+++ b/xep.ent
@@ -1345,3 +1345,4 @@ IANA Service Location Protocol, Version 2 (SLPv2) Templates
Nonzas (are not Stanzas) (XEP-0360) XEP-0360: Nonzas (are not Stanzas) <http://xmpp.org/extensions/xep-0360.html>. " >
Zero Handshake Server to Server Protocol (XEP-0361) XEP-0361: Zero Handshake Server to Server Protocol <http://xmpp.org/extensions/xep-0361.html>. " >
Raft over XMPP (XEP-0362) XEP-0362: Raft over XMPP <http://xmpp.org/extensions/xep-0362.html>. " >
+HTTP File Upload (XEP-0363) XEP-0363: HTTP File Upload <http://xmpp.org/extensions/xep-0363.html>. " >
From 36bc44599796124358c9580c966af44afe2bc606 Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Wed, 26 Aug 2015 11:17:20 -0500
Subject: [PATCH 046/106] Fix otr-info construction section
Remove unclear opinion from the security section
---
inbox/otr-info.xml | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/inbox/otr-info.xml b/inbox/otr-info.xml
index 3fcce5f1..544accc5 100644
--- a/inbox/otr-info.xml
+++ b/inbox/otr-info.xml
@@ -147,14 +147,10 @@
- When sending a message encrypted with OTR, it is RECOMMENDED to encrypt
- only the text node of the <body/> element (the message itself).
- However, there are some clients in the wild which will encrypt the entire
- contents of the <body/> element, including sub-nodes. Because of
- this behavior, it is RECOMMENDED that clients decrypt and expand any OTR
- messages inside of the body element before re-processing the element as a
- whole. Clients that support OTR MUST tolerate encrypted payloads which
- expand to XML, and those which expand to plain text messages.
+ Some clients in the wild have been known to insert XML in the
+ <body> node of a message. Clients that support OTR should tolerate
+ encrypted payloads which expand to unescaped XML, and treat it as plain
+ text.
@@ -270,10 +266,8 @@ xmpp:feste@allfools.lit?otr-fingerprint=AEA4D503298797D4A4FC823BC1D24524B4C54338
https://www.schneier.com/blog/archives/2012/10/when_will_we_se.html
>
.
- This puts generating SHA-1 collisions well within the reach of governments
- and well funded criminal organizations. In this authors opinion, there are
- no theoretical vulnerabilities, and SHA-1 should be treated with extreme
- caution.
+ This puts generating SHA-1 collisions well within the reach of governments,
+ malicious organizations, and even well-funded individuals.
From ae5618890dd1e78c4b8b7746e09c9fe2039400fc Mon Sep 17 00:00:00 2001
From: "Matthew A. Miller"
Date: Thu, 27 Aug 2015 10:19:12 -0600
Subject: [PATCH 047/106] XEP-0364 v0.1 - Advance to Experimental
---
inbox/otr-info.xml => xep-0364.xml | 10 ++++++++--
xep.ent | 1 +
2 files changed, 9 insertions(+), 2 deletions(-)
rename inbox/otr-info.xml => xep-0364.xml (97%)
diff --git a/inbox/otr-info.xml b/xep-0364.xml
similarity index 97%
rename from inbox/otr-info.xml
rename to xep-0364.xml
index 544accc5..3baa7ca9 100644
--- a/inbox/otr-info.xml
+++ b/xep-0364.xml
@@ -13,8 +13,8 @@
end user experience.
&LEGALNOTICE;
- xxxx
- ProtoXEP
+ 0364
+ Experimental
Informational
Standards
Council
@@ -30,6 +30,12 @@
sam@samwhited.com
sam@samwhited.com
+
+ 0.1
+ 2015-08-27
+ XEP Editor (mam)
+ Initial published version approved by the XMPP Council.
+
0.0.1
2015-07-28
diff --git a/xep.ent b/xep.ent
index 6bcb4544..09426a06 100644
--- a/xep.ent
+++ b/xep.ent
@@ -1346,3 +1346,4 @@ IANA Service Location Protocol, Version 2 (SLPv2) Templates
Zero Handshake Server to Server Protocol (XEP-0361) XEP-0361: Zero Handshake Server to Server Protocol <http://xmpp.org/extensions/xep-0361.html>. " >
Raft over XMPP (XEP-0362) XEP-0362: Raft over XMPP <http://xmpp.org/extensions/xep-0362.html>. " >
HTTP File Upload (XEP-0363) XEP-0363: HTTP File Upload <http://xmpp.org/extensions/xep-0363.html>. " >
+Current Off-the-Record Messaging Usage (XEP-0364) XEP-0364: Current Off-the-Record Messaging Usage <http://xmpp.org/extensions/xep-0364.html>. " >
From bcefb30da6c166c438d40b462162d7325e4ac2ff Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Tue, 25 Aug 2015 18:31:22 -0500
Subject: [PATCH 048/106] Add initial draft of Entity Versioning.
---
inbox/entityversioning.xml | 404 +++++++++++++++++++++++++++++++++++++
1 file changed, 404 insertions(+)
create mode 100644 inbox/entityversioning.xml
diff --git a/inbox/entityversioning.xml b/inbox/entityversioning.xml
new file mode 100644
index 00000000..a895be2c
--- /dev/null
+++ b/inbox/entityversioning.xml
@@ -0,0 +1,404 @@
+
+
+%ents;
+]>
+
+
+
+ Entity Versioning
+
+ A method by which rosters and disco items may be versioned so that servers
+ will not need to send the entire list if it has not been modified, saving
+ bandwidth and time during session initialization with minimal state being
+ stored by the server and client.
+
+ &LEGALNOTICE;
+ xxxx
+ ProtoXEP
+ Standards Track
+ Standards
+ Council
+
+ RFC 6120
+ RFC 6121
+
+
+
+ EV
+
+ Sam
+ Whited
+ swhited@atlassian.com
+ sam@samwhited.com
+
+
+ Doug
+ Keen
+ dkeen@atlassian.com
+
+
+ 0.0.1
+ 2015-08-25
+ ssw
+ First draft
+
+
+
+
+
+ This problem of "downloading the world" (downloading the entire roster
+ every time a session is initialized) was partially addressed by &xep0237;
+ which was later merged into &rfc6121; §2.6. While this solved the problem
+ for the roster, it didn't account for other entities (eg. MUC
+ disco#items). Furthermore, roster versioning requires that the server
+ maintain a great deal of state (multiple versions of the roster) which can
+ be difficult to implement in a large, distributed system. This XEP defines
+ a method by which entities other than the roster can be versioned and
+ cached.
+
+
+
+
+
+ -
+ An extra round trip MUST NOT be required to initiate entity versioning.
+
+ -
+ Clients that do not implement the protocol (but which use servers that
+ do) MUST still be able to request and receive entities normally.
+
+ -
+ Servers which implement this protocol MUST NOT be required to store
+ multiple versions of an entity list or maintain other redundant state.
+
+ -
+ Inconsistant state between servers in a cluster should not cause cache
+ invalidation for the entire entity list.
+
+ -
+ Large changes SHOULD NOT be required for existing servers / clients.
+
+
+
+
+
+
+ - Aggregate Token
+ -
+ A hash which represents the state of a list of entities, and changes if
+ any of those entities changes.
+
+ - Versioned Entity
+ - Any abstract object which may be versioned (eg. rooms, users).
+ - Version Token
+ -
+ A generally short, case sensitive string which represents an entity and
+ changes if that entity changes.
+
+
+
+
+
+
+
+ -
+ A client on a mobile device where bandwidth and throughput are limited
+ has a very large roster which cause connections to take an unacceptable
+ amount of time. With entity versioning, connections after the first
+ connection do not take as long, and use less bandwidth.
+
+ -
+ A client often wants to view the list of multi-user chat rooms
+ available on a servers MUC service. However, the list is very long and
+ takes a long time to download. After enabling entity versioning the
+ client can fetch the list, and then poll for changes at a later date
+ without re-requesting the entire list.
+
+
+
+
+
+ -
+ A server is running in an environment where storing multiple versions
+ of each users roster may put too much pressure on the storage backend.
+ After enabling entity versioning, they only have to store a small token
+ per user and can calculate the diffs to send to the client afterwards.
+
+ -
+ A server maintains an out-of-band HTTP API for fetching information
+ about MUC rooms to display on their web page. They wish to use a
+ reverse proxy to cache API requests based on etags. Instead of
+ attempting to check if the backend page has changed and generate etags,
+ the room's entity version token is used as a weakly-validated ETag.
+
+
+
+
+
+
+
+
+ If a server supports entity versioning, it MUST inform the connecting
+ client when returning stream features during the stream negotiation
+ process. This is done by including a <ver/> element, qualified by
+ the 'urn:xmpp:features:entityver:0' namespace. At the latest, this SHOULD
+ be done when informing a client that resource binding is required. For
+ example:
+
+
+
+
+
+
+
+ ]]>
+
+ The entity versioning stream feature is merely informative and therefore
+ is never mandatory-to-negotiate.
+
+
+
+
+
+ Version tokens are short case-sensitive strings which are generated by
+ the server. Their format is not defined in this spec, but a
+ recommendation may be found in the Implementation Notes. Version tokens
+ are akin to a weakly-validated etag for the entity in question.
+
+
+ Servers that implement this protocol must assign such a version token to
+ each entity that is controlled by the server. The server MUST then update
+ this version every time any mutable property of the entity changes (eg.
+ when the subscription status of a user changes). The server MAY choose to
+ update this token at any time (to force the clients to invalidate their
+ cached representation fo the object). This version token MUST then be
+ included with every object representation of that entity sent down in the
+ stream. This is done by including a sub-node called "version" qualified
+ by the entity versioning XML namespace defined in this document.
+ Similarly, clients MAY also add version nodes for each version token they
+ possess to the request for a list (not specifying a version token will
+ force the server to send information on that entity to the client). If a
+ server sends up a list of version tokens, the server MUST then check to
+ see if those tokens correspond to any entity which it knows about, and
+ not send down any entities with matching version tokens in the response.
+
+ For example, a roster request might look like:
+
+
+
+ -
+
25P2A7H8
+
+ -
+
VIZSVF0D
+
+
+
+
+
+
+
+ 9ZFZXVP9
+
+
+
+ ]]>
+
+ Note that in this case there may be three roster items total (and the
+ client only knows about two of them), or there may be two total roster
+ items and the server is informing the client about a change to
+ "bill@shakespeare.lit". Version tokens MUST also be present in roster
+ pushes:
+
+
+
+
+ - XWE4MUUP
+
+
+
+ ]]>
+ A disco request for rooms (as defined in &xep0045;) might look like:
+
+
+
+ 25P2A7H8
+
+ -
+
4OLGSVNY
+
+
+
+
+
+
+
+ -
+
VIZSVF0D
+
+
+
+ ]]>
+
+ In this example coven@chat.shakespeare.lit has been modified (eg. the
+ room name might have been changed), but inverness@chat.shakespeare.lit
+ has not changed, therefore no update is sent down.
+
+
+ Clients that implement this protocol SHOULD then cache the entity in
+ question when a version token is received.
+
+
+
+
+ While the version token approach to caching does not require a great deal
+ of state to be stored on the client or the server, it does require a lot
+ more information to be sent by the client when requesting a list of
+ entities. For a very large list which is not likely to have changed, it may
+ be useful know in advance if the roster has changed or not (so that we can
+ avoid sending the large request entirely). To do this, we can request an
+ aggregate version token from the server. This aggregate token is calculated
+ by constructing a string of comma separated "bare JID:version" pairs sorted
+ in byte-wise order, and taking the MD5 hash of the constructed string. For
+ example, if the server is calculating the aggregate version token for a
+ roster, it might end up with the following string:
+
+
+
+ Which results in the aggregate token:
+
+
+
+ The actual request is an IQ sent to the server, or entity handling the
+ versioned list which contains a query that specifies the namespace of the
+ list we want to fetch. Eg. to fetch the aggregate token for the roster one
+ would query the server:
+
+
+
+
+
+
+
+
+
+ 0514fc90e6c7981b06bbb2173bb8ef03
+
+
+ ]]>
+
+ Similarly, to fetch the aggregate token for a list of MUC rooms, one would
+ query the MUC component directly:
+
+
+
+
+
+
+
+
+
+ 32151d1d01440d5536a7f106afd3f4d8
+
+
+ ]]>
+
+ Because aggregate tokens are OPTIONAL to implement, clients MUST fall back
+ to a normal request if any error is returned in response to an aggregate
+ token IQ.
+
+
+ Clients are also NOT REQUIRED to check aggregate tokens. However, clients
+ MAY wish to check aggregate tokens before making a roster or MUC request
+ when the cached roster or MUC list is very large. When to check aggregate
+ tokens is left up to the clients.
+
+
+
+
+
+
+ Version tokens may not provide enough collision resistance across versioned
+ entities (hereafter simply called "entities"), and may vary from server to
+ server, and therefore they MUST NOT be used as an entity identifier.
+
+
+ Version tokens SHOULD always be considered opaque to the client (eg. even
+ if the version token is a derivable and consistant hash on the server side,
+ clients should not need to know how the server is calculating the token).
+
+
+ The author RECOMMENDS using 8 character (32-bit) random alphanumeric ASCII
+ strings (eg. AABd7z9T) for version tokens.
+
+
+ If a server which supports this XEP provides an HTTP API which can be used
+ to fetch information about entities (eg. for listing information about MUC
+ rooms that a server provides on the providers web page), the entities
+ version token MAY be used as a weakly validated ETag for any API requests
+ for that entity.
+
+
+
+
+
+ Client-side caching of entity information across sessions (rather than
+ holding them in memory only for the life of a session) could pose a privacy
+ risk, especially on shared systems. Implementations SHOULD protect cached
+ entity data with strong encryption or other appropriate means.
+
+
+
+
+ This document requires no interaction with &IANA;.
+
+
+
+
+ This specification defines the following XML namespace:
+
+ - urn:xmpp:features:entityver:0
+
+
+ Upon advancement of this specification from a status of Experimental to a
+ status of Draft, the ®ISTRAR; shall add the foregoing namespace to the
+ registry located at &STREAMFEATURES;, as described in Section 4 of
+ &xep0053;.
+
+
+
+
+
+TODO
+
+
+
+
+ The original entity versioning proposal was engineered and written by
+ HipChat's Doug Keen.
+
+
+
+
From d6b3f54e00e4d81e2f0771a4b0cfc90c826e6e3b Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Thu, 27 Aug 2015 08:56:37 -0500
Subject: [PATCH 049/106] Remove :features: from namespace
---
inbox/entityversioning.xml | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/inbox/entityversioning.xml b/inbox/entityversioning.xml
index a895be2c..16dec0d4 100644
--- a/inbox/entityversioning.xml
+++ b/inbox/entityversioning.xml
@@ -142,7 +142,7 @@
If a server supports entity versioning, it MUST inform the connecting
client when returning stream features during the stream negotiation
process. This is done by including a <ver/> element, qualified by
- the 'urn:xmpp:features:entityver:0' namespace. At the latest, this SHOULD
+ the 'urn:xmpp:entityver:0' namespace. At the latest, this SHOULD
be done when informing a client that resource binding is required. For
example:
@@ -151,7 +151,7 @@
-
+
]]>
@@ -190,10 +190,10 @@
-
-
25P2A7H8
+ 25P2A7H8
-
-
VIZSVF0D
+ VIZSVF0D
@@ -202,7 +202,7 @@
- 9ZFZXVP9
+ 9ZFZXVP9
@@ -219,7 +219,7 @@
- XWE4MUUP
+
XWE4MUUP
@@ -233,10 +233,10 @@
type='get'>
- 25P2A7H8
+ 25P2A7H8
-
-
4OLGSVNY
+ 4OLGSVNY
@@ -249,7 +249,7 @@
-
-
VIZSVF0D
+ VIZSVF0D
@@ -297,12 +297,12 @@ anne@shakespeare.lit:VIZSVF0D,bill@shakespeare.lit:25P2A7H8
-
+
-
+
0514fc90e6c7981b06bbb2173bb8ef03
@@ -314,12 +314,12 @@ anne@shakespeare.lit:VIZSVF0D,bill@shakespeare.lit:25P2A7H8
-
+
-
+
32151d1d01440d5536a7f106afd3f4d8
@@ -379,7 +379,7 @@ anne@shakespeare.lit:VIZSVF0D,bill@shakespeare.lit:25P2A7H8
This specification defines the following XML namespace:
- - urn:xmpp:features:entityver:0
+ - urn:xmpp:entityver:0
Upon advancement of this specification from a status of Experimental to a
From b3725e2cf9070cd750bd025bea46da13e433a403 Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Thu, 27 Aug 2015 16:22:55 -0500
Subject: [PATCH 050/106] Add a use case to entity versioning
Also:
Minor typo and wording fixes
Fix broken example XML
More tabbing fixes
---
inbox/entityversioning.xml | 36 ++++++++++++++++++++----------------
1 file changed, 20 insertions(+), 16 deletions(-)
diff --git a/inbox/entityversioning.xml b/inbox/entityversioning.xml
index 16dec0d4..45451591 100644
--- a/inbox/entityversioning.xml
+++ b/inbox/entityversioning.xml
@@ -50,12 +50,11 @@
This problem of "downloading the world" (downloading the entire roster
every time a session is initialized) was partially addressed by &xep0237;
which was later merged into &rfc6121; §2.6. While this solved the problem
- for the roster, it didn't account for other entities (eg. MUC
- disco#items). Furthermore, roster versioning requires that the server
- maintain a great deal of state (multiple versions of the roster) which can
- be difficult to implement in a large, distributed system. This XEP defines
- a method by which entities other than the roster can be versioned and
- cached.
+ for the roster, it didn't account for other entities (eg. disco items).
+ Furthermore, roster versioning requires that the server maintain a great
+ deal of state (multiple versions of the roster) which can be difficult to
+ implement in a large, distributed system. This XEP defines a method by
+ which entities other than the roster can be versioned and cached.
@@ -115,6 +114,11 @@
client can fetch the list, and then poll for changes at a later date
without re-requesting the entire list.
+
+ A client wishes to cache the features supported by servers of the
+ contacts in their roster since their disco items is not likely to
+ change often.
+
@@ -200,11 +204,11 @@
-
+
+ -
9ZFZXVP9
-
-
+
+
]]>
@@ -218,7 +222,7 @@
- -
XWE4MUUP
@@ -243,13 +247,13 @@
+ id='zb8q41fas6yn4'
+ to='hag66@shakespeare.lit/phone'
+ type='result'>
-
-
VIZSVF0D
+ VIZSVF0D
@@ -346,7 +350,7 @@ anne@shakespeare.lit:VIZSVF0D,bill@shakespeare.lit:25P2A7H8
Version tokens SHOULD always be considered opaque to the client (eg. even
- if the version token is a derivable and consistant hash on the server side,
+ if the version token is a derivable and consistent hash on the server side,
clients should not need to know how the server is calculating the token).
From 81cefd2e889673586b168ec66436d5d284ab8736 Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Sat, 29 Aug 2015 15:03:50 -0500
Subject: [PATCH 051/106] Initial draft of OTR disco
---
inbox/otrdisco.xml | 107 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 107 insertions(+)
create mode 100644 inbox/otrdisco.xml
diff --git a/inbox/otrdisco.xml b/inbox/otrdisco.xml
new file mode 100644
index 00000000..be091d1e
--- /dev/null
+++ b/inbox/otrdisco.xml
@@ -0,0 +1,107 @@
+
+
+%ents;
+]>
+
+
+
+ OTR Discovery
+
+ This document provides a mechanism by which OTR encryption support can be
+ discovered in XMPP, without relying on OTRs protocol agnostic discovery
+ mechanism.
+
+ &LEGALNOTICE;
+ xxxx
+ ProtoXEP
+ Standards Track
+ Standards
+ Council
+
+ XMPP Core
+ XEP-0030
+
+
+
+ NOT_YET_ASSIGNED
+
+ Sam
+ Whited
+ sam@samwhited.com
+ sam@samwhited.com
+
+
+ 0.0.1
+ 2015-08-29
+ ssw
+ Initial draft.
+
+
+
+
+ The Off-the-Record messaging protocol (OTR) is widely layered on top of
+ XMPP to provide end-to-end encryption. Current use of the protocol is
+ described in &xep0364;. OTR provides its own discovery mechanism in which
+ it sends messages with special whitespace characters to indicate support.
+ While this works when initializing a session, there is no way to query a
+ client for support and to know in advance that a particular version of
+ OTR is supported. This XEP provides a mechanism for discovering OTR
+ support at the XMPP level. This specification aims to solve that by
+ providing an in-band mechanism for discovering OTR support in XMPP.
+
+
+ It should be noted that newer, more secure encryption protocols exist for
+ XMPP, and that new implementations of OTR are discouraged. This protocol
+ is primarily intended to solve issues with existing implementations of
+ OTR.
+
+
+
+
+ If an entity supports OTR it MUST advertise the fact by returning a
+ feature of 'urn:xmpp:otr:0' &VNOTE; in response to a &xep0030;
+ information request. It MUST also include '<version>' elements for
+ each version of the OTR protocol that is supported. Eg. an entity which
+ supports OTR versions 2 and 3 might include the following feature in its
+ disco info list:
+
+
+ 2
+ 3
+
+ ]]>
+
+
+
+
+ Because OTR support is advertised outside of any end-to-end encrypted
+ stream, it may be subject to downgrade attacks (eg. the server operator
+ may remove one or more versions of OTR from the list).
+
+
+
+
+ This document requires no interaction with the Internet Assigned Numbers
+ Authority (IANA).
+
+
+
+ This specification defines the following XML namespaces:
+
+ - urn:xmpp:otr:0
+
+
+ The ®ISTRAR; shall include the foregoing namespaces in its disco
+ features registry as defined in &xep0030;.
+
+ urn:xmpp:otr:0
+ Indicates support for Off-the-Record Messaging (OTR)
+ XEP-xxxx
+
+ ]]>
+
+
+
From 50e058ee0312b832c8ae45930fe7f935b1031477 Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Sun, 30 Aug 2015 11:05:33 -0500
Subject: [PATCH 052/106] Support OTRv3 only and remove feature subelements
---
inbox/otrdisco.xml | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/inbox/otrdisco.xml b/inbox/otrdisco.xml
index be091d1e..d9dd19b5 100644
--- a/inbox/otrdisco.xml
+++ b/inbox/otrdisco.xml
@@ -61,18 +61,24 @@
If an entity supports OTR it MUST advertise the fact by returning a
feature of 'urn:xmpp:otr:0' &VNOTE; in response to a &xep0030;
- information request. It MUST also include '<version>' elements for
- each version of the OTR protocol that is supported. Eg. an entity which
- supports OTR versions 2 and 3 might include the following feature in its
- disco info list:
-
+ information request. This indicates support for OTRv3 as defined by
+
+ Off-the-Record Messaging Protocol version 3
+
+
+ (Accessed 2015-08-30). "Off-the-Record Messaging Protocol version 3"
+ <
+ https://otr.cypherpunks.ca/Protocol-v3-4.0.0.html
+ >
+ .
- 2
- 3
-
+
]]>
+
+ If older versions of OTR are required, they may be discovered out of band
+ using OTRs built in mechanism which is beyond the scope of this document.
+
From 7d8b386dd5e4dc58da3872fb738af7a8c9904be8 Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Sun, 30 Aug 2015 11:12:56 -0500
Subject: [PATCH 053/106] Update registrar submission
---
inbox/otrdisco.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/inbox/otrdisco.xml b/inbox/otrdisco.xml
index d9dd19b5..27555167 100644
--- a/inbox/otrdisco.xml
+++ b/inbox/otrdisco.xml
@@ -104,7 +104,7 @@
urn:xmpp:otr:0
- Indicates support for Off-the-Record Messaging (OTR)
+ Indicates support for Off-the-Record Messaging (OTR) version 3
XEP-xxxx
]]>
From b867a4d5682f9c3bb17a7a0fd20092e3f11d4cc3 Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Sun, 30 Aug 2015 11:21:46 -0500
Subject: [PATCH 054/106] Remove redundant sentence
---
inbox/otrdisco.xml | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/inbox/otrdisco.xml b/inbox/otrdisco.xml
index 27555167..802fa2a8 100644
--- a/inbox/otrdisco.xml
+++ b/inbox/otrdisco.xml
@@ -46,9 +46,8 @@
it sends messages with special whitespace characters to indicate support.
While this works when initializing a session, there is no way to query a
client for support and to know in advance that a particular version of
- OTR is supported. This XEP provides a mechanism for discovering OTR
- support at the XMPP level. This specification aims to solve that by
- providing an in-band mechanism for discovering OTR support in XMPP.
+ OTR is supported. This specification aims to solve that by providing an
+ in-band mechanism for discovering OTR support in XMPP.
It should be noted that newer, more secure encryption protocols exist for
From 796a7a4d94810674898b9d9d9ce4c4665e5d148c Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Mon, 31 Aug 2015 20:41:35 -0500
Subject: [PATCH 055/106] Update OTR Disco's security section
---
inbox/otrdisco.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/inbox/otrdisco.xml b/inbox/otrdisco.xml
index 802fa2a8..ed9d2135 100644
--- a/inbox/otrdisco.xml
+++ b/inbox/otrdisco.xml
@@ -83,7 +83,7 @@
Because OTR support is advertised outside of any end-to-end encrypted
stream, it may be subject to downgrade attacks (eg. the server operator
- may remove one or more versions of OTR from the list).
+ may remove OTR from the features list).
From f7eb0a8a8ca8d442f9869ac79b0086a2e17b6939 Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Tue, 1 Sep 2015 19:54:32 -0500
Subject: [PATCH 056/106] Add cache invalidation to entity versioning
---
inbox/entityversioning.xml | 55 +++++++++++++++++++++++++++++++++++---
1 file changed, 52 insertions(+), 3 deletions(-)
diff --git a/inbox/entityversioning.xml b/inbox/entityversioning.xml
index 45451591..8546d25a 100644
--- a/inbox/entityversioning.xml
+++ b/inbox/entityversioning.xml
@@ -52,9 +52,13 @@
which was later merged into &rfc6121; §2.6. While this solved the problem
for the roster, it didn't account for other entities (eg. disco items).
Furthermore, roster versioning requires that the server maintain a great
- deal of state (multiple versions of the roster) which can be difficult to
- implement in a large, distributed system. This XEP defines a method by
- which entities other than the roster can be versioned and cached.
+ deal of state (roster items which should be pushed for each entity on
+ reconnect, or monotonically increasing counters, etc.) which can be
+ difficult to store or synchronize in a large, distributed system. This XEP
+ defines a method by which the roster and entities other than the roster can
+ be versioned and cached, and which is optimized for distributed systems
+ with large enity lists (but works equally well on small, single server
+ deployments).
@@ -268,6 +272,51 @@
question when a version token is received.
+
+
+ When a client syncs with the server and indicates that it has a version
+ token in its cache that does not match any entity on the server (or when
+ the server wants to remove an entity from the clients cache for any other
+ reason), the server MUST reply with an empty <version/> node. When
+ the client receives such an empty version node it SHOULD purge the entity
+ from its cache. For example, the following exchange would trigger the
+ removal of 'inverness@chat.shakespeare.lit' from the cached MUC list:
+
+
+
+
+ 25P2A7H8
+
+ -
+
4OLGSVNY
+
+
+
+
+
+
+
+ -
+
+
+
+
+ ]]>
+
+
+ If the client receives an indication that it should delete an item from a
+ list by any other means (eg. via a roster push), it SHOULD remove the
+ version token associated with that entity from its cache.
+
+
While the version token approach to caching does not require a great deal
From 8c40f321721c811da24b7bbf72d2b5cea190f227 Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Wed, 2 Sep 2015 19:55:22 -0500
Subject: [PATCH 057/106] Address some feedback on entity versioning
---
inbox/entityversioning.xml | 192 +++++++++++++++++++------------------
1 file changed, 100 insertions(+), 92 deletions(-)
diff --git a/inbox/entityversioning.xml b/inbox/entityversioning.xml
index 8546d25a..a0d77cab 100644
--- a/inbox/entityversioning.xml
+++ b/inbox/entityversioning.xml
@@ -144,8 +144,7 @@
-
-
+
If a server supports entity versioning, it MUST inform the connecting
client when returning stream features during the stream negotiation
@@ -166,34 +165,34 @@
The entity versioning stream feature is merely informative and therefore
is never mandatory-to-negotiate.
-
+
-
-
- Version tokens are short case-sensitive strings which are generated by
- the server. Their format is not defined in this spec, but a
- recommendation may be found in the Implementation Notes. Version tokens
- are akin to a weakly-validated etag for the entity in question.
-
-
- Servers that implement this protocol must assign such a version token to
- each entity that is controlled by the server. The server MUST then update
- this version every time any mutable property of the entity changes (eg.
- when the subscription status of a user changes). The server MAY choose to
- update this token at any time (to force the clients to invalidate their
- cached representation fo the object). This version token MUST then be
- included with every object representation of that entity sent down in the
- stream. This is done by including a sub-node called "version" qualified
- by the entity versioning XML namespace defined in this document.
- Similarly, clients MAY also add version nodes for each version token they
- possess to the request for a list (not specifying a version token will
- force the server to send information on that entity to the client). If a
- server sends up a list of version tokens, the server MUST then check to
- see if those tokens correspond to any entity which it knows about, and
- not send down any entities with matching version tokens in the response.
-
- For example, a roster request might look like:
-
+
+ Version tokens are short case-sensitive strings which are generated by the
+ server. Their format is not defined in this spec, but a recommendation may
+ be found in the Implementation Notes. Version
+ tokens are akin to a weakly-validated etag for the entity in question.
+
+
+ Servers that implement this protocol must assign such a version token to
+ each entity that is controlled by the server. The server MUST then update
+ this version every time any mutable property of the entity changes (eg.
+ when the subscription status of a user changes). The server MAY choose to
+ update this token at any time (to force the clients to invalidate their
+ cached representation fo the object). This version token MUST then be
+ included with every object representation of that entity sent down in the
+ stream. This is done by including a sub-node called "version" qualified
+ by the entity versioning XML namespace defined in this document.
+ Similarly, clients MAY also add version nodes for each version token they
+ possess to the request for a list (not specifying a version token will
+ force the server to send information on that entity to the client). If a
+ server sends up a list of version tokens, the server MUST then check to
+ see if those tokens correspond to any entity which it knows about, and
+ not send down any entities with matching version tokens in the response.
+
+ For example, a roster request might look like:
+
@@ -271,53 +270,54 @@
Clients that implement this protocol SHOULD then cache the entity in
question when a version token is received.
-
-
-
- When a client syncs with the server and indicates that it has a version
- token in its cache that does not match any entity on the server (or when
- the server wants to remove an entity from the clients cache for any other
- reason), the server MUST reply with an empty <version/> node. When
- the client receives such an empty version node it SHOULD purge the entity
- from its cache. For example, the following exchange would trigger the
- removal of 'inverness@chat.shakespeare.lit' from the cached MUC list:
-
-
+
+ When a client syncs with the server and indicates that it has a version
+ token in its cache that does not match any entity on the server (or when
+ the server wants to remove an entity from the clients cache for any other
+ reason), the server MUST reply with an empty <version/> node. When
+ the client receives such an empty version node it SHOULD purge the entity
+ from its cache. For example, the following exchange would trigger the
+ removal of 'inverness@chat.shakespeare.lit' from the cached MUC list:
+
+
+
+
+ 25P2A7H8
+
+ -
+
4OLGSVNY
+
+
+
+
+
+
-
- 25P2A7H8
-
- -
-
4OLGSVNY
-
-
-
-
-
-
-
- -
-
-
-
-
- ]]>
-
-
- If the client receives an indication that it should delete an item from a
- list by any other means (eg. via a roster push), it SHOULD remove the
- version token associated with that entity from its cache.
-
-
-
+ to='hag66@shakespeare.lit/phone'
+ type='result'>
+
+ -
+
+
+
+
+ ]]>
+
+
+ If the client receives an indication that it should delete an item from a
+ list by any other means (eg. via a roster push), it SHOULD remove the
+ version token associated with that entity from its cache.
+
+
+
+
While the version token approach to caching does not require a great deal
of state to be stored on the client or the server, it does require a lot
@@ -327,9 +327,11 @@
avoid sending the large request entirely). To do this, we can request an
aggregate version token from the server. This aggregate token is calculated
by constructing a string of comma separated "bare JID:version" pairs sorted
- in byte-wise order, and taking the MD5 hash of the constructed string. For
- example, if the server is calculating the aggregate version token for a
- roster, it might end up with the following string:
+ in byte-wise order (because the JID:version pair is constructed before
+ sorting, if two items in the list have the same JID they can still be
+ sorted by the version token), and taking the MD5 hash of the constructed
+ string. For example, if the server is calculating the aggregate version
+ token for a roster, it might end up with the following string:
+
+
+
-
-
-
-
-
-
-
-
- 0514fc90e6c7981b06bbb2173bb8ef03
-
-
+
+
+
+ 0514fc90e6c7981b06bbb2173bb8ef03
+
+
]]>
Similarly, to fetch the aggregate token for a list of MUC rooms, one would
- query the MUC component directly:
+ query the MUC component directly with the type set to the 'disco#items'
+ namespace:
@@ -382,13 +385,18 @@ anne@shakespeare.lit:VIZSVF0D,bill@shakespeare.lit:25P2A7H8
to a normal request if any error is returned in response to an aggregate
token IQ.
+
+ If an aggregate token is requested for a list that may contain more than
+ one type of entity (eg. MUC rooms and pubsub nodes that live on the same
+ component), then the server MUST return the aggregate token constructed
+ with the entire list (rooms and pubsub nodes).
+
Clients are also NOT REQUIRED to check aggregate tokens. However, clients
MAY wish to check aggregate tokens before making a roster or MUC request
when the cached roster or MUC list is very large. When to check aggregate
- tokens is left up to the clients.
+ tokens (if at all) is left up to the implementation.
-
From e22172cf39bd9ccfe2e74d9d8e578a96a9240a5e Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Wed, 2 Sep 2015 22:22:03 -0500
Subject: [PATCH 058/106] Fix reference to bare JIDs
---
inbox/entityversioning.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/inbox/entityversioning.xml b/inbox/entityversioning.xml
index a0d77cab..5ac781ac 100644
--- a/inbox/entityversioning.xml
+++ b/inbox/entityversioning.xml
@@ -326,8 +326,8 @@
be useful know in advance if the roster has changed or not (so that we can
avoid sending the large request entirely). To do this, we can request an
aggregate version token from the server. This aggregate token is calculated
- by constructing a string of comma separated "bare JID:version" pairs sorted
- in byte-wise order (because the JID:version pair is constructed before
+ by constructing a string of comma separated "JID:version" pairs sorted in
+ byte-wise order (because the JID:version pair is constructed before
sorting, if two items in the list have the same JID they can still be
sorted by the version token), and taking the MD5 hash of the constructed
string. For example, if the server is calculating the aggregate version
From 0f40c2266831dab0a89da1fad15b8801fa0acf52 Mon Sep 17 00:00:00 2001
From: Daniel Gultsch
Date: Tue, 1 Sep 2015 16:44:05 +0200
Subject: [PATCH 059/106] clarify the no-storage/no-store confusion in XEP-0334
and add a new hint to always store message the message hints XEP confusingly
talks about no-storage and no-permanent-storage in one place even though
no-store was meant added a new message hint to ask the server to store
messages even though they do not contain a body. like encrypted messages
---
xep-0334.xml | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/xep-0334.xml b/xep-0334.xml
index 8183b751..1f381f0f 100644
--- a/xep-0334.xml
+++ b/xep-0334.xml
@@ -21,6 +21,15 @@
NOT_YET_ASSIGNED
&mwild;
+
+ 0.2
+ 2015-09-01
+ dg
+
+ Fixed the wrong use of no-storage instead of no-store
+ Added a message hint <store/>
+
+
0.1
2013-07-11
@@ -45,6 +54,7 @@
- Whether to store a message (e.g. for archival or as an 'offline message').
- Whether to copy a message to other resources.
+ - Whether to store a message that would not have been stored under normal conditions
@@ -74,16 +84,19 @@
recipient is offline at the time of sending). Such a message can be marked with the <no-permanent-store/> hint.
+
+ Offline storage and &xep0313; can define their own rules on what messages to store and usually only store messages that contain a body element. However a sender may want to indicate that a message is worth storeing even though it might not match those rules (e.g. an encrypted message that carries the payload outside the body element). Such a message can be marked with a <store/> hint.
+
-
- The <no-permanent-storage/> hint informs entities that they shouldn't store the message in
+
+ The <no-permanent-store/> hint informs entities that they shouldn't store the message in
any permanent or semi-permanent public or private archive (such as described in &xep0136; and &xep0313;)
or in logs (such as chatroom logs).
-
- A message containing a <no-storage/> hint should not be stored by a server either permanently (as above)
+
+ A message containing a <no-store/> hint should not be stored by a server either permanently (as above)
or temporarily, e.g. for later delivery to an offline client, or to users not currently present in a chatroom.
@@ -95,6 +108,9 @@
occupants in a &xep0045; room.
+
+ A message containing the <store/> hint that is not of type 'error' SHOULD be stored by the entity.
+
It is important to note that message hints are, as the name implies, just hints. Implementations
@@ -122,6 +138,7 @@
+
From c20b089c0fc9572da2b9c1a42cedaa409e42816c Mon Sep 17 00:00:00 2001
From: Lance Stout
Date: Mon, 24 Aug 2015 14:58:04 -0700
Subject: [PATCH 060/106] Update title and typo fixes
---
xep-0357.xml | 14 ++++++++++----
xep.ent | 2 +-
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/xep-0357.xml b/xep-0357.xml
index 73a1f6df..9a4b95d2 100644
--- a/xep-0357.xml
+++ b/xep-0357.xml
@@ -6,7 +6,7 @@
- Push
+ Push Notifications
This specification defines a way for an XMPP servers to deliver information for use in push notifications to mobile and other devices.
&LEGALNOTICE;
0357
@@ -29,6 +29,12 @@
lancestout@gmail.com
lance@lance.im
+
+ 0.2
+ 2015-09-10
+ lance
+ Change the name to 'Push Notifications' based on feedback.
+
0.1
2015-03-18
@@ -52,7 +58,7 @@
The purpose of push notifications is to inform users of new messages or other pertinent information even when they have no XMPP clients online.
Typically, these notifications are delivered to a user's mobile device, displaying a notice that can trigger opening an XMPP client to continue a conversation or answer a Jingle session request.
- There have been several push noticiations implementations by mobile XMPP client vendors. However, experience has shown that these implementations carried several drawbacks:
+ There have been several push notification implementations by mobile XMPP client vendors. However, experience has shown that these implementations carried several drawbacks:
- Treated the XMPP client and XMPP server as one unified service, such that push notifications only worked using the "official" client.
- Proxied a user's session through the client provider's backend services in order to monitor for and trigger push notifications.
@@ -76,7 +82,7 @@
- The third-party (and potentially proprietary or platform-dependent) push service delivers the notification from the client application's backend service to the user's device.
- This two-tiered push architecture allows the user's XMPP server to deliver notifications to arbitrary third-pary clients, and in turn allows those clients to use the appropriate delivery mechanism for their platforms without having to share any private keys or other credentials with the XMPP server.
+ This two-tiered push architecture allows the user's XMPP server to deliver notifications to arbitrary third-party clients, and in turn allows those clients to use the appropriate delivery mechanism for their platforms without having to share any private keys or other credentials with the XMPP server.
The current state-of-the-art for a generic push notification service requires four actors:
@@ -335,7 +341,7 @@
If additional data was provided when enabling the service, the publish request SHOULD include the data as publish options.
-
Customizable Message Routing (XEP-0354) XEP-0354: Customizable Message Routing <http://xmpp.org/extensions/xep-0354.html>. " >
Namespace Delegation (XEP-0355) XEP-0355: Namespace Delegation <http://xmpp.org/extensions/xep-0355.html>. " >
Privileged Entity (XEP-0356) XEP-0356: Privileged Entity <http://xmpp.org/extensions/xep-0356.html>. " >
-Push (XEP-0357) XEP-0357: Push <http://xmpp.org/extensions/xep-0357.html>. " >
+Push Notifications (XEP-0357) XEP-0357: Push Notifications <http://xmpp.org/extensions/xep-0357.html>. " >
Publishing Available Jingle Sessions (XEP-0358) XEP-0358: Publishing Available Jingle Sessions <http://xmpp.org/extensions/xep-0358.html>. " >
Unique and Stable Stanza IDs (XEP-0359) XEP-0359: Unique and Stable Stanza IDs <http://xmpp.org/extensions/xep-0359.html>. " >
Nonzas (are not Stanzas) (XEP-0360) XEP-0360: Nonzas (are not Stanzas) <http://xmpp.org/extensions/xep-0360.html>. " >
From 4bba55b8c06c44bf0de04ae5cda75c831e4b3a1d Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Mon, 31 Aug 2015 21:41:35 -0500
Subject: [PATCH 061/106] Add a Makefile to build XEPs
---
Makefile | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 Makefile
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..38849269
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,32 @@
+.SILENT:
+
+OUTDIR?=build
+XMLDEPS=xep.xsl xep.xsd xep.ent xep.dtd ref.xsl
+
+.PHONY: help
+help:
+ @echo 'XEP makefile targets:'
+ @echo ' '
+ @echo ' help - (this message)'
+ @echo ' all - build all XEPs'
+ @echo ' clean - recursively unlink the build tree'
+ @echo ' xep-xxxx - build xep-xxxx.html'
+ @echo ' '
+ @echo 'Output directory: "$(OUTDIR)/"'
+
+.PHONY: all
+all: $(patsubst %.xml, $(OUTDIR)/%.html, $(wildcard *.xml))
+
+.PHONY: xep-%
+xep-%: $(OUTDIR)/xep-%.html
+
+
+$(OUTDIR)/%.html: %.xml $(XMLDEPS) $(OUTDIR)
+ xsltproc xep.xsl "$<" > "$@"
+
+$(OUTDIR):
+ mkdir -p $(OUTDIR)
+
+.PHONY: clean
+clean:
+ rm -rf $(OUTDIR)
From a2c7826aab72844b966a0e7ebfa0823845163b30 Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Mon, 31 Aug 2015 21:45:00 -0500
Subject: [PATCH 062/106] Add build instructions to the README
Fixes #18
---
README.md | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 4a876ca3..724c4aca 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ Please use this repository to raise issues and submit pull requests:
https://github.com/xsf/xeps/issues
https://github.com/xsf/xeps/pulls
-For in-depth technical discussion, please post to the standards@xmpp.org
+For in-depth technical discussion, please post to the standards@xmpp.org
email list:
http://mail.jabber.org/mailman/listinfo/standards
@@ -23,7 +23,18 @@ page:
http://xmpp.org/xmpp-protocols/xmpp-extensions/submitting-a-xep/
-[XEP-0001: XMPP Extension Protocols](http://xmpp.org/extensions/xep-0001.html) defines the standards process followed by the XMPP Standards Foundation.
+[XEP-0001: XMPP Extension Protocols](http://xmpp.org/extensions/xep-0001.html)
+defines the standards process followed by the XMPP Standards Foundation.
-Thanks!
+Building XEPs
+-------------
+To build a single XEP as HTML simply run:
+
+ make xep-xxxx
+
+To change the output directory, set the variable `OUTDIR`, eg.
+
+ OUTDIR=/tmp/xeps make all
+
+For more information try `make help`.
From ba1646cfca0ff24fcaede814510d41a22ceac3e1 Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Mon, 31 Aug 2015 23:15:10 -0500
Subject: [PATCH 063/106] Add PDF generation support to Makefile
---
Makefile | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 50 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index 38849269..25389fc2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,32 +1,76 @@
.SILENT:
OUTDIR?=build
-XMLDEPS=xep.xsl xep.xsd xep.ent xep.dtd ref.xsl
+TEMPDIR?=$(TMPDIR)/xepbuild
+XMLDEPS=xep.xsl xep.xsd xep.ent xep.dtd ref.xsl $(OUTDIR)
+TEXMLDEPS=xep2texml.xsl $(TEMPDIR) $(XMLDEPS) $(TEMPDIR)/xmpp.pdf $(TEMPDIR)/xmpp-text.pdf
+
.PHONY: help
help:
@echo 'XEP makefile targets:'
@echo ' '
@echo ' help - (this message)'
- @echo ' all - build all XEPs'
+ @echo ' all - build all XEPs (html and pdfs)'
+ @echo ' pdf - build all XEPs'
+ @echo ' html - build all XEPs'
@echo ' clean - recursively unlink the build tree'
- @echo ' xep-xxxx - build xep-xxxx.html'
+ @echo ' xep-xxxx - build xep-xxxx.html and xep-xxxx.pdf'
+ @echo ' xep-xxxx.html - build xep-xxxx.html'
+ @echo ' xep-xxxx.pdf - build xep-xxxx.html'
@echo ' '
@echo 'Output directory: "$(OUTDIR)/"'
.PHONY: all
-all: $(patsubst %.xml, $(OUTDIR)/%.html, $(wildcard *.xml))
+all: html pdfs
+
+.PHONY: html
+html: $(patsubst %.xml, $(OUTDIR)/%.html, $(wildcard *.xml))
+
+.PHONY: pdf
+pdf: $(patsubst %.xml, $(OUTDIR)/%.pdf, $(wildcard *.xml))
.PHONY: xep-%
-xep-%: $(OUTDIR)/xep-%.html
+xep-%: $(OUTDIR)/xep-%.html $(OUTDIR)/xep-%.pdf
-$(OUTDIR)/%.html: %.xml $(XMLDEPS) $(OUTDIR)
+.PHONY: xep-%.html
+xep-%.html: $(OUTDIR)/xep-%.html
+
+
+.PHONY: xep-%.pdf
+xep-%.pdf: $(OUTDIR)/xep-%.pdf
+
+
+$(OUTDIR)/%.html: %.xml $(XMLDEPS)
xsltproc xep.xsl "$<" > "$@"
+$(OUTDIR)/%.pdf: %.xml $(TEMPDIR)/%.xml.texml $(TEMPDIR)/%.xml.texml.tex $(TEXMLDEPS)
+ cd $(TEMPDIR); xelatex $(TEMPDIR)/$<.texml.tex
+ mv $(TEMPDIR)/$<.texml.pdf $(OUTDIR)/$(patsubst %.xml.pdf,%.pdf,$<.pdf)
+
+$(TEMPDIR)/%.xml.texml: %.xml $(TEXMLDEPS) $(TEMPDIR)
+ xsltproc -o $(TEMPDIR)/$<.texml xep2texml.xsl "$<"
+
+$(TEMPDIR)/%.xml.texml.tex: $(TEMPDIR)/%.xml.texml $(OUTDIR) $(TEMPDIR)
+ texml -e utf8 $< $<.tex
+ sed -i 's|\([\s"]\)\([^"]http://[^ "]*\)|\1\\path{\2}|g' $<.tex
+ sed -i 's|\\hyperref\[#\([^}]*\)\]|\\hyperref\[\1\]|g' $<.tex
+ sed -i 's|\\pageref{#\([^}]*\)}|\\pageref{\1}|g' $<.tex
+
+$(TEMPDIR)/xmpp-text.pdf: $(TEMPDIR)
+ -[ -e $(TEMPDIR)/xmpp-text.pdf ] || curl -o "$(TEMPDIR)/xmpp-text.pdf" https://xmpp.org/images/xmpp-text.pdf
+
+$(TEMPDIR)/xmpp.pdf: $(TEMPDIR)
+ -[ -e $(TEMPDIR)/xmpp.pdf ] || curl -o "$(TEMPDIR)/xmpp.pdf" https://xmpp.org/images/xmpp.pdf
+
+$(TEMPDIR):
+ mkdir -p $(TEMPDIR)
+
$(OUTDIR):
mkdir -p $(OUTDIR)
.PHONY: clean
clean:
+ rm -rf $(TEMPDIR)
rm -rf $(OUTDIR)
From 4eec7f6324443b300b80ff1f9e0cff21ec8bd96c Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Tue, 1 Sep 2015 19:53:49 -0500
Subject: [PATCH 064/106] Make sure the makefile looks in curdir for files
Eg. in case you're generating something in the inbox
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 25389fc2..1598e95e 100644
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,7 @@ xep-%.pdf: $(OUTDIR)/xep-%.pdf
$(OUTDIR)/%.html: %.xml $(XMLDEPS)
- xsltproc xep.xsl "$<" > "$@"
+ xsltproc --path $(CURDIR) xep.xsl "$<" > "$@"
$(OUTDIR)/%.pdf: %.xml $(TEMPDIR)/%.xml.texml $(TEMPDIR)/%.xml.texml.tex $(TEXMLDEPS)
cd $(TEMPDIR); xelatex $(TEMPDIR)/$<.texml.tex
From b2988569408f0e22288211bbbaf9e0e3a21ba206 Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Thu, 10 Sep 2015 13:06:50 -0500
Subject: [PATCH 065/106] Add output when build complete
---
Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 1598e95e..e1b98e35 100644
--- a/Makefile
+++ b/Makefile
@@ -43,11 +43,12 @@ xep-%.pdf: $(OUTDIR)/xep-%.pdf
$(OUTDIR)/%.html: %.xml $(XMLDEPS)
- xsltproc --path $(CURDIR) xep.xsl "$<" > "$@"
+ xsltproc --path $(CURDIR) xep.xsl "$<" > "$@" && echo "Finished building $@"
$(OUTDIR)/%.pdf: %.xml $(TEMPDIR)/%.xml.texml $(TEMPDIR)/%.xml.texml.tex $(TEXMLDEPS)
cd $(TEMPDIR); xelatex $(TEMPDIR)/$<.texml.tex
mv $(TEMPDIR)/$<.texml.pdf $(OUTDIR)/$(patsubst %.xml.pdf,%.pdf,$<.pdf)
+ echo "Finished building $(patsubst %.xml.pdf,%.pdf,$<.pdf)"
$(TEMPDIR)/%.xml.texml: %.xml $(TEXMLDEPS) $(TEMPDIR)
xsltproc -o $(TEMPDIR)/$<.texml xep2texml.xsl "$<"
From 931daefbdaf50987d720112d02af200413fe96eb Mon Sep 17 00:00:00 2001
From: Sam Whited
Date: Thu, 10 Sep 2015 13:12:30 -0500
Subject: [PATCH 066/106] Only run sed once and escape possible mistaken label
marker
---
Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index e1b98e35..2f306c47 100644
--- a/Makefile
+++ b/Makefile
@@ -55,9 +55,9 @@ $(TEMPDIR)/%.xml.texml: %.xml $(TEXMLDEPS) $(TEMPDIR)
$(TEMPDIR)/%.xml.texml.tex: $(TEMPDIR)/%.xml.texml $(OUTDIR) $(TEMPDIR)
texml -e utf8 $< $<.tex
- sed -i 's|\([\s"]\)\([^"]http://[^ "]*\)|\1\\path{\2}|g' $<.tex
- sed -i 's|\\hyperref\[#\([^}]*\)\]|\\hyperref\[\1\]|g' $<.tex
- sed -i 's|\\pageref{#\([^}]*\)}|\\pageref{\1}|g' $<.tex
+ sed -i -e 's|\([\s"]\)\([^"]http\://[^ "]*\)|\1\\path{\2}|g' \
+ -e 's|\\hyperref\[#\([^}]*\)\]|\\hyperref\[\1\]|g' \
+ -e 's|\\pageref{#\([^}]*\)}|\\pageref{\1}|g' $<.tex
$(TEMPDIR)/xmpp-text.pdf: $(TEMPDIR)
-[ -e $(TEMPDIR)/xmpp-text.pdf ] || curl -o "$(TEMPDIR)/xmpp-text.pdf" https://xmpp.org/images/xmpp-text.pdf
From f845947c314f25e7e15fea078453e7915d3274bc Mon Sep 17 00:00:00 2001
From: Lance Stout
Date: Thu, 10 Sep 2015 12:23:55 -0700
Subject: [PATCH 067/106] A better formalization of XEP-0234
* Recast the document to match the registration procedure defined by XEP-0166 for new application types.
* Explicitly defined the schema of the <file/> element instead of referencing XEP-0096.
* Defined the use of a 'length' attribute on <range/> elements. This attribute was always there because the <file/> and <range/> elements had been defined as the same as the parallel elements in XEP-0096, but the 'length' attribute was not explicitly referenced in this document.
* Clarified the need for the 'senders' attribute on Jingle <content/> elements to distinguish between File Offers and File Requests.
* Added the <file-not-found/> and <file-too-large/> reason types.
* Clarified how to abort a file transfer via 'content-remove' or 'session-terminate' actions.
* Added <received/> element for indicating that a transfer was successful, particularly when there are multiple transfers.
* Added SDP mapping.
---
xep-0234.xml | 916 +++++++++++++++++++++++++++++++++++----------------
xep.ent | 1 +
2 files changed, 635 insertions(+), 282 deletions(-)
diff --git a/xep-0234.xml b/xep-0234.xml
index 8bd0bbef..15189e96 100644
--- a/xep-0234.xml
+++ b/xep-0234.xml
@@ -15,15 +15,32 @@
Standards
XMPP Core
- XEP-0047
- XEP-0065
- XEP-0096
XEP-0166
+ XEP-0261
+ XEP-0300
NOT_YET_ASSIGNED
&stpeter;
+ &lance;
+
+ 0.17
+ 2015-09-08
+ ls/psa
+
+
+ - Recast the document to match the registration procedure defined by XEP-0166 for new application types.
+ - Explicitly defined the schema of the <file/> element instead of referencing XEP-0096.
+ - Defined the use of a 'length' attribute on <range/> elements. This attribute was always there because the <file/> and <range/> elements had been defined as the same as the parallel elements in XEP-0096, but the 'length' attribute was not explicitly referenced in this document.
+ - Clarified the need for the 'senders' attribute on Jingle <content/> elements to distinguish between File Offers and File Requests.
+ - Added the <file-not-found/> and <file-too-large/> reason types.
+ - Clarified how to abort a file transfer via 'content-remove' or 'session-terminate' actions.
+ - Added <received/> element for indicating that a transfer was successful, particularly when there are multiple transfers.
+ - Added SDP mapping.
+
+
+
0.16
2014-08-11
@@ -163,54 +180,200 @@
0.0.2
2008-02-28
psa
- Modified negotiation flow to use new content-replace action.
+ Modified negotiation flow to use new content-replace action.
0.0.1
2008-01-29
psa
- First draft.
+ First draft.
+ &xep0166; can be used to initiate and negotiate a wide range of peer-to-peer sessions. One session type of interest is file transfer. This document specifies an application format for negotiating Jingle file transfer sessions, where files are exchanged via any available reliable transport.
+
+
+
&xep0096; was the original XMPP protocol extension for file transfer negotiation. However, that protocol has several drawbacks, most related to the &xep0095; protocol on which it depends:
- - It does not enable a true, bidirectional negotiation; instead, the initiator sets the terms for the file transfer and the responder either accepts the terms or cancels the negotiation.
- - It is the only technology in the Jabber/XMPP protocol "stack" that uses XEP-095: Stream Initiation. More modern technologies such as voice and video session negotiation use &xep0166;, and it would be helpful if implementors could re-use the same code for all negotiation use cases.
+ It does not enable a true, bidirectional negotiation; instead, the initiator sets the terms for the file transfer and the responder either accepts the terms or cancels the negotiation.
+ It is the only technology in the Jabber/XMPP protocol "stack" that uses XEP-0095: Stream Initiation. More modern technologies such as voice and video session negotiation use &xep0166;, and it would be helpful if implementors could re-use the same code for all negotiation use cases.
To overcome these drawbacks, this specification defines a file transfer negotiation method that meets the following requirements:
- - Use the session negotiation semantics from XEP-0166.
- - Use &xep0260; and &xep0261; as transport methods.
- - Define a file description format that, unlike XEP-0096, enables hash agility (via &xep0300;).
- - Define a clear upgrade path from SI File Transfer to Jingle File Transfer.
+ Use the session negotiation semantics from XEP-0166.
+ -
+
Use any reliable Jingle transport mechanism, including but not limited to:
+
+ - ICE-TCP &rfc6544;
+ - SOCKS5 Bytestreams &xep0260;
+ - In-Band Bytestreams &xep0261;
+
+
+ Define a file description format that, unlike XEP-0096, enables hash agility (via &xep0300;).
+ Define a clear upgrade path from SI File Transfer to Jingle File Transfer.
- Jingle file transfer is only as reliable as the transports on which it depends. In particular, SOCKS5 Bytestreams ("S5B") does not always result in NAT or firewall traversal. To work around that problem, this specification requires all implementations to support as a fallback mechanism In-Band Bytestreams ("IBB"), which usually results in a successful (if slow) file transfer.
- Note: It is likely that a future version of this specification will also recommend implementation of a Jingle transport method that emulates the IETF's ICE-TCP technology, as specified in &rfc6544;.
+ Note that Jingle file transfer is only as reliable as the transports on which it depends. In particular, SOCKS5 Bytestreams ("S5B") does not always result in NAT or firewall traversal. To work around that problem, this specification requires all implementations to support as a fallback mechanism In-Band Bytestreams ("IBB"), which usually results in a successful (if slow) file transfer. A more robust and adaptable option is ICE-TCP (RFC 6455); at the time of writing &xep0176; is being updated to include the ability to negotiate ICE-TCP candidates.
-
- This section provides a friendly introduction to Jingle file transfer.
- First, the party that wishes to initiate the file transfer determines the responder's capabilities (via &xep0030; or &xep0115;). Here we assume that the responder supports the following service discovery features:
-
- - urn:xmpp:jingle:1 as described in XEP-0166
- - urn:xmpp:jingle:apps:file-transfer:4 as defined in this document &NSVER;
- - urn:xmpp:jingle:transports:s5b:1 as defined in XEP-0260
- - urn:xmpp:jingle:transports:ibb:1 as defined in XEP-0261
-
- The initiator then sends a Jingle session-initiation request to a potential responder. The content-type of the request specifies two things:
+
+
+
+ - File Offer
+ - A Jingle File Transfer Content is said to be a File Offer if the content creator is the same as the content sender (see Use of Jingle Content Senders).
+
+
+ - File Request
+ - A Jingle File Transfer Content is said to be a File Request if the content creator is the opposite of the content sender (see Use of Jingle Content Senders).
+
+
+ - File Sender
+ - The File Sender is the side of the Jingle session responsible for sending the file data. The File Sender is not necessarily the same entity as the Jingle session initiator, and an entity could be both a File Sender and File Receiver in the context of a single Jingle session with multiple files.
+
+
+ - File Receiver
+ - The File Receiver is the side of the Jingle session responsible for receiving the file data. The File Receiver is not necessarily the same entity as the Jingle session responder, and an entity could be both a File Receiver and File Sender in the context of a single Jingle session with multiple files.
+
+
+
+
+
+ In accordance with Section 12 of XEP-0166, this document specifies the following information related to the Jingle File Transfer ("Jingle FT") application type:
- - An application type of "urn:xmpp:jingle:apps:file-transfer:4". In particular, the <description/> element contains a <file/> elements describing the file to be sent.
- - An appropriate transport method. So far the suggested methods are jingle-s5b (XEP-0260) and, as a fallback, jingle-ibb (XEP-0261).
+ The application format negotiation process is defined in the Negotiating a Jingle File Transfer Session section of this document.
+ The semantics of the &DESCRIPTION; element are defined in the Application Format section of this document.
+ A mapping of Jingle semantics to the Session Description Protocol is provided in the Mapping to Session Description Protocol section of this document.
+ A Jingle File Transfer session SHOULD use a streaming transport method, not a datagram transport method.
+ Transport components are not used in Jingle File Transfer.
+ -
+
Content is to be sent and received as follows:
+ For streaming transports, outbound content shall be encoded into packets (as defined by the transport mechanism) without any other framing mechanism and sent in succession over the transport. Incoming data received over the transport shall be processed as a stream of packets, where each packet's content payload is entirely composed of the next portion of file data to be processed.
+
- In this example, the initiator is <romeo@montague.lit>, the responder is <juliet@capulet.lit>, the application type is a file offer, and the transport method is jingle-s5b.
- The flow is as follows.
+
+
+ Jingle File Transfer makes critical use of the 'senders' attribute of Jingle &CONTENT; elements in order to specify which party is responsible for sending the described file. As such, Jingle File Transfer content MUST include a 'senders' attribute, where the allowed values are "initiator" and "responder". The semantics of the values "both" and "none" are undefined in Jingle File Transfer and thus NOT RECOMMENDED for use with Jingle File Transfer content.
+ In general, a Jingle File Transfer content is said to be a "File Offer" if the 'senders' attribute is the same as the role of the party adding the content to the session, and a "File Request" if the 'senders' value is the opposite role of the party adding the content.
+ Note: The content 'creator' attribute does not specify who created or is sending the file, it only specifies which party to the session added the Jingle content to the session.
+
+
+ Jingle Session Role
+ Content Senders
+ File Transfer Type
+
+
+ initiator
+ initiator
+ File Offer
+
+
+ initiator
+ responder
+ File Request
+
+
+ responder
+ initiator
+ File Request
+
+
+ responder
+ responder
+ File Offer
+
+
+
+
+
+
+ A Jingle File Transfer session is described by a content type that contains one application format and one transport method. Each &CONTENT; element defines the details of a single file transfer. A Jingle negotiation MAY result in the establishment of multiple file transfers by including multiple &CONTENT; elements.
+ The application format consists of a file description contained within a &DESCRIPTION; element qualified by the "urn:xmpp:jingle:apps:file-transfer:4" namespace &VNOTE;. The file description is a <file/> element specifying metadata such as the name of the file, media type, etc., as illustrated in the following example.
+
+
+ text/plain
+ test.txt
+ 2015-07-26T21:46:00
+ 6144
+ 552da749930852c69ae5d2141d3766b1
+
+]]>
+ The &DESCRIPTION; element is intended to be a child of a Jingle &CONTENT; element as specified in XEP-0166.
+ The child elements of the <file/> element are as follows:
+
+
+ Element Name
+ Description
+ Inclusion
+
+
+ date
+ UTC timestamp specifying the last modified time of the file (which MUST conform to the DateTime profile of &xep0082;).
+ OPTIONAL
+
+
+ desc
+ A human readable description of the file. Multiple <desc/> elements MAY be included if different xml:lang values are specified.
+ OPTIONAL
+
+
+ hash
+ A hash of the file content, using the <hash/> element defined in &xep0300; and qualifed by the 'urn:xmpp:hashes:1' namespace. Multiple hashes MAY be included for hash agility.
+ REQUIRED when offering a file, otherwise OPTIONAL
+
+
+ media-type
+ The media type of the file content, which SHOULD be a valid MIME-TYPE as registered with &IANA; (specifically, as listed at <http://www.iana.org/assignments/media-types>). If not specified, the content is assumed to be "application/octet-stream".
+ RECOMMENDED when offering a file, otherwise OPTIONAL
+
+
+ name
+ The name of the file. The name SHOULD NOT contain characters or character sequences that would be interpreted as a directory structure by the local file system (e.g. "/", "\", "../", etc.). If any such characters or character sequences are present (possibly because the local and remote file systems use different syntax for directory structure), they SHOULD be escaped (e.g., via percent-encoding) before using the name as part of any file system operation. See Security Considerations.
+ OPTIONAL
+
+
+ size
+ The length of the file's content, in bytes.
+ OPTIONAL, but SHOULD be present when offering a file.
+
+
+ range
+ The presence of the <range/> element indicates support of ranged transfers, and can be used to control where a transfer starts.
+ OPTIONAL
+
+
+ One or more <hash/> elements MUST be present when offering a file, but those elements MAY be empty if the hash has not yet been computed. If there is no computed hash value, the <hash/> element(s) MUST possess an 'algo' attribute specifying which hash algorithm will be used. Once a hash has been calculated by the File Sender, the File Sender SHOULD inform the File Receiver of the hash value as described in Checksum.
+ Additional elements MAY be included as children of the <file/> element to provide additional metadata about the file, such as &xep0264;.
+ The optional <range/> element MAY possess two attributes:
+
+
+ Attribute
+ Description
+ Inclusion
+
+
+ offset
+ Specifies the position, in bytes, from which to start transferring file data. This defaults to zero (0) if not specified.
+ OPTIONAL
+
+
+ length
+ Specifies the number of bytes to retrieve starting at offset. This defaults to the length of the file from offset to the end.
+ OPTIONAL
+
+
+ Inclusion of a <range/> element in a File Offer indicates support of ranged transfers for future File Requests if the transfer is interrupted and needs to be restarted.
+ A <range/> element MAY include an 'offset' attribute set to begin the transfer at a point other than the start of the file, and MAY include a 'length' attribute to request a portion of the file smaller than the remaining length of the file. If no 'offset' or 'length' attributes are present then it is the same as if no <range/> element was present, because the default values of the attributes would indicate a requested range of the entire file. In general, the first byte of data to be transferred is at the (zero-indexed) position specified by the 'offset' value, with a total of 'length' bytes sent.
+
+
+
+ In general, the process for negotiating a Jingle File Transfer session is as follows:
and S5B) |
|---------------------------->|
| ack |
|<----------------------------|
@@ -218,25 +381,33 @@ Initiator Responder
|<----------------------------|
| ack |
|---------------------------->|
- | [ file transfer ] |
+ | [optional further |
+ | negotiation] |
+ |<--------------------------->|
+ | File Transfer |
|============================>|
- | session-terminate |
- |<----------------------------|
- | ack |
- |---------------------------->|
- | |
- ]]>
- First the initiator sends a Jingle session-initiate.
-
+
+ To start a File Offer, the initiator sends a Jingle session-initiation request to a potential responder. The request specifies three things:
+In this example, the initiator is <romeo@montague.example>, the responder is <juliet@capulet.example>, the application type is a File Offer, and the transport method is jingle-s5b (XEP-0260).
+The flow is as follows.
+First the initiator sends a Jingle session-initiate.
+Note: As in XEP-0096, inclusion of the <range/> child of the <file/> element indicates that the initiatior supports ranged transfers as described below under Ranged Transfers.
-Note: Computing the hash of the file before sending it can slow down the process of file transfer, since the sending application needs to process the file twice. The sender might prefer to send the hash after the file transfer has begun, using a transport-info message as described under Communicating the Hash.
-The responder immediately acknowledges receipt of the Jingle session-initiate.
-Note: Inclusion of the <range/> child of the <file/> element indicates that the initiator supports ranged transfers as described below under Ranged Transfers.
+Note: Computing the hash of the file before sending it can slow down the process of file transfer, because the sending application needs to process the file twice. The File Sender might prefer to send the hash after the file transfer has begun, using a transport-info message as described under Checksum.
+The responder immediately acknowledges receipt of the Jingle session-initiate.
+The initiator then attempts to initiate a SOCKS5 Bytestream with the responder as described in XEP-0260 and XEP-0065. In the meantime, the responder returns a Jingle session-accept. In the session-accept message, the <file/> element MAY contain a <range/> element to indicate that the receiver also supports ranged transfers as described below under Ranged Transfers.
-The initiator then attempts to initiate a SOCKS5 Bytestream with the responder as described in XEP-0260 and XEP-0065. In the meantime, the responder returns a Jingle session-accept. In the session-accept message, the <file/> element MAY contain a <range/> element to indicate that the receiver also supports ranged transfers as described below under Ranged Transfers.
+The initiator acknowledges the Jingle session-accept.
-The initiator acknowledges the Jingle session-accept.
+Once one client has successfully created a connection, it sends a <remote-candidate/> element to the peer inside a Jingle transport-info message. If a client receives a remote-candidate notification it SHOULD continue trying to connect to candidates sent by its peer if it has not tried all candidates with a higher priority than the one successfully used by the peer.
-If the File Sender has advertised the existence of a file that it hosts, such as by &xep0358;, or if a previous file transfer attempt has failed and the File Receiver would like to initiate another attempt, the File Receiver can "pull" the file from the File Sender. This is done by sending a Jingle session-initiate to the File Sender which includes a <content/> with the 'senders' attribute set to the opposite Jingle session role of the party requesting the file (see Use of Jingle Content Senders) and a <description/> element qualified by the 'urn:xmpp:jingle:apps:file-transfer:4' namespace and which includes a <file/> element with enough information included to form a "file selector" (see Section 5 of &rfc5547;) to identify the requested file.
+The peer immediately acknowledges receipt.
-(See XEP-0260 for further details.)
-Now the parties exchange the file using the negotiated transport (here, SOCKS5 Bytestreams).
-Once the transfer is completed, either party can acknowledge completion or terminate the Jingle session; preferably this is done by the entity that receives the file to ensure that the complete file (up to the advertised size) has been received.
-See File not Available for how to respond if the requester does not have permission to request the file, or if the file cannot be found.
+While the Jingle File Transfer session is active, either party MAY choose to add additional files (both offers and requests) to the transfer session. To do so, a Jingle content-add action is used, as shown in the following examples.
+The other party then acks the content-add request.
+At this point, the content-add request needs to be either accepted or rejected using Jingle content-accept or content-reject actions.
+As in XEP-0096, a transfer can include only part of a file (e.g., to restart delivery of a truncated transfer session at a point other than the start of the file). This is done using the <range/> element. The usage is illustrated in the following examples.
+Let us imagine that the parties negotiate a file transfer session using, say, In-Band Bytestreams. During the transfer, the recipient goes offline unexpectedly and IBB stanzas from the File Sender to the File Receiver begin to bounce. When the recipient comes back online, the File Sender could initiate a new Jingle session and specify that it wants to send all chunks after byte 270336 (which might be the 66th chunk of size 4096).
+At any point, either party MAY choose to abort the transfer of a single file, or end the session entirely to abort all active transfers.
+When there is only a single Jingle content or if a party wishes to abort the transfer of all files in the session, a session-terminate including a Jingle reason of <cancel /> is sent.
+After terminating the session, the parties would close the data transport as described in the relevant specification (e.g., XEP-0260 or XEP-0261).
-For a description of the transport fallback scenario (from SOCKS5 Bytestreams to In-Band Bytestreams), refer to XEP-0260.
+]]> +If a party chooses to abort the transfer of a single file out of several active transfers, a Jingle content-remove action is used, which MAY include a Jingle reason of <cancel/>, as shown in the following example.
+The other party then acks the content-remove request.
+If after removing the content there are no other Jingle contents the session MUST be terminated as described in the next section.
+Once all file content in the session has been transfered, either party MAY acknowledge receipt of the received files (see Received) or, if there are no other active file transfers, terminate the Jingle session with a Jingle session of <success/>. Preferably, sending the session-terminate is done by the last entity to finish receiving a file to ensure that all offered or requested files by either party have been completely received (up to the advertised sizes).
+At any time during the lifetime of the file transfer session, the hosting entity (i.e., the entity where the file resides) can communicate the checksum of the file to the receiving entity.
-This can be done in the session-initiate message if the sender already knows the checksum, as shown above in Example 1.
-After the session-initiate message, this can also be done by sending a session-info message containing a <checksum/> element qualified by the 'urn:xmpp:jingle:apps:file-transfer:4' namespace, which in turn contains a <file/> element that MUST at least contain a child element of <hash/> qualified by the 'urn:xmpp:hashes:1' namespace and MAY contain other elements qualified by the 'urn:xmpp:jingle:apps:file-transfer:4' namespace (e.g. <name/> and <date/>). Each <hash/> element contains a checksum of the file contents produced in accordance with the hashing function specified by the 'algo' attribute, which MUST be one of the functions listed in the &ianahashes;.
-&rfc5547; defines the general process for including file transfer information in SDP.
+The SDP media type for Jingle File Transfer can be "message" (e.g. when used with &rfc4975;) or "application"; however, this media value is not reflected in the Jingle File Transfer application format.
+Any combination of <name/>, <size/>, <media-type/>and <hash/> values MAY be used to form a "file selector" (see Section 5 of &rfc5547;), which would be mapped to SDP as follows:
+"] [size:] [type:] [hash::]]]>
+ (The hash value MUST be encoded as hexadecimal with each byte separated by a colon.)
+The <date/> value is the last modified time of the file, and thus is mapped as follows:
+"]]>
+ Note: the format used here for <date> is the date-time format defined in &rfc5322;.
+If a range is specified, the SDP mapping requires both a start and stop offset. If no length was specified for the range, the stop offset is "*". If a length was specified, the stop offset is the <range/> offset value plus the length.
+-<(offset + length) | *>]]>
+ As a full example, given the following Jingle File Transfer content description:
+
+
+ text/plain
+ test.txt
+ 2015-07-26T21:46:00
+ 6144
+ 552da749930852c69ae5d2141d3766b1
+
+
+]]>
+ The equivalent SDP would be:
+
+Once a file has been successfully received, the recipient MAY send a Jingle session-info message indicating receipt of the complete file, which consists of a <received/> element qualified by the 'urn:xmpp:jingle:apps:file-transfer:4' namespace. The <received/> element SHOULD contain 'creator' and 'name' attributes sufficient to identify the content that was received.
+At any time during the lifetime of the file transfer session, the File Sender can communicate the checksum of the file to the File Receiver.
+This can be done in the session-initiate message if the File Sender already knows the checksum, as shown above in Example 3.
+After the session-initiate message, this can also be done by sending a session-info message containing a <checksum/> element qualified by the 'urn:xmpp:jingle:apps:file-transfer:4' namespace. The <checksum/> element SHOULD contain 'creator' and 'name' attributes sufficient to identitfy the content the checksum belongs to. Additionally, the <checksum/> element MUST contain a <file/> element which MUST contain at least one <hash/> element qualified by the 'urn:xmpp:hashes:1' namespace. Each <hash/> element contains a checksum of the file data produced in accordance with the hashing function specified by the 'algo' attribute, which MUST be one of the functions listed in the &ianahashes;.
+If the initiator wishes to communicate only the hashing algorithm as the beginning of the session (e.g., because it has not yet calculated the checksum), it can send an empty <hash/> element (without a checksum in the XML character data as shown in the previous examples) in the session-initiate message; this enables the recipient to check the file during the transfer session (which can be helpful in the case of transfers that are truncated or fail mid-stream).
-If a ranged transfer was requested, the <file/> element inside the <checksum/> element MAY include a <range/> element specifying the offset and length of the requested range, which in turn includes <hash/> element(s) with hashes of the data that was transferred for that range.
+If the initiator wishes to communicate only the hashing algorithm at the beginning of the session (e.g., because it has not yet calculated the checksum), it can send an empty <hash/> element (without a checksum in the XML character data as shown in the previous examples) in the session-initiate message; this enables the recipient to check the file during the transfer session (which can be helpful in the case of transfers that are truncated or fail mid-stream).
+As in XEP-0096, a transfer can include only part of a file (e.g., to restart delivery of a truncated transfer session at a point other than the start of the file). This is done using the <range/> element from XEP-0096. The usage is illustrated in the following examples.
-Let us imagine that the parties negotiate a file transfer session using, say, In-Band Bytestreams. During the transfer, the recipient goes offline unexpectedly and IBB stanzas from the sender to the recipient begin to bounce. When the recipient comes back online, the sender could initiate a new Jingle session and specify that it wants to send all chunks after byte 270336 (which might be the 66th chunk of size 4096).
-If a requested file cannot be found (or the requester does not have permission to request or know about the existence of the file in question), then the File Sender SHOULD send either a session-terminate or content-reject action in response to the session-initiate or content-add request, and SHOULD include a Jingle reason of <failed-application/> and MAY include an application specific reason of a <file-not-available/> element qualified by the 'urn:xmpp:jingle:apps:file-transfer:errors:0' namespace.
+There are several situations where a File Receiver might wish to abort a transfer due to an excess of file data, for example:
+In such cases, the File Receiver MAY abort the transfer by sending a Jingle session-terminate (or content-remove as appropriate) which includes a Jingle reason of <media-error/> and MAY include an application specific reason of a <file-too-large/> element qualified by the 'urn:xmpp:jingle:apps:file-transfer:errors:0' namespace.
+To prevent denial of service and other attacks, the File Receiver is fully within its rights to drop received data or not send a session-terminate message.
+Jingle file transfer uses only a few of the actions defined in XEP-0166. Jingle usage is summarized in the following table.
-Action | -Use | -
---|---|
content-accept | -Unused | -
content-add | -Unused | -
content-modify | -Unused | -
content-reject | -Unused | -
content-remove | -Unused | -
description-info | -Unused | -
security-info | -Unused | -
session-accept | -Accepting a file offer or request | -
session-info | -Communicating the file hash | -
session-initiate | -Initiating a file offer or request | -
session-terminate | -Ending a file transfer session | -
transport-accept | -Accepting fallback from S5B to IBB | -
transport-info | -Used in SOCKS5 Bytestreams | -
transport-reject | -Rejecting fallback from S5B to IBB | -
transport-replace | -Fallback from S5B to IBB | -
All implementations MUST support the Jingle In-Band Bytestreams Transport Method (XEP-0261) as a reliable method of last resort. An implementation SHOULD support other transport methods as well, especially the Jingle SOCKS5 Bytestreams Transport Method (XEP-0260).
+All implementations MUST support the Jingle In-Band Bytestreams Transport Method (XEP-0261) as a reliable method of last resort. An implementation SHOULD support other transport methods as well, especially ICE-TCP (RFC 6455) and the Jingle SOCKS5 Bytestreams Transport Method (XEP-0260).
An application MAY present transport methods in any order, except that the Jingle In-Band Bytestreams Transport Method MUST be the lowest preference.
@@ -570,17 +903,16 @@ Initiator ResponderTo advertise its support for the Jingle File Transfer, when replying to service discovery information ("disco#info") requests an entity MUST return URNs for any version of this protocol that the entity supports -- e.g., "urn:xmpp:jingle:apps:file-transfer:4" for this version &VNOTE;.
As noted, if an application supports exchange of multiple files, it MUST advertise a service discovery feature of "urn:xmpp:jingle:apps:file-transfer:multi".
+]]>In order for an application to determine whether an entity supports this protocol, where possible it SHOULD use the dynamic, presence-based profile of service discovery defined in &xep0115;. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.
It is RECOMMENDED for implementations to use the strongest hashing algorithm available to both parties. See XEP-0300 for further discussion.
+Caution needs to be exercised when using the <name/> of a file offer or request to control any interaction with a file system. For example, a malicious user could request a file with <name>/etc/passwd</name> or include file system specific control patterns such as <name>../../private.txt</name> to try and access a sensitive file outside of the set of files intended to be shared. Or a malicious user could offer a file named "/etc/passwd" to try and trick the receiver into overwriting that or other sensitive files. Therefore, implementations SHOULD escape any file system path separators in the <name/> before using that value in any file system calls.
+It is RECOMMENDED for implementations to use the strongest hashing algorithm available to both parties. See XEP-0300 for further discussion.
In order to secure the data stream, implementations SHOULD use encryption methods appropriate to the transport method being used. For example, end-to-end encryption can be negotiated over either SOCKS5 Bytestreams or In-Band Bytestreams as described in XEP-0260 and XEP-0261.
-Refer to XEP-0047, XEP-0065, XEP-0096, XEP-0260, and XEP-0261 for related security considerations.
+Refer to XEP-0047, XEP-0065, XEP-0096, XEP-0176, XEP-0260, XEP-0261, and RFC 6455 for related security considerations.
The service discovery feature for advertising support for exchange of multiple files is "urn:xmpp:jingle:apps:file-transfer:multi".
-The registry submission is as follows.
-
- urn:xmpp:jingle:apps:file-transfer:multi
- Signals support for exchange of multiple files.
- XEP-0234
-
- ]]>
- The XMPP Registrar shall include "file-transfer" in its registry of Jingle application formats. The registry submission is as follows:
Jingle sessions for the transfer of a file
streaming
XEP-0234
-
- ]]>
+]]>
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
- ]]>
+]]>
+
+
+
+
+
+
+
+ ]]>
+ Thanks to Diana Cionoiu, Olivier Crête, Viktor Fast, Philipp Hancke, Waqas Hussain, Justin Karneges, Steffen Larsen, Yann Leboulanger, Marcus Lundblad, Robert McQueen, Joe Maissel, Glenn Maynard, Ali Sabil, Sjoerd Simons, Lance Stout, Will Thompson, Matthew Wild, and Jiří Zárevúcky for their feedback.
+Thanks to Diana Cionoiu, Olivier Crête, Viktor Fast, Philipp Hancke, Waqas Hussain, Justin Karneges, Steffen Larsen, Yann Leboulanger, Marcus Lundblad, Robert McQueen, Joe Maissel, Glenn Maynard, Ali Sabil, Sjoerd Simons, Will Thompson, Matthew Wild, and Jiří Zárevúcky for their feedback.
The "jid" attribute specifies the JID of the StreamHost. This attribute MUST be present, and MUST be a valid JID for communication over XMPP.
The <activate/> element is sent from the Requester to the Proxy in order to formally start the bytestream. This element is always empty and has no defined attributes.
+The <activate/> element is sent from the Requester to the Proxy in order to formally start the bytestream. This element has no defined attributes and its XML character data specifies the JID of the target.
The <udpsuccess/> element is sent from the StreamHost to the Target or Requester to indicate that the StreamHost has received a UDP initialization packet.
From 61dd46602347ccf6433a4f1a958e7febd55532f0 Mon Sep 17 00:00:00 2001 From: Sam WhitedAdd profiles / parcial sync.
This problem of "downloading the world" (downloading the entire roster - every time a session is initialized) was partially addressed by &xep0237; - which was later merged into &rfc6121; §2.6. While this solved the problem - for the roster, it didn't account for other entities (eg. disco items). + every time a session is initialized or receiving an entire disco items + response every time a MUC list is queried, etc.) was partially addressed by + &xep0237; which was later merged into &rfc6121; §2.6. While this solved + the problem for the roster, it didn't account for other entities. Furthermore, roster versioning requires that the server maintain a great deal of state (roster items which should be pushed for each entity on reconnect, or monotonically increasing counters, etc.) which can be difficult to store or synchronize in a large, distributed system. This XEP - defines a method by which the roster and entities other than the roster can - be versioned and cached, and which is optimized for distributed systems - with large enity lists (but works equally well on small, single server - deployments). + defines a method by which generic entity lists can be versioned and cached, + and which is optimized for distributed systems with large entity lists (but + works equally well on small, single server deployments).
+ Because entity versioning is designed to be a generic system for syncing + any sort of list in XMPP, and the format and requirements of various entity + lists may vary greatly, no specific wire format is defined in this + specification. Instead, the specifics for various lists will be left up to + separate XEPs which will define entity versioning "profiles" which must be + registered with the XMPP registrar. These profiles will define exactly how + version tokens are represented in the specific list format for which they + wish to use entity versioning. The rest of this document will provide + details about entity versioning which will be common to all entity + versioning profiles and do not need to be redefined in EV profile XEPs. It + will also define an EV profile for fetching the roster. +
++ The roster entity versioning profile which is used as an example throughout + this document will use the namespace 'urn:xmpp:entityver:profile:roster:0' + as described in the XMPP Registrar + Considerations section of this document. +
+- If a server supports entity versioning, it MUST inform the connecting - client when returning stream features during the stream negotiation - process. This is done by including a <ver/> element, qualified by - the 'urn:xmpp:entityver:0' namespace. At the latest, this SHOULD - be done when informing a client that resource binding is required. For - example: -
-The entity versioning stream feature is merely informative and therefore is never mandatory-to-negotiate.
+
+ Clients, servers, and other entities that support &xep0030; and entity
+ versioning must respond to service discovery requests with a feature of
+ 'urn:xmpp:entityver:0' and with a feature for each EV profile supported by
+ the responding entity as described in the relavant specifications. Eg. a
+ response from a server that supports roster versioning for the requesting
+ entity might look like the following:
+
- Version tokens are short case-sensitive strings which are generated by the - server. Their format is not defined in this spec, but a recommendation may - be found in the Implementation Notes. Version - tokens are akin to a weakly-validated etag for the entity in question. -
-- Servers that implement this protocol must assign such a version token to - each entity that is controlled by the server. The server MUST then update - this version every time any mutable property of the entity changes (eg. - when the subscription status of a user changes). The server MAY choose to - update this token at any time (to force the clients to invalidate their - cached representation fo the object). This version token MUST then be - included with every object representation of that entity sent down in the - stream. This is done by including a sub-node called "version" qualified - by the entity versioning XML namespace defined in this document. - Similarly, clients MAY also add version nodes for each version token they - possess to the request for a list (not specifying a version token will - force the server to send information on that entity to the client). If a - server sends up a list of version tokens, the server MUST then check to - see if those tokens correspond to any entity which it knows about, and - not send down any entities with matching version tokens in the response. -
-For example, a roster request might look like:
-+ Version tokens are short case-sensitive strings which are generated by + the server. Their format is not defined in this spec, but a + recommendation may be found in the Implementation + Notes. Version tokens are akin to a weakly-validated etag for the + entity in question. +
++ Servers that implement this protocol must assign such a version token to + each entity that is controlled by the server. The server SHOULD then + update this version every time any mutable property of the entity changes + (eg. when the subscription status of a user changes). The server MAY + choose to update this token at any time (to force the clients to + invalidate their cached representation fo the object). This version token + MUST then be included with every object representation of that entity + sent down in the stream. This is done by including a sub-node called + "version" qualified by the entity versioning XML namespace defined in + this document. Similarly, clients MAY also add version nodes for each + version token they possess to the request for a list (not specifying a + version token will force the server to send information on that entity to + the client). If a server sends up a list of version tokens, the server + MUST then check to see if those tokens correspond to any entity which it + knows about, and not send down any entities with matching version tokens + in the response. +
+
+ For example, a versioned roster request might look like this:
+
Note that in this case there may be three roster items total (and the client only knows about two of them), or there may be two total roster items and the server is informing the client about a change to "bill@shakespeare.lit". Version tokens MUST also be present in roster pushes: -
-A disco request for rooms (as defined in &xep0045;) might look like:
-- In this example coven@chat.shakespeare.lit has been modified (eg. the - room name might have been changed), but inverness@chat.shakespeare.lit - has not changed, therefore no update is sent down. -
-- Clients that implement this protocol SHOULD then cache the entity in - question when a version token is received. -
- + ]]>
When a client syncs with the server and indicates that it has a version
@@ -278,127 +292,154 @@
the server wants to remove an entity from the clients cache for any other
reason), the server MUST reply with an empty <version/> node. When
the client receives such an empty version node it SHOULD purge the entity
- from its cache. For example, the following exchange would trigger the
- removal of 'inverness@chat.shakespeare.lit' from the cached MUC list:
-
-
- If the client receives an indication that it should delete an item from a - list by any other means (eg. via a roster push), it SHOULD remove the - version token associated with that entity from its cache. + Roster pushes that indicate a deleted item MUST also remove the version + from the cache (and need not contain an empty <version/> element).
- While the version token approach to caching does not require a great deal - of state to be stored on the client or the server, it does require a lot - more information to be sent by the client when requesting a list of - entities. For a very large list which is not likely to have changed, it may - be useful know in advance if the roster has changed or not (so that we can - avoid sending the large request entirely). To do this, we can request an - aggregate version token from the server. This aggregate token is calculated - by constructing a string of comma separated "JID:version" pairs sorted in - byte-wise order (because the JID:version pair is constructed before - sorting, if two items in the list have the same JID they can still be - sorted by the version token), and taking the MD5 hash of the constructed - string. For example, if the server is calculating the aggregate version - token for a roster, it might end up with the following string: -
-+ For very large groups fetching an entire list may not be practical or + necessary. For example, one might imagine a large corporation with a + shared roster that is too large for its version tokens to be sent up to + the server on every sync, or even to download fully the first time. To + solve this, servers MAY choose to send down only a part of an entity list + in response to a query (unless the individual EV profile forbids partial + list sync). How servers choose what items to return is an implementation + detail that is out of the scope of this document. Some suggestions may be + found in the Implementation Notes. On subsequent + requests for the entity list, the server MAY choose to return more + entities (eg. based on changes in its internal selection criteria), + however it MUST NOT invalidate cached entities unless they have actually + been removed from the list. +
+
+ XEPs defining entity versioning profiles MUST include a section to
+ indicate if partial sync is supported, and if so, how it will be
+ indicated to the client (and how the client can request a full list). If
+ no mechanism is specified, this is done by adding a boolean "full_list"
+ attribute to the request, eg. a roster request for a partial list looks
+ like:
+
+ When making a request for a partial list, clients do not need to send up + every entity in their cache. Instead they MAY send up just those entities + for which they wish to check for updates. The server MUST then respond + with any updates for those entities, and MAY also add other entities to + the list if desired. If the client requests a partial list but does not + indicate that it has anything in its cache, what entities to return (if + any) is left up to the server implementation. +
+ ++ While the version token approach to caching does not require a great deal + of state to be stored on the client or the server, it does require a lot + more information to be sent by the client when requesting a list of + entities. For a very large list which is not likely to have changed, it + may be useful know in advance if the roster has changed or not (so that + we can avoid sending the large request entirely). To do this, we can + request an aggregate version token from the server. This aggregate token + is calculated by constructing a string of comma separated "ID:version" + pairs sorted in byte-wise order (because the ID:version pair is + constructed before sorting, if two items in the list have the same ID + they can still be sorted by the version token), and taking the MD5 hash + of the constructed string. The ID in the pair is any ID or key that + identifies the entity as defined in its profile (eg. a JID for roster + items and most other entities). For example, if the server is calculating + the aggregate version token for a roster, it might end up with the + following string: +
+- Which results in the aggregate token: -
-+ Which results in the aggregate token: +
+- The actual request is an IQ sent to the server, or entity handling the - versioned list which contains a query that specifies the namespace of the - list we want to fetch. Eg. to fetch the aggregate token for the roster one - would query the server with the type set to the `jabber:iq:roster` - namespace: -
-+ The actual request is an IQ sent to the server, or entity handling the + versioned list which contains a query that specifies the namespace of the + list we want to fetch. Eg. to fetch the aggregate token for the roster + one would query the server with the query's XMLNS set to + 'urn:xmpp:entityver:profile:roster:0': +
+- Similarly, to fetch the aggregate token for a list of MUC rooms, one would - query the MUC component directly with the type set to the 'disco#items' - namespace: -
-- Because aggregate tokens are OPTIONAL to implement, clients MUST fall back - to a normal request if any error is returned in response to an aggregate - token IQ. -
-- If an aggregate token is requested for a list that may contain more than - one type of entity (eg. MUC rooms and pubsub nodes that live on the same - component), then the server MUST return the aggregate token constructed - with the entire list (rooms and pubsub nodes). -
-- Clients are also NOT REQUIRED to check aggregate tokens. However, clients - MAY wish to check aggregate tokens before making a roster or MUC request - when the cached roster or MUC list is very large. When to check aggregate - tokens (if at all) is left up to the implementation. -
+ ]]>+ Because aggregate tokens are OPTIONAL to implement, clients MUST fall + back to making a normal list request if any error is returned in response + to an aggregate token IQ. +
++ If an aggregate token is requested for a list that may contain more than + one type of entity (eg. MUC rooms and pubsub nodes that live on the same + component), then the server MUST return the aggregate token constructed + with the entire list (rooms and pubsub nodes). +
++ Because aggregate tokens are calculated for the entire list as seen by + the client or server, they will never match if partial lists have been + downloaded by the client. +
++ Clients are also NOT REQUIRED to check aggregate tokens. However, clients + MAY wish to check aggregate tokens before making a roster or MUC request + when the cached roster or MUC list is very large. When to check aggregate + tokens (if at all) is left up to the implementation. +
+Version tokens may not provide enough collision resistance across versioned @@ -421,6 +462,22 @@ anne@shakespeare.lit:VIZSVF0D,bill@shakespeare.lit:25P2A7H8 version token MAY be used as a weakly validated ETag for any API requests for that entity.
++ Servers following this specification may choose to send down partial entity + lists in response to queries. For the case of rosters one or more of the + following may be returned to the requesting entity during the initial + roster sync: +
+ The XMPP Registrar shall maintain a registry of entity versioning + profiles. All EV profile registrations shall be defined in separate + specifications (not in this document). Application types defined within + the XEP series MUST be registered with the XMPP Registrar, resulting in + protocol URNs of the form "urn:xmpp:entityver:profile:name:X" (where + "name" is the registered name of the profile and "X" is a non-negative + integer). +
+ ®PROCESS; +
+ The name of the entity versioning profile.
+ A natural-language summary of the profile.
+
+ The document in which the original list definition is specified.
+
+
+ The document in which the EV profile for the list is specified (may be the
+ same as <listdev/>).
+
+
+ ]]>
+ This specification defines the following entity versioning profile:
+
+ Upon advancement of this specification from a status of Experimental to a
+ status of Draft, the ®ISTRAR; shall add the following definition to
+ the entity versioning profiles registry, as described in this document:
+
+
+
This specification uses STANAG 5066 Edition 3 "PROFILE FOR HF RADIO DATA COMMUNICATIONS" (December 2010).
-STANAG 5066 is a NATO UNCLASSIFED (Releasable to the Public) document that may circulated freely. The author has requested permission form NATO to enable publishing of this document on the Web.
+STANAG 5066 is a NATO UNCLASSIFED (Releasable to the Public) document that may circulated freely. It is available on http://nso.nato.int/nso/zPublic/stanags/CURRENT/5066Ed03.pdf
Kevin Smith provided useful comments on this specification.
++ Dave Cridland asked NATO about STANAG 5066 publication, leading to its availability on the Web. +
First draft.
- This specification arose from requirements to operate over HF Radio, which has exceedingly high latency (sometimes minutes) low data rates (down to 75 bits/second) and poor reliablity. STANAG 5066 is a widely used link level protocol. Direct use of STANAG 5066 enables elimination of all extraneous end to end handshaking, which is important to optimize performance. It also enables use of STANAG 5066 flow control, which is important for reslience. - -
-- The solution is based on XEP-0361 "Zero Handshake Server to Server Protocol" and requires peer configuration to be established according to XEP-0361. The data exchanged between the XMPP servers follows exactly what is specified in XEP-0316. The data is transferred using STANAG 5066 rather than using TCP. - -
-- This specification can be considered as a profile for server to server XMPP communication, to enable XMPP deployment over HF Radio using STANAG 5066. This profile MUST only be used where its use has been pre-agreed and configured for both participating servers. -
-- An example scenario where this protocol is important is where two ships connected by HF Surface Wave communication only need to exchange XMPP messages. A reliable link (Soft Link) can be established using STANAG 5066 and XMPP communicated efficiently and reliably. - -
-- Because of potentially very low bandwidth sending server MAY perform traffic optimisation, such as selective removal of stanzas that are not adding sufficient value, like CSNs, or strip selected elements such as xhtml-im. -
-- Applications sending data over STANAG 5066 need to be aware of increased delays and any application level timers (e.g., IQ response timers) need to be set accordingly. -
-- XEP-0361 transfer of data between a pair of XMPP servers is a byte stream flowing in each direction over TCP. There is no other protocol or hand shaking. - When carried instead over STANAG 5066, these byte streams are transmitted as a sequence of blocks transferred in order - Each block is an XML stanza, holding message, presence or iq. Essentially the stream is broken into blocks (stanzas) at natural boundaries XMPP boundaries, and then reassembled on reception into the original stream. - - -
-- XEP-0198 Stream Management MUST not be used over STANAG 5066, as reliability of stanza transfer is handled by use of STANAG 5066. Application-layer keepalives and timeout detection such as white-space pings and XEP-0199 MUST NOT be used. -
- -- Each stanza is transferred using the RCOP (Reliable Connection Oriented Protocol) defined in Section F.8 of Annex F of STANAG 5066. This reliably transfers the block of data to the destination. If a soft link needs to be established this will be done by the STANAG 5066 service. The XEP-0361 peer agreement is supported by a flow of stanzas in each direction being transferred by RCOP. The peer agreement will use this flow of stanzas to provide a service equivalent to the TCP connection or connections of XEP-0361. -
-- STANAG 5066 SIS Delivery Confirmation MAY be set to NODE DELIVERY, as this gives optimum network performance. CLIENT DELIVERY MAY be used, which increases reliability as stanza delivery to the peer XMPP server is guaranteed and the sending server will receive acknowledgements equivalent to XEP-0198 support. In the event of delivery failure, the whole RCOP PDU (Stanza) MUST be retransmitted. -
- -- The peer addressing of the STANAG 5066 end points will be configured as part of the XEP-03161 peer agreement. -
-- The STANAG 5066 SAP MAY be set to any mutually agreed value. It is RECOMMENDED that 2 is used. This is the standard SAP for RCOP. -
-- The RCOP connection ID number will be set to a mutually agreed value. It is RECOMMENDED that 0 is used as the preferred value. -
-- Security Considerations of XEP-0361 apply. STANAG 5066 will frequently be employed in conjunction with link level crypto devices, which SHOULD be done when appropriate to provide data confidentiality. -
- -This specification uses STANAG 5066 Edition 3 "PROFILE FOR HF RADIO DATA COMMUNICATIONS" (December 2010).
-STANAG 5066 is a NATO UNCLASSIFED (Releasable to the Public) document that may circulated freely. It is available on http://nso.nato.int/nso/zPublic/stanags/CURRENT/5066Ed03.pdf
-- Curtis King designed and validated the approach documented in this XEP. -
-- Kevin Smith provided useful comments on this specification. -
-- Dave Cridland asked NATO about STANAG 5066 publication, leading to its availability on the Web. -
-Initial published version approved by the XMPP Council.
First draft.
+ This specification arose from requirements to operate over HF Radio, which has exceedingly high latency (sometimes minutes) low data rates (down to 75 bits/second) and poor reliablity. STANAG 5066
+ The solution is based on &xep0361; and requires peer configuration to be established according to XEP-0361. The data exchanged between the XMPP servers follows exactly what is specified in XEP-0361. The data is transferred using STANAG 5066 rather than using TCP. + +
++ This specification can be considered as a profile for server to server XMPP communication, to enable XMPP deployment over HF Radio using STANAG 5066. This profile MUST only be used where its use has been pre-agreed and configured for both participating servers. +
++ An example scenario where this protocol is important is where two ships connected by HF Surface Wave communication only need to exchange XMPP messages. A reliable link (Soft Link) can be established using STANAG 5066 and XMPP communicated efficiently and reliably. + +
++ Because of potentially very low bandwidth sending server MAY perform traffic optimisation, such as selective removal of stanzas that are not adding sufficient value, like CSNs, or strip selected elements such as xhtml-im. +
++ Applications sending data over STANAG 5066 need to be aware of increased delays and any application level timers (e.g., IQ response timers) need to be set accordingly. +
++ XEP-0361 transfer of data between a pair of XMPP servers is a byte stream flowing in each direction over TCP. There is no other protocol or hand shaking. + When carried instead over STANAG 5066, these byte streams are transmitted as a sequence of blocks transferred in order + Each block is an XML stanza, holding message, presence or iq. Essentially the stream is broken into blocks (stanzas) at natural boundaries XMPP boundaries, and then reassembled on reception into the original stream. + + +
++ &xep0198; MUST not be used over STANAG 5066, as reliability of stanza transfer is handled by use of STANAG 5066. Application-layer keepalives and timeout detection such as white-space pings and &xep0199; MUST NOT be used. +
+ ++ Each stanza is transferred using the RCOP (Reliable Connection Oriented Protocol) defined in Section F.8 of Annex F of STANAG 5066. This reliably transfers the block of data to the destination. If a soft link needs to be established this will be done by the STANAG 5066 service. The XEP-0361 peer agreement is supported by a flow of stanzas in each direction being transferred by RCOP. The peer agreement will use this flow of stanzas to provide a service equivalent to the TCP connection or connections of XEP-0361. +
++ STANAG 5066 SIS Delivery Confirmation MAY be set to NODE DELIVERY, as this gives optimum network performance. CLIENT DELIVERY MAY be used, which increases reliability as stanza delivery to the peer XMPP server is guaranteed and the sending server will receive acknowledgements equivalent to XEP-0361 support. In the event of delivery failure, the whole RCOP PDU (Stanza) MUST be retransmitted. +
+ ++ The peer addressing of the STANAG 5066 end points will be configured as part of the XEP-0361 peer agreement. +
++ The STANAG 5066 SAP MAY be set to any mutually agreed value. It is RECOMMENDED that 2 is used. This is the standard SAP for RCOP. +
++ The RCOP connection ID number will be set to a mutually agreed value. It is RECOMMENDED that 0 is used as the preferred value. +
++ Security Considerations of XEP-0361 apply. STANAG 5066 will frequently be employed in conjunction with link level crypto devices, which SHOULD be done when appropriate to provide data confidentiality. +
+ +This specification uses STANAG 5066 Edition 3 "PROFILE FOR HF RADIO DATA COMMUNICATIONS" (December 2010).
+STANAG 5066 is a NATO UNCLASSIFED (Releasable to the Public) document that may circulated freely. It is available on http://nso.nato.int/nso/zPublic/stanags/CURRENT/5066Ed03.pdf.
++ Curtis King designed and validated the approach documented in this XEP. +
++ Kevin Smith provided useful comments on this specification. +
++ Dave Cridland asked NATO about STANAG 5066 publication, leading to its availability on the Web. +
+- Some use cases require the client to generate the stanza ID. In this case, the client MUST use 'client-id' as attribute name for the ID. + Some use cases require the client to generate the stanza ID. In this case, the client MUST use the 'client-id' element.
- The server MAY add an 'id' attribute to the stanza-id element. In that case, it MUST preserve the content of the 'client-id' attribute. + The server or component MAY add a stanza-id element. In that case, it MUST preserve the content of the 'client-id' element.