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

How to import Energy Module.h packages in NS3

To import ENERGY-MODULE.H packages in NS3 read out the guidance that we have listed below, we work on energy parameters, monitoring energy levels, and managing device power states. Contact us to get best project ideas. The EnergyModule class helps keep tabs on how much energy devices are using, whether they’re sending, receiving, or just sitting idle. It comes with different energy models that let you dive deep into analyzing energy efficiency and battery life in wireless networks. Getting a grip on energy-module.h is key for running simulations that focus on energy-conscious networking, especially in mobile and IoT (Internet of Things) situations.

Have a look at the installation of Energy-module.h.

PRE-REQUISITES:

  1. Fresh installation of Ubuntu 22.04 LTS:

Screenshot:

Fresh installation of Ubuntu 22_04 LTS

2.NS-3.35 Installation:

Screenshot:

NS-3.35 Installation

HEADER FILE VERIFICATION:

  1. Locate to the ns3.35/examples/energy folder:

Screenshot:

Locate to the ns3-examples-energy folder

2.Copy the energy-model-example.cc file to scratch folder:

Next, we need to copy the energy-model-example.cc file from ns3.35/examples/energy folder to the ns3/scratch folder.

Screenshot:

Next, we need to paste the energy-model-example.cc file to the ns3/scratch folder.

Screenshot:

Copy the energy-model-example.cc file to scratch folder

3.Open the Terminal:

Next, we need to launch the terminal by right clicking the mouse in the ns3 location.

Screenshot:

Open the Terminal

Screenshot:

Open the Terminal

4.NS-3.35 Configuration && Building Process:

Next, we need to configure and build the ns3 folder to make the copied files to the scratch need to store in configuration.

Command:      “./waf configure && ./waf build”

Screenshot:

Screenshot:

NS-3.35 Configuration && Building Process

5.Importing Energy-module.h:

Here we imported the Energy-module.h header file in this example program.

Screenshot:

Importing Energy-module.h

Here we highlighted the code line that BasicEnergySourceHelper class which is the part of the Energy-module.h that we will show class file that used in this code via energy folder which represents Energy module.

Screenshot:

Screenshot:

Importing Energy-module.h

Here we will show the header file by opening basic-energy-source-helper.h file to show the class imported from the Energy-module.h in the example code.

Screenshot:

Importing Energy-module.h

6.Executing the Example Wifi-net-device Program:

Then we need to run the Example Wifi-net-device program to view output of the program.

Command:      “./waf –run energy-model-example –vis”

Screenshot:

Executing the Example Energy-module Program

Here we shown the output of the example Wifi-net-device program by using Energy-module.h.

Screenshot:

Executing the Example Energy-module Program

Screenshot:

Executing the Example Energy-module Program

Screenshot:

Executing the Example Energy-module Program