In a previous article, we explained the way of installing ns-3.35 under chroot jail. But installing ns-3-dev, in the same way, is not possible under chroot jail because, ns-3-dev configure and compile process will not allow running configure and compile script ‘ns3’ as root user which is the default user privilege under chroot.
In this article, we will see a trick to install ns-3-dev under chroot-jail
The following article explains a chroot jail based installation of ns-3.35.
Installing ns3.35 in Debian 10 chroot Jail Under Debian 11 Host OS or any Version of Linux Host
That article explained the following :
- Problems that we face during installing ns-3 under Native and Virtual Hardware/OS,
- Chroot based Virtualization,
- Advantages of installing ns-3 Under Chroot Jail Based Virtualization.
- Installation of Debian 10 Buster (64 bit) chroot Jail Environment under Debian 11
- Installation of ns-3 Under Chroot Jail and and
- Installation of NetAnim Under Chroot Jail
In the above-mentioned steps, instead of installing ns-3.35 at the 5th step, we are going to install ns-3-dev version as per the following procedure since we can not install the latest ns-3-dev in the same way since the installation script “ns3” will not allow us to run it as root user.
This procedure assumes that the user already set up a chroot jail and installed a suitable Linux OS under it. (I mean, up to step 4 in the above-mentioned list).
Installation of ns-3-dev under chroot
Step 1: Downloading ns-3-dev using “git”
You may download a compressed version of ns-3-dev or directly clone it using “git” command. The following shows the way of cloning ns-3-dev project repository using “git” command. Here we try to install ns-3-dev under a folder named “/home” (even though /root is the default privileged home directory of the user root under chroot jail)
$ git clone https://gitlab.com/nsnam/ns-3-dev.git
The above command will clone the entire ns-3-dev project under the folder home. So, now the folder /home/ns-3-dev will contain the dev
Step 2: Editing the configuration and installation script “ns3”
The following shows the section/lines that needed to be edited.
Step 3: Configure the ns-3-dev
$ ./ns3 configure –enable-examples –enable-tests
Step 4: Compiling ns-3-dev
$ ./ns3
The following screenshot shows the successful compilation of ns-3-dev 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:
$ ./ns3 run first
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”.
- Simulating And Visualizing 3D Mobile Underwater Sensor Network (UWSN) Under ns-3
- Simulating And Visualizing 3D Aerial Ad-hoc Network (AANET) and Flying Ad-hoc Network (FANET) Under ns-3
- Simulation of Multi-Tire UAV/AANET/FANET Topology Using Gauss-Markov 3D Mobility Model Under ns-3
- Using Gauss-Markov 3D Mobility Model Under ns-3 for Simulating Unmanned Aerial Vehicle (UAV), Aerial Ad-hoc Network (AANET) and Flying Ad-hoc Network (FANET)