Skip to content

Installing ns-3 and NetAnim Under New Windows 11 Using WSL2 

The Windows Subsystem for Linux (WSL): 

The Windows Subsystem for Linux (WSL) lets developers run a GNU/Linux environment — including most command-line tools, utilities, and applications — directly on Windows, unmodified, without the overhead of a traditional virtual machine or dual-boot setup[1]. Particularly, by using the latest version of WSL2 under Windows 11 one can effortlessly install ns-3 and NetAnim under Windows 11.

Compiling the latest Linux-based simulation tool  ns-3 using  Cygwin, MinGW and MSYS2  will be a challenging task. Of course, some people successfully made it work but the rest of the people may fail to make it work because of various reasons.

But, using different virtualisation solutions such as Microsoft Virtual PC, Microsoft Hyper-V, VMWare, VirtualBox, etc., one can successfully install and use any Linux-based application under Windows. But the performance of ns-3 simulation in terms of speed will not be good under these kinds of desktop virtualization solutions.  But Windows Subsystem for Linux is the best and most efficient way of running a Linux-based simulation tool ns-3 under Windows. It will give better performance in terms of speed while comparing with other virtualization technologies.

 

Step 1: Installing WSL2 and suitable Linux version Under Windows 11

 

The following step-by-step procedure explains the way of installing WSL2, and Ubuntu under the latest Windows 11 version.

 

Installing WSL2 Under Windows 11 and Running GUI Linux Apps.

 

The installation procedure that we present here is almost the same as the following one :

Installing ns3.35 in Debian 11 (Bullseye)

 

Instead of doing it under chroot, we are repeating it under WSL2 of Windows 11.

Step 2: Install the necessary dependencies of ns3 

# refresh the database of available packages
$ sudo apt-get update

#install the dependencies
$ sudo apt install g++ python3 python3-dev pkg-config sqlite3 qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools

#(see https://www.nsnam.org/wiki/Installation for more details)

Step 3: Download ns3.35 from https://www.nsnam.org/releases/ns-3-35/

# Download ns-allinone-3.35.tar.bz2under home directory
# cd /home/your_home
$ wget https://www.nsnam.org/releases/ns-allinone-3.35.tar.bz2
 

#extract the compressed file using your own method
$ tar -xvf  ns-allinone-3.35.tar.bz2

 

In this procedure, I will extract the directory structure of ns-3.35under the folder /home/your_home/ns-allinone-3.35 

The following output shows the extracted folder ‘ns-allinone-3.35’ from file explorer ‘nautilus’ of Ubuntu (under WSL).

 

Step 4: Compiling ns-3.35

 

#compiling ns-3.35

$ cd /home/jason/ns-allinone-3.35/ns-3.35

#configure make file according to the environment 
$./waf –disable-python configure

# Sometimes we may need to configure some gcc options  and then configure the make as follows
#  CXXFLAGS=”-Wall -g -O0″ ./waf –disable-python configure

The following terminal output shows the successful configure operation:
The red warnings show the options that are not enabled in the configuration.
 

Step 5: Making ns-3.35 using ‘waf’

#Compiling ns-3.35
$ ./waf
 

 

The following WSL terminal shows the successful compile of ns-3.35

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. In fact, the NetAnim tool is running under WSL2 Ubuntu Linux; but displaying its GUI under the desktop environment of Windows 11. This is the elegance of using ns-3 and NetAnim under WSL2.

 

Conclusion

With the latest Windows 11 and its WSL2 support, we can run any GUI-based Linux applications under windows. The future version of WSL may even have excellent support for applications that may use 3D graphics subsystem. 

Now we can install any text-based as well as GUI-based Linux application under this Ubuntu which is running under WSL2. So, now it is possible to install ns-3 with ‘NetAnim‘ (GUI) or ns-2 with the ‘nam‘ (GUI) OMNet++ with its ‘IDE’ (GUI), SUMO (GUI).

We may see the installation procedure of these simulation tools under WSL2 in different articles. Meantime one may try the following installation procedures under WSL2.

https://www.projectguideline.com/installing-netsimulyzer-3d-visualization-tool-under-linux-virtual-guest-operating-system-environment/

Installing NetSimulyzer 3D Visualization Tool Under Linux Virtual Guest Operating System Environment

https://www.projectguideline.com/installing-aquasim-aqua3d-on-an-old-linux-under-virtualbox/

Installing Aquasim & Aqua3D on an old Linux under VirtualBox

 

https://www.projectguideline.com/installing-omnet-6-on-a-64-bit-debian-10-under-chroot-jail/

 

Installing OMNeT++ 6 on a 64-bit Debian 10 Under Chroot-Jail

 

References 

    1. https://docs.microsoft.com/en-us/windows/wsl/about
    2. https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#1-overview
    3. https://www.nsnam.org/wiki/Installation
WhatsApp Discuss Through WhatsApp