This repository contains information and archives of the experiments used in the paper “A Wi-Fi Energy Model for Scalable Simulation”.
Part of the code samples proposed in this file can be executed directly using org-mode.
- ./microbenchmarks: contains the results, script and code for the microbenchmarks (single WLan,
the up/down traffic experiments, the simplemix experiment)
- ./microbenchmarks/logs: archives of the full logs of each scenario
- ./large_use_case: contains the results, scripts and code for the large experiment
- ./large_use_case/logs: archive of the full logs
- ./analysis: contains the visualisations and error computations we made for the paper. The code to generate the figures of the paper, as well as additional visualisations can be seen.
- SimGrid
- Version: patched v3.32.1 (soon in the official repository of SimGrid)
- Link: https://framagit.org/klement/simgrid/-/tree/wifi_clean
- ns-3
- Version: patched 3.36.1
- Link: https://www.nsnam.org/releases/
- Patch file: ./ns-3.36.1.patch
Run the following code block to install dependencies in ${currDir}
# the directory used to install the dependencies
currDir=${PWD}
root=~/dep_wifi_energy/
mkdir -p ${root}
cd ${root}
# Install SimGrid into ${root}/simgrid
git clone https://framagit.org/klement/simgrid.git
cd simgrid
git checkout wifi_clean
mkdir build && cd build
cmake ..
make -j$(nproc)
cd ${root}
# Install ns-3 into ${root}/ns-allinone-3.36.1/
wget https://www.nsnam.org/releases/ns-allinone-3.36.1.tar.bz2
tar -xvf ns-allinone-3.36.1.tar.bz2
cd ${root}/ns-allinone-3.36.1
# Patch the wifi energy model to allow observing dynamic energy separately
patch -u ns-3.36.1/src/wifi/model/wifi-radio-energy-model.cc -i ${currDir}/ns-3.36.1.patch
python build.py
Run the following code block to build the binaries of the simulators
root=~/dep_wifi_energy/
sgPath=${root}/simgrid/
nsPath=${root}/ns-allinone-3.36.1/ns-3.36.1/
currDir=${PWD}
# create simlinks and build simulators
cd ${currDir}/microbenchmarks/simgrid/
ln -s ${sgPath} simgrid
make clean && make
cd ${currDir}/microbenchmarks/ns-3/
ln -s ${nsPath} ns-3
make clean && make
cd ${currDir}/large_use_case/simgrid/
ln -s ${sgPath} simgrid
make clean && make
cd ${currDir}/large_use_case/ns-3/
ln -s ${nsPath} ns-3
make clean && make
The launchers can be executed in 2 different modes:
- Local execution: All experiments are run on your local machine. The results
will be written in a file named “results_local.csv” and logs will be saved
under the “logs” directory. To execute locally the experiments, you need to
set the
local_only
variable to 1 in the launcher (./microbenchmarks/run_control_frames_dyn.sh for instance), and execute it with the following command:hostFile=hosts.txt bash run_control_frames_dyn.sh
. This will generate an args file under the nameargs_TIMESTAMP_DEFAULT.sh
containing 1 line per simulation to execute, with the different parameters to be used. Run the experiments with the command:localOnlyArgsFile=<argsFile> ./run.sh
and wait until it finishes **Warning:** Since there are several hundred/thousands of simulations to be executed in both SimGrid and ns-3 in each scenario, this option is very time consuming. Either reduce the amount of experiments by modifying the parameters, or execute the benchmarks using several nodes with a parallel execution - Parallel execution: This is the default execution mode. You need to specify in
a HostFile the name of the machines that will execute the experiments. In
this file, put 1 machine per line, and make sure you have an ssh access to
these machines and the repository is installed on all of them. Then run the
launcher, which will use the hostFile to dispatch the simulations and gather
the results:
hostFile=<hostFile> bash run_control_frames_dyn.sh
**Our setup:** We used the Grid’5000 testbed to execute the experiments, allowing us to use several nodes in parallel. We used the cluster Paravance in Rennes. The hardware of those nodes is available online: https://www.grid5000.fr/w/Rennes:Hardware#paravance
Depending on the nodes you use, you will be able to execute more or less
simulations concurrently (1 simulation takes 1 CPU core). You can modify the
number of concurrent simulations to be performed in the script executed by your
experiments. The variable to modify is nSub
:
In the case of the large_use_case experiment, take care of the amount of memory used by the experiment. Around 80 GB of memory were required for the largest experiments.
To run all the experiments sequentially, specify the path of the hosts file in ./microbenchmarks/run_all_benchmarks.sh (set it to ./microbenchmarks/hosts.txt if you run it locally), then run the file.
cd microbenchmarks
bash run_all_benchmarks.sh
To run the experiments, specify the path of the hosts file and run the launcher using:
cd large_use_case/
hostFile=~/hostsRennes.txt bash run_g5k_largewifi.sh
To obtain the results for the total energy consumption, set the idle energy to 0.82 in ./large_use_case/platform_generator.py for SimGrid, and comment the line modifying the IDLE energy to 0 in ./large_use_case/ns-3/wifisimNS.cpp (run the make command then to rebuild the simulator).