Bash scripts to run multiple scenarios - Waseda-Sato-lab/ccn-sim GitHub Wiki

Due to the number of simulations we need to run, we have created some Bash scripts to help us automate the process a little. We will try to explain how to use the Bash scripts to make it easier to run simulations.

Scripts

In the same directory as waf, there are two bash scripts that help us run multiple simulations. The scripts are run-all.sh and run-sim.sh.

The help of the scripts should give us a better idea of how they work. run-all.sh ends up calling run-sim.sh and run-sim.sh calls up waf with the particular scenario.

Both scripts were made to run comparison scenarios between TCP/IP networks and CCN networks. Both scripts depend on a file named sims.conf that should be placed in the same directory as the waf script. In this conf file, we place the name of the ns3 scenario to run. An example is shown below:

TCPSIM=disaster-tcp
NDNSIM=nms-disaster-ccn

run-sim.sh runs a simulation with the given parameters for a number of times, looking to obtain a average for the simulation. The help output is shown below:

$ ./run-sim.sh -h
Tiny script to automize running of a ns3 scenario
Options:
    -c NUM    Number of clients (consumers) for the scenario. Default [1]
    -n NUM    Number of networks the scenario will have. Default [1]
    -p NUM    Number of servers (producers) for the scenario. Default [1]
    -r NUM    Number of times to run the scenario. Default [1]
    -s NUM    Size, in MB of the content to be distributed. Default [10]
    -t        Run TCP scenario. Default [0]
    -x        Run NDN scenario. Default [0]
    -d DIR    Directory to place the results. Default [results]

The important options to notice are -r, which tells us how many times the same simulation will be run and -t and -x which flag if the simulation will be of type TCP/IP or NDN.

Now we show the help of run-all.sh:

$ ./run-all.sh -h
Script to automize running a continuous set of ns3 scenarios
Options:
    -c NUM    Max number of clients (consumers) for the scenario. Default [1].
              Starts at 1
    -n NUM    Max number of networks the scenario will have. Default [1].
              Starts at 1
    -p NUM    Max number of servers (producers) for the scenario. Default [1].
              Starts at 1
    -r NUM    Number of times to run the scenario. Default [1]
    -s NUM    Size, in MB of the content to be distributed. Default [10]
    -t        Run TCP scenario. Default []
    -x        Run NDN scenario. Default []
    -d DIR    Directory to place the results. Default [results]

Notice that the numbers give in -c, -n and -p tell the script the maximum number of clients, networks and servers respectively. The script is essentially a 3 level nested for loop that cycles through all the values supplied for these flags. This script is only useful if you wish to test the same scenario topology with a different number of clients, networks and servers.