Ns3 Projects for B.E/B.Tech M.E/M.Tech PhD Scholars.  Phone-Number:9790238391   E-mail: ns3simulation@gmail.com

NS3 NETANIM & PYVIZ INSTALLATION STEPS

We’ve discussed how NetAnim serves as a graphical animation tool that helps visualize network simulations done with the NS-3 simulator. It lets users see packet transfers, node movements, and various network happenings either in real-time or through a replay. Plus, it comes with customization features like speed control, event filtering, and zooming for a closer look. This makes it super handy for debugging and grasping complicated network situations. NetAnim is a great resource for researchers and developers to better understand network dynamics, making the exploration of networking concepts even more effective.

PyViz offers a range of Python tools that are open-source and perfect for making interactive visualizations effortlessly. With libraries such as HoloViews, GeoViews, and Datashader, it seamlessly integrates with commonly used data science tools. PyViz is particularly great at managing big datasets, allowing for smooth rendering and interactive exploration. Its ecosystem includes useful features like zooming, panning, and data selection, which enhance the intuitiveness of data analysis. By using PyViz, data scientists can create impactful visualizations with minimal coding, improving data comprehension and communication.

Look out for the installation steps in NetAnim.

PRE-REQUISITES:

  1. Fresh installation of Ubuntu 22.04 LTS:

Screenshot:

Fresh installation of Ubuntu 22_04 LTS

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. g++: A C++ compiler from the GNU Compiler Collection, essential for compiling C++ programs.
    2. python3: The Python programming language interpreter, used for running Python scripts and applications.
    3. cmake: A cross-platform tool for managing the build process of software using a compiler-independent method.
    4. git: A distributed version control system for tracking changes in source code during software development.

Command:      “sudo apt install g++ python3 cmake git”

Screenshot:

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.

  1. Install Required Libraries and Development Tools:
  2. python3-dev: Header files and a static library for Python development.
  3. pkg-config: Helps to manage compile and link flags for libraries.
  4. autoconf: Tool for generating configure scripts.
  5. automake: Tool for generating Makefile.in files.
  6. libc6-dev, libc6-dev-i386: Development libraries for the GNU C Library.
  7. libclang-dev: Development files for Clang, a C language family frontend for LLVM.
  8. llvm-dev: Development libraries for LLVM.
  9. libboost-all-dev: Boost libraries development files.
  10. gsl-bin, libgsl-dev, libgslcblas0: GNU Scientific Library development files and binaries.
  11. python3-setuptools: Tools for installing Python packages.
  12. openmpi-bin, openmpi-common, openmpi-doc, libopenmpi-dev: MPI libraries and tools for parallel computing.
  13. cvs: Concurrent Versions System, a version control system.
  14. bzr: Bazaar, a distributed version control system.
  15. unrar: Unarchiver for .rar files.
  16. wireshark, tcpdump: Network protocol analyzers.
  17. openmpi-bin, openmpi-common, openmpi-doc, libopenmpi-dev: Tools and libraries for the Open MPI project.
  18. sqlite3, libsqlite3-dev: SQLite database command-line interface and development files.
  19. libxml2, libxml2-dev: Libraries for parsing XML.
  20. libxmu-dev: package that provides the development headers for the X11 miscellaneous utility library (libXmu)
  21. build-essential: A meta-package in Linux distributions like Ubuntu that groups together essential tools for compiling software from source code

Command:           

“sudo apt install build-essential autoconf automake libxmu-dev python3-dev pkg-config sqlite3 python3-setuptools openmpi-bin openmpi-common openmpi-doc libopenmpi-dev autoconf cvs bzr unrar gsl-bin libgsl-dev libgslcblas0 wireshark tcpdump sqlite sqlite3 libsqlite3-dev  libxml2 libxml2-dev libc6-dev libc6-dev-i386 libclang-dev llvm-dev automake python3-pip libxml2 libxml2-dev libboost-all-dev”

Screenshot:

Install Required Libraries and Development Tools

Click Yes to install wireshark packages to capture the packets from Network simulator 3.

Screenshot:

Screenshot:

Installation of the Required Libraries and Development Tools package completed successfully.

  1. Install NetAnim Required Libraries and Tools:

Next, we need to install NetAnim Required Libraries and Tools such as QT packages in the ubuntu system. Use below command to install the NetAnim package.

Command:      “sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools”

apt install gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3 

Screenshot:

Install NetAnim Required Libraries and Tools

If you get Prompt like [Y/N], then Click Y to install these additional Packages.

Screenshot:

Install NetAnim Required Libraries and Tools

5.Install PyViz Required Libraries and Tools:

Next, we need to install PyViz Required Libraries and Tools such as Graphviz packages in the ubuntu system. Use below command to install the PyViz package.

Command:      “sudo apt-get install gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3”

Screenshot:

Install PyViz Required Libraries and Tools

INSTALL NETWORK SIMULATOR 3 (NS3):

  1. Download ns-allinone-3.35.tar.bz2 file:

We have to download the ns-allinone-3.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://www.nsnam.org/releases/ns-allinone-3.35.tar.bz2

Screenshot:

Download ns-allinone-3.35.tar.bz2 file

2.Extraction of the ns-allinone-3.35.tar.bz2 file:

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

Screenshot:

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

Screenshot:

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

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

  1. Locating the ns-allinone-3.35 Folder:

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

Screenshot:

Locating the ns-allinone-3.35 Folder

4.Launching the terminal in the ns-allinone-3.35 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.35 Folder

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

Launching the terminal in the ns-allinone-3.35 Folder

5.Building the terminal in the ns-allinone-3.35 Folder:

Next, we need to build the ns-3.35 to install the network simulation 3 Environment in the User system and it will build the netanim also. So, use the command to build the ns-3.35.

Command:      “./build.py”

Screenshot:

Building the terminal in the ns-allinone-3.35 Folder

6.Netanim Building process:

Here we will display the NetAnim building process by giving above command it will automatically build the NetAnim.

Screenshot:

Netanim Building process

Here We shown the NetAnim built Successfully.

Screenshot:

Netanim Building process

7.Ns-3.35 Configuring process:

Here, we will show the Configuration process that will check the packages required for ns-3.35 tools by giving above command it will automatically Configure the ns-3.35.

Screenshot:

Ns-3.35 Configuring process

The “./ns3 configure” command is to configure the Network Simulator 3 (NS-3) 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-3.35 Configuring process

Ns-3.35 Configuration Completed successfully.

8.Enable PyViz Visualizer:

Here we shown the PyViz enabled in ns-3.35 Configuration process by using previous Enabling PyViz commands.

Screenshot:

Enable PyViz Visualizer

9.Ns-3.35 Building process:

Here, we will show the building process that will build the files in the ns-3.35 Source files by giving above command it will automatically build the ns-3.35.

Screenshot:

Ns-3.35 Building process

The “./ns3 build” command is used to build the Network Simulator 3 (NS-3) framework from its source code. When use this command, It will compiles the source code, generates the Makefiles, and builds the NS-3 binary and libraries and make Runnable Environment.

Screenshot:

Ns-3.35 Building process

Note: This Error will occur due to pybindgen configuration so follow the Python bindings Enabling Procedure as Below.

10.Enable Python Bindings:

The Python bindings for NS-3 are a set of Python modules that allow you to use the Network Simulator 3 (NS-3) library from within Python. With the Python bindings, you can leverage the power of NS-3 to simulate and analyse network behaviour without needing to write code in C++.

Next, we will locate the cppclass.py file in /home/<your-user-name>/ns-allinone-3.35/pybindgen-0.22.0/pybindgen/ cppclass.py

Enable Python Bindings

Screenshot:

Enable Python Bindings

Next, we need to open cppclass.py file in the text Editor by right clicking the file and Edit the following file code with below screenshot.

Screenshot:

Enable Python Bindings

Here we installed the python bindings required packages successfully.

11.Ns-3.35 Location Change:

Change the location to the ns-3.35.

Command:cd ns-3.35

Screenshot:

Ns-3.35 Location Change

12.Ns-3.35 Configuring process:

The Ns 3.35 configuration of the Network Simulator 3 (NS-3) 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.

Command: “./waf configure”

Screenshot:

Ns-3.35 Configuring process

Ns-3.35 Configuration Completed successfully.

13.Ns-3.35 Building process:

The “./waf build” command is used to build the Network Simulator 3 (NS-3) framework from its source code. When use this command, It will compiles the source code, generates the Makefiles, and builds the NS-3 binary and libraries and make Runnable Environment.

Command: “. /waf build”

Screenshot:

Ns-3.35 Building process

Screenshot:

Ns-3.35 Building process

Ns-3.35 Installed successfully in the Ubuntu 22.04 system.

14.Simulation of Example code for PyVizualizer and NetAnim:

Next, we have taken example file from ns-3.35 source folder. Here, we need copy file from example folder in the src folder of the ns-3.35 and Use below command to run the Scratch file.

Command: “./waf configure && ./waf build && ./waf –run grid-animation –vis”

PyVizualizer:

Screenshot:

PyVizualizer

Screenshot:

PyVizualizer

NetAnim:

To Launch the NetAnim, you need to locate the ns-allinone-3.35 directory and need to move to netanim-3.108 folder and Use below Commands to launch the NetAnim.

Command: “./NetAnim”

Screenshot:

NetAnim

Screenshot:

NetAnim

Here We shown the NetAnim Window, we will load the XML file that created by ns 3 simulation and you can see this file in ns-3.35 folder.

Screenshot:

NetAnim

Select the xml file.

Screenshot:

NetAnim

Here we display the Simulated xml file from the PyVisualizer.

Screenshot:

NetAnim

Click the Play Ø button to simulate the Xml file.

Screenshot:

NetAnim

Screenshot:

NetAnim

Finally, we simulated the XML file using NetAnim Successfully.

If you encounter any difficulties, feel free to reach out to us for help with NETANIM & PYVIZ installation as well as guidance on your project.