On 11/23/21 10:46 PM,
igs...@gmail.com wrote:
> This question is important because, where I first tried to compile the
> very first release of ns-3, after compiling it I searched for a simulator.
> Because, in my previous experience with open source and non-free
> simulators, I found one such simulator in them after installing or
> compiling them.
>
> source - binary
> -------------------------------------
> ns-2 -> ns
> Omnet++ -> omnetpp
> Opent -> opnet (? - forgot the name of the binary because,
> nowadays, I am using only open source simulators)
> ... -> ...
> ----------------------------------------
>
>
> After compiling ns-3 for first time, I didn't able to find one such
> simulator to do simulations. It was a great disappointment to me at that
> time :-))
> I was continuously trying to understand the 'simulator' in 'ns-3 code'.
> But only after a decade, I realized that, the simulation itself
> becoming the simulator. (from my perspective)
>
> That is why this is a serious question here to understand ns-3 (at
> least for a beginner like me who had experience with some other simulators)
>
> I hope that you will understand this.
>
OK, I understand better now where your concern arises. I will try to
update the tutorial to clarify this. Something like:
"Readers may be familiar with other simulators that are compiled into an
executable that is invoked with a second file interpreted by the
simulator and that contains the configuration. For example, in ns-2:
./ns simple.tcl
ns-3 is not compiled into a generic executable that interprets
configuration files, such as the above. Instead, ns-3 is made up of
shared libraries that are later linked to a different executable
(containing configuration) that the user creates. The libraries are
modular and typically can be found in the 'build/lib' directory. The
essential library to include is 'core' since that has the implementation
of running and stopping the simulator's event scheduler, but other
libraries can be added depending on the functionality needed. The user
would then write a 'simple.cc' program with a main() function and
compile and link it to the necessary ns-3 libraries, and then call the
'simple' executable directly. If desired, the 'simple.cc' can be
further configured to accept command-line arguments and to read
configuration files so that changes to the parameterization of the
program do not require recompilation and relinking.
In summary, in a simulator like ns-2, the step of running the simulation
such as:
./ns simple.tcl [... optional arguments]
looks like the following in ns-3 (making use of a script named 'ns3'):
./ns3 --run 'simple [... optional arguments]'
or when no options are present:
./ns3 --run simple"
What do you think; does it help?
The above explanation is how it is planned to work when we convert to
CMake; with the current code and Waf, one would instead run:
./waf --run simple
- Tom