From 38bd5b56f9a0bd8b1e2e01fd0c03a6f787d5f419 Mon Sep 17 00:00:00 2001 From: Youngjoon Lee <5462944+youngjoon-lee@users.noreply.github.com> Date: Mon, 15 Jul 2024 23:44:56 +0900 Subject: [PATCH] update readme --- mixnet/sim/README.md | 28 +++++++++++++++++++++++++--- mixnet/sim/state.py | 3 ++- mixnet/sim/stats.py | 2 +- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/mixnet/sim/README.md b/mixnet/sim/README.md index 5fa2a2a..8600862 100644 --- a/mixnet/sim/README.md +++ b/mixnet/sim/README.md @@ -1,5 +1,26 @@ # NomMix Simulation +* [Features](#features) +* [Future Plans](#future-plans) +* [Installation](#installation) +* [Getting Started](#getting-started) + +## Features + +- Simulate the NomMix protocol with the given parameters. +- Measure the performance of the NomMix protocol. + - Bandwidth usages +- Analyze the privacy properties that the NomMix protocol provides. + - Message sizes + - Node states and hamming distances + +## Future Plans + +- Simulate more features of the NomMix protocol. + - Temporal mixing + - Level-1 noise +- Simulate possible adversarial attacks and measure the robustness of the NomMix protocol. + ## Installation Clone the repository and install the dependencies: @@ -11,7 +32,7 @@ source .venv/bin/activate pip install -r requirements.txt ``` -## Getting started +## Getting Started Copy the [`mixnet/sim/config.ci.yaml`](./config.ci.yaml) file and adjust the parameters to your needs. Each parameter is explained in the config file. @@ -26,13 +47,14 @@ All results are printed in the console as below. And, all plots are shown once all analysis is done. ``` ========================================== - Message Size Distribution +Message Size Distribution ========================================== msg_size count 0 1405 99990 ========================================== - Node States of All Nodes over Time +Node States of All Nodes over Time +SENDING:-1, IDLE:0, RECEIVING:1 ========================================== Node-0 Node-1 Node-2 Node-3 Node-4 0 0 0 0 0 0 diff --git a/mixnet/sim/state.py b/mixnet/sim/state.py index 1d203f0..fbbd033 100644 --- a/mixnet/sim/state.py +++ b/mixnet/sim/state.py @@ -32,7 +32,8 @@ class NodeStateTable: # Convert NodeState enum to their integer values df = df.map(lambda state: state.value) print("==========================================") - print(" Node States of All Nodes over Time") + print("Node States of All Nodes over Time") + print(", ".join(f"{state.name}:{state.value}" for state in NodeState)) print("==========================================") print(f"{df}\n") diff --git a/mixnet/sim/stats.py b/mixnet/sim/stats.py index 0efbae2..a3e7eb5 100644 --- a/mixnet/sim/stats.py +++ b/mixnet/sim/stats.py @@ -43,7 +43,7 @@ class ConnectionStats: df = pandas.DataFrame.from_dict(sizes, orient="index").reset_index() df.columns = ["msg_size", "count"] print("==========================================") - print(" Message Size Distribution") + print("Message Size Distribution") print("==========================================") print(f"{df}\n")