nomos-specs/mixnet/v2/sim
Youngjoon Lee 30a82265c9
add time concept in readme
2024-05-15 19:41:48 +09:00
..
README.md add time concept in readme 2024-05-15 19:41:48 +09:00
config.py add weights for real_message_prob 2024-05-15 18:55:17 +09:00
config.yaml add time concept in readme 2024-05-15 19:41:48 +09:00
main.py analyze nodes who emitted messages around the promised interval 2024-05-15 18:01:42 +09:00
node.py add weights for real_message_prob 2024-05-15 18:55:17 +09:00
p2p.py analyze nodes who emitted messages around the promised interval 2024-05-15 18:01:42 +09:00
simulation.py analyze nodes who emitted messages around the promised interval 2024-05-15 18:01:42 +09:00
sphinx.py add comment 2024-05-13 13:58:22 +09:00

README.md

Mixnet v2 Simulation

How to Run

First, make sure that all dependencies specified in the requirements.txt in the project root. Then, configure parameters in the config.yaml, and run the following command:

python main.py --config ./config.yaml

The simulation runs during a specified duration, prints the results to the console, and show some plots.

Time in simulation

The simulation has been implemented based on SimPy which is discrete-event simulation framework. All events are processed sequentially by a single thread. However, multiple parallel events, which should be processed at the same time, can be also simulated by scheduling them at the same "time".

The simulation has the virtual time concept, which doesn't have the same scale as the real time. If the event A is scheduled to happen at time 10, and the event B is scheduled to happen at time 11, the simulation guarantees that the event B happens only after the event A happens. But, it doesn't mean that the event B happens exactly 1 second after the event A. It will be much shorter.

If two events are scheduled at the same time (e.g. 10), the simulation processes the one that is scheduled first and the other one next (FIFO). But, it is guarantees that those two event are processed before the events scheduled at time 11+.

Using this virtual time, complex distributed systems can be simulated in a simple way without worrying about the real-time synchronization. For more details, please see the Time and Scheduling section in the SimPy documentation.

Mixnet Functionalities

  • Modified Sphinx
    • Without encryption
    • With encryption
  • P2P Broadcasting
    • Naive 1:N
    • More realistic broadcasting (e.g. gossipsub)
  • Sending a real message to the mixnet at the promised interval
    • Each node has its own probability of sending a real message at each interval.
  • Cover traffic
    • All nodes have the same probability of sending a cover message at each interval.
  • Forwarding messages through mixes, and then broadcasting messages to all nodes if the message is real.
  • Mix delays
    • Naive random delays
    • More sophisticated delays (e.g. Poisson) if necessary

Adversary Models

  • Identifying nodes emitting messages around the promised interval.
    • With partial visibility
  • Correlating senders-receivers based on timing
  • Active attacks
  • Reporting & Visualization
    • With quantifying the effect of attacks above based on parameter changes.