To simulate the Source Tree Adaptive Routing (STAR) protocol in OMNeT++ has needs to execute a custom routing protocol or prolonging existing ones. The STAR protocol, intended for Mobile Ad Hoc Networks (MANETs), reduce control overhead by sustaining source trees for routing at each node, only updating routes when essential.
The below are the procedures to execute the STAR in OMNeT++
Steps for Simulating STAR Protocol in OMNeT++
- Install OMNeT++ and INET Framework
Before initiates the implementation that needs to install OMNeT++ and the INET framework:
- Download OMNeT++: Get the latest version of OMNeT++.
- Install INET: The INET framework deliver network models such as wireless nodes, routing, mobility, and so on. Install it as follows:
- Clone the INET repository:
git clone https://github.com/inet-framework/inet.git
-
- Open OMNeT++ IDE, and import the INET project (File > Import… > Existing Projects into Workspace). Select the inet directory.
- Build the INET project by right-clicking on it and select Build Project.
- Understand STAR Protocol
Source Tree Adaptive Routing (STAR) is a proactive routing protocol. Each node sustain a source tree denotes the paths it utilize to reach other nodes. The protocol performs by reducing routing updates and control messages by only transmit updates when the node’s source tree changes.
- Define the Network Topology in NED
Next, describe the network topology for the simulation. This contains to configure multiple nodes that interact through wireless links. Utilize NED (Network Description) files to certain the network structure.
Example NED File (StarNetwork.ned):
package starprotocol;
import inet.node.inet.Router;
import inet.node.inet.StandardHost;
import inet.physicallayer.ieee80211.packetlevel.Ieee80211ScalarRadioMedium;
import inet.mobility.single.RandomWaypointMobility;
network StarNetwork
{
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: Models the wireless communication medium for nodes.
- StandardHost: Each host node acts as a wireless node using STAR routing.
- RandomWaypointMobility: This mobility model makes sure that the nodes move randomly inside a defined space that is common in MANET simulations.
- Implement the STAR Protocol
While OMNeT++ doesn’t deliver a built-in implementation of the STAR protocol, we can weather execute it from scratch or prolong existing routing modules like OLSR or DSDV from INET.
- Create a STAR Routing Module (in NED and C++)
We will describe a new routing module that encapsulates STAR’s logic.
STAR Routing NED Module (StarRouting.ned):
simple StarRouting
{
parameters:
double updateInterval @unit(s) = default(5s); // Period for source tree updates
@display(“i=block/routing”);
gates:
input in;
output out;
}
STAR Routing C++ Implementation (StarRouting.cc):
#include “StarRouting.h”
Define_Module(StarRouting);
void StarRouting::initialize()
{
updateInterval = par(“updateInterval”);
// Initialize source tree and routing structures
scheduleAt(simTime() + updateInterval, new cMessage(“UpdateSourceTree”));
}
void StarRouting::handleMessage(cMessage *msg)
{
if (msg->isSelfMessage()) {
// Update the source tree periodically
updateSourceTree();
scheduleAt(simTime() + updateInterval, msg);
} else {
// Forward incoming packets based on the source tree
forwardPacket(check_and_cast<cPacket *>(msg));
}
}
void StarRouting::updateSourceTree()
{
// Logic to update source tree based on the current network topology
EV << “Updating source tree…\n”;
}
void StarRouting::forwardPacket(cPacket *pkt)
{
// Logic to forward packets using the source tree
EV << “Forwarding packet using STAR routing\n”;
send(pkt, “out”);
}
Explanation:
- Source Tree Maintenance: The updateSourceTree() function updates the source tree occasionally, implicates any changes in the network topology.
- Packet Forwarding: The forwardPacket() function forwards packets based on to the source tree.
- Periodic Updates: Source tree updates happens at a regular interval (updateInterval), as specified in the NED file.
- Configure the Simulation in omnetpp.ini
The omnetpp.ini file controls numerous contexts of the simulation, that contain the network setup, mobility, and routing protocol configuration.
Example omnetpp.ini Configuration:
network = StarNetwork
sim-time-limit = 300s
# Wireless settings for nodes
*.node[*].wlan[0].typename = “Ieee80211NicAdhoc”
*.node[*].wlan[0].mac.address = autoassign
*.node[*].wlan[0].radio.transmitter.power = 2mW
# STAR routing protocol configuration
*.node[*].hasStarRouting = true
*.node[*].starRouting.updateInterval = 10s # Update the routing table every 10s
# Mobility settings
*.node[*].mobility.typename = “RandomWaypointMobility”
*.node[*].mobility.speed = uniform(1mps, 5mps)
# Application traffic configuration
*.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(1s)
*.node[9].numApps = 1
*.node[9].app[0].typename = “UdpSink”
*.node[9].app[0].localPort = 5000
Explanation:
- STAR Routing: This permits the custom StarRouting module and sets the routing update interval to 10 seconds.
- Mobility: Set up nodes to move in terms of the RandomWaypointMobility model, with a random speed.
- Traffic Generation: Node 0 sends UDP packets to Node 9, that perform as the receiver.
- Run the Simulation
- Build the Project:
- Right-click on OMNeT++ project and select Build Project to compile the new STAR routing module and the simulation.
- Run the Simulation:
- Right-click on omnetpp.ini and choose Run As > OMNeT++ Simulation.
- Utilize Qtenv (graphical interface) or Cmdenv (command line interface) to track the simulation and monitor node movement and packet interchange.
- Analyse the Results
We can measure the performance of the STAR protocol by concentrate on parameters such as:
- Packet Delivery Ratio: Evaluate the percentage of successfully delivered packets related to the total number sent.
- End-to-End Delay: Estimate the average time taken for packets to reach their destination.
- Routing Overhead: Measure the control message overhead created by the periodic source tree updates.
- Latency and Packet Loss: measure how node mobility affects latency and packet loss in the network.
Tools:
- Utilize the OMNeT++ Scalar and Vector output files to extract these parameter.
- Envision node connectivity and packet flows using the Qtenv interface.
- Extend the Simulation
- Increase Network Size: Add more nodes to replicate larger networks and monitor how STAR manages increased traffic and mobility.
- Variable Mobility Models: Validate different mobility models such as Gauss-Markov Mobility to evaluate how STAR performs in different mobility environment.
- Dynamic Traffic: Establish different kinds of traffic (such as TCP, VoIP) and see how STAR manages them related to other routing protocols such as AODV or DSDV.
- Implement STAR Variants: If essential, test with variations of the STAR protocol, like hybrid models that mix proactive and reactive routing methods.
In this setup, we had illustrated about how the Source Tree Adaptive Routing projects will be simulated in OMNeT+ tool and also we provide the complete explanation to understand the Source Tree Adaptive Routing project. More information regarding this process will also be shared. To simulate the Source Tree Adaptive Routing (STAR) protocol in OMNeT++ tool we will give you best simulation support so send your details to us we will give you best outcomes.