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 3D Underwater WSN in OMNeT++

To implement the 3D Underwater Wireless Sensor Network (UWSN) in OMNeT++ requires an environment that has underwater sensor nodes, communication channels suitable for underwater environments and acoustic interactive features. We need to expand the INET or use extra libraries mainly designed for underwater communication because INET framework is commonly used for old communication networks. Connect with us for best simulation results on 3D Underwater Wireless Sensor Network (UWSN) in OMNeT++.

Here, we offer the step-by-step details on how to implement 3D Underwater WSN in OMNeT++

Step-by-Step Implementation:

Step 1: Install OMNeT++ and INET Framework

  1. Download OMNeT++:
    • Go to the OMNeT++ download the latest version.
  2. Install OMNeT++:
    • Follow the installation instructions provided on the website for your operating system.
  3. Download and Install INET Framework:
    • The INET framework provides models for internet protocols and is often used with OMNeT++.
    • You can download it from the INET website.

Step 2: Set Up Your Project

  1. Create a New OMNeT++ Project:
    • Open the OMNeT++ IDE.
    • Go to File -> New -> OMNeT++ Project.
    • Enter a project name and select the appropriate options.
  2. Set Up Directory Structure:
    • Ensure project has the required folders like src for source files and simulations for NED files and configuration.
  3. Add INET to Your Project:
    • Right-click on project in the Project Explorer.
    • Select Properties -> Project References.
    • Check the box for INET.

Step 3: Define UWSN Models Using NED

  1. Create NED Files:
    • In the src directory, create a new NED file (like UWSNNetwork.ned).
    • State the network topology in the NED file. Here, we provide the sample:

package uwsn;

import inet.node.inet.StandardHost;

import inet.mobility.single.RandomWaypointMobility;

import inet.physicallayer.common.packetlevel.RadioMedium;

network UWSNNetwork

{

parameters:

int numNodes = default(10);

types:

channel radioChannel extends RadioMedium {}

submodules:

radioMedium: radioChannel {

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

}

node[numNodes]: StandardHost {

@display(“p=200+100*i,200”);

mobility.typename = “RandomWaypointMobility”;

@configurator:

wlan.typename = “UWSNTransceiver”;

}

connections allowunconnected:

for i=0..numNodes-1 {

node[i].wlan[0] <–> radioMedium <–> node[(i+1) % numNodes].wlan[0];

}

}

Step 4: Implement Underwater Communication Logic

  1. Create C++ Modules for Underwater Communication:
    • Create new C++ classes (for instance: UWSNTransmitter.cc and UWSNReceiver.cc) in the src directory.
    • Has the necessary OMNeT++ headers and define underwater communication logic.
  2. Underwater Transmitter Implementation:

#include <omnetpp.h>

#include “inet/applications/base/ApplicationBase.h”

#include “inet/common/packet/Packet.h”

using namespace omnetpp;

using namespace inet;

class UWSNTransmitter : public ApplicationBase

{

protected:

virtual void initialize(int stage) override;

virtual void handleMessageWhenUp(cMessage *msg) override;

void sendUnderwaterMessage();

void handleUnderwaterMessage(cPacket *pkt);

cMessage *sendEvent = nullptr;

};

Define_Module(UWSNTransmitter);

void UWSNTransmitter::initialize(int stage)

{

ApplicationBase::initialize(stage);

if (stage == INITSTAGE_LOCAL) {

sendEvent = new cMessage(“sendUnderwaterMessage”);

scheduleAt(simTime() + par(“startTime”), sendEvent);

}

}

void UWSNTransmitter::handleMessageWhenUp(cMessage *msg)

{

if (msg == sendEvent) {

sendUnderwaterMessage();

scheduleAt(simTime() + par(“sendInterval”), sendEvent);

} else {

cPacket *pkt = check_and_cast<cPacket *>(msg);

handleUnderwaterMessage(pkt);

}

}

void UWSNTransmitter::sendUnderwaterMessage()

{

// Create and send an underwater message to the next node

EV << “Sending underwater message” << endl;

Packet *pkt = new Packet(“UnderwaterMessage”);

pkt->setByteLength(par(“messageSize”));

send(pkt, “lowerLayerOut”);

}

void UWSNTransmitter::handleUnderwaterMessage(cPacket *pkt)

{

// Handle received underwater message

EV << “Received underwater message: ” << pkt->getName() << endl;

delete pkt;

}

  1. Underwater Receiver Implementation:

#include <omnetpp.h>

#include “inet/applications/base/ApplicationBase.h”

#include “inet/common/packet/Packet.h”

using namespace omnetpp;

using namespace inet;

class UWSNReceiver : public ApplicationBase

{

protected:

virtual void initialize(int stage) override;

virtual void handleMessageWhenUp(cMessage *msg) override;

void handleUnderwaterMessage(cPacket *pkt);

};

Define_Module(UWSNReceiver);

void UWSNReceiver::initialize(int stage)

{

ApplicationBase::initialize(stage);

}

void UWSNReceiver::handleMessageWhenUp(cMessage *msg)

{

if (msg->isSelfMessage()) {

delete msg;

} else {

cPacket *pkt = check_and_cast<cPacket *>(msg);

handleUnderwaterMessage(pkt);

}

}

void UWSNReceiver::handleUnderwaterMessage(cPacket *pkt)

{

// Handle received underwater message

EV << “Received underwater message: ” << pkt->getName() << endl;

delete pkt;

}

Step 5: Implement 3D Mobility Model

  1. Implement a Custom 3D Mobility Model:
    • We can use the existing mobility models in INET and expand them for 3D movement. For instance, to use the vertical movement we have to extend the RandomWaypointMobility model.
  2. 3D Random Waypoint Mobility Implementation:

#include “inet/mobility/single/RandomWaypointMobility.h”

namespace inet {

class ThreeDRandomWaypointMobility : public RandomWaypointMobility

{

protected:

virtual void initialize(int stage) override;

virtual void setTargetPosition() override;

};

Define_Module(ThreeDRandomWaypointMobility);

void ThreeDRandomWaypointMobility::initialize(int stage)

{

RandomWaypointMobility::initialize(stage);

}

void ThreeDRandomWaypointMobility::setTargetPosition()

{

targetPosition.x = uniform(0, playgroundSizeX);

targetPosition.y = uniform(0, playgroundSizeY);

targetPosition.z = uniform(0, playgroundSizeZ);

}

} // namespace inet

Step 6: Integrate 3D Mobility and Underwater Communication Modules

  1. Modify NED File to Use 3D Mobility and Underwater Communication Modules:
    • Use the use the custom 3D mobility and underwater communication modules by updating the NED file:

package uwsn;

import inet.node.inet.StandardHost;

import inet.physicallayer.contract.packetlevel.IRadioMedium;

import inet.physicallayer.common.packetlevel.RadioMedium;

network UWSNNetwork

{

parameters:

int numNodes = default(10);

submodules:

radioMedium: RadioMedium {

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

}

node[numNodes]: StandardHost {

@display(“p=200+100*i,200”);

mobility.typename = “ThreeDRandomWaypointMobility”;

@children:

wlan[0].radio.transmitter.typename = “UWSNTransmitter”;

wlan[0].radio.receiver.typename = “UWSNReceiver”;

}

connections allowunconnected:

for i=0..numNodes-1 {

node[i].wlan[0] <–> radioMedium <–> node[(i+1) % numNodes].wlan[0];

}

}

Step 7: Configure Simulation Parameters

  1. Create omnetpp.ini:
    • Create an omnetpp.ini file in the simulation directory.
    • Define simulation parameters like the duration and network parameters:

[General]

network = UWSNNetwork

sim-time-limit = 100s

# Mobility

**.node[*].mobility.bounds = “0,0,0,1000,1000,1000”

# Underwater communication parameters

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

**.node[*].udpApp.sendInterval = exponential(1s)

**.node[*].udpApp.messageSize = 256B

**.node[*].udpApp.localPort = 1000

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

Step 8: Build and Run the Simulation

  1. Build the Project:
    • Right-click on project and select Build Project in the OMNeT++ IDE.
  2. Run the Simulation:
    • Go to Run -> Run Configurations.
    • Set up a new run configuration for project and run the simulation.

Step 9: Analyze Results

  1. View Simulation Results:
    • After the simulation completes, analyze the results using OMNeT++’s tools.
    • Visualize and translate the data by opening the ANF (Analysis Framework).

In this script, we comprehensively provide the essential information needed to implement 3D Underwater WSN and how to expand the INET framework using OMNeT++. As per you needs, we can offer any additional details about this topic.

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 .