%ents; ]>
Roster Versioning This specification proposes a modification to the XMPP roster management protocol to support versioning of rosters for more efficient downloading of the roster information. &LEGALNOTICE; 0237 Experimental Standards Track Standards Council XMPP Core XMPP IM NOT YET ASSIGNED &stpeter; 0.1 2008-03-05 psa

Initial published version; per Council consensus, removed optionality regarding semantics of the version attribute.

0.0.3 2008-03-05 psa

Corrected semantics of version attribute (should be a strictly increasing sequence number but may be any unique identifier).

0.0.2 2008-03-04 psa

Clarified description of roster diff; added diff attribute and specified its use in roster results; specified use of version attribute in roster pushes.

0.0.1 2008-03-04 psa

First draft.

&RFC3921BISNOTE;

RFC 3921 specifies that an XMPP client must retrieve the entire roster on login. However, XMPP rosters can be quite large and often the roster has not changed since it was last retrieved. If the client could cache the roster and retrieve only changes to the roster, the login process could be significantly streamlined, which could be especially valuable over low-bandwidth connections such as those common in mobile environments. This document defines a method for such streamlining, via the concept of roster versioning.

Note: This document is provided for discussion purposes in order to improve roster management in XMPP systems. It is not meant to supersede the text in RFC 3921. However, the recommendations in this document may be folded into rfc3921bis.

This document specifies the addition of a 'version' attribute to the &QUERY; element qualified by the 'jabber:iq:roster' namespace, as well as a 'diff' attribute for use in roster results.

The value of the 'version' attribute MUST be a non-negative integer representing a strictly increasing sequence number that is increased with any change to the roster (whether or not the client supports this extension) but MAY be a unique identifer that is opaque to the client but understood by the server. In any case, the 'version' attribute contained in roster pushes MUST be unique. A "change to the roster" is any addition, update, or removal of a roster item that would result in a roster push, including changes in subscription states, as described in RFC 3921 or rfc3921bis.

The attribute is used as described in the following sections.

If a server supports roster versioning, it MUST inform the client when returning stream features during the stream setup process, at the latest when informing the client that resource binding is required. This is done by including a <roster-versioning/> element qualified by the 'urn:xmpp:tmp:roster-versioning' namespace &NSNOTE;.

]]>

If a client supports roster versioning and knows that the server does so, it SHOULD include the 'version' attribute in its request for the roster, set to the last version it has cached.

]]>

If the client has not yet cached the roster or the cache is lost or corrupted, but the client wishes to bootstrap the use of roster versioning, it SHOULD include the 'version' attribute set to a value of zero (0).

If the roster has not changed since the version enumerated by the client, the server MUST return an empty IQ-result.

]]>

If the roster version has increased since the version enumerated by the client, the server MUST return a &QUERY; element that includes the latest version number.

The &QUERY; element SHOULD include the effective "diff" since the roster version enumerated by the client (including the complete roster item with name, group, and subscription state). If the roster result is a diff and not the complete roster, the server MUST include a 'diff' attribute set to a value of "true" or "1" &BOOLEANNOTE;. If the roster result is the complete roster and not a diff, the server SHOULD NOT include the 'diff' attribute (which defaults to "false" or "0").

Servants ]]>

The "roster diff" can be understood as follows:

  1. Imagine that the client had an active presence session for the entire time between its cached roster version (in this case, 305) and the new roster version (317).
  2. During that time, the client would have received roster pushes related to roster versions 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, and 317.
  3. However, some of those roster pushes might have contained intermediate updates to the same roster item (e.g., changes in the subscription state for bill@shakespeare.lit from "none" to "to" and from "to" to "both").
  4. The roster result would not include all of the intermediate steps, only the final result of all changes applied while the client was in fact offline.

When the server sends subsequent roster pushes to the client, it MUST include the updated roster version number.

]]>

It is possible that caching of the roster (rather than holding it in memory only for the life of the session) could introduce new vulnerabilities. Client implementations should take care to appropriately protect the cached roster information.

This document requires no interaction with &IANA;.

Until this specification advances to a status of Draft, the associated namespace for its stream feature shall be "urn:xmpp:tmp:roster-versioning"; upon advancement of this specification, the ®ISTRAR; shall issue a permanent namespace in accordance with the process defined in Section 4 of &xep0053;.

If this modification to the roster management protocol is added to rfc3921bis and approved by the IESG in the speficiation that supersedes RFC 3921, the schema for the roster management namespace would be changed as follows.

]]>
]]>

Thanks to Dave Cridland, Richard Dobson, Alexander Gnauck, and Pedro Melo for their comments.