To simulate an Epidemic Routing Protocols using OMNeT++ contains modeling how data (messages or packets) spreads via a network in a manner same to the spread of a virus or an epidemic. Epidemic routing is especially helpful in Delay-Tolerant Networks (DTNs), in which nodes have intermittent connectivity, and the protocol depends on message replication and node encounters to deliver data. For best simulation outcomes you can believe in our experts we will provide you with good simulation assistance.
The following is a step-by-step instruction to support us mimic an Epidemic Routing Protocol project using OMNeT++:
Steps to Simulate Epidemic Protocol Projects in OMNeT++
- Install OMNeT++ and INET Framework
- Download OMNeT++: We download the latest version of OMNeT++ from the official website.
- Install the INET Framework: INET offers numerous wireless models and mobility models, which are necessary for DTN simulations.
- Clone the INET repository:
git clone https://github.com/inet-framework/inet.git
-
- Import the INET project into OMNeT++ IDE and build it by choosing Build Project from the context menu.
- Understand the Epidemic Routing Protocol
The Epidemic Routing Protocol functions by flooding messages throughout the network to make certain delivery. For each node conserves a buffer of messages and forwards copies to meet nodes. Once two nodes are come into contact then they exchange their messages, maximizing the probability, which the message will eventually attain the destination.
Key Concepts of Epidemic Routing:
- Replication: Each node simulates and forwards the message to every other node it encounters.
- Buffer Management: Each node has a limited buffer in which it stores the messages it carries.
- Message Delivery: The message propagates via several nodes until it attains the destination.
- Set Up the Network Topology in NED
Describe a mobile network where the nodes can move around and interact with one another. For epidemic routing, nodes should have intermittent connections and move according to a mobility model.
Example NED File (EpidemicNetwork.ned):
package epidemicrouting;
import inet.node.inet.StandardHost;
import inet.physicallayer.ieee80211.packetlevel.Ieee80211ScalarRadioMedium;
import inet.mobility.single.RandomWaypointMobility;
network EpidemicNetwork
{
types:
channel wirelesslink extends ned.DatarateChannel {
datarate = 1Mbps;
}
submodules:
radioMedium: Ieee80211ScalarRadioMedium {
@display(“p=100,100”);
}
node[10]: StandardHost {
@display(“p=200+100*i,200+100*j”);
mobility.typename = “RandomWaypointMobility”;
mobility.speed = uniform(1mps, 5mps);
}
}
Explanation:
- Ieee80211ScalarRadioMedium: This module offers wireless connectivity for communication among the nodes.
- RandomWaypointMobility: A mobility model in which nodes move randomly within a described space.
- StandardHost: Denotes the network nodes that perform as mobile devices.
- node[10]: Makes 10 mobile nodes for the network.
- Implement the Epidemic Routing Protocol
The simulation tool OMNeT++ does not offer Epidemic Routing out-of-the-box, thus we will want to execute it as a custom routing module or use an existing one, like from the SimuLIS framework (a framework for simulating Delay-Tolerant Networks with epidemic routing) or change existing protocols such as Flooding from INET.
Basic Epidemic Routing Logic:
The fundamental idea is that when two nodes are encounter, they swap the messages in their buffer. Here’s an outline of the logic:
- Node Encounters: Once two nodes are in range then they distribute their buffers.
- Message Forwarding: Each node simulates the message to the other node if it doesn’t already have it.
- Buffer Management: Nodes have a buffer with limited space, and messages are dropped according to the policies such as FIFO (First-In, First-Out).
Custom EpidemicRouting Module:
Here’s how we would describe an EpidemicRouting module using OMNeT++’s module system and custom C++ code.
EpidemicRouting.ned:
simple EpidemicRouting
{
parameters:
double bufferSize @unit(B) = default(10MB); // Maximum buffer size
double messageTTL @unit(s) = default(300s); // Time-to-live for messages
gates:
input in;
output out;
}
EpidemicRouting.cc (C++ Implementation):
#include “EpidemicRouting.h”
Define_Module(EpidemicRouting);
void EpidemicRouting::initialize()
{
bufferSize = par(“bufferSize”);
messageTTL = par(“messageTTL”);
}
void EpidemicRouting::handleMessage(cMessage *msg)
{
// Check if message is already in the buffer
if (!isMessageInBuffer(msg)) {
// Add message to buffer and forward to encountered node
buffer.push_back(msg);
forwardMessage(msg);
}
// Simulate message expiration (TTL)
if (simTime() > msg->getCreationTime() + messageTTL) {
deleteMessage(msg); // Remove expired message
}
}
bool EpidemicRouting::isMessageInBuffer(cMessage *msg)
{
// Check if the message is already in the buffer
for (auto &m : buffer) {
if (m->getId() == msg->getId()) {
return true;
}
}
return false;
}
void EpidemicRouting::forwardMessage(cMessage *msg)
{
// Forward the message to neighboring nodes (encountered nodes)
send(msg, “out”);
}
void EpidemicRouting::deleteMessage(cMessage *msg)
{
// Remove message from buffer
buffer.erase(std::remove(buffer.begin(), buffer.end(), msg), buffer.end());
delete msg;
}
Explanation:
- Buffer Management: Nodes are store messages in a buffer, and when two nodes encounter, they swap messages.
- TTL (Time-to-Live): Each message has a finite lifespan, after which it is removed.
- Message Forwarding: When nodes meet each other, messages are sent if the receiving node doesn’t already have them.
- Configure the Simulation in omnetpp.ini
Configure simulation configuration, identifying the metrics such as mobility, buffer size, and message transmission.
Example omnetpp.ini:
[General]
network = EpidemicNetwork
sim-time-limit = 500s
# Configure wireless settings
*.node[*].wlan[0].typename = “Ieee80211NicAdhoc”
*.node[*].wlan[0].mac.address = autoassign
*.node[*].wlan[0].radio.transmitter.power = 2mW
# Epidemic routing configuration
*.node[*].hasEpidemicRouting = true
*.node[*].epidemicRouting.bufferSize = 10MB
*.node[*].epidemicRouting.messageTTL = 300s
# Mobility settings
*.node[*].mobility.typename = “RandomWaypointMobility”
*.node[*].mobility.speed = uniform(1mps, 5mps)
*.node[*].mobility.updateInterval = 0.1s
# Application layer traffic
*.node[0].numApps = 1
*.node[0].app[0].typename = “UdpBasicApp”
*.node[0].app[0].destAddresses = “node[9]”
*.node[0].app[0].destPort = 5000
*.node[0].app[0].messageLength = 1024B
*.node[0].app[0].sendInterval = exponential(10s)
*.node[9].numApps = 1
*.node[9].app[0].typename = “UdpSink”
*.node[9].app[0].localPort = 5000
Explanation:
- Mobility Settings: Nodes move randomly using the RandomWaypointMobility model.
- Epidemic Routing: Allowed epidemic routing with custom buffer size and message TTL.
- Application Layer: Node 0 transmits UDP traffic to Node 9, using epidemic routing to send the messages.
- Run the Simulation
- Build the Project:
- Right-click on the project and select Build Project to compile the simulation.
- Run the Simulation:
- Right-click on omnetpp.ini and select Run As > OMNeT++ Simulation.
- The Qtenv GUI will introduce, indicating the network topology and node mobility.
- Observe the Simulation:
- Observe how messages are replicated and spread via the network.
- Monitor the message delivery process as nodes move and meet each other.
- Analyse the Results
- Delivery Rate: Assess the percentage of messages effectively delivered to their destination.
- Latency: Estimate the delay among message creation and effective delivery.
- Buffer Utilization: Track buffer usage over time to investigate memory constraints.
- Message Replication Overhead: Compute how many copies of each message are made before it attains the destination.
- Extend the Simulation
- Buffer Management Policies: Execute distinct buffer management strategies (e.g., drop oldest message, prioritize messages by TTL).
- Energy Consumption: Insert an energy models to mimic how much power is consumed by the epidemic routing process.
- Mobility Models: Utilize distinct mobility models (e.g., Gauss-Markov, RandomWalk) to estimate the effect of node movement on protocol performance.
- Advanced Epidemic Variants: Execute other DTN protocols such as Spray and Wait or PRoPHET to compare their performance with epidemic routing.
We had known more about the Epidemic Protocol projects, simulated and analysed through the above stepwise approach with the help of OMNeT++ analysis tool. We will also deliver in-depth concepts and advanced informations relevant to this protocol.