go.dedis.ch/onet/v4@v4.0.0-pre1/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 ### Statistics for subset of hosts 43 44 Buckets of statistics can be defined using the following variable: 45 46 - `Buckets` - indices range of the buckets 47 48 The parameter is a string where the buckets are separated with spaces and the ranges 49 by a dash (e.g. `Buckets = "0:5 5:10-15:20"` that will create a bucket with hosts 0 50 to 4 and another one with hosts 5 to 9 and 15 to 19). Range indices can be compared 51 to Go slices so that the lower index is inclusive and the higher is exclusive. 52 53 A file will be written per bucket and the global one containing the statistics of all 54 the conodes will always be present independently from the parameter. Each file will have 55 the bucket number as suffix. 56 57 ### Simulations with long setup-times and multiple measurements 58 59 Per default, all rounds of an individual simulation-run will be averaged and 60 written to the csv-file. If you set `IndividualStats` to a non-`""`-value, 61 every round will create a new line. This is useful if you have a simulation 62 with a long setup-time and you want to do multiple measurements for the same 63 setup. 64 65 ### Timeouts 66 67 Timeouts are parsed according to Go's time.Duration: A duration string 68 is a possibly signed sequence of decimal numbers, each with optional 69 fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid 70 time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". 71 72 Two timeout variables are available: 73 74 - `RunWait` - how many seconds to wait for a run (one line of .toml-file) to finish 75 (default: 180s) 76 - `ExperimentWait` - how many seconds to wait for the while experiment to finish 77 (default: RunWait * #Runs) 78 79 ### PreScript 80 81 If you need to run a script before the simulation is started (like installing 82 a missing library), you can define 83 84 - `PreScript` - a shell-script that is run _before_ the simulation is started 85 on each machine. 86 It receives a single argument: the platform this simulation runs: 87 [localhost,mininet,deterlab] 88 89 ### MiniNet specific 90 91 Mininet has support for setting up delays and bandwidth for each simulation. 92 You can use the following two variables: 93 - `Delay`[ms] - the delay between two hosts - the round-trip delay will be 94 the double of this 95 - `Bandwidth`[Mbps] - the bandwidth in both sending and receiving direction 96 for each host, measured in mega bits per second 97 98 You can put these variables either globally at the top of the .toml file or 99 set them up for each line in the experiment (see the exapmles below). 100 101 ### Experimental 102 103 - `SingleHost` - which will reduce the tree to use only one host per server, and 104 thus speeding up connections again 105 - `Tags` - build-tags that will be called when building the binaries for the 106 simulation 107 108 ### Example 109 110 Simulation = "ExampleHandlers" 111 Servers = 16 112 BF = 2 113 Rounds = 10 114 #SingleHost = true 115 116 Hosts 117 3 118 7 119 15 120 31 121 This will run the `ExampleHandlers`-simulation on 16 servers with a branching 122 factor of 2 and 10 rounds. The `SingleHost`-argument is commented out, so it 123 will use as many hosts as described. 124 125 In the second part, 4 experiments are defined, each only changing the number 126 of `Hosts`. First 3, then 7, 15, and finally 31 hosts are run on the 16 127 servers. For each experiment 10 rounds are started. 128 129 Assuming the simulation runs on MiniNet, the network delay can be set globally 130 as follows: 131 132 Simulation = "ExampleHandlers" 133 Delay = 100 134 Servers = 16 135 BF = 2 136 Rounds = 10 137 #SingleHost = true 138 139 Hosts 140 3 141 7 142 15 143 31 144 145 Alternatively, it can be set for each individual experiment: 146 147 Simulation = "ExampleHandlers" 148 Servers = 16 149 BF = 2 150 Rounds = 10 151 #SingleHost = true 152 153 Hosts,Delay 154 3,50 155 7,100 156 15,200 157 31,400 158