Steps To Install NS-2.35 in Ubuntu 16.04: 1) Download Network Simulator NS-2.35 From The Link Given Below
Steps To Install NS-2.35 in Ubuntu 16.04: 1) Download Network Simulator NS-2.35 From The Link Given Below
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
# 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!