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

How to import SIMULATOR.H packages in NS3

To import SIMULATOR.H packages in NS3 read the steps. If you need assistance with the installation, feel free to reach out to us. We can help you with your project execution. The Simulator class manages simulation time, schedules events, and runs simulation steps. It has methods to move time forward, set up events, and control how the simulation progresses. This class makes sure that all events happen in the right order and at the right times. Knowing simulator.h is important for developers using NS-3 because it supports the running and management of network simulations, allowing for precise and effective testing of network protocols and setups.

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/src/core/examples folder:

Screenshot:

Locate to the ns3-src-core-examples folder

2.Copy the sample-simulator.cc file to scratch folder:

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

Screenshot:

Next, we need to paste the sample-simulator.cc file to the ns3/scratch folder.

Screenshot:

Copy the sample-simulator.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:

NS-3.35 Configuration && Building Process

Screenshot:

NS-3.35 Configuration && Building Process

5.Importing Simulator.h:

Here we imported the Simulator.h header file in this example program.

Screenshot:

Importing Simulator.h

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

Screenshot:

Importing Simulator.h

Screenshot:

Here we will show the header file by opening simulator.h file to show the class imported from the Simulator.h in the example code.

Screenshot:

Importing Simulator.h

6.Executing the Example Simulator Program:

Then we need to run the Example Simulator program to view output of the program.

Command:      “./waf –run sample-simulator –vis”

Screenshot:

Executing the Example Simulator Program

Here we shown the output of the example Simulator program by using Simulator.h.

Screenshot:

Executing the Example Simulator Program