Skip to content

Cmake based ns-3.37 install in Debian 11 chroot Environment

ns-3.37 was released on November 1, 2022 with some interesting updates and features  and the base coding style was updated, resulting in a large number of style and whitespace changes[1].

This article is about compiling and installing ns-3.37 on Debian 11 using cmake system.

New user-visible features in ns-3.37[2]

As mentioned in[2], in this version of ns-3, the there are some visible changes in internet module, lte module, wifi module and lr-wpan module.

 

In [2], the following changes are mentioned:

  • This release features upgrades to the IEEE 802.15.4 LR-WPAN models, including support for device association, energy detection, active, and passive scanning, and channel paging.
  • 3GPP-based propagation loss models were extended to include outdoor-to-indoor building penetration loss models for three scenarios. A new helper to auto-generate the IPv4 and IPv6 neighbor caches has been added.
  • The wifi module contains a number of small improvements and some architectural upgrades to prepare for support of multi-link operation.
  • The previous Python bindings generation framework (Pybindgen) was replaced by a new framework (Cppyy), and numerous build system improvements were added to the CMake system introduced in the last release cycle.

Supported platforms and requirements [2]

As mentioned in[2], this release is intended to work on systems with the following minimal requirements.

  • g++-8 or later, or LLVM/clang++-6 or later
  • Python 3.6 or later
  • CMake 3.10 or later
  • (macOS only) Xcode 11 or later
  • (Windows only) Msys2/MinGW64 toolchain

But as mentioned in[2],  not all ns-3 features are available on all systems. It means, some modules or features of ns-3 will not be available in some platform while we are compiling it under that platform.

 

Setting up Debian 11 ‘Chroot’ Environment

One may follow the steps  in the section “The Installation Requirements of chroot jail environment in Host” of the following article[3] to setup Debian 11 chroot environment.

 

Installing ns3.35 in Debian 10 chroot Jail Under Debian 11 Host OS or any Version of Linux Host

The above article explains a ‘waf’ script based installation procedure of ns-3.35. 

But the following is a “cmake” based  installation procedure for installing ns-3.37 under Debian 11 Bullseye. 

 

Installing ns-3.37 under Debian 11 chroot jail

Hidden Section! Contact Charles  

The key/passphrase will be given once you have been approved for getting paid research support/assistance from Charles. To get paid support, you may start a 'free' research discussion.  

WhatsApp chatDiscuss Through WhatsApp
 

Step 7: Installing ns-3.37

Note: For Chroot based installation of ns-3, we need to edit the configuration and installation script ‘ns3’ as explained in step 2 of the procedure [6], before trying to run the script ‘ns3’.

 $ cd /home/your_home/ns-allinone-3.37/ns-3.37
 $  ./ns3 configure –enable-examples –enable-tests

The following screenshot shows the successful “configure operation” in which you can see the modules that are configured to build.

 

Step 8: Compiling ns-3-dev

$ cd /home/your_home/ns-allinone-3.37/ns-3.37
$ ./ns3
Running the script from the folder cd /home/your_home/ns-allinone-3.37/ns-3.37 will compile ns-3.37 using CMake.
 

The following screenshot shows the successful compilation of ns-3.37 under chroot jail.

Step 4: Testing the Installation by Running an Example

We may test the installation by running the example script firs.cc as follows:

$ cd /home/your_home/ns-allinone-3.37/ns-3.37
$ ./ns3 run first
The following screenshot shows the installation completed good so that the example script is running and producing outputs correctly.
 

Installation of NetAnim

Step 1: Creating a Make file for compiling NetAnim

 

The NetAnim installation will need “make’ command. If your system doesn’t contain it, then you have to install it before compiling NetAnim. We need to install  build-essential which will contain “make” 
$ sudo apt install  build-essential
 
The command qmake is used to create the Makefile for making NetAnim.
#Creating Make file for compiling NetAnim
$ cd /home/your_home/ns-allinone-3.35/netanim-3.108

#configure make file using qmake
$ qmake NetAnim.pro

The above commands will create the Makefile for the compilation of NetAnim. The following screenshot shows the successful creation of Makefile.

 

Step 2:Compiling NetAnim

#compiling NetAnim

$ make -j9

# the option -j9 is for compile using multiple CPU jobs

 

The following screenshot shows the successful compilation of NetAnim.

 

Step3: Testing the working of NetAnim

The following screenshot shows the NetAnim GUI. 

 

Final Note :

The important thing we have to understand here is, the application which is running under chroot jail environment will get the native or near-native performance of the Host OS and Host hardware. So, we are getting the native software and hardware performance under this unique virtualization technology. So that the ns-3 compile process also gets accelerated and get near-native software and hardware performance.

Some Examples of “chroot-jail” based ns-3 Simulations

In the following articles, you may find some of the simulations that I did under chroot jail. Please note the excellent performance of these GUI based 3D simulations. In fact, these simulations are actually running under chroot jail but the GUI 3D outputs are rendered in the Host Display’s windowing system. So that these simulations are getting the native 3D performance.  One will never get such a level of performance under any other kind of virtualization like “VirtualBox”.

References:

  1. https://www.nsnam.org/releases/ns-3-37/
  2. https://gitlab.com/nsnam/ns-3-dev/blob/ns-3.37/RELEASE_NOTES.md
  3. https://www.projectguideline.com/installing-ns3-35-in-debian-10-chroot-jail-under-debian-11-host-os-or-any-version-of-linux-host/
  4. https://www.nsnam.org/wiki/Installation
  5. https://www.nsnam.org/docs/tutorial/html/getting-started.html
  6. https://www.projectguideline.com/installing-ns-3-dev-under-chroot-jail-and-compile-with-cmake/

 

WhatsApp Discuss Through WhatsApp