Difference between revisions of "Install and run Aqua-Sim-NG code"
(→How-To) |
|||
Line 42: | Line 42: | ||
After building ns-3 + aqua-sim, simulation scripts can be run using <code>./waf --run 'script_name'</code> command. | After building ns-3 + aqua-sim, simulation scripts can be run using <code>./waf --run 'script_name'</code> command. | ||
− | The scripts are located in | + | The scripts are located in <code>/scratch</code> folder, and also in <code>examples</code> folders of the corresponding ns-3 models, located in <code>src/</code>. |
E.g., the corresponding examples of aqua-sim models are located in <code>../src/aqua-sim-ng/examples/</code> | E.g., the corresponding examples of aqua-sim models are located in <code>../src/aqua-sim-ng/examples/</code> | ||
+ | |||
'''Note:''' Names of the scripts to execute may differ from the names of the corresponding .cc files. | '''Note:''' Names of the scripts to execute may differ from the names of the corresponding .cc files. | ||
For example, in order to run "../src/aqua-sim-ng/examples/multichannel_mac_example.cc" script, the following command should be executed: | For example, in order to run "../src/aqua-sim-ng/examples/multichannel_mac_example.cc" script, the following command should be executed: | ||
+ | |||
<code>./waf --run ./waf --run MultichannelMacExample</code> | <code>./waf --run ./waf --run MultichannelMacExample</code> | ||
'script_source_name.cc' and corresponding 'script_name' mapping can be found in "../src/model_name/examples/wscript" file. | 'script_source_name.cc' and corresponding 'script_name' mapping can be found in "../src/model_name/examples/wscript" file. | ||
+ | |||
+ | |||
+ | === Running multichannel MAC example === | ||
+ | |||
+ | <code>./waf --run "MultichannelMacExample --packetSize=50 --channelId=1 --RngRun=11"</code> | ||
+ | |||
+ | The command above will run a script for multichannel MAC example, with OnOffApplication's packet size of 50 Bytes, | ||
+ | on channel 1. | ||
+ | |||
+ | 'RngRun' parameter defines a seed value of the pseudo-random generator during the script execution. Simulation results can be repeated using the same 'RngRun' value. |
Latest revision as of 08:51, 17 August 2018
How-To build ns-3 + aqua-sim
- download and unpack ns-3.27 source code:
wget http://www.nsnam.org/release/ns-allinone-3.27.tar.bz2
tar xjf ns-allinone-3.27.tar.bz2
Note: Aqua-Sim-NG has been tested with ns-3.27. The higher versions of ns-3 (i.e., 3.28, 3.29) might not be compilable with aqua-sim modules.
- get aqua-sim source code:
- move to ../src directory of ns-3:
cd "ns-3_working_dir/ns-3.27/src/"
- for multichannel MAC development:
git clone https://github.com/dugdmitry/aqua-sim-ng.git
- original version from main repository:
git clone https://github.com/rmartin5/aqua-sim-ng.git
- build ns-3 with aqua-sim source code:
- change to ns-3 working directory:
cd "ns-3_working_dir/ns-3.27/
- configure and build using "waf":
./waf clean
./waf configure --build-profile=debug --enable-examples
./waf
How-To run examples
After building ns-3 + aqua-sim, simulation scripts can be run using ./waf --run 'script_name'
command.
The scripts are located in /scratch
folder, and also in examples
folders of the corresponding ns-3 models, located in src/
.
E.g., the corresponding examples of aqua-sim models are located in ../src/aqua-sim-ng/examples/
Note: Names of the scripts to execute may differ from the names of the corresponding .cc files.
For example, in order to run "../src/aqua-sim-ng/examples/multichannel_mac_example.cc" script, the following command should be executed:
./waf --run ./waf --run MultichannelMacExample
'script_source_name.cc' and corresponding 'script_name' mapping can be found in "../src/model_name/examples/wscript" file.
Running multichannel MAC example
./waf --run "MultichannelMacExample --packetSize=50 --channelId=1 --RngRun=11"
The command above will run a script for multichannel MAC example, with OnOffApplication's packet size of 50 Bytes, on channel 1.
'RngRun' parameter defines a seed value of the pseudo-random generator during the script execution. Simulation results can be repeated using the same 'RngRun' value.