Chord Protocol: Implementation of chord protocol over collection of nodes in java. Both node join and deletion is implemented. In this node will leave gracefully i.e by notifying his fellow nodes. Also this is reliable as file is also distributed to fellow node before leaving.
There are four folder named 1, 2, 3, 4 representing 4 different nodes and each node contain a folder nodeFile which stores the file of a particular node. Also each folder contains a script to generate 100 file which is used later as example files.
Java (jdk 8)
Navigate to each folder and open a terminal in each folder (for running the commands designed for the protocol). Each terminal basically represents a node.
use this command:
javac Chord.java
java Chord
Node Joined in Network and Id assigned to it is16
Enter Port number if you Know someone else enter -1
if it's the first node first use :
sh fileCreator.sh
it creates 100 file in nodeFile folder of particular node.
To know the port number either look in code or Enter 1 when display menu comes.
java Chord
****Node Joined in Network and Id assigned to it is ****16
Enter Port number if you Know someone else enter -1 -1
Finger table intialized for this node
Enter respective choices
- own IP address and ID
- The IP address and ID of the successor and predecessor.
- The file key IDs it contains
- Its own finger table
- To leave network
In order to extend this to more number of node just create another folder with chord.java file and nodeFile folder plus filecreator.sh and change the port in code an try to avoid collision of id's with previous node.