Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dayone

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dayone

A Performant Discrete-Event Simulator for Network Simulations with a Single-Threaded Executor

  • 0.1.7
  • PyPI
  • Socket score

Maintainers
1

Day and Day One: Two Performant Discrete-Event Simulators for Network Simulations

Developed with the Rust programming language, Day One have been designed as a performant discrete-event simulators for network simulations, using a single-threaded design.

In Day One, the use of a single thread allows it to avoid any read-write mutual exclusion locks and thread synchronization overhead when sharing global data — such as the simulation time — across stackless coroutines, therefore improving single-threaded performance. With multiple CPU cores, multiple parallel simulation runs can take place using Day One, each with a different configuration setting or random seed.

To run a network simulation session using a configuration file with either of the two simulators, run:

RUST_LOG=debug dayone configs/simple.toml

where RUST_LOG levels can be error, warn, info, debug, and trace, and configs/simple.toml is the configuration file.

Configuration Settings

In Day One, all configuration settings are read from a configuration file when a simulation session starts, and the configuration file follows the TOML format for the sake of simplicity and readability.

Here is an example configuration file simple.toml:

# An example configuration file that shows a basic setup.

seed = 1000
edges = [[0, 1], [0, 2]]
hosts = [0, 1, 2]
progress = 2.0
duration = 20.0
log_path = "./simple"
log_interval = 1.0

[switch]
port_rate = 8000
capacity = 100
weights = [1]
discipline = "FIFO"
drop = "RED"

[[flow]]
flow_type = "PacketDistribution"
graph = [[0, 1]]
[flow.traffic]
    initial_delay = 1.0
    size = 10000
    arr_dist = {type = "Exp", lambda = 1.0}
    pkt_size_dist = {type = "Uniform", low = 1000, high = 1500}

[[flow]]
flow_type = "PacketDistribution"
graph = [[1, 0]]
[flow.traffic]
    initial_delay = 2.0
    duration = 10.0
    arr_dist = {type = "Uniform", low = 1, high = 1}
    pkt_size_dist = {type = "Uniform", low = 1000, high = 1500}

[[collective]]
collective_type = "Broadcast"
flow_type = "PacketDistribution"
flow_count = 2
graph = [[0, 1], [0, 2]]
sources = [0]
sinks = [1, 2]
[collective.traffic]
    initial_delay = 1.0
    duration = 10.0
    arr_dist = {type = "Uniform", low = 1, high = 1}
    pkt_size_dist = {type = "Uniform", low = 1000, high = 1500}

The following introduces all the possible settings in the configuration file.

General

seed

The seed for the random number generator to ensure reproducibility of the simulation results.

  • Valid value: Integer

  • Required: Yes

  • Example:

    seed = 1000
    
duration

The total duration of the simulation in seconds.

  • Valid value: Floating point number

  • Required: No

  • Default: 1500.0

  • Example:

    duration = 20.0
    
progress

Day and Day One provide progress bars to visualize the progression of a simulation session. This progress element specifies the progress interval, which is the time interval to advance the position of the progress bar.

  • Valid value: Floating point number

  • Required: No

  • Default: duration / 100

  • Example:

    progress = 1.0
    
log_path

Day and Day One generate three CSV files, sources.csv, sinks.csv, and switches.csv, containing statistics of a simulation session. log_path specifies the directory of the three CSV files.

  • Valid value: String

  • Required: No

  • Default: ./output

  • Example:

    log_path = "./test"
    
log_interval

In the three CSV files, each row contains statistics in a time interval. log_interval specifies the length of a time interval in seconds.

  • Valid value: Floating point number

  • Required: No

  • Default: Value of progress

  • Example:

    log_interval = "1.0"
    
topology

Day and Day One support arbitrary topologies. Besides widely-used topologies FatTree and Torus, any topology that can be specified as an undirected graph can be supported as well.

  • FatTree

    To specify the FatTree topology, it is required to specific k. k is a multiple of 2.

    Example:

    [topology]
    category = "FatTree"
    
    [topology.torus]
      	k = 8
    
  • Torus

    To specify the Torus topology, it is required to specific dimension dim, and node per dimension n. Only 1D, 2D, and 3D Torus topologies are supported. That is, valid values of dim are 1, 2, 3.

    Example:

    [topology]
    category = "Torus"
    
    [topology.torus]
      	dim = 2
      	n = 3
    
  • Custom topology

    Use edges to specify an undirected graph as the topology, and hosts to specify hosts in the topology.

    edges is a vector of [integer, integer]. An [integer, integer] pair presents an edge in the undirected graph.

    hosts is a vector of integers

    Example:

    edges = [[0, 1], [0, 2]]
    hosts = [0, 1, 2]
    

Switch

In Day and Day One, all switches use the same setting which can be specified with the following attributes.

port_rate

The bit rate of each outbound port.

  • Valid value: Floating point number

  • Required: Yes

  • Example:

    port_rate = 8000
    
capacity

The capacity (buffer size) of each outbound port.

  • Valid value: Integer

  • Required: Yes

  • Example:

    capacity = 100
    
drop

The packet drop strategy that drops packets when the buffer is full.

  • Valid value:

    ValueMeaning
    TailDropDropping packets at the tail of the queue
    REDRandom Early Detection
  • Required: Yes

  • Example:

    capacity = 100
    
discipline

The scheduling discipline.

  • Valid value:

    ValueMeaningNotes
    FIFOFirst In First Out
    DRRDeficit Round RobinRequired to specify weights
    WFQWeighted Fair QueueingRequired to specify weights
    SPStatic PriorityRequired to specify priorities
    VCVirtual ClockRequired to specify vticks
  • Required: Yes

  • Example:

    discipline = "FIFO"
    
weights
  • Valid value: Vector of integers

  • Required: Yes if dispcipline = "DRR" or dispcipline = "WFQ"

  • Example:

    weights = [1, 2, 3]
    
priorities
  • Valid value: Vector of (integer, integer), where the first integer is the flow class and the second integer is the priority of this flow class

  • Required: Yes if dispcipline = "SP"

  • Example:

    priorities = [(0, 2), (1, 1)]
    
vticks
  • Valid value: Vector of (integer, integer), where the first integer is the flow class and the second integer is the inverse of the desired rates for the corresponding flows, in bits per second

  • Required: Yes if dispcipline = "VC"

  • Example:

    vticks = [(0, 2), (1, 1)]
    

Flow

In Day and Day One, flows can be specified one by one:

[[flow]]
flow_id = 2
starts_before = [3]
starts_after = [1]
flow_type = "PacketDistribution"
graph = [[0, 1]]
[flow.traffic]
    initial_delay = 1.0
    duration = 2.0
    arr_dist = {type = "Uniform", low = 1, high = 1}
    pkt_size_dist = {type = "Uniform", low = 1000, high = 1500}

or by sets:

[[flow_set]]
first_flow_id = 10
flow_type = "PacketDistribution"
flow_count = 10
[flow_set.traffic]
    initial_delay = 0.0
    duration = 10.0
    arr_dist = {type = "Uniform", low = 0.0008, high = 0.0008}  # 10Mbps
    pkt_size_dist = {type = "Uniform", low = 1024, high = 1024}

The following table lists required, optional, or not supported attributes of a flow or a flow set.

AttributeMeaningflowflow_set
flow_idThe id of the flowoptionalno
first_flow_idThe smallest flow id of the flow setnooptional
starts_beforeThe ids of flows that cannot start until this flow / flow set endsoptionaloptional
starts_afterThe ids of flows that this flow / flow set must wait for them to end before it startsoptionaloptional
flow_typeThe type of the flow or flows of the flow setrequiredrequired
flow_countThe number of flows in the flow setnorequired
graphThe pair of the source host and the sink host of the flowrequiredno
pathThe path of the flowoptionalno
trafficThe traffic of the flow / flow setrequiredrequired
flow_id

The id of the flow.
If not specified, the id of the first flow specified in the configuration file will be 0, and the subsequent ids of flows increase by 1.

  • Valid value: Integer

  • Required: No

  • Example:

    flow_id = 1
    
first_flow_id

The smallest flow id of the flow set.

  • Valid value: Integer

  • Required: No

  • Example:

    flow_first_id = 1
    
starts_before

The ids of flows that cannot start until this flow / flow set ends.

  • Valid value: Vector of integers

  • Required: No

  • Example:

    starts_before = [3, 4]
    
starts_after

The ids of flows that this flow / flow set must wait for them to end before it starts.

  • Valid value: Vector of integers

  • Required: No

  • Example:

    starts_after = [0, 1]
    
flow_type

The type of the flow or flows of the flow set.

  • Valid value:

    ValueMeaning
    PacketDistributionA flow whose packet source sends packets with specific distributions of inter-arrival times and packet sizes
    TCPA flow whose packet source simulate the TCP protocol
  • Required: Yes

  • Example:

    flow_type = "PacketDistribution"
    
flow_count

The number of flows in the flow set.

  • Valid value: Integer

  • Required: Yes for a flow set

  • Example:

    flow_count = 10
    
graph

The pair of the source host and the sink host of the flow.

  • Valid value: [[integer, integer]]

  • Required: Yes for a single flow

  • Example:

    graph = [[0, 2]]
    
path

The path of the flow.

  • Valid value: Vector of integers where each integer is a node in the path

  • Required: No

  • Example:

    path = [0, 1, 2]
    
traffic

For a flow, it must specify its traffic under [flow.traffic].
For a flow set, it must specify the traffic of its flows under [flow_set.traffic].

The following table lists attributes of traffic.

Note:

  • initial_delay, arr_dist, and pkt_size_dist are required.
  • Either size or duration is required.
  • If flow_type = "TCP", [flow.traffic.tcp] or [flow_set.traffic.tcp] must be specified for the flow or flow set.
  • Attributes:

    AttributeMeaningValid Value
    initial_delayThe seconds the flow / flow set waits before producing its first packetFloating point number
    sizeThe total size of packets of the flow / each flow of the flow set in bytesInteger
    durationThe duration of the flow / each flow of the flow set in secondsFloating point number
    arr_distThe arrival distribution of packets in secondsValid distribution info
    pkt_size_distThe distribution of packet sizes in bytesValid distribution info

Valid distribution info includes uniform distribution and exponential distribution:

  • {type = "Uniform", low = 0.0008, high = 0.0008}
  • {type = "Exp", lambda = 1.0}
  • Required: Yes

  • Example:

    [[flow_set]]
    flow_type = "TCP"
    flow_count = 100
    [flow_set.traffic]
    	initial_delay = 0.0
    	duration = 0.1
    	arr_dist = {type = "Uniform", low = 0.0008, high = 0.0008}
    	pkt_size_dist = {type = "Uniform", low = 1024, high = 1024}
    [flow_set.traffic.tcp]
    	cc_algorithm = "TCPReno"
    
traffic.tcp

For a flow, it must specify its tcp characteristics under [flow.traffic.tcp].
For a flow set, it must specify the tcp characteristics of its flows under [flow_set.traffic.tcp].

  • Attributes:

    AttributeMeaningValid Value
    cc_algorithmThe congestion control algorithmTCPReno, TCPCubic
  • Required: Yes

  • Example:

    [flow.traffic.tcp]
    	cc_algorithm = "TCPReno"
    

Collective

In Day and Day One, collectives can be specified one by one:

[[collective]]
collective_type = "Broadcast"
flow_type = "PacketDistribution"
flow_count = 2
graph = [[0, 2], [0, 3], [1, 2], [1, 3]]
sources = [0, 1]
sinks = [2, 3]
[collective.traffic]
    initial_delay = 1.0
    duration = 10.0
    arr_dist = {type = "Uniform", low = 1, high = 2}
    pkt_size_dist = {type = "Uniform", low = 1000, high = 1500}

or by sets:

[[collective_set]]
collective_type = "Gather"
collective_count = 2
flow_type = "PacketDistribution"
flow_count = 2
sources = [[0, 1], [1, 2]]
sinks = [[2, 2], [3, 3]]
[collective_set.traffic]
    initial_delay = 1.0
    duration = 10.0
    arr_dist = {type = "Uniform", low = 3, high = 4}
    pkt_size_dist = {type = "Uniform", low = 2000, high = 2500}

The following table lists required, optional, or not supported attributes of a collective or a collective set.

AttributeMeaningcollectivecollective_set
collective_typeThe type of the collective or collective setrequiredrequired
first_flow_idThe smallest flow id of the collective or collective setoptionaloptional
collective_countThe number of collectives in the collective setnorequired
flow_typeThe type of the flows of the collective or collective setrequiredrequired
flow_countThe number of flows in the collective or in each collective of the collective setrequiredrequired
graphThe pairs of the source host and the sink host of the collective's flowsoptionalno
pathsThe paths of the collective's flowsoptionalno
sourcesThe sources of flowsoptionaloptional
sinksThe sinks of flowsoptionaloptional
trafficThe traffic of the collective / collective setrequiredrequired
collective_type

The type of the collective or collective set.

  • Valid value: Brordcast or Gather

  • Required: Yes

  • Example:

    collective_type = "Broadcast"
    
first_flow_id

The smallest flow id of the collective / collective set.

  • Valid value: Integer

  • Required: No

  • Example:

    flow_first_id = 1
    
collective_count

The number of collectives in the collective set.

  • Valid value: Integer

  • Required: Yes for a collective set

  • Example:

    collective_count = 10
    
flow_count

The number of flows in the collective or in each collective of the collective set.

  • Valid value: Integer

  • Required: Yes

  • Example:

    flow_count = 4
    
graph

The pairs of the source hosts and the sink hosts of the collective's flows.

  • Valid value: Vector of [integer, integer]

  • Required: No

  • Example:

    graph = [[0, 1], [0, 2]]
    
paths

The paths of the collective's flows.

  • Valid value: Vector of vectors of integers where each integer is a node in the path

  • Required: No

  • Example:

    paths = [[0, 1], [0, 1, 2]]
    
sources

For a collective, sources is the set of the source hosts of this collective's flows.

  • Valid value: Vector of integers where each integer is a source host

  • Required: No

  • Example:

    sources = [0, 1]
    

For a collective set, sources is set of the source hosts of this collective set's collectives' flows.

  • Valid value: Vector of vectors of integers where each vector is a collective's flows' source hosts

  • Required: No

  • Example:

    sources = [[0, 0], [1, 1]]
    
sinks

For a collective, sinks is the set of the sink hosts of this collective's flows.

  • Valid value: Vector of integers where each integer is a sink host

  • Required: No

  • Example:

    sinks = [0, 1]
    

For a collective set, sinks is set of the sink hosts of this collective set's collectives' flows.

  • Valid value: Vector of vectors of integers where each vector is a collective's flows' sink hosts

  • Required: No

  • Example:

    sinks = [[0, 0], [1, 1]]
    
traffic

For a collective, it must specify the traffic of its flows under [collective.traffic].
For a collective set, it must specify the traffic of its flows under [collective_set.traffic].

The following table lists attributes of traffic.

Note:

  • initial_delay, arr_dist, and pkt_size_dist are required.
  • Either size or duration is required.
  • If flow_type = "TCP", [flow.traffic.tcp] or [flow_set.traffic.tcp] must be specified for the flow or flow set.
  • Attributes:

    AttributeMeaningValid Value
    initial_delayThe seconds the collective / collective set waits before producing its first packetFloating point number
    sizeThe total size of packets of each flow of the collective / collective set in bytesInteger
    durationThe duration of each flow of the collective / collective set in secondsFloating point number
    arr_distThe arrival distribution of packets in secondsValid distribution info
    pkt_size_distThe distribution of packet sizes in bytesValid distribution info

Valid distribution info includes uniform distribution and exponential distribution:

  • {type = "Uniform", low = 0.0008, high = 0.0008}
  • {type = "Exp", lambda = 1.0}
  • Required: Yes

  • Example:

    [[collective]]
    collective_type = "Broadcast"
    flow_type = "PacketDistribution"
    flow_count = 4
    [collective.traffic]
        initial_delay = 1.0
        duration = 10.0
        arr_dist = {type = "Uniform", low = 3, high = 4}
        pkt_size_dist = {type = "Uniform", low = 2000, high = 2500}
    
traffic.tcp

For a collective, it must specify the tcp characteristicsc of its flows under [collective.traffic.tcp].
For a collective set, it must specify the tcp characteristics of its collectives' flows under [collective_set.traffic.tcp].

  • Attributes:

    AttributeMeaningValid Value
    cc_algorithmThe congestion control algorithmTCPReno, TCPCubic
  • Required: Yes

  • Example:

    [collective.traffic.tcp]
    	cc_algorithm = "TCPReno"
    

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc