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

HOW TO IMPORT MOBILITY HELPER.H PACKAGES IN NS3

To import Mobility-helper.h packages in NS3 Our developers have explained that Mobility-helper.h is a header file in the NS-3 network simulator. It defines the ns3:: MobilityHelper class, which makes it easier to set up and manage how nodes move in simulations. The MobilityHelper class helps with tasks like assigning mobility models, positioning nodes, and controlling movement patterns. It works with different mobility models, such as constant position, random walk, and more advanced trajectory models. This helper class is important for effectively managing node movement in NS-3 simulations, allowing for the creation and analysis of dynamic network scenarios.

Read out the installation of Mobility-helper.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/src/mobility/examples folder:

Screenshot:

2.Copy the main-random-walk.cc file to scratch folder:

Next, we need to copy the main-random-walk.cc file from ns3.35/src/mobility/examples/ folder to the ns3/scratch folder.

Screenshot:

Copy the main-random-walk.cc file to scratch folder

Next, we need to paste the main-random-walk.cc file to the ns3/scratch folder.

Screenshot:

Copy the main-random-walk.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

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 Mobility-helper.h:

Here we imported the mobility-helper.h header file in this example program.

Screenshot:

Importing Mobility-helper.h

Here we highlighted the code line that MobilityHelper class using SetPositionAllocator() function which is the part of the mobility-helper.h that we will show class file that used in this code via network folder which represents mobility-helper.

Screenshot:

Importing Mobility-helper.h

Screenshot:

Importing Mobility-helper.h

Here we will show the header file by opening mobility-helper.h file to show the class imported from the mobility-helper.h in the example code.

Screenshot:

Importing Mobility-helper.h

6.Executing the Example Mobility-helper Program:

Then we need to run the Example Mobility-helper program to view output of the program.

Command:      “./waf –run main-random-walk –vis”

Screenshot:

Executing the Example Mobility-helper Program

Here we shown the output of the example Mobility-helper program by using Mobility-helper.h.

Screenshot:

Executing the Example Mobility-helper Program

Screenshot:

Executing the Example Mobility-helper Program

Screenshot: