Project 1
Instructor: Prof. Neeraj Mittal
Author: Malay Virendra Bhavsar (MXB230055)
This individual project implements a distributed system using the Chandy-Lamport snapshot-taking protocol and the MAP (Message Active Passive) protocol. Developed in Java (Version 22.0.2), the project emphasizes socket programming and distributed communication, running exclusively on the dcXX.utdallas.edu
machines.
The project comprises several essential components:
-
Node: Sets up Client, Server, and ChandyLamport instances; manages the configuration file.
-
Server: Oversees incoming communications and directs them appropriately.
-
Client: Manages outgoing communications, including application and control messages.
-
ChandyLamport: Implements the snapshot protocol and ensures the consistency of snapshots.
-
Message: Establishes a structured format for inter-process message exchange.
The project is divided into four main segments:
-
Part 1: Implement a distributed system with
n
nodes, each able to send messages according to the MAP protocol. Nodes transition between active and passive states based on message counts and delays. -
Part 2: Integrate Chandy and Lamport’s protocol to record a consistent global snapshot, initiated by node 0, to detect the termination of the MAP protocol.
-
Part 3: Implement Fidge/Mattern’s vector clock protocol to verify the consistency of snapshots through vector timestamps.
-
Part 4: Create a protocol for halting all nodes after node 0 detects MAP protocol termination.
The project utilizes a plain-text configuration file formatted as follows:
- The first line contains six tokens:
Number of nodes
minPerActive
maxPerActive
minSendDelay
snapshotDelay
maxNumber
.
- The next
n
lines specify node details:nodeId
hostname
port
- The subsequent
n
lines list neighboring nodes.
For a configuration file named <config_name>.txt
with n
nodes, the program will generate n
output files named <config_name>-<node_id>.out
. Each file contains vector timestamps for each snapshot recorded by the respective process.
Example Output:
0 4 3 6 0 2 3
3 7 6 7 2 4 4
6 9 11 10 5 7 5
8 12 14 23 8 10 7
- Ensure you have Java Development Kit (JDK) 22.0.2 installed.
- This project must be executed on the machines
dcXX.utdallas.edu
(where XX ∈ {01, 02, ..., 45}).
-
Create a project directory:
mkdir aos-project1 cd aos-project1
-
Place all project files (including the configuration file) in this directory.
-
Compile the project:
javac *.java
- Clean up before and after running the program:
chmod +x cleanup.sh
./cleanup.sh
- Run the program:
chmod +x launcher.sh
./launcher.sh
- Perform cleanup after use:
./cleanup.sh
To connect to the server at dcXX.utdallas.edu
, use the following command (omit the password):
ssh <your-username>@dcXX.utdallas.edu
Ensure that you replace with your actual username. After connecting, you can navigate to your project directory to compile and run your code.
The ./launcher.sh
and ./cleanup.sh
scripts are provided by the professor. All credits go to the respective owners for these contributions.
This project delves into the intricacies of distributed systems, showcasing effective communication and state consistency through the Chandy-Lamport protocol. We encourage you to explore these concepts deeply and enhance your understanding.
If you have any questions or require further assistance, please don't hesitate to reach out!