|Quantitative stochastic simulation is a useful tool
for studying performance of stochastic dynamic systems, but it can
consume much time and computing resources. To overcome these limits,
parallel or distributed computation is needed. Akaroa-2 makes an
aproach to parallel simulation, that of multiple replications in
parallel or MRIP.|
NS-2 is a nice tool for network simulation, but does not provide support for statistical analysis of the obtained results. So by combining NS-2 and Akaroa-2 we add run-length control for simulations based on statistic measures to NS-2 as well as a speed-up if the simulation can be run on many hosts in parallel.
The more precise objective for this project was to combine the Network Simulator with Akaroa-2 and to make the changes only in the ns part. This should give the opportunity to monitor a running ns simulation while not writing out excessive trace files. In addition, akaroa-2 provides the nice feature of an almost linear speedup with the number of hosts due to the MRIP (Multiple Replications In Parallel) method.
|ns-2 is a discrete
event simulator targeted at networking research. It provides
substantial support for simulation of TCP, routing, and multicast
protocols over wired and wireless (local and satellite) networks. For
more information about Network Simulator check the URL:|
Simulations are written in OTcl but if you need some specific behavior of the OTcl Classes you can write your own in C++.
For a good tutorial : www.isi.edu/nsnam/ns/tutorial/index.html 
For a Tcl/Tk- tutorial : hegel.ittc.ukans.edu/topics/tcltk/ 
has been developed at the University of Canterbury in Christchurch,
New Zealand by Prof. Dr. K. Pawlikowski, Dr. Don McNickle and Dr. Greg
Ewing. It is designed for running quantitative stochastic
discrete-event simulations on Unix multiprocessor systems or networks
of heterogeneous Unix workstations. Instead of dividing up the program
for parallelization - a tremendous effort -, multiple instances of an
ordinary simulation program are run simultaneously on different
Akaroa-2 is freely available for educational purposes. For details of the usage policy please read this copyright notice.
| Files to
Or as zip file: nsak.zip 
In this file a new class Akaroa - derived from TclObject - is defined. The function calls from OTcl are mapped to Akaroa library calls. Also an new RNGImplementaion class was derived. It maps calls for a new uniformly distributed random number to the Akaroa Random Number Generator. Additionaly some intializations are performed.
When running multiple replications of a simulation model in parallel, it is important that each simulaton engine uses a unique stream of random numbers. So we had to exchange the Random Number Generator.
rng.h and rng.cc
The class RNGImplementation has now a virtual long next() method instead of a normal one. The class RNG has a
static void setRNGImplementation(RNGImplementation *imp)
method, to set a new RNGImplementation when needed. The Akaroa-class uses it to install its own implementation. Due to its dynamic nature the random number stream of RNG is a pointer now. We added reference counting for the stream to ensure that there is only one RNGImplementation object.
|In your ns-simulation.tcl
file do the following: |
into your module and call
AkObservation (parameternumber, observation);
|Running a ns-2 simulation
|First, you have to start the akmaster process that
controls the parallelization and the random number generator.|
> akmaster &
Next, start the akslave process on every machine that you want to run your simulation on. It collects the results and starts and terminates the simulations locally.
> akslave &
You can use the BatchDistribution tool for this. This java tool will login on your behalf using ssh and run any command specified.
Last, start akrun with the parameters like the number of hosts and the program to be executed, e.g.:
> akrun -n 5 ns mm1.tcl
Eventually, a result like this should appear:
|Example ns script|
|MM1 - Queueing system  |
|You should make sure that your
simulation reaches a steady state, especially when you use more
realistic traffic models, like self-similar traffic. Akaroa2 will
produce accurate results characterizing steady-state behaviour of the
simulated system only if that system can reach steady state within a
reasonable time interval. Simulation of systems converging to steady
state extremely slowly, or systems that are unstable and never reach
steady-state, will be automatically stopped.|
If you intend to execute a terminating simulation instead of steady-state one, then you need to use Akaroa2 in Independent Observation Mode; see Section 2.6 of the Akaroa2's manual.
Combination of AKAROA-‐2 and NS-2
Hagen Woesner, Eugen Gillich, Andreas Köpke (release)
|Now works with ns-2 v.2.26, fixed a bug
(AkRandom() replaced by AkRandomReal()*MAX_INT) and simplified
Note: The new RNG of ns 2.26 has a complex interface, the rng.cc and rng.h you can download here support only the important subset. Write a mail, if somebody actually uses the new interface - this will result in link errors.