This project was developed within the scope of the Distributed Systems course, of the Master's degree in Network and Information Systems Engineering at the Faculty of Sciences of the University of Porto, implemented in three separate packages. Each one focuses on distributed systems concepts and implements distinct functionalities.
- Implements a token ring network with N peers.
- Ensures mutual exclusion for accessing a calculator multi server.
- Peers communicate in a ring topology and use a token to access the server.
- Each peer generates requests based on a Poisson distribution (4 events/minute).
Run the following command in the project root:
make trg
- Start the server on a designated machine:
./trg_server.sh <serverHost> <serverPort>
- Start each peer on its respective machine:
./trg_peer.sh <host> <port> <nextPeerHost> <nextPeerPort> <ServerHost> <ServerPort>
- Inject the token into one of the peers to start the token ring:
./trg_injector.sh <peerHost> <peerPort>
- If a peer fails, the ring breaks. Restart the failed peer and re-inject the token to resume operation.
- Implements a P2P network with N peers.
- Each peer maintains a map of connected peers and disseminates the map using the Anti-Entropy Algorithm.
- Updates occur twice per minute following a Poisson distribution.
- Handles peer removal using timestamps for entries, removing peers when they exceed timeout.
Run the following command in the project root:
make p2p
Start each peer on its respective machine:
./p2p_peer.sh <host> <port> [<neighborHost> <neighborPort>...]
- If a peer fails, its neighbors will keep trying to connection. After a timeout, the failed peer is removed from the network.
- Restarting a failed peer before the timeout allows it to rejoin the network.
- Implements a chat application with N peers.
- Ensures a totally ordered sequence of messages using Lamport clocks.
- Messages are sent according to a Poisson distribution (1 event/second).
- Messages are ordered globally before processing, ensuring consistent output across all peers.
Run the following command in the project root:
make tom
Start each peer on its respective machine:
./tom_peer.sh <host> <port> [<neighborHost> <neighborPort>...]
- Peers not printing the same words, but they are printed in the same order for all peers.
- To compile all packages:
make
- Grant execution permissions for all shell scrips (
.sh
files):chmod +x *.sh
- To clean up compiled .class files:
make clean
Carlos Santos 201607406