Chat program without a central server

chatsecurity

I'm developing a chat application (in VB.Net). It will be a "secure" chat program. All traffic will be encrypted (I also need to find the best approach for this, but that's not the question for now).

Currently the program works. I have a server application and a client application. However I want to setup the application so that it doesn't need a central server for it to work.

What approach can I take to decentralize the network?

I think I need to develop the clients in a way so that they do also act as a server.

How would the clients know what server it needs to connect with / what happens if a server is down? How would the clients / servers now what other nodes there are in the network without having a central server?

At best I don't want the clients to know what the IP addresses are of the different nodes, however I don't think this would be possible without having a central server.

As stated the application will be written in VB.Net, but I think the language doesn't really matter at this point.

Just want to know the different approaches I can follow.

Best Solution

Look for example at the paper of the Kademlia protocol (you can find it here). If you just want a quick overview, look at the Wikipedia page http://en.wikipedia.org/wiki/Kademlia. The Kademlia protocol defines a way of node lookups in a network in a decentral way. It has been successfully applied in the eMule software - so it is tested to really work.

It should cause no serious problems to apply it to your chat software.