How to Start CGSR Protocol Projects Using OMNeT++

To start a Clusterhead Gateway Switch Routing (CGSR) protocol project in OMNeT++, follow the steps outlined below. CGSR is a hybrid routing protocol created for mobile ad hoc networks (MANETs), organizing nodes into clusters and utilising cluster heads to route messages among them.

While CGSR isn’t supported in the INET framework of OMNeT++, we adjust or execute the protocol. Here’s a stepwise approach to configure and replicate CGSR project using OMNeT++.

Steps to Start CGSR Protocol Projects in OMNeT++

  1. Install OMNeT++ and INET Framework

Before creating a CGSR simulation, ensure that OMNeT++ and the INET framework are installed. The INET framework offers essential support for network modules and protocols.

Installing OMNeT++ and INET Framework:

  1. Download OMNeT++:
    • Download and install OMNeT++ environment on the system.
  2. Install INET Framework:
    • Use the following Git command to clone the INET repository:

git clone https://github.com/inet-framework/inet.git

    • Refer to the INET documentation to combine the framework with OMNeT++.
  1. Create a New OMNeT++ Project

After installing OMNeT++ and the INET framework, we can make a new OMNeT++ project:

  1. Go to OMNeT++ IDE.
  2. Navigate to File > New > OMNeT++ Project.
  3. Assign a name, such as “CGSR_Simulation”.
  4. Include INET like a framework in project if not already inserted in the course of project creation.
  1. Design the Network Topology (NED File)

Network topologies are defined by NED files in OMNeT++. For CGSR, we want to create a clustered wireless network including mobile nodes and cluster heads. The network organizes the nodes into clusters with each cluster containing a cluster head responsible for routing messages within its cluster.

Example of a simple CGSR topology in NED file:

network CGSRNetwork

{

parameters:

int numNodes = 10; // Total number of nodes

int numClusters = 3; // Number of clusters

submodules:

// Cluster Heads

clusterHead[3]: ClusterHead {

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

}

// Mobile Nodes (Regular Nodes)

node[numNodes]: MobileNode {

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

}

connections:

// Connections between nodes and cluster heads

node[0].wlan[0] <–> clusterHead[0].wlan[0];

node[1].wlan[0] <–> clusterHead[1].wlan[0];

node[2].wlan[0] <–> clusterHead[2].wlan[0];

}

In this example:

  • ClusterHead modules denote the cluster heads within each cluster.
  • MobileNode modules signifies regular nodes.
  • Each node associates to a part of the cluster heads.
  1. Implement CGSR Protocol

The CGSR protocol organizes the nodes to clusters that chosen cluster heads, and facilitates the data routing through these cluster heads. Since, OMNeT++ doesn’t provide built-in support for CGSR, we want to execute it by extending existing modules or making new ones tailored for CGSR-specific behaviors.

Basic Steps for Implementing CGSR:

  1. Cluster Formation:
    • Develop a mechanism to allow nodes to find each other and build clusters according to the proximity or other criteria.
    • Enable nodes to periodically swap messages (e.g., Hello messages) for discovery and cluster head election.
    • Implement a cluster head election process, considering factors such as node mobility, energy levels, or node IDs.
  2. Cluster Head Responsibilities:
    • Define the functionality for a cluster head, including the ability to:
      • Obtain and forward packets from other nodes within their cluster.
      • Perform like a gateway for communication between clusters.
      • Route data among the clusters using inter-cluster communication.
  3. Routing within Clusters:
    • Execute the intra-cluster communication in which cluster members (non-cluster head nodes) interact with their respective cluster head for data routing and transmission.
    • Intra-cluster routing can manage through standard routing methods like flooding or distance vector.
  4. Inter-cluster Routing:
    • Execute the inter-cluster routing in which a cluster head transmits packets into other cluster heads.
    • Cluster heads will be exchanged routing data sustaining a modern routing table for inter-cluster interaction.

Example of a Basic CGSR Protocol Class:

class CGSRProtocol : public cSimpleModule

{

protected:

virtual void initialize() override;

virtual void handleMessage(cMessage *msg) override;

virtual void sendHelloMessages();

virtual void electClusterHead();

virtual void forwardData(cMessage *msg);

};

Functions:

  • initialize(): Configures the first state of the node such as whether it is a cluster head.
  • handleMessage(): Handles incoming messages like Hello messages or data packets.
  • sendHelloMessages(): Emit Hello messages to find the neighbors.
  • electClusterHead(): It chooses a cluster head depends on the predefined criteria.
  • forwardData(): Sends data packets from one cluster head to another or from regular nodes to the cluster head.
  1. Configure the CGSR Protocol in omnetpp.ini

When we executed the CGSR protocol then we want to set metrics using omnetpp.ini file. This file manages the settings like which protocol each node utilizes.

Example configuration in omnetpp.ini:

network = CGSRNetwork

sim-time-limit = 100s

**.node[*].protocol = “CGSRProtocol”

**.clusterHead[*].protocol = “CGSRProtocol”

**.node[*].helloInterval = 10s

**.node[*].clusterHeadElectionInterval = 30s

In this example:

  • For routing, node[*] uses the CGSRProtocol.
  • The helloInterval describes how frequently nodes transmit the Hello messages.
  • The clusterHeadElectionInterval indicates how often the cluster head election happens.
  1. Add Traffic Generation (Optional)

We can create the traffic within the network replicating the realistic interaction. For instance, we can be generated the UDP or TCP traffic among nodes and then monitor how CGSR manages routing amid data transmission.

Example of traffic generation configuration:

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

**.node[0].app[0].destAddr = “node[5]”

**.node[0].app[0].startTime = 1s

**.node[0].app[0].messageLength = 1000B

This sample sets UDP traffic from node 0 to node 5 to begin at 1 second including a message size of 1000 bytes.

  1. Run the Simulation

After configuring the simulation then we need to execute it:

  1. Select Run to execute the simulation in OMNeT++.
  2. Monitor the CGSR’s behavior with:
    • Cluster formation and cluster head election.
    • Routing of data packets among the nodes.
    • Inter-cluster interaction and routing efficiency.
  1. Analyze the Results

OMNeT++ environment offers the capability to examine the simulation outcomes through scalars and vectors. We can be investigated the simulation performance parameters such as:

  • Packet delivery ratio (how many packets attain its destination).
  • Cluster head election time.
  • Network throughput that is how much data is effectively sent.
  • Cluster stability (how frequently clusters form and re-form).

Example configuration to output results:

output-scalar-file = “cgsr_results.sca”

output-vector-file = “cgsr_results.vec”

Envision the data and also examine network performance using OMNeT++’s Result Analysis Tools, after the simulation.

  1. Extend the Simulation

When execute the basic CGSR protocol then we need to prolong it further with more complex behaviors, like:

  • Node mobility: Replicate the movement of nodes and then we monitor how CGSR adjusts network topology changes.
  • Fault Tolerance: Experiment how the protocol manages the node or cluster head failures for tolerance.
  • Scalability: Maximizes the network size for replicating large-scale MANETs.

Resources:

  • INET Framework Documentation: INET Docs
  • OMNeT++ Documentation: OMNeT++ Docs
  • Mobile Ad-Hoc Networks: Focus on CGSR and relevant protocols from research papers or other community-driven projects for details to cluster-based routing protocols within MANETs.

By adhering to these steps, we can set up and replicate the CGSR protocol and we monitor its behaviour through OMNeT++. Further insights will be provided in another manual based on your requirements.

Keep in touch with  phdprojects.org. We guarantee timely results accompanied by thorough explanations. We provide topics and project ideas for CGSR Protocol Projects using OMNeT++, and we can customize or implement the protocol relevant to your projects.