0% found this document useful (0 votes)
19 views3 pages

Installation of NS2

Uploaded by

venkat Mohan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views3 pages

Installation of NS2

Uploaded by

venkat Mohan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Installation of NS2

Packages needed

Download the ns2 allinone in home/user_folder


https://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/ns-allinone-2.35.tar.gz/
download

Download the files from below folder


https://tinyurl.com/kv4dkd9p

Download and extract the ns-allinone-2.35 folder in /home/user_name/ folder

1. Update System Packages


To begin, ensure your system is up-to-date by running the following commands in the terminal:
$ sudo apt update
$ sudo apt install build-essential autoconf automake libxmu-dev

2. Install Required GCC and G++ Versions


NS-2 requires specific versions of GCC and G++, namely version 4.8. To install these, follow the
steps below: Open the sources.list file for editing:

$ sudo gedit /etc/apt/sources.list

Add the following line at the end of the file:


deb http://in.archive.ubuntu.com/ubuntu/ bionic main universe

Save and close the file. Then, update the package list:

$ sudo apt update

If you encounter any issues with missing keys during the update process, you can resolve it with the
following commands:
$ sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 3B4FE6ACC0B21F32
$ sudo apt update

Next, install the required GCC and G++ versions:


$ sudo apt install gcc-4.8 g++-4.8
3. Install NS2 (ns-allinone-2.35)
Once GCC and G++ are successfully installed, proceed with the installation of NS2.
Navigate to the directory where the NS2 files are located:

$ cd ns-allinone-2.35/ // replace with the appropriate file name if you changed

Start the NS2 installation process:


ns-allinone-2.35 $ ./install

Note: The installation process may take 3-5 minutes to complete. Once finished, you should see a
confirmation message indicating successful installation.

4. Configure Environment Variables

After the installation, we have the console for nearly 3 to 5 mins. At the end, we got the output as
follows

After the installation completes, configure your environment by editing the .bashrc file:
$ gedit .bashrc

Add the following lines to the file, replacing the highlighted part with the appropriate directory
from your terminal output during the installation:

In the file opened (.bashrc), line 3 - # for examples


export PATH = $PATH: {the highlighted link in the previous terminal}
export LD_LIBRARY_PATH = /home/ionhax/ns-allinone-2.35/otcl-1.14, /home/ionhax/ns-
allinone-2.35/lib
In the LD_LIBRARY_PATH, replace the ‘,’ with ‘:’
Then save and exit the file.

5. Verify NS2 Installation

Open the terminal and type the following command


$ source .bashrc
for this, the output will be like
%

$nam
for this, the output will be like
nam:

Then download and paste the deb file – nam_1.14_amd64.deb in /home folder.
$ ls

$ sudo dpkg –install nam_1.14_amd64.deb

now, in terminal, type nam as command and we got the output as follows.

You might also like