e-mail address: omnetmanual@gmail.com

Phone number: +91 9444856435

Tel 7639361621

DEFENDER
  • Phd Omnet++ Projects
    • RESEARCH PROJECTS IN OMNET++
  • Network Simulator Research Papers
    • Omnet++ Thesis
    • Phd Omnet++ Projects
    • MS Omnet++ Projects
    • M.Tech Omnet++ Projects
    • Latest Omnet++ Projects
    • 2016 Omnet++ Projects
    • 2015 Omnet++ Projects
  • OMNET INSTALLATION
    • 4G LTE INSTALLATION
    • CASTALIA INSTALLATION
    • INET FRAMEWORK INSTALLATION
    • INETMANET INSTALLATION
    • JDK INSTALLATION
    • LTE INSTALLATION
    • MIXIM INSTALLATION
    • Os3 INSTALLATION
    • SUMO INSTALLATION
    • VEINS INSTALLATION
  • Latest Omnet++ Projects
    • AODV OMNET++ SOURCE CODE
    • VEINS OMNETPP
    • Network Attacks in OMNeT++
    • NETWORK SECURITY OMNET++ PROJECTS
    • Omnet++ Framework Tutorial
      • Network Simulator Research Papers
      • OMNET++ AD-HOC SIMULATION
      • OmneT++ Bandwidth
      • OMNET++ BLUETOOTH PROJECTS
      • OMNET++ CODE WSN
      • OMNET++ LTE MODULE
      • OMNET++ MESH NETWORK PROJECTS
      • OMNET++ MIXIM MANUAL
  • OMNeT++ Projects
    • OMNeT++ OS3 Manual
    • OMNET++ NETWORK PROJECTS
    • OMNET++ ROUTING EXAMPLES
    • OMNeT++ Routing Protocol Projects
    • OMNET++ SAMPLE PROJECT
    • OMNeT++ SDN PROJECTS
    • OMNET++ SMART GRID
    • OMNeT++ SUMO Tutorial
  • OMNET++ SIMULATION THESIS
    • OMNET++ TUTORIAL FOR WIRELESS SENSOR NETWORK
    • OMNET++ VANET PROJECTS
    • OMNET++ WIRELESS BODY AREA NETWORK PROJECTS
    • OMNET++ WIRELESS NETWORK SIMULATION
      • OMNeT++ Zigbee Module
    • QOS OMNET++
    • OPENFLOW OMNETPP
  • Contact

How to Implement mesh protocols in OMNeT++

To implement the mesh protocols in OMNeT++ needs a module which has to simulate the characteristics of routing protocols specially build for wireless mesh network. The mesh protocols include AODV (Ad hoc On-Demand Distance Vector), HWMP (Hybrid Wireless Mesh Protocol), and others. We provided the step-by-step approach to implement the mesh protocols in OMNeT++:

Step-by-Step implementation:

Step 1: Set Up OMNeT++ and INET Framework

  1. Install OMNeT++: Download and install the latest version of OMNeT++.
  2. Install INET Framework: Download and install the INET framework from the INET repository.

Step 2: Understand HWMP Protocol

HWMP syndicating both proactive and reactive elements:

  • Proactive Tree Building (PANN): To build and manage a routing tree, root nodes intermittently broadcast proactive PREQ messages.
  • On-demand Path Discovery: Nodes can find the paths on demand using Route Requests (RREQs) and Route Replies (RREPs).

Step 3: Create the HWMP Protocol Module

Define the Module in .ned File

Create a .ned file for the HWMP protocol module.

simple HWMP

{

parameters:

@display(“i=block/cogwheel”);

double proactiveInterval @unit(s) = default(5s); // Interval for proactive PREQ messages

gates:

input fromNetworkLayer;

output toNetworkLayer;

input fromMacLayer;

output toMacLayer;

}

Implement the Module in C++

Generate the corresponding .cc and .h files.

HWMP.h

#ifndef __HWMP_H_

#define __HWMP_H_

#include <omnetpp.h>

#include “inet/networklayer/contract/IRoutingTable.h”

#include “inet/common/INETDefs.h”

#include “inet/networklayer/common/L3AddressResolver.h”

#include <map>

#include <set>

using namespace omnetpp;

using namespace inet;

class HWMP : public cSimpleModule

{

private:

double proactiveInterval;

IRoutingTable *routingTable;

cMessage *proactiveMsg;

std::map<L3Address, L3Address> routeTable; // Maps destination to next hop

std::map<L3Address, int> metricTable; // Stores path metrics

protected:

virtual void initialize() override;

virtual void handleMessage(cMessage *msg) override;

void sendProactivePREQ();

void processProactivePREQ(cMessage *msg);

void sendRREQ(L3Address destAddr);

void processRREQ(cMessage *msg);

void sendRREP(L3Address destAddr);

void processRREP(cMessage *msg);

void processRERR(cMessage *msg);

public:

HWMP();

virtual ~HWMP();

};

#endif

HWMP.cc

#include “HWMP.h”

Define_Module(HWMP);

HWMP::HWMP()

{

proactiveMsg = nullptr;

}

HWMP::~HWMP()

{

cancelAndDelete(proactiveMsg);

}

void HWMP::initialize()

{

proactiveInterval = par(“proactiveInterval”);

routingTable = getModuleFromPar<IRoutingTable>(par(“routingTableModule”), this);

proactiveMsg = new cMessage(“sendProactivePREQ”);

scheduleAt(simTime() + proactiveInterval, proactiveMsg);

}

void HWMP::handleMessage(cMessage *msg)

{

if (msg == proactiveMsg)

{

sendProactivePREQ();

scheduleAt(simTime() + proactiveInterval, proactiveMsg);

}

else if (strcmp(msg->getName(), “ProactivePREQ”) == 0)

{

processProactivePREQ(msg);

}

else if (strcmp(msg->getName(), “RREQ”) == 0)

{

processRREQ(msg);

}

else if (strcmp(msg->getName(), “RREP”) == 0)

{

processRREP(msg);

}

else if (strcmp(msg->getName(), “RERR”) == 0)

{

processRERR(msg);

}

else if (dynamic_cast<cPacket *>(msg))

{

// Handle incoming data packets

L3Address dest = L3AddressResolver().resolve(msg->par(“destAddr”).stringValue());

if (routeTable.find(dest) != routeTable.end())

{

// Forward the packet to the next hop

send(msg, “toMacLayer”);

}

else

{

// Drop the packet if no route found

delete msg;

}

}

else

{

// Handle other messages

}

}

void HWMP::sendProactivePREQ()

{

cMessage *preq = new cMessage(“ProactivePREQ”);

send(preq, “toMacLayer”);

}

void HWMP::processProactivePREQ(cMessage *msg)

{

// Process received proactive PREQ message

delete msg;

}

void HWMP::sendRREQ(L3Address destAddr)

{

cMessage *rreq = new cMessage(“RREQ”);

rreq->addPar(“destAddr”) = destAddr.str().c_str();

send(rreq, “toMacLayer”);

}

void HWMP::processRREQ(cMessage *msg)

{

// Implement processing of RREQ message

L3Address srcAddr = L3AddressResolver().resolve(msg->par(“srcAddr”).stringValue());

L3Address destAddr = L3AddressResolver().resolve(msg->par(“destAddr”).stringValue());

if (routeTable.find(destAddr) != routeTable.end())

{

sendRREP(destAddr);

}

else

{

// Forward the RREQ

send(msg, “toMacLayer”);

}

}

void HWMP::sendRREP(L3Address destAddr)

{

cMessage *rrep = new cMessage(“RREP”);

rrep->addPar(“destAddr”) = destAddr.str().c_str();

send(rrep, “toMacLayer”);

}

void HWMP::processRREP(cMessage *msg)

{

// Implement processing of RREP message

L3Address destAddr = L3AddressResolver().resolve(msg->par(“destAddr”).stringValue());

L3Address nextHop = L3AddressResolver().resolve(msg->par(“nextHop”).stringValue());

int metric = msg->par(“metric”).intValue();

routeTable[destAddr] = nextHop;

metricTable[destAddr] = metric;

delete msg;

}

void HWMP::processRERR(cMessage *msg)

{

// Implement processing of RERR message

L3Address destAddr = L3AddressResolver().resolve(msg->par(“destAddr”).stringValue());

routeTable.erase(destAddr);

metricTable.erase(destAddr);

delete msg;

}

Step 4: Integrate with Simulation Model

Assimilate the HWMP module within the network simulation model.

Network Configuration .ned File

network HWMPNetwork

{

submodules:

node1: StandardHost {

parameters:

@display(“p=100,100”);

}

node2: StandardHost {

parameters:

@display(“p=300,100”);

}

// Add more nodes as needed

connections:

node1.pppg++ <–> { @display(“m=100,100”); } <–> node2.pppg++;

}

omnetpp.ini Configuration

network = HWMPNetwork

*.node*.pppg[*].queue.typename = “DropTailQueue”

*.node*.ipv4.routingTable = “inet.networklayer.routing.manet.Router”

*.node*.networkLayer.networkProtocol.typename = “IPv4NetworkLayer”

*.node*.transportLayer.tcp.typename = “Tcp”

*.node*.transportLayer.udp.typename = “Udp”

*.node*.application[*].typename = “UdpBasicApp”

*.node*.application[*].destAddresses = “node1”  // Set destination as needed

*.node*.application[*].destPort = 2000

*.node*.application[*].startTime = uniform(0s, 10s)

*.node*.application[*].sendInterval = uniform(1s, 2s)

*.node*.application[*].packetLength = 512B

*.node*.app[0].typename = “HWMP”

Step 5: Test and Debug

  1. Run Simulations: Implement simulations to examine the behavior of HWMP module under various network conditions.
  2. Analyze Results: Validate the correctness and performance of the implementation.
  3. Debugging: Troubleshoot the issues with the help of OMNeT++’s debugging tools.

Step 6: Extend to Other Mesh Protocols

To accomplish other mesh protocols like AODV, OLSR, etc., follow the provided steps:

  • State the protocol’s logic.
  • Create corresponding .ned, .cc, and .h files.
  • Integrate the protocol with the simulation model.

This procedure will guide you through the process of implementing a basic mesh protocol, specifically HWMP, which is part of the IEEE 802.11s standard for mesh networking. For further references, we can help you by providing materials. For best simulation results be on touch with us we will help you more.

Related Topics

  • Network Intrusion Detection Projects
  • Computer Science Phd Topics
  • Iot Thesis Ideas
  • Cyber Security Thesis Topics
  • Network Security Research Topics

designed by OMNeT++ Projects .