What is Ns2 and NAM

Sometimes the research scholars may feel hard to differentiate and integrate the network simulator 2 (Ns2) and network animator (Nam). Thus, we have derived this article with all the required data.

Keynotes of Ns2 and Nam

Ns2 is described as the notable network simulation tool to simulate both the wired and wireless network simulations. On the other hand, Nam is defined as one of the network animated tool to provide the graphical representation of packets flow in Ns2 network simulations.

Install Nam for Ns2

We have to execute the below mentioned commands in the terminal window for the installation of Nam based on Ns2 in Ubuntu.

sudo dpkg –install NAM_1.15-10_i386.deb

Installation of Nam in Ns2

Code for Nam in Ns2

Following that, we have highlighted the sample code to integrate Nam with Ns2 in the Ns2 main TCL file.

  • Ns2 code to open Nam trace file

set networksimulation [new Simulator]

set namfile [open namSimulation.nam w]

$networksimulation namtrace-all $namfile

  • Ns2 code to close and implement Nam on trace file

global networksimulation namfile

 $networksimulation flush-trace

 close $namfile

 exec nam namSimulation.nam &

Execute Nam in Ns2

Then, we have to change the Ns2 main file location and implement the below mentioned commands to implement Nam file in Ns2.

cd /home/research/NAM_in_NS2

sudo ./ns NAM_in_NS2.tcl

Execution of Nam in Ns2

Finally, we have highlighted the result which is acquired through implementing Nam based Ns2 wired simulation in Ubuntu.

Result of Nam Based Ns2 Wired Simulation

Ping us acquire more research assistance!!!