How to Start ODMRP Protocol Projects Using NS3

To start an On-Demand Multicast Routing Protocol (ODMRP) project using NS3 which want to replicate or execute this multicast protocol. ODMRP is created for dynamic wireless networks such as Mobile Ad-hoc Networks (MANETs) in which group members and network topology often modify.

Following is simple steps to start the ODMRP Protocol Projects in NS3.

Steps to Start ODMRP Protocol Projects in NS3

  1. Understand ODMRP
  • What is ODMRP?
    • ODMRP is a multicast routing protocol, which utilizes on-demand creation and multicast groups’ maintenance.
    • Core Features:
      • Soft state-based mesh structure.
      • On-demand creation of multicast forwarding groups.
      • Flooding-based route discovery.
  • Use Cases:
    • It is utilized for wireless and mobile networks.
    • Dynamic multicast interaction.
  1. Set Up NS3
  • Install NS3:
    • Go to nsnam.org to download and install NS3.
  • Verify Installation:

./waf –run scratch/test-example

  • Modules Required:
    • wifi: It supports for wireless interaction.
    • mobility: For dynamic node movement.
    • internet: For IP and routing stack.
    • manet-routing: Discretionary, if utilizing or prolonging the existing routing protocols.
  1. Plan Your ODMRP Project
  • Key ODMRP Components:
    • Join Query (JQ): Packets flooded by source determining the routes.
    • Join Reply (JR): Responds retransmitted by group members to make the multicast mesh.
    • Forwarding Group (FG): These nodes are responsible for forwarding multicast packets.
  • Define Objectives:
    • To replicate the ODMRP and then examine their performance.
    • Equate ODMRP including other multicast protocols such as MAODV, PIM-SM.
  • Metrics:
    • We estimate the performance parameters such as packet delivery ratio, multicast group overhead, and end-to-end delay.
  1. Write a Basic Multicast Simulation in NS3
  • We can write simple multicast simulation script and prolong it for ODMRP.
  • Example: Basic Wireless Multicast Setup

#include “ns3/core-module.h”

#include “ns3/network-module.h”

#include “ns3/internet-module.h”

#include “ns3/wifi-module.h”

#include “ns3/mobility-module.h”

#include “ns3/applications-module.h”

using namespace ns3;

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

uint32_t nNodes = 10;

double simulationTime = 20.0;

// Create nodes

NodeContainer nodes;

nodes.Create(nNodes);

// Configure Wi-Fi

WifiHelper wifi;

wifi.SetStandard(WIFI_PHY_STANDARD_80211b);

YansWifiPhyHelper phy = YansWifiPhyHelper::Default();

YansWifiChannelHelper channel = YansWifiChannelHelper::Default();

phy.SetChannel(channel.Create());

WifiMacHelper mac;

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

NetDeviceContainer devices = wifi.Install(phy, mac, nodes);

// Mobility model

MobilityHelper mobility;

mobility.SetPositionAllocator(“ns3::RandomRectanglePositionAllocator”,

“X”, StringValue(“ns3::UniformRandomVariable[Min=0|Max=100]”),

“Y”, StringValue(“ns3::UniformRandomVariable[Min=0|Max=100]”));

mobility.SetMobilityModel(“ns3::RandomWaypointMobilityModel”,

“Speed”, StringValue(“ns3::UniformRandomVariable[Min=1.0|Max=5.0]”),

“Pause”, StringValue(“ns3::ConstantRandomVariable[Constant=0.0]”));

mobility.Install(nodes);

// Install Internet stack

InternetStackHelper internet;

internet.Install(nodes);

// Assign IP addresses

Ipv4AddressHelper ipv4;

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

ipv4.Assign(devices);

// Create multicast sender application

uint16_t multicastPort = 9;

InetSocketAddress multicastGroup(Ipv4Address(“225.1.1.1”), multicastPort);

UdpEchoServerHelper echoServer(multicastPort);

ApplicationContainer serverApps = echoServer.Install(nodes.Get(nNodes – 1));

serverApps.Start(Seconds(1.0));

serverApps.Stop(Seconds(simulationTime));

UdpEchoClientHelper echoClient(multicastGroup, multicastPort);

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

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

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

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

clientApps.Start(Seconds(2.0));

clientApps.Stop(Seconds(simulationTime));

// Enable pcap tracing

phy.EnablePcapAll(“odmrp”);

Simulator::Stop(Seconds(simulationTime));

Simulator::Run();

Simulator::Destroy();

return 0;

}

  1. Implement ODMRP-Specific Logic
  • Key ODMRP Steps:
    1. Join Query Flooding:
      • Prolong the NS3 tool overflowing JQ packets over the network.
    2. Join Reply Propagation:
      • Make sure that multicast members reply with JRs to launch the paths.
    3. Forwarding Group Maintenance:
      • In the FG, nodes occasionally revitalize its membership.
  • Custom Routing Protocol:
    • We can prolong the Ipv4RoutingProtocol or make a custom RoutingProtocol class.
    • Implement the techniques such as:
      • RouteInput(): To manage the incoming packets.
      • RouteOutput(): It helps to select forwarding paths.
  1. Test and Debug
  • Enable Logging:

export NS_LOG=Ipv4RoutingProtocol=level_all

./waf –run scratch/odmrp

  • Packet Analysis:
    • Examine the JQ and JR packets within Wireshark to utilize PCAP files.
  1. Evaluate Performance
  • Metrics to Measure:
    • We need to estimate the performance parameters such as packet delivery ratio, end-to-end delay, and routing overhead (control packet frequency, size).
  • FlowMonitor Integration:

FlowMonitorHelper flowMonitor;

Ptr<FlowMonitor> monitor = flowMonitor.InstallAll();

  1. Advanced Features
  • Mobility Support:
    • Launch higher mobility scenarios to experiment the robustness of ODMRP.
  • Optimization:
    • To enhance the FG selection minimizing redundancy.
  • Comparison:
    • We want to equate the ODMRP including other multicast protocols such as MAODV, DSR.

Here, we explored the step-by-step method to start and analyse the On-Demand Multicast Routing Protocol (ODMRP) projects which is designed for dynamic wireless networks using NS3 simulation tool.

For your ODMRP Protocol Projects utilizing the NS3 tool, consider leveraging the expertise of the team at phdprojects.org, who are ready to support you throughout each stage of the process. Take advantage of our tailored assistance to achieve the best possible results and ensure your project is completed on schedule. Our developers are available to enhance your project performance and provide insights into Mobile Ad-hoc Networks (MANETs). Please feel free to reach out to us for further guidance.