[jdev] Routing

Artur Hefczyc ajdev at tigase.org
Mon Jun 23 07:21:18 CDT 2008


Hi Jonathan,

First - you didn't tell us what you are writing about...
Are you working on kind of clustering implementation for some server
or what?

Anyway.
I think the basic idea is good. I mean with the token-ring like
implementation.

This is how clustering in Tigase server is implemented.
It is more like on your second diagram:

Router-1   <----->   Router-2   <------->   Router-n

There are SM, c2s, s2s and possible other components (MUC, PubSub)
attached to each router. Routers deliver packets to components by
the packet address. Whole clustering is implemented on the component
level. The component decides whether the packet can be processed
locally or it should be forwarded to a different cluster node.

This is because each component has different needs about clustering
so the logic must be inside the component otherwise the router
implementation would be too complex and couldn't be generic.

Artur

On 23 Jun 2008, at 12:42, Jonathan Dickinson wrote:

> Hey All,
>
> You will need a monospace font for this one :).
>
> Can anyone give me some advice on this problem? From what I can  
> tell, currently routers are a congestion point for all components.  
> E.g.
>
> +--------+
> | ROUTER +-S2S
> +---+----+
>    |
>   C2S
>
> As you can see the performance of the whole server depends on the  
> router, and the router can't be scaled horizontally by clustering it  
> (as far as I can tell). Like as follows:
>
> +--------+   +--------+
> | ROUTER +---+ ROUTER +-C2S
> +--------+   +--------+
> |        |   |        |
> C2S     C2S  C2S      S2S
>
> Can anyone correct me on this?
>
> I came up with the following solution to the problem:
>
>              C2S      S2S
>               |        |
>               +--------+
>               | ROUTER |
>               +----+---+
>              /     |    \
> C2S-+--------+ +----+---+ +--------+-C2S
>    | ROUTER +-+ FAILURE+-+ ROUTER |
> C2S-+--------+ +----+---+ +--------+-C2S
>              \     |    /
>               +----+---+
>               | ROUTER |
>               +--------+
>               |        |
>              S2S      S2S
>
> The router network works like a token ring network, only that there  
> is no token. Each router can send the packet along to the next as it  
> wishes (in one direction only). The following flow would apply:
>
> <!-- Router1 -->
> <route from="c2s1.50" to="joe at joe.com">
>  ...
> </route>
>
> <!-- Router2 -->
> <route from="r1" to="joe at joe.com">
>  <visit name="r1"/>
>  ...
> </route>
>
> <!-- Router3 -->
> <route from="r2" to="joe at joe.com">
>  <visit name="r1"/>
>  <visit name="r2"/>
>  ...
> </route>
>
> If at any point one of the routers handles the packet successfully  
> it simply stops passing the route node around. If the route node  
> visits the same router twice it:
>
> a. If the node is from 'this' domain send it to the failure node.
> b. If the node is not from 'this' domain:
>   1. If I have a S2S component attached send it to that.
>   2. If I don't have a S2S component attached send it on.
>
> Components would send failures if no connected client is found: thus  
> making the router continue routing the packet.
>
> The sexy thing about this is that you should be able to remove and  
> connect routers to the network without bringing the whole thing down.
>
> Great so far, this would work well with single-sign-in capable  
> systems (i.e. no resources/priorities like MSN). Now, I can't for  
> the life of me figure out a way to handle resources and priorities.  
> One way would be to (but it's ugly):
>
> Component gets route packet:
>
> <route from="r4" to="joe at joe.com">
>  <visit name="r3"/>
>  <visit name="r4"/>
>  <priority name="c2s4.1" resource="home" value="0"/>
>  <priority name="c2s3.50" resource="mobile" value="50"/>
>  ...
> </route>
>
> Thus each stanza would make a complete trip round the network (2 at  
> worst) before it could be sent. Does anyone have any clever ideas  
> how to get around this?
>
> Thanks!
>
> Jonathan
> _______________________________________________
> JDev mailing list
> FAQ: http://www.jabber.org/discussion-lists/jdev-faq
> Forum: http://www.jabberforum.org/forumdisplay.php?f=20
> Info: http://mail.jabber.org/mailman/listinfo/jdev
> Unsubscribe: JDev-unsubscribe at jabber.org
> _______________________________________________

Artur
-- 
Artur Hefczyc
http://www.tigase.org/
http://artur.hefczyc.net/




More information about the JDev mailing list