Distance Vector routing with the ability to reroute messages to more relevant servers when clients move.
Matt Forster
001044201
Daya Guar
2016-11-30
- Nodejs + NPM:
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
npm install
: install package dependenciesnpm run start:server -- <server id> <server port>
start a servernpm run start:client -- <server address> <client port>
start a client
To define peers for a server when starting from the cli, add the peer object to it's environment file under PEERS
.
npm test
npm test:client
npm test:server
Tests include senarios for:
- Two clients and a single server:
Client -> Server -> Client
- Two clients and two servers:
Client -> Server <-> Server -> Client
- Two clients and five servers with limited knowledge:
Client -> Server -> Server <-> Server <-> Server -> Server -> Client
Socket Library Used: Nodejs Native Datagram Sockets
Servers use a distance vector sharing technique with the aim to create efficient forwarding routes. The weights on the routes are increased when clients communicate, and decrease over time (each server tick).
This allows for servers who communicate often with clients to receive their messages, and also allows for messages to be moved to more relevant servers when the clients change connections. Idle information is not propagated, and only recent information is saved.
Server Implementation: server/index.js
Client Implementation: client/index.js