How to Install NS 2.29 packages in UBUNTU
To import NS 2.29 packages in NS2 have a look at the steps that are discussed in detail, if you face any doubt we are ready to help you. Network Simulator 2 (NS2) is a prominent open-source discrete event network simulator. Initially developed by the VINT (Virtual Inter-Network Testbed) project, NS2 is employed for the simulation of network protocols, routing algorithms, and traffic models. It accommodates both wired and wireless networks, rendering it suitable for a variety of research and educational applications. NS2 provides researchers with the opportunity to explore intricate network scenarios within a controlled setting, thereby enabling the assessment and comparison of network performance across diverse conditions. Utilizing its scripting language (TCL) and a C++ based framework, NS2 allows users to design custom network topologies and analyze protocol behavior with comprehensive statistical outputs. It continues to be a fundamental tool in the domain of network simulation, fostering progress in fields such as mobile networking, the Internet of Things (IoT), and protocol development.
Here, we have an exciting and exclusive article that is just popped out for you to notify the steps that are required for the installation of Network simulator 2.
PRE-REQUISITES:
- Fresh installation of Ubuntu 16.04 LTS:
Screenshot:
2.Download ns-allinone-2.29.tar.bz2 file:
We have to download the ns-allinone-2.29.tar.gz under home directory by the clicking the Link, it will directly download to Download Location and move the compressed file to the home Directory.
Screenshot:
3.Extraction of the ns-allinone-2.29.tar.gz file:
Next, we have to extract the compressed file by right click and click Extract here to extract the ns-allinone-2.29 as folder in the home directory.
Screenshot:
ns-allinone-2.29 compressed file Extracted Successfully in the home directory.
INSTALL DEPENDENCIES OF NS2:
- Open a terminal, Copy and Paste the commands to install required package:
Screenshot:
2.System File Update Command:
First of all, we need to updates the list of available packages and their versions stored in the system’s package index. Use below command to update the system package.
Command: “sudo apt-get update”
Screenshot:
3.Install Essential Tools:
- build-essential: A package containing essential tools for compiling software on Ubuntu, including GCC, g++, and make.
- autoconf: A tool for automatically configuring source code packages to adapt to various UNIX-like systems.
- automake: A tool that automatically generates Makefile.in files, simplifying the creation of portable makefiles.
- libxmu-dev: A development package for the X11 Athena Widget library, providing miscellaneous utility functions for X Window System programs.
Command: “sudo apt-get install build-essential autoconf automake libxmu-dev”
Screenshot:
Click the key Y to install the required Essentials tools for giving permission to install the package in the user system.
Screenshot:
Installation of the Essential tools package completed successfully.
INSTALL NETWORK SIMULATOR 2 (NS2):
- Locating the ns-allinone-2.29 Folder:
Next, we need to install the NS 2 in our system so locate the Extracted ns-allinone-2.29 folder in the home directory.
Screenshot:
2.Launching the terminal in the ns-allinone-2.29 Folder:
Then Right Click in the current Directory and select the “Open in Terminal” button and it will launch the terminal.
Screenshot:
Here, we launched the terminal by that button in the folder.
Screenshot:
3.Modification of ns-2.29 Code:
Next, we need to modify the Ns-2.29 to install the network simulation 2 Environment in the User system and it will resolve some dependency errors. First of all, locate to the Ns-2.29 folder.
Command: “cd ns-2.29”
Screenshot:
Next, we need to edit the ls.h file in the Ns-2.29 with gedit command.
Command: “cd linkstate && gedit ls.h”
Screenshot:
Screenshot:
Next, the code this-> is added to the line 137 and before the erase (basemap::begin(), baseMap::end()) code.
Screenshot:
Next, we need to edit the configure.in file in the nsallinone-2.29 folder with gedit command.
Command: “cd otcl-1.11 && gedit configure.in”
Screenshot:
Screenshot:
Next, Replace the code line 75-81
“ Linux*)
SHLIB_CFLAGS=”-fpic”
SHLIB_LD=”ld -shared”
SHLIB_SUFFIX=”.so”
DL_LIBS=”-ldl”
SHLD_FLAGS=””
;; ” with
“
Linux*)
SHLIB_CFLAGS=”-fpic”
SHLIB_LD=”gcc -shared”
SHLIB_SUFFIX=”.so”
DL_LIBS=”-ldl”
SHLD_FLAGS=””
;; ”.
Screenshot:
Next, we need to edit the Tcl.cc file in the nsallinone-2.29 folder with gedit command.
Command: “cd tclcl-1.17 && gedit Tcl.cc”
Screenshot:
Screenshot:
Next, Replace the code line 566 “char *p = strchr(localName, ‘(‘);” with “char* p = const_cast<char*>(strchr(localName, ‘(‘));”.
Screenshot:
Next, we need to edit the red.cc file in the Ns-2.29 with gedit command.
Command: “cd queue && gedit red.cc”
Screenshot:
Screenshot:
Next, Replace the code line 874 to 875 “char wrk[500], *p;” with “char wrk[500]; const char* p;”
Screenshot:
Next, we need to edit the rio.cc file in the Ns-2.29 with gedit command.
Command: “cd queue && gedit rio.cc”
Screenshot:
Screenshot:
Next, Replace the code line 563 to 564 “char wrk[500], *p;” with “char wrk[500]; const char* p;”
Screenshot:
Next, we need to edit the pi.cc file in the Ns-2.29 with gedit command.
Command: “cd queue && gedit pi.cc”
Screenshot:
Screenshot:
Next, Replace the code line 314 to 315 “char wrk[500], *p;” with “char wrk[500]; const char* p;”
Screenshot:
Next, we need to edit the vq.cc file in the Ns-2.29 with gedit command.
Command: “cd queue && gedit vq.cc”
Screenshot:
Screenshot:
Next, Replace the code line 331 to 332 “char wrk[500], *p;” with “char wrk[500]; const char* p;”
Screenshot:
Next, we need to edit the rem.cc file in the Ns-2.29 with gedit command.
Command: “cd queue && gedit rem.cc”
Screenshot:
Screenshot:
Next, Replace the code line 333 to 334 “char wrk[500], *p;” with “char wrk[500]; const char* p;”
Screenshot:
Next, we need to edit the gk.cc file in the Ns-2.29 with gedit command.
Command: “cd queue && gedit gk.cc”
Screenshot:
Screenshot:
Next, Replace the code line 205 to 206 “char wrk[500], *p;” with “char wrk[500]; const char* p;”
Screenshot:
4.Installing Ns-2.29 by the terminal:
Next, we need to install the network simulation 2.29 Environment in the User system and it. So, use the command to install the ns-2.29 in the ns-allinone-2.29 folder location.
Command: “./install”
Screenshot:
Ns-2.29 Configuration process:
Screenshot:
The configuration of the Network Simulator 2 (NS-2) environment. This command is typically used to set various parameters, such as the simulation duration, network topology, and node properties. It can also be used to specify the output format and other simulation settings.
Screenshot:
Ns-2.29 Configuration Completed successfully.
Ns-2.29 Building process:
Screenshot:
Next, Building the Network Simulator 2 (NS-2) framework from its source code. When use this command, It will compiles the source code, generates the Makefiles, and builds the NS-2 binary and libraries and make Runnable Environment.
Screenshot:
Ns-2.29 Installed successfully in the Ubuntu 16.04 system. If you are experiencing difficulties in running NS-2.29 packages in NS2, you may seek our assistance, as we are committed to providing you with optimal guidance and results with best research project guidance..