This Document explain how did work DChub Cluster mode.
------------------------------------------------------

I Why

The Cluster Mode had been added to allow DCHUB users to create sprawing hub,
using more that one internet connection. Without this feature an ADSL 1024/256
host cannot host more than 120 users (keeping a good service quality). Using
dchub misc antiflood system you can have more users.

The DChub cluster can allow you to :
- Keep a hub online despite of the 24h disconnection from certain ISP.
- Route internationnal trafic.
- Host thousand users.



II How did It work

DCHub have 2 multihub topology:

a fully connected multi server topology, managed with the -fusion function.

     [Server 1] -------- [Server 2]
        |   |    \______  /     |  \
        |   |           \/      |   \
        |   |       ____/\      |    |
        |   |      /      \     |    |
        | [Server 5] ____  \    |    |
        |   |            \  \   |    |
    [Server 3] --------- [Server 4]  |
           \________________________/

This multiserver mode (called Type I) fit for low stability connection (ADSL for
example), even if a hub crashs, the virtual hub will only lost the users hosted
by the disconnected hub. When the lost server will become available, all the
interhub connection will automatically be recreated.



an irc like Multi server topology, manage with the -linkhub function.

      [Server 1]        [Server 5]
         \                 |
           \               |
         [Server 2]----[Server 3]
            |
            |
         [Server 4]

This multiserver mode work like irc, and need stable connections (even if it can
work without). In the previous drawing, if the Server 2 lost all its
connections, the Server 1 and 4 will stay alone and the 3 and 5, will stay
connected, in other word, the virtual hub will be splitted in 3 parts. This
connection is named Type III



FAQ:
- Why is there no connection Type II ?
The connection Type II is used in same time that the Type I, when
having more the 2 Hub connected.
- Why are the schemas are so nasty ?
hmmm, I'm not an expert in ASCI art's.



III How to use it

3.1 general.

a) create a new Account with 'F' privilege.

b) don't forget to set the Hubaddr key value to a valid dns or IP in all your
   hub.

c) choose a multihub user/passwd, that you will use in all you're hubs, then
   give them to all the hub's using -setfusionpass and -setfusionuser.

now you can start the fusions.

3.2 TYPE I/II

To use this connection, choose a hub that will be the MASTER hub from your TYPE
I/II cluster, and in all the others hubs write
-fusion MASTER_DNS:port
in the Hub-Security. (you can omit the :port if you're using the default port).

3.2 TYPE III
The multi Hub Type III is more easy to use, link the hub the way you want,
But:
- do not create Loop !!!.
- a hub having a CNX Type I cannot create a new CNX Type I.
- the more the host is stable the more hublink you should create on it.

3.3 TYPE I + III

     [Server 1] -------- [Server 2]      \
        |   |    \______  /     |  \     |
        |   |           \/      |   \    | 5 servers
        |   |       ____/\      |    |   | interconnected
        |   |      /      \     |    |   | With
        | [Server 5] ____  \    |    |   | CNX TYPE I
        |   |            \  \   |    |   |
  /-[Server 3] --------- [Server 4]  |   |
  |     |  \________________________/    /
  |     |
  |     |
  |  [Server 6] -- [Server 7]            \
  |     |     \    /     |               |
  |     |      \  /      |               | 4 servers
  |     |       \/       |               | interconnected
  |     |       /\       |               | With
  |     |      /  \      |               | CNX TYPE I
  |     |     /    \     |               |
  |  [Server 9] -- [Server 8]            /
  |
  |
 [Server 10] -- [Server 12]             \
    |           /                       |
    |          /                        | 3 servers
    |         /                         | interconnected
    |        /                          | With
    |       /                           | CNX TYPE I
    |      /                            |
 [Server 11]                            /

 \___________________________________/
   3 virtual Hub interconnected
         With CNX Type III

IV Conclusion

