How to Run Ns2 Program

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

Ns2 Wired Network Program

As the first process, we have to use the Ns2 program code to configure the wired network simulation then the Ns2 program has to be stored in the workspace location.

Program of Ns2 Wired Network
  • Ns2 code for create a wired nodes

set n0 [$ns node]

set n1 [$ns node]

set n2 [$ns node]

set n3 [$ns node]

set n4 [$ns node]

  • Ns2 code for make a link between wired nodes

$ns duplex-link $n0 $n2 2Mb 10ms DropTail

$ns duplex-link $n1 $n2 2Mb 10ms RED

$ns duplex-link $n2 $n3 1.7Mb 20ms RED

$ns duplex-link-op $n0 $n2 color “blue”

$ns duplex-link-op $n1 $n2 color “green”

$ns queue-limit $n2 $n3 10

Run Ns2 Program

To run the Ns2 program, we have to change the workspace location and implement the wired network simulation main file through implementing the following commands.

cd /home/research/Desktop/ns2_wired_simulation

./ns wired_simulation.tcl

For your reference, we have highlighted the result that is acquired through running the Ns2 program.

Result of Running Ns2 Program

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