Online presence of Mridul
Archives
« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today
XML
Search

Links
 

Today's Page Hits: 0

« No progress for a... | Main | Minimising S2S traff... »
20061108 Wednesday November 08, 2006
Minimising S2S traffic in XMPP
Please refer to next post for more clarification and correction to this proposal

XMPP has federation built into the protocol - not an afterthought retrofitted in.
Even though it allows to build a mesh of trusted federated network, it does have issues of scale in terms of handling traffic.
Let us look at a typical issue and how we are thinking of solving it (since there is no standard way to 'fix' this right now) ...
Ofcourse, this would be an extension as of now and so would work only on/between Sun servers if/when we end up supporting it.

A simple problem statement

The scenario :

The scenario is slightly contrived :-) But is intentionally so to illustrate the problem.
Consider the following 'configuration'. Now consider this runtime situation :
  1. Users userA08, userA09 (domainA on serverA) and users userB08, userB09 (domainB on serverB) are online - all others are offline.
  2. User userA00 connects.
Let us analyze the situation when userA00 sends its available presence intially to serverA (a single xml stanza). In the current situation, this result in the following traffic between the various entities.
Local traffic
As you can see, it is as optimal as it can get .. only info to required subscribers is sent - and only info about subscribers who are available are sent. Now let us consider the traffic over the federated link (over S2S).
S2S traffic
If you compare the traffic between serverA to serverB connection and that of userA to serverA, it is immediately evident that it is highly skewed - the traffic between both server is suboptimal as compared to the traffic within a single server.
You have 30 stanza's over S2S, while the same thing has only 10 for user case - that is 2 * 'number of contacts' more !

Now, to be fair, the reasons for this should be evident.
serverA cannot trust serverB to 'do the right thing' - it cannot trust that the user's roster in serverA is in sync in serverB's users roster, etc.
The issues are many and boils down essentially to, who is responsible and accountable to whom : so serverA cannot offload his responsibility to serverB - that is a given.

How can we 'solve' this issue with these restriction ?
That is :
  1. serverA is accountable for its users and should make best case effort to make sure that there are no presence leaks and only contacts who are subscribed to user's presence according to serverA's roster get the update
  2. Minimize traffic as much as possible

A potential solution ?

What we are thinking of doing to solve this problem is the following :
Make following extensions to Extended Stanza Addressing, namely : So how does this help ?
Let us consider how we will use these extensions to solve our 'problems':
How it will work now : S2S traffic
In this case, we will have - 'list creation overhead' + 2 stanzas (presence and probe) + response for each jid in the list.
So we have the traffic coming down to optimal case + constant overhead !
Note :
  1. The actual list name would be assigned by serverB - and would be totally random to prevent collusions : no meaning can be derived out of it.
  2. The list can 'expire' at any time - so if serverA sends to a list and finds that it does not exist (serverB returns error), it MUST recreate it and send the stanza again to this new list : serverB MUST include the original stanza to nonexistant list in the error response.
  3. Other than the creator of the list - serverA and host of the list serverB, no one else knows the list details : and there should be no way for any other entity to query for this information.

posted by mridul Nov 08 2006, 10:00:44 PM IST Permalink Comments [2]

Trackback URL: http://blogs.sun.com/mridul/entry/minimising_s2s_traffic
Comments:

This would be quite useful for MUC services with regard to both presence and message as well.

Posted by JD Conley on November 10, 2006 at 01:16 AM IST #

Hi JD, There are two problems with using this for MUC : a) The MUC component should be 'aware' of this feature in the server - if a seperate component, I am not sure how this can be achieved. b) If users joining/leaving happens at a fast enough rate, then the (new) list creation overhead will offset the advantage to some extent. But yes, all in all, if something along this lines gets standardized - it will really help in minimising S2S traffic even while talking to non Sun IM servers ! - Mridul

Posted by Mridul on November 10, 2006 at 02:24 AM IST #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed