gopkg.in/dedis/onet.v2@v2.0.0-20181115163211-c8f3724038a7/simul/README.md (about)

     1  Navigation: [DEDIS](https://github.com/dedis/doc/tree/master/README.md) ::
     2  [Onet](../README.md) ::
     3  Simulation
     4  
     5  # Simulation
     6  
     7  The simulation can be used to run the protocol or service in
     8  different settings:
     9  
    10  - localhost - for up to 100 nodes
    11  - [Mininet](platform/MININET.md) - for up to 3000 nodes
    12  - [Deterlab](platform/DETERLAB.md) - for up to 50'000 nodes
    13  
    14  Refer to the simulation-examples in simul/manage/simulation and
    15  https://github.com/dedis/cothority_template
    16  
    17  ## Runfile for simulations
    18  
    19  Each simulation can have one or more .toml-files that describe a number of experiments
    20  to be run on localhost or deterlab.
    21  
    22  The .toml-files are split in two parts, separated by an empty line. The first
    23  part consists of one or more 'global' variables that describe all experiments.
    24  
    25  The second part starts with a line of variables that have to be defined for each
    26  experiment, where each experiment makes up one line.
    27  
    28  ### Necessary variables
    29  
    30  - `Simulation` - what simulation to run
    31  - `Hosts` - how many hosts to instantiate
    32  - `Servers` - how many servers to use
    33  
    34  ### onet.SimulationBFTree
    35  
    36  If you use the `onet.SimulationBFTree`, the following variables are also available:
    37  
    38  - `BF` - branching factor: how many children each node has
    39  - `Depth` - the depth of the tree in levels below the root-node
    40  - `Rounds` - for how many rounds the simulation should run
    41  
    42  ### Simulations with long setup-times and multiple measurements
    43  
    44  Per default, all rounds of an individual simulation-run will be averaged and
    45  written to the csv-file. If you set `IndividualStats` to a non-`""`-value,
    46  every round will create a new line. This is useful if you have a simulation
    47  with a long setup-time and you want to do multiple measurements for the same
    48  setup.
    49  
    50  ### Timeouts
    51  
    52  Timeouts are parsed according to Go's time.Duration: A duration string
    53  is a possibly signed sequence of decimal numbers, each with optional
    54  fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid
    55  time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
    56  
    57  Two timeout variables are available:
    58  
    59  - `RunWait` - how many seconds to wait for a run (one line of .toml-file) to finish
    60      (default: 180s)
    61  - `ExperimentWait` - how many seconds to wait for the while experiment to finish
    62      (default: RunWait * #Runs)
    63  
    64  ### PreScript
    65  
    66  If you need to run a script before the simulation is started (like installing
    67  a missing library), you can define
    68  
    69  - `PreScript` - a shell-script that is run _before_ the simulation is started
    70    on each machine.
    71    It receives a single argument: the platform this simulation runs:
    72    [localhost,mininet,deterlab]
    73  
    74  ### MiniNet specific
    75  
    76  Mininet has support for setting up delays and bandwidth for each simulation.
    77  You can use the following two variables:
    78  - `Delay`[ms] - the delay between two hosts - the round-trip delay will be
    79  the double of this
    80  - `Bandwidth`[MBps] - the bandwidth in both sending and receiving direction
    81  for each host
    82  
    83  You can put these variables either globally at the top of the .toml file or
    84  set them up for each line in the experiment (see the exapmles below).
    85  
    86  ### Experimental
    87  
    88  - `SingleHost` - which will reduce the tree to use only one host per server, and
    89  thus speeding up connections again
    90  - `Tags` - build-tags that will be called when building the binaries for the
    91  simulation
    92  
    93  ### Example
    94  
    95      Simulation = "ExampleHandlers"
    96      Servers = 16
    97      BF = 2
    98      Rounds = 10
    99      #SingleHost = true
   100  
   101      Hosts
   102      3
   103      7
   104      15
   105      31
   106  This will run the `ExampleHandlers`-simulation on 16 servers with a branching
   107  factor of 2 and 10 rounds. The `SingleHost`-argument is commented out, so it
   108  will use as many hosts as described.
   109  
   110  In the second part, 4 experiments are defined, each only changing the number
   111  of `Hosts`. First 3, then 7, 15, and finally 31 hosts are run on the 16
   112  servers. For each experiment 10 rounds are started.
   113  
   114  Assuming the simulation runs on MiniNet, the network delay can be set globally
   115  as follows:
   116  
   117      Simulation = "ExampleHandlers"
   118  	Delay = 100
   119      Servers = 16
   120      BF = 2
   121      Rounds = 10
   122      #SingleHost = true
   123  
   124      Hosts
   125      3
   126      7
   127      15
   128      31
   129  
   130  Alternatively, it can be set for each individual experiment:
   131  
   132      Simulation = "ExampleHandlers"
   133      Servers = 16
   134      BF = 2
   135      Rounds = 10
   136      #SingleHost = true
   137  
   138      Hosts,Delay
   139      3,50
   140      7,100
   141      15,200
   142      31,400
   143