This project simulates network latencies and evaluates the performance of quorum-reaching algorithms under different attack strategies. The simulation compares normal latencies with enhanced security measures using Vivaldi coordinates.
To run this simulation, you need Python 3.x installed. Follow the steps below to set up the environment:
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Create a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required dependencies:
pip install -r requirements.txt
To run the simulation, use the following command:
python main.py --data <dataset> --out <output_directory> --multiprocess
--data
or-d
: Specifies the dataset to be used for simulating latencies in the network. Possible values areking
,wonder
, andplanet
. Default iswonder
.--out
or-o
: Specifies the output directory for the plots. Default is the current directory.--multiprocess
or-p
: Enables the experimental feature to run the program in a multiprocess fashion. Default isFalse
.
Example command:
python main.py --data king --out ./output --multiprocess
- main.py: The main entry point of the script. It defines the command-line interface and runs the simulation.
- plots/simulation_average_quorum_time.py: Contains the simulation logic and functions to run the simulation and generate plots.
- data_generation/: Directory containing utilities for data generation and handling network latency data.
- vivaldi/: Directory containing the implementation of Vivaldi coordinates and related attack strategies.
- aware/: Directory containing attack strategies specific to the AWARE protocol.
- simulate_normal_latencies: Simulates normal latencies without enhanced security measures.
- simulate_vivaldi_latencies: Simulates latencies using Vivaldi coordinates for enhanced security.
- plot_results: Plots the results of the simulations.
- run_one_simulation: Runs a single simulation for a specific set of parameters.
- run_simulation_over_all_behaviour: Runs the simulation over all defined attack strategies and plots the results.
This project is licensed under the MIT License. See the LICENSE file for details.