HOW TO INSTALL SGB2NS PACKAGES IN NS2

To import SGB2NS packages into NS2, you need to follow the steps listed below. If you run into any issues during the import process, feel free to reach out to ns2project.com. We also provide great ideas and topics for your projects. SGB2NS (Stanford GraphBase to NS converter) is a dedicated utility designed to transform graph representations from the Stanford GraphBase (SGB) format into the format compatible with NS-2 (Network Simulator 2). This tool is primarily utilized in network simulation settings where researchers and network engineers aim to replicate network topologies derived from intricate graph structures. The Stanford GraphBase, created by Donald Knuth, comprises an extensive array of tools and data structures intended for the generation and manipulation of large graphs, which serve to model complex networks. SGB2NS enables the smooth incorporation of these graph-based topologies into the NS-2 simulation framework, allowing users to conduct comprehensive network simulations based on established graph structures. By converting SGB graphs into formats suitable for NS, SGB2NS empowers users to specify network nodes, edges, and link attributes based on either real-world or synthetic graphs. This functionality is especially beneficial for evaluating network protocols, analyzing routing behaviors, and simulating extensive network scenarios. The topologies converted by SGB2NS are subsequently employed in NS-2 to simulate a diverse array of network behaviors, including traffic dynamics, congestion patterns, and routing efficiency.

PRE-REQUISITES:

  1. Fresh installation of Ubuntu 16.04 LTS:

Screenshot:

Fresh installation of Ubuntu 16.04 LTS

2.Download ns-allinone-2.35.tar.bz2 file:

We have to download the ns-allinone-2.35.tar.bz2 under home directory by the clicking the Link, it will directly download to Download Location and move the compressed file to the home Directory.

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

Screenshot:

Download ns-allinone-2.35.tar.bz2 file

3.Extraction of the ns-allinone-2.35.tar.bz2 file:

Next, we have to extract the compressed file by right click and click Extract here to extract the ns-allinone-2.35 as folder in the home directory.

Screenshot:

Extraction of the ns-allinone-2.35.tar.bz2 file

Screenshot:

Extraction of the ns-allinone-2.35.tar.bz2 file

ns-allinone-2.35 compressed file Extracted Successfully in the home directory.

INSTALL DEPENDENCIES OF NS3:

  1. Open a terminal, Copy and Paste the commands to install required package:

Screenshot:

Open a terminal, Copy and Paste the commands to install required package

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:

System File Update Command

3.Install Essential Tools:

    1. build-essential: A package containing essential tools for compiling software on Ubuntu, including GCC, g++, and make.
    2. autoconf: A tool for automatically configuring source code packages to adapt to various UNIX-like systems.
    3. automake: A tool that automatically generates Makefile.in files, simplifying the creation of portable makefiles.
    4. 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:

Install Essential Tools

Click the key Y to install the required Essentials tools for giving permission to install the package in the user system.

Screenshot:

Install Essential Tools

Installation of the Essential tools package completed successfully. 

INSTALL NETWORK SIMULATOR 3 (NS3) With SGB2NS:

  1. Locating the ns-allinone-2.35 Folder:

Next, we need to install the NS 3 in our system so locate the Extracted ns-allinone-2.35 folder in the home directory.

Screenshot:

Locating the ns-allinone-2.35 Folder

2.Launching the terminal in the ns-allinone-3.25 Folder:

Then Right Click in the current Directory and select the “Open in Terminal” button and it will launch the terminal.

Screenshot

Launching the terminal in the ns-allinone-3.25 Folder

Here, we launched the terminal by that button in the folder.

Screenshot:

Launching the terminal in the ns-allinone-3.25 Folder

3.Modification of ns2.35 Code:

Next, we need to modify the ns-2.35 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.35 folder.

Command:      “cd ns-2.35”

Screenshot:

Modification of ns2.35 Code

Next, we need to edit the ls.h file in the ns-2.35 with gedit command.

Command:      “cd linkstate && gedit ls.h

 Screenshot:

Modification of ns2.35 Code

Screenshot:

Modification of ns2.35 Code

Next, the code this-> is added to the line 137 and before the erase (basemap::begin(), baseMap::end()) code.

Screenshot:

Modification of ns2.35 Code

4.Installing ns-2.35 by the terminal:

Next, we need to install the network simulation 2.35 Environment in the User system and it. So, use the command to install the ns-3.25 for SGB2NS Package in the ns-allinone-2.35 folder location.

Command:      “./install”

 Screenshot:

Installing ns-2.35 by the terminal

SGB2NS Building process:       

Screenshot:

SGB2NS Building process

Next, Building the SGB2NS tool along with 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 with SGB2NS binary and libraries and make Runnable Environment.

 

Screenshot:

SGB2NS Building process

Here SGB got validated and all test had been passed successfully, if configuration is configured correctly , then it will show this message.

Screenshot:

SGB2NS Building process

Screenshot:

SGB2NS Building process

SGB2NS Installed successfully in the NS-2.35 Environment.

Ns-2.35 Configuration process:

Screenshot:

Ns-2.35 Configuration process

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.35 Configuration process

Ns-2.35 Configuration Completed successfully. 

Ns-2.35 Building process:

Screenshot:

Ns-2.35 Building process

Next, Building the Network Simulator 2 (NS-2) framework from its source code. When use this command, it will compile the source code, generates the Makefiles, and builds the NS-2 binary and libraries and make Runnable Environment.

Screenshot:

Ns-2.35 Building process

Ns-2.35 Installed successfully in the Ubuntu 16.04 system.

 Screenshot:

Ns-2.35 Building process

SGB2NS Installed successfully along with Ns-2.35 Installation process in the Ubuntu 16.04 system.