0% found this document useful (0 votes)
219 views2 pages

Steps To Install NS-2.35 in Ubuntu 16.04: 1) Download Network Simulator NS-2.35 From The Link Given Below

The document provides steps to install NS-2.35 network simulator on Ubuntu 16.04. It involves downloading the NS-2.35 file, extracting it to the /opt folder, installing prerequisites like gcc, configuring environment variables in .bashrc to set paths for NS libraries and running test commands to verify the installation. If there are errors during linking, suggested edits to specific files are provided to troubleshoot the installation.

Uploaded by

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

Steps To Install NS-2.35 in Ubuntu 16.04: 1) Download Network Simulator NS-2.35 From The Link Given Below

The document provides steps to install NS-2.35 network simulator on Ubuntu 16.04. It involves downloading the NS-2.35 file, extracting it to the /opt folder, installing prerequisites like gcc, configuring environment variables in .bashrc to set paths for NS libraries and running test commands to verify the installation. If there are errors during linking, suggested edits to specific files are provided to troubleshoot the installation.

Uploaded by

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

Steps to Install NS-2.35 in Ubuntu 16.

04
1) Download Network Simulator NS-2.35 from the link given below
https://osdn.net/frs/g_redir.php?m=netix&f=%2Fnsnam%2Fallinone%2Fns-allinone-
2.35%2Fns-allinone-2.35.tar.gz
2) It get downloaded into your '/home/your_user_name/Downloads' directory.
copy it to /opt folder y following command cp /home/user_name/Downloads/ns-
allinone-2.35.tar.gz /opt/
Install Prerequisites
3) Type following commands on terminal
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get update
sudo apt-get gcc (For gcc installation follow section 4)
sudo apt-get install build-essential autoconf automake
sudo apt-get install tcl8.5-dev tk8.5-dev
sudo apt-get install perl xgraph libxt-dev libx11-dev libxmu-dev
4) How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
Note: Usually NS-2.35 works with gcc 4.8 or gcc 4.9. If there is an
error then change it to 4.9 from 6 which works well from below
command
sudo apt-get update
sudo apt-get install build-essential software-properties-common -y
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install gcc-snapshot -y
sudo apt-get update
sudo apt-get install gcc-6 g++-6 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave
/usr/bin/g++ g++ /usr/bin/g++-6
sudo apt-get install gcc-4.8 g++-4.8 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave
/usr/bin/g++ g++ /usr/bin/g++-4.8

When completed, you must change to the gcc you want to work with by default. Type
in your terminal:
sudo update-alternatives --config gcc

To verify if it worked. Just type in your terminal


gcc -v
Extract ns2
5) Type following commands on terminal
cd /opt/
tar -zxvf ns-allinone-2.35.tar.gz
cd ns-allinone-2.35
./install
6) During ns 2 installation if you find linkstate error
linkstate/ls.h:137:58: note: use ‘this->erase’ instead
make: *** [linkstate/ls.o] Error 1
Ns make failed!
Then
You must edit the line number 137 of ns-2.35/linkstate/ls.h from
void eraseAll() { erase(baseMap::begin(), baseMap::end()); }
to
void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }

Now again Goto Step 5 to install again! (./install)


7) After Installation Completed
Type following commands on terminal
sudo gedit ~/.bashrc

Copy the following lines in red AT THE END of the file.#


LD_LIBRARY_PATHOTCL_LIB=/opt/ns-allinone-2.35/otcl-
1.14/NS2_LIB=/opt/ns-allinone-2.35/lib/USR_Local_LIB=/usr/local/lib/export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$USR
_Local_LIB

# TCL_LIBRARYTCL_LIB=/opt/ns-allinone
2.35/tcl8.5.10/library/USR_LIB=/usr/lib/export
TCL_LIBRARY=$TCL_LIBRARY:$TCL_LIB:$USR_LIB

# PATHXGRAPH=/opt/ns-allinone-2.35/xgraph-12.2/:/opt/ns-allinone-
2.35/bin/:/opt/ns-allinone-2.35/tcl8.5.10/unix/:/opt/ns-allinone-
2.35/tk8.5.10/unix/NS=/opt/ns-allinone-2.35/ns-2.35/NAM=/opt/ns-allinone-
2.35/nam-1.15/export PATH=$PATH:$XGRAPH:$NS:$NAM

#----
Type following commands on terminal
source ~/.bashrc
Type following commands on terminal
ns
If you received the "%" sign, it means that NS is running
correctly!

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy