-
Notifications
You must be signed in to change notification settings - Fork 45
How to create a campaign of simulations ?
This section explains how to build a campaign of simulations. Hence, it details the possible parameters and how to use them for tuning the simulations.
1. Prepare your JSON
With the interactive console:
user@instant-contiki:rpl-attacks>> make_all sample-attacks
Or with Fabric:
../rpl-attacks$ fab prepare:test-campaign
When generating the campaign JSON, the framework will fill the docstrings at the beginning of the file with some useful information about available items, namely:
- Building-blocks
- Root mote types (the C files prefixed with
root-in[FRAMEWORK_FOLDER]/templates/experiment/motes/) - Sensor mote types (the C files prefixed with
sensor-in[FRAMEWORK_FOLDER]/templates/experiment/motes/) - Malicious mote types (the C files prefixed with
malicious-in[FRAMEWORK_FOLDER]/templates/experiment/motes/)
2. Tune the JSON according to the following structure
With a common topology for all simulations
{
"BASE": {
"simulation": {
"[field]": [value],
...
},
"malicious": {
"[field]": [value],
...
}
},
"[experiment]": {
"simulation": {
"[field]": [value],
...
},
"malicious": {
"[field]": [value],
...
}
},
[other experiment blocks]
}BASE: (mandatory)
simulation
Field Value titlestring goalstring notesstring Inside the simulation file (.CSC), the text in the SimulationNotes plugin will be generated with the following layout:
Goal: [goal]
[notes]
Field Value number-motesnon-null positive integer (this is the number of non-root motes) targetstring amongst the available platforms in [CONTIKI_FOLDER]/platform/durationnon-null positive integer, duration in seconds debugboolean, for printing debug messages of the ContikiRPL library repeatnon-null positive integer, number of simulation repetitions [NOT IMPLEMENTED YET] rootstring amongst the suffixes (that is, excluding root-) of C files in[FRAMEWORK_FOLDER]/templates/experiment/motes/sensorstring amongst the suffixes (that is, excluding sensor-) of C files in[FRAMEWORK_FOLDER]/templates/experiment/motes/minimum-distance-from-rootnon-null positive integer determining the minimal distance of the malicious mote from the root transmission-rangepositive integer greater than or equal to minimum-distance-from-rootinterference-rangepositive integer greater than or equal to transmission-rangearea-square-sidepositive integer greater than or equal to `sqrt(2) * minimum-distance-from-root wsn-generation-algorithmstring indicating the WSN topology generation algorithm to be used
malicious: NOT present in BASE (the experiments start after the BASE definition)
[experiment]: (mandatory)
simulation
Here, the same parameters as for simulation in BASE can be entered. They override these of the BASE block.
malicious
Field Value targetstring amongst the available platforms in [CONTIKI_FOLDER]/platform/typestring amongst the suffixes (that is, excluding malicious-) of C files in[FRAMEWORK_FOLDER]/templates/experiment/motes/building-blockslist of strings amongst the blocks defined in [FRAMEWORK_FOLDER]/templates/building-blocks.jsonexternal-librarythe path to a user-defined RPL library This means that the malicious mote can be compiled with a platform different than the rest of the WSN.
With a specific topology for each simulation
Same as for the structure with BASE, except that this block is not present and each experiment holds a simulation section with the same available parameters (if this section is not mentioned, default parameters are use
Example JSON for a campaign with a BASE simulation as a template for the other simulations (with the same topology) :

Example JSON for a campaign of heterogeneous simulations (with randomized topologies) :
