Installation of Ns2

Here, our research professionals have highlighted the steps that are required to install network simulator 2.

Downloading Ns2.31

Firstly, we have to download the packages based on network simulator 2.31 for Ubuntu along with the utilization of below mentioned URL.

https://github.com/cseas/vtulabs/blob/master/15CSL57_Computer_Network_Laboratory/ns-allinone-2.31.tar.xz

Link to Download Ns2 Package

Installation of Ns2.31

Following that, we have to copy and paste the downloaded Ns2.31 packages into the home drive and we have to extract the packages for the installation process. Then, we have to execute the below mentioned commands for the installation of Ns2.31 in the Ubuntu terminal window.

cd ns-allinone-2.31/

suod ./install

Installation of Ns2

Ns2 Code for Simulation Packet Transmission

For your ease, our technical professionals have highlighted some sample source code based on network simulator 2.

  • Ns2 code to make a connection among the nodes for communication

set udp [new Agent/UDP]

set null [new Agent/Null]

$ns attach-agent $node_(10) $udp

$ns attach-agent $node_(15) $null

$ns connect $udp $null

  • Ns2 code to make a packet transmission among the nodes

set cbr [new Application/Traffic/CBR]

$cbr attach-agent $udp

$cbr set packetSize_ 512

$cbr set interval_ 0.1

$ns at 0.5 “$cbr start”

$ns at 10.5 “$cbr stop”

So, the research scholars can join hands with our experts to get succeed in your research career.