How do I Compile in Ns2

We can proceed to compile network simulator 2 for that we have to follow some guidelines to get succeed in that process of compiling. Now, let’s get into the step by step process of Ns2 compiling.

Step: 1 Install Ns2 in Ubuntu

Initially, we have to change the package location through the execution of following commands for the installation of Ns2.

cd ns-allinone-2.31

Changing Package Location

Following that, we have to install the Ns2 packages in Ubuntu through the implementation of the below mentioned commands.

sudo ./install

Step: 2 Configuration of Ns2 in Ubuntu

Then, we have to create the new source package code in Ns-2.35 with the file extension of .cc and .h and execute the following commands to configure the updated Ns2 source code in Ubuntu.

cd ns-2.31

sudo ./configure

Configuration of Ns2

Step: 3 Compile Ns2 in Ubuntu

Consequently, we have to compile the updated Ns2 source code in Ubuntu by executing the following commands.

sudo make

Step: 4 Run Ns2 Simulation in Ubuntu

Then, we have to create the Ns2 simulation main file with the file extension of .tcl and implement the following commands to run the simulation.

sudo ./ns main.tcl

In addition, we have highlighted the acquired result of Ns2 simulation in the following.

Result of Ns2 Simulation

Throw away all your hesitation and reach us to clarify your issues based on Ns2 compiling process.