JEP-xxxx: Smart Presence Distribution

This document documents the current distribution model for presence and introduces a smart presence distribution strategy to cut down on S2S traffic and load.


WARNING: This document has not yet been accepted for consideration or approved in any official manner by the Jabber Software Foundation, and this document must not be referred to as a Jabber Enhancement Proposal (JEP). If this document is accepted as a JEP by the Jabber Council, it will be published at <http://www.jabber.org/jeps/> and announced on the <standards-jig@jabber.org> mailing list.


JEP Information

Status: ProtoJEP
Type: Standards Track
Number: xxxx
Version: 0.0.1
Last Updated: 2006-04-15
JIG: Standards JIG
Approving Body: Jabber Council
Dependencies: XMPP Core, XMPP IM
Supersedes: None
Superseded By: None
Short Name: Not yet assigned

Author Information

Philipp Hancke

Email: fippo@jabber.goes.symlynX.com
JID: fippo@goodadvice.pages.de

Carlo von Loesch

Email: lynX@jabber.getting.psyced.org
JID: lynX@ve.symlynX.com

Legal Notice

This Jabber Enhancement Proposal is copyright 1999 - 2006 by the Jabber Software Foundation (JSF) and is in full conformance with the JSF's Intellectual Property Rights Policy <http://www.jabber.org/jsf/ipr-policy.shtml>. This material may be distributed only subject to the terms and conditions set forth in the Creative Commons Attribution License (<http://creativecommons.org/licenses/by/2.5/>).

Discussion Venue

The preferred venue for discussion of this document is the Standards-JIG discussion list: <http://mail.jabber.org/mailman/listinfo/standards-jig>.

Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the Jabber Software Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this JEP has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.

Conformance Terms

The following keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".


Table of Contents

1. Introduction
2. Example Scenario
3. Glossary
4. Broad Unicast Model
4.1. Protocol
5. Smart Unicast Model
5.1. Protocol
5.2. Integration with Privacy Lists
5.3. Further Application
6. Security Considerations
7. IANA Considerations
8. Jabber Registrar Considerations
Notes
Revision History


1. Introduction

This document describes an optimized strategy of presence delivery called "Smart Unicast" to address the most pressing scalability issues involved with the currently used "Broad Unicast" strategy. The technique described is already successfully in use with the PSYC (Protocol for SYnchronous Conferencing) [1] as a part of its approach to multicasting.

2. Example Scenario

Upon receiving a presence stanza from a client lacking a 'to' address, the server must distribute this information on behalf of the client. We will first present the characters used in the examples, then show how the same operation of presence distribution is achieved using the old and the new distribution strategies.

Table 1: Dramatis Personae

Name JID Status
Romeo romeo@montague online
Abram, servant of Montague abram@montague online
Balthasar, servant of Montague balthasar@montague offline
Juliet juliet@capulet online, with resources balcony and chamber
Nurse nurse@capulet online
Peter peter@capulet online
Sampson sampson@capulet online
Gregory gregory@capulet online
Anthony anthony@capulet offline
Potpan potpan@capulet offline

Romeo enters the scene and sends his initial presence to all subscribers. At the same time he also probes the presence of his subscribers to obtain an up-to-date buddy list.

3. Glossary

Unicast -- delivery of information to a single destination.

Broadcast -- delivery of information to every destination on the network.

Multicast -- delivery of information to a group of destinations simultaneously using the most efficient strategy to deliver messages over each link of the network only once and create clones when the links to the destinations split.

4. Broad Unicast Model

In the XMPP specification this strategy is referred to as 'Broadcast Model'. To avoid confusion with other meanings of the term 'broadcast' we prefer to speak of 'Broad Unicast'.

The Montague server fans out a copy of the presence information to each peer, even if more than one peer happens to use the same receiving server.

The list of receivers is computed by the Montague Server based on subscription information in the roster of Romeo.

Note that the Capulet Server already handles distribution to all of Juliets available resources.

Romeo -------> Montague Server ----------> Capulet Server ------> Juliet (balcony)
					   Capulet Server ------> Juliet (chamber)
               Montague Server ----------> Capulet Server ------> Nurse
               Montague Server ----------> Capulet Server ------> Peter
	       Montague Server ----------> Capulet Server ------> Sampson
               Montague Server ----------> Capulet Server ------> Gregory
               Montague Server ----------> Capulet Server (Anthony is offline)
               Montague Server ----------> Capulet Server (Potpan is offline)
               Montague Server ----> Abram
               Montague Server (Balthasar is offline)

4.1 Protocol

Client sends presence without "to" attribute

<presence/> 
      

Local server distributes on behalf of the client

<presence from='romeo@montague/inlove' to='juliet@capulet'/>
<presence from='romeo@montague/inlove' to='juliet@capulet' type='probe'/>
<presence from='romeo@montague/inlove' to='nurse@capulet'/>
<presence from='romeo@montague/inlove' to='nurse@capulet' type='probe'/>
<presence from='romeo@montague/inlove' to='peter@capulet'/>
<presence from='romeo@montague/inlove' to='peter@capulet' type='probe'/>
<presence from='romeo@montague/inlove' to='sampson@capulet'/>
<presence from='romeo@montague/inlove' to='sampson@capulet' type='probe'/>
<presence from='romeo@montague/inlove' to='gregory@capulet'/>
<presence from='romeo@montague/inlove' to='gregory@capulet' type='probe'/>
<presence from='romeo@montague/inlove' to='anthony@capulet'/>
<presence from='romeo@montague/inlove' to='anthony@capulet' type='probe'/>
<presence from='romeo@montague/inlove' to='potpan@capulet'/>
<presence from='romeo@montague/inlove' to='potpan@capulet' type='probe'/>
<presence from='romeo@montague/inlove' to='abram@montague'/>
      

And it replies to the local probe queries as appropriate.

Capulet Server proxies the packets

<presence from='romeo@montague/inlove' to='juliet@capulet'/> (to balcony resource)
<presence from='romeo@montague/inlove' to='juliet@capulet'/> (to chamber resource)
<presence from='romeo@montague/inlove' to='nurse@capulet'/>
<presence from='romeo@montague/inlove' to='peter@capulet'/>
<presence from='romeo@montague/inlove' to='sampson@capulet'/>
<presence from='romeo@montague/inlove' to='gregory@capulet'/>
      

And it replies to its local probe queries as appropriate.

5. Smart Unicast Model

This new approach however leaves it to the receiving server to sort out who is to receive the information, thus cutting down on interserver traffic dramatically.

In the example, the Montague Server sends a single presence to the Capulet Server, which is then distributed based on the subscription information in all Capulet rosters.

Romeo -------> Montague Server ----------> Capulet Server ------> Juliet (balcony)
					   Capulet Server ------> Juliet (chamber)
			                   Capulet Server ------> Nurse
                                           Capulet Server ------> Peter
                                           Capulet Server ------> Sampson
                                           Capulet Server ------> Gregory
			                   Capulet Server (Anthony is offline)
			                   Capulet Server (Potpan is offline)
               Montague Server ---> Abram
               Montague Server (Balthasar is offline)

This document proposes to extend the 'jabber:server' namespace to allow stanzas not to possess a 'to' attribute also in S2S traffic.

Upon receiving a stanza without 'to' attribute, the receiving server must distribute it to a list of recipients, the local context subscriber list, that is determined based upon the bare JID of the 'from' attribute.

5.1 Protocol

For presence, this list is to be determined based on who is subscribed to the senders presence notification.

Client sends presence without "to" attribute

<presence/> 
    

Local server distributes to online local clients

<presence from='romeo@montague/inlove' to='abram@montague'/>
    

The local messages are delivered and probes responded to as before.

Local server distributes to involved servers

<presence from='romeo@montague/inlove'/>
<presence from='romeo@montague/inlove' type='probe'/>
    

But from now on only one copy of the message is sent to each remote servers, simple and short. Upon receiving this stanza, the capulet server looks up who is subscribed to the bare JID, in this example 'romeo@montague', and sends each of the subscribers a copy:

Remote server distributes each packet to those subscribers which are online

<presence from='romeo@montague/inlove' to='juliet@capulet'/> (to balcony resource)
<presence from='romeo@montague/inlove' to='juliet@capulet'/> (to chamber resource)
<presence from='romeo@montague/inlove' to='nurse@capulet'/>
<presence from='romeo@montague/inlove' to='peter@capulet'/>
<presence from='romeo@montague/inlove' to='sampson@capulet'/>
<presence from='romeo@montague/inlove' to='gregory@capulet'/>
    

It also replies to the probe query for each of its subscribers.

5.2 Integration with Privacy Lists

This model defeats the <presence-out/> function of privacy lists.

As definining a more elaborate protocol for the <presence-out/> privacy list function is beyond the scope of this document, it is recommended not to use the 'Smart Unicast' distribution model with a particular server, whenever the user has defined a privacy list containing at least one user of that server. Simply revert to the 'Broad Unicast' model in this case.

5.3 Further Application

The 'Smart Unicast' model can be applied to any one-to-many communication, such as multi-user chat and pubsub. Inspecting these options is however beyond the scope of this document and will be addressed in future documents.

6. Security Considerations

It should be noted that the 'Broad Unicast' model SHOULD limit the size and frequency of presence "broadcasts", otherwise it may be vulnerable to Denial-of-Service attacks.

7. IANA Considerations

This JEP requires no interaction with the Internet Assigned Numbers Authority (IANA) [2].

8. Jabber Registrar Considerations

This JEP requires no interaction with the Jabber Registrar [3].


Notes

1. PSYC (Protocol for SYnchronous Conferencing) is a distributed chat and messaging protocol which was designed with elaborate multicast distribution strategies in mind. For further information, see <http://www.psyc.eu>.

2. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

3. The Jabber Registrar maintains a list of reserved Jabber protocol namespaces as well as registries of parameters used in the context of protocols approved by the Jabber Software Foundation. For further information, see <http://www.jabber.org/registrar/>.


Revision History

Version 0.0.1 (2006-04-15)

First draft.

(ph)

Version 0.0.2 (2006-04-21)

2nd draft.

(cvl)

Version 0.0.3 (2006-05-11)

Juliet gets a second resource.

(ph)


END