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 Underwater Sensor Network in OMNeT++

To implement the Underwater Sensor Network (UWSN) in OMNeT++ has includes to generate the simulation environment that contains underwater sensor nodes, acoustic communication channels, and particular communication protocols for underwater environments. Since the INET framework is usually used for traditional communication networks, so we need to extend it or use more libraries that particularly modelled for underwater communication. Below are the procedures on how to implement the underwater sensor network in OMNet++.

Step-by-Step Implementation:

Step 1: Install OMNeT++ and INET Framework

  1. Download OMNeT++:
    • Download the OMNeT++ latest version.
  2. Install OMNeT++:
    • Based on the conditions of the operating system install the OMNet++.
  3. Download and Install INET Framework:
    • The INET framework offers models for internet protocols and is usually used with OMNeT++.
    • We need to 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:
    • Make sure your project has the essential folders, like src for source files and simulations for NED files and configuration.
  3. Add INET to Your Project:
    • Right-click on your 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 (e.g., UWSNNetwork.ned).
    • Outline the network topology in the NED file. Here’s a simple example:

package uwsn;

import inet.node.inet.StandardHost;

import inet.node.inet.Router;

import inet.mobility.static.StationaryMobility;

network UWSNNetwork

{

parameters:

int numSensors = default(5);

submodules:

sink: Router {

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

mobility.typename = “StationaryMobility”;

}

sensor[numSensors]: StandardHost {

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

mobility.typename = “StationaryMobility”;

}

connections allowunconnected:

for i=0..numSensors-1 {

sensor[i].wlan[0] <–> sink.wlan[0];

}

}

Step 4: Implement Underwater Communication Logic

  1. Create C++ Modules for Underwater Communication:
    • In the src directory, create new C++ classes (e.g., UnderwaterTransmitter.cc and UnderwaterReceiver.cc).
    • Comprise essential OMNeT++ headers and describe 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 UnderwaterTransmitter : 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(UnderwaterTransmitter);

void UnderwaterTransmitter::initialize(int stage)

{

ApplicationBase::initialize(stage);

if (stage == INITSTAGE_LOCAL) {

sendEvent = new cMessage(“sendUnderwaterMessage”);

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

}

}

void UnderwaterTransmitter::handleMessageWhenUp(cMessage *msg)

{

if (msg == sendEvent) {

sendUnderwaterMessage();

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

} else {

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

handleUnderwaterMessage(pkt);

}

}

void UnderwaterTransmitter::sendUnderwaterMessage()

{

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

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

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

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

send(pkt, “lowerLayerOut”);

}

void UnderwaterTransmitter::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 UnderwaterReceiver : public ApplicationBase

{

protected:

virtual void initialize(int stage) override;

virtual void handleMessageWhenUp(cMessage *msg) override;

void handleUnderwaterMessage(cPacket *pkt);

 

};

Define_Module(UnderwaterReceiver);

void UnderwaterReceiver::initialize(int stage)

{

ApplicationBase::initialize(stage);

}

void UnderwaterReceiver::handleMessageWhenUp(cMessage *msg)

{

if (msg->isSelfMessage()) {

delete msg;

} else {

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

handleUnderwaterMessage(pkt);

}

}

void UnderwaterReceiver::handleUnderwaterMessage(cPacket *pkt)

{

// Handle received underwater message

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

delete pkt;

}

Step 5: Implement Underwater Acoustic Channel

We must execute a custom acoustic channel to emulate underwater communication features like delay, attenuation, and noise.

  1. Create a New C++ Class for the Acoustic Channel:

#include <omnetpp.h>

#include “inet/physicallayer/contract/packetlevel/IRadioMedium.h”

#include “inet/physicallayer/common/packetlevel/RadioMedium.h”

using namespace omnetpp;

using namespace inet;

using namespace inet::physicallayer;

 

class UnderwaterAcousticChannel : public RadioMedium

{

protected:

virtual void initialize(int stage) override;

virtual simtime_t calculatePropagationTime(const ITransmission *transmission) const override;

virtual double calculatePathLoss(const ITransmission *transmission, const IArrival *arrival) const override;

};

Define_Module(UnderwaterAcousticChannel);

void UnderwaterAcousticChannel::initialize(int stage)

{

RadioMedium::initialize(stage);

// Additional initialization for underwater acoustic channel if needed

}

simtime_t UnderwaterAcousticChannel::calculatePropagationTime(const ITransmission *transmission) const

{

// Implement propagation time calculation for underwater environment

double distance = transmission->getStartPosition().distance(transmission->getEndPosition());

double speedOfSoundInWater = 1500.0; // meters per second

return distance / speedOfSoundInWater;

}

double UnderwaterAcousticChannel::calculatePathLoss(const ITransmission *transmission, const IArrival *arrival) const

{

// Implement path loss calculation for underwater environment

double distance = transmission->getStartPosition().distance(arrival->getStartPosition());

double frequency = transmission->getCarrierFrequency().get();

double pathLoss = 20 * log10(distance) + frequency * distance * 0.1; // Example path loss calculation

return pathLoss;

}

  1. Modify NED File to Use the Acoustic Channel:

package uwsn;

import inet.node.inet.StandardHost;

import inet.node.inet.Router;

import inet.mobility.static.StationaryMobility;

import inet.physicallayer.contract.packetlevel.IRadioMedium;

import inet.physicallayer.common.packetlevel.RadioMedium;

network UWSNNetwork

{

parameters:

int numSensors = default(5);

submodules:

sink: Router {

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

mobility.typename = “StationaryMobility”;

}

sensor[numSensors]: StandardHost {

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

mobility.typename = “StationaryMobility”;

}

radioMedium: RadioMedium {

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

physicalEnvironmentModule = “^.^.physicalEnvironment”;

propagation.typename = “UnderwaterAcousticChannel”;

}

connections allowunconnected:

for i=0..numSensors-1 {

sensor[i].wlan[0] <–> radioMedium <–> sink.wlan[0];

}

}

Step 6: Configure Simulation Parameters

  1. Create omnetpp.ini:
    • In the simulations directory, create an omnetpp.ini file.
    • Describe simulation parameters, like the duration and network parameters:

network = UWSNNetwork

sim-time-limit = 100s

# Underwater communication parameters

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

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

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

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

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

**.sink.udpApp.localPort = 2000

Step 7: Build and Run the Simulation

  1. Build the Project:
    • In the OMNeT++ IDE, right-click on your project and top quality Build Project.
  2. Run the Simulation:
    • Go to Run -> Run Configurations.
    • Set up a new run configuration for your project and run the simulation.

Step 8: Analyse Results

  1. View Simulation Results:
    • After the simulation completes, use OMNeT++’s tools to investigate the results.
    • Open the ANF (Analysis Framework) to visualize and understand the data.

Conclusively, we had learned how to implement the under water sensor in OMNet++ simulator that generates the network then used the tradditioanl communication protocols to execute the circumstances. If you are in search of expert simulation results, we invite you to explore ns3simulation.com for exceptional outcomes. Our developers are proficient in implementing Underwater Sensor Networks in OMNeT++ for your projects.

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 .