We want to create a chat application that allows for Peer to Peer chatting in a mesh network where nodes can connect/disconnect dynamically. The chat application operates without a central master server, i.e. each individual node routes received messages according to a set of routing instructions which are updated whenever the network topology changes.
The chat application itself will only have a rudimentary feature set, and the focus of the project will be on the following stuff:
- Implemeting an efficient method for updating the routing information of affected nodes whenever a node connects or disconnects from the network
- Implementing an optimized routing algorithm (based on existing shortest-path algorithms) for routing chat messages from one node to any other node in the network.
- Get a working version of the TEDA environment running on your machine
- Clone this repo inside the
apps
directory so that you have something like/teda_light_2/apps/p2pchat
- That's it.
In the p2pchat
dir, deploy the app to TEDA using the provided scripts
$ ../../scripts/depl_app.sh p2pchat make hosts_alive.conf
$ ../../scripts/depl_enodes.sh p2pchat hosts_alive.conf
First start by deploying a network of completely connected erlang nodes
$ ../../scripts/run.sh p2pchat "network:run()" hosts_alive.conf diufpc81.unifr.ch <username>
Then you can attach one or multiple chat clients to one of the nodes in the network:
$ erl -make
$ erl
> c(client).
> client:run().
... open another shell in the same directory
$ erl
> c(client).
> client:run().