Nomos Blend Simulation
Features
- The simulation runs multiple Nomos Blend nodes using netrunner.
- Each node implements the Nomos Blend Tier 1~3 protocols.
- Persistent Transmission
- Message Blending
- Cover Traffic
- Also, each node generates data messages probabilistically (similar as the consensus protocol).
- The simulation prints logs that can be used to analyze the following properties.
- Latency
- Bandwidth
- Anonymity
Configurations
The simulation can be configured by config/blendnet.json.
step_time and network_settings
We recommend setting the step time equal to the minimum latency in the network settings, in order to speed up the simulation. For example, if all regions are used, and if the minimum latency is 40ms (asia:asia), we recommend setting the step time to 40ms.
wards.sum
The simulation runs until the wards.sum number of messages (data or cover) arrive in
their last blend node and finally fully unwrapped.
Network Topology
The simulation constructs a network with the node_count number of nodes.
Each node establish connections with the connected_peers_count number of nodes randomly selected.
Nodes are distributed across multiple regions specified in the network_settings.regions.
Conneciton latency between regions can be set by network_settings.network_behaviors.
Protocol Parameters
Tier 1: Persistent Transmission
"persistent_transmission": {
"max_emission_frequency": 1.0,
"drop_message_probability": 0.0
},
We recommend setting max_emission_frequency to 1 message per second,
which is the same as the expected maximum message frequency configured in the consensus protocol
that will use the Nomos Blend protocol.
To disable drop messages, set drop_message_probability to 0.
Tier 2: Message Blending
"number_of_mix_layers": 2,
"max_delay_seconds": 10
The number_of_mix_layers is a parameter for the Cryptographic Processor. And, the max_delay_seconds is for Temporal Processor, which is the same as \Delta_{max} in the specification.
Tier 3: Cover Traffic
"epoch_duration": "432000s",
"slot_duration": "20s",
"slots_per_epoch": 21600,
"number_of_hops": 2,
These parameters are defined in the specification.
In short, each node selects the slots_per_epoch / node_count * (1 / number_of_hops) number of slots
at the beginning of each epoch. At every selected slot, the node generates a cover message.
Running the simulation
cargo build --release
../target/release/blendnet-sims run --input-settings ./config/blendnet.json
The simulation prints a bunch of logs that can be used for analysis. We recommend piping logs to a file.
Analysis
Bandwidth
The bandwidth consumed by each node is printed as a log at the end of the simulation.
The unit of bandwidth is bytes / second.
2025-02-17T11:20:36.540603Z INFO netrunner::runner::sync_runner: Network state: NetworkState { total_outbound_bandwidth: 1295032320, total_inbound_bandwidth: 1293844480, min_node_total_bandwidth: 7823360.0, max_node_total_bandwidth: 17039360.0, avg_node_total_bandwidth: 12938444.8 }
Latency
The analyze latency command reads a log generated by the simulation,
and analyzes the total latency of each message that has reached to its final blend node.
Also, it analyzes the latency of the connections that messages have traveled through. This is useful to compare the distribution of the used connections with the configured distribution of the nodes.
# Set the path of a log file printed from the simulation.
# Don't forget to use the step duration used in the simulation.
../target/release/blendnet-sims analyze latency --log-file <path> --step-duration 10ms
{
"message": {
"count": 101,
"min": 1160,
"min_payload_id": "38479093-25ee-4eaa-a055-3817b92c0265",
"q1": 4050.0,
"avg": 5448.316831683168,
"med": 5100.0,
"q3": 7030.0,
"max": 10110,
"max_payload_id": "1efd8780-b574-4aee-9df5-f8732a93e182"
},
"connection": {
"count": 19943,
"min": 30,
"q1": 50.0,
"avg": 111.3152484581056,
"med": 60.0,
"q3": 140.0,
"max": 400
}
}
Message History
The analyze message-history command gathers all events related to a message from the log.
This is useful to investigate how much time was spent in each event (connection, persistent transmission, and temporal processor).
# Set the path of a log file printed from the simulation.
# Don't forget to use the step duration used in the simulation.
../target/release/blendnet-sims analyze message-history \
--log-file <path> \
--step-duration 10ms \
--payload-id 1efd8780-b574-4aee-9df5-f8732a93e182