How to Start AOMDV Protocol Projects Using NS3

To start the Ad hoc On-Demand Multipath Distance Vector (AOMDV) protocol using NS3 which is an expansion of the AODV (Ad hoc On-Demand Distance Vector) protocol that offers several paths within mobile ad hoc networks (MANETs) for each route. This aspect permits the AOMDV, managing route failures effectively, since alternate routes without needing a full route discovery, which is available.

At present, NS3 does not directly support AOMDV. But, we can be replicated AOMDV functionality through third-party executions, which insert AOMDV assist to NS3 environment. Below is a simple guideline to start AOMDV in NS3 that contains steps appending an AOMDV module if available and then replicating the AOMDV-like behavior.

Steps to Start AOMDV Protocol Projects in NS3

Option 1: Using a Third-Party AOMDV Module for NS3

There are AOMDV’s third-party executions for NS3 which is available from researchers or developers. If they’re matching with NS3 version then we can be used these module.

Steps for Installing and Using a Third-Party AOMDV Module

  1. Find and Download the AOMDV Module:
    • Look for an AOMDV module for NS3 that normally available in GitHub or research repositories.
    • Instance repositories: GitHub or research archives.
  2. Install the AOMDV Module:
    • In the NS3’s src directory, locate the AOMDV module folder.
    • Change the wscript file within the src directory with the AOMDV module in the construct process.
    • Then, we reconstruct the NS3 compiling the AOMDV module including the existing NS3 configuration:

./ns3 configure –enable-examples –enable-tests

./ns3 build

  1. Run a Simulation with AOMDV:
    • We need to utilize an instance script that offered with the module, or we make use of AOMDV like the routing protocol to change an existing script.

Option 2: Simulating AOMDV-Like Behavior with Custom Multipath Routing Approximation

If we cannot determine a third-party module for AOMDV then we can estimate the AOMDV functionality by setting up AODV of NS3 offering numerous paths or replicating the route redundancy. This method doesn’t completely execute the AOMDV however it can be provided insight to multipath routing behavior.

Steps for an AOMDV-Like Multipath Routing Approximation

  1. Create a New Script: In the NS3’s scratch directory, we can save the below code like aomdv_simulation.cc.

Example Code for aomdv_simulation.cc

Following instance estimates the multipath routing by configuring numerous routes among the nodes and if main path fails, allowing route switching.

#include “ns3/core-module.h”

#include “ns3/network-module.h”

#include “ns3/internet-module.h”

#include “ns3/aodv-helper.h”

#include “ns3/mobility-module.h”

#include “ns3/wifi-module.h”

#include “ns3/applications-module.h”

using namespace ns3;

NS_LOG_COMPONENT_DEFINE(“AomdvSimulation”);

void SimulateLinkFailure(Ptr<Node> node1, Ptr<Node> node2) {

node1->GetDevice(0)->GetChannel()->GetDevice(1)->SetReceiveCallback(MakeNullCallback<void, Ptr<NetDevice>, Ptr<const Packet>, uint16_t, const Address &>());

NS_LOG_INFO(“Simulating link failure between nodes ” << node1->GetId() << ” and ” << node2->GetId());

}

int main(int argc, char *argv[]) {

LogComponentEnable(“AomdvSimulation”, LOG_LEVEL_INFO);

// Create nodes in a MANET configuration

NodeContainer nodes;

nodes.Create(5); // 5 nodes to demonstrate multipath behavior

// Set up mobility model for the nodes

MobilityHelper mobility;

mobility.SetPositionAllocator(“ns3::GridPositionAllocator”,

“MinX”, DoubleValue(0.0),

“MinY”, DoubleValue(0.0),

“DeltaX”, DoubleValue(50.0),

“DeltaY”, DoubleValue(50.0),

“GridWidth”, UintegerValue(3),

“LayoutType”, StringValue(“RowFirst”));

mobility.SetMobilityModel(“ns3::ConstantPositionMobilityModel”);

mobility.Install(nodes);

// Configure WiFi for ad hoc communication

WifiHelper wifi;

wifi.SetStandard(WIFI_STANDARD_80211b);

YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default();

YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default();

wifiPhy.SetChannel(wifiChannel.Create());

WifiMacHelper wifiMac;

wifiMac.SetType(“ns3::AdhocWifiMac”);

NetDeviceContainer devices = wifi.Install(wifiPhy, wifiMac, nodes);

// Install Internet stack with AODV routing on nodes (approximation of AOMDV)

AodvHelper aodv;

InternetStackHelper internet;

internet.SetRoutingHelper(aodv);

internet.Install(nodes);

// Assign IP addresses to devices

Ipv4AddressHelper ipv4;

ipv4.SetBase(“10.1.1.0”, “255.255.255.0”);

Ipv4InterfaceContainer interfaces = ipv4.Assign(devices);

// Set up a UDP echo server on one node to test connectivity

UdpEchoServerHelper echoServer(9);

ApplicationContainer serverApps = echoServer.Install(nodes.Get(4));

serverApps.Start(Seconds(1.0));

serverApps.Stop(Seconds(10.0));

// Set up a UDP echo client on another node to communicate with the server

UdpEchoClientHelper echoClient(interfaces.GetAddress(4), 9);

echoClient.SetAttribute(“MaxPackets”, UintegerValue(5));

echoClient.SetAttribute(“Interval”, TimeValue(Seconds(1.0)));

echoClient.SetAttribute(“PacketSize”, UintegerValue(1024));

ApplicationContainer clientApps = echoClient.Install(nodes.Get(0));

clientApps.Start(Seconds(2.0));

clientApps.Stop(Seconds(10.0));

// Schedule link failure to test multipath recovery

Simulator::Schedule(Seconds(3.0), &SimulateLinkFailure, nodes.Get(1), nodes.Get(2));

Simulator::Run();

Simulator::Destroy();

return 0;

}

Explanation of the Code

  • Node Configuration:
    • We configured five nodes in an ad hoc network including WiFi in ad hoc mode.
  • AODV Routing Approximation:
    • AODV is utilized by means of AOMDV’s basic estimation to offer routes requests. Although it doesn’t have true multipath routing then it can offer another routes if the main route fails.
  • Simulated Link Failure:
    • The function SimulateLinkFailure replicates a link failure among two nodes at 3 seconds to force AODV determining an alternate route.
  • UDP Echo Applications:
    • A UDP Echo Server is configured at one node, and a UDP Echo Client on alternative node transmits packets to the server analysing end-to-end connectivity.
  1. Build and Run the Simulation
  1. In the scratch directory, we must save aomdv_simulation.cc.
  2. Go to terminal, pass through to the NS3 directory, and then make the script:

./ns3 build

  1. Run the simulation:

./ns3 run scratch/aomdv_simulation

Above code will run the simulation then indicate log messages to show the link’s failure and AODV’s try to determine another path.

Further Experimentation Ideas

To discover further AOMDV-like behavior, we can deliberate:

  • Increase Network Size and Mobility: Insert additional nodes and to experiment the capability of AODV to manage often route changes to utilise a dynamic mobility model.
  • Implement Additional Route Caching: Change AODV caching several routes and alter among them as per link failures, to estimate the multipath aspect of AOMDV.
  • Use NS-3’s FlowMonitor: Observe the performance parameters such as packet delivery ratio, end-to-end delay, and routing overhead, measuring the replicated multipath routing efficiency.

From the illustration, we completely aggregate the data and simulation approach with example coding for AOMDV Protocol projects, initiated and simulated using NS3 environment. Additional insights will be offered in another guide.

phdprojects.org will guide you with best project topic and  simulation results to Start your AOMDV Protocol Projects Using NS3 tool. You will come to know about your project results after working with us. Get project performance done by us .