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

To implement an optical network in the OMNeT++ needs an environment which has to simulate and contain the optical transmitters, receivers, switches, and optical links by creating it. Support the optical communication features by extending the INET framework. Here’s a step-by-step process on how to execute optical network in OMNeT++:

Step-by-Step Implementation:

Step 1: Install OMNeT++ and INET Framework

  1. Download OMNeT++:
    • Get the latest version of the OMNeT++.
  2. Install OMNeT++:
    • Follow the installation details about which one is appropriate for the operating system.
  3. Download and Install INET Framework:
    • The INET framework offers models for internet protocols and is commonly used with OMNeT++.
    • Install the INET framework on your system.

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 pick the proper options.
  2. Set Up Directory Structure:
    • Make certain that the project contains essential 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 Optical Network Models Using NED

  1. Create NED Files:
    • In the src directory, create a new NED file (e.g., OpticalNetwork.ned).
    • Determine the network topology in the NED file. Here’s an example:

package optical;

import inet.node.inet.StandardHost;

import inet.node.ethernet.EtherSwitch;

import inet.node.inet.Router;

import inet.physicallayer.common.packetlevel.RadioMedium;

network OpticalNetwork

{

parameters:

int numNodes = default(5);

submodules:

router: Router {

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

}

node[numNodes]: StandardHost {

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

}

switch[numNodes]: EtherSwitch {

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

}

connections allowunconnected:

for i=0..numNodes-1 {

node[i].ethg++ <–> Eth100M <–> switch[i].ethg++;

switch[i].ethg++ <–> Eth100M <–> router.ethg++;

}

}

Step 4: Implement Optical Communication Logic

  1. Extend INET’s Physical Layer for Optical Communication:
    • To support the optical communication features, we have to extend the physical layer of INET. We might need to create new classes or extend existing ones to comprise optical modulation and demodulation.
  2. Create C++ Modules for Optical Communication:
    • In the src directory, create new C++ classes (e.g., OpticalTransmitter.cc and OpticalReceiver.cc).
    • Has the necessary OMNeT++ headers and define optical communication logic.
  3. Optical Transmitter Implementation:

#include <omnetpp.h>

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

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

using namespace omnetpp;

using namespace inet;

class OpticalTransmitter : public ApplicationBase

{

protected:

virtual void initialize(int stage) override;

virtual void handleMessageWhenUp(cMessage *msg) override;

void sendOpticalMessage();

void handleOpticalMessage(cPacket *pkt);

 

cMessage *sendEvent = nullptr;

};

 

Define_Module(OpticalTransmitter);

void OpticalTransmitter::initialize(int stage)

{

ApplicationBase::initialize(stage);

if (stage == INITSTAGE_LOCAL) {

sendEvent = new cMessage(“sendOpticalMessage”);

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

}

}

void OpticalTransmitter::handleMessageWhenUp(cMessage *msg)

{

if (msg == sendEvent) {

sendOpticalMessage();

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

} else {

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

handleOpticalMessage(pkt);

}

}

void OpticalTransmitter::sendOpticalMessage()

{

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

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

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

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

send(pkt, “lowerLayerOut”);

}

void OpticalTransmitter::handleOpticalMessage(cPacket *pkt)

{

// Handle received optical message

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

delete pkt;

}

  1. Optical Receiver Implementation:

#include <omnetpp.h>

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

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

using namespace omnetpp;

using namespace inet;

class OpticalReceiver : public ApplicationBase

{

protected:

virtual void initialize(int stage) override;

virtual void handleMessageWhenUp(cMessage *msg) override;

void handleOpticalMessage(cPacket *pkt);

 

};

Define_Module(OpticalReceiver);

void OpticalReceiver::initialize(int stage)

{

ApplicationBase::initialize(stage);

}

void OpticalReceiver::handleMessageWhenUp(cMessage *msg)

{

if (msg->isSelfMessage()) {

delete msg;

} else {

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

handleOpticalMessage(pkt);

}

}

void OpticalReceiver::handleOpticalMessage(cPacket *pkt)

{

// Handle received optical message

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

delete pkt;

}

Step 5: Integrate Optical Modules into Network Model

  1. Modify NED File to Use Optical Modules:
    • Use the custom optical transmitter and receiver modules by updating the NED file:

package optical;

import inet.node.inet.StandardHost;

import inet.node.ethernet.EtherSwitch;

import inet.node.inet.Router;

import inet.physicallayer.contract.packetlevel.IRadioMedium;

import inet.physicallayer.common.packetlevel.RadioMedium;

network OpticalNetwork

{

parameters:

int numNodes = default(5);

submodules:

router: Router {

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

}

node[numNodes]: StandardHost {

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

@children:

eth[0].transmitter.typename = “OpticalTransmitter”;

eth[0].receiver.typename = “OpticalReceiver”;

}

switch[numNodes]: EtherSwitch {

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

}

connections allowunconnected:

for i=0..numNodes-1 {

node[i].ethg++ <–> Eth100M <–> switch[i].ethg++;

switch[i].ethg++ <–> Eth100M <–> router.ethg++;

}

}

Step 6: Configure Simulation Parameters

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

[General]

network = OpticalNetwork

sim-time-limit = 100s

# Mobility

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

# Optical transmitter and receiver parameters

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

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

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

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

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

**.router.udpApp.localPort = 2000

Step 7: Build and Run the Simulation

  1. Build the Project:
    • In the OMNeT++ IDE, right-click on your project and select 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: Analyze Results

  1. View Simulation Results:
    • After the simulation completes, we have to analyze the results using OMNeT++’s tools.
    • Open the ANF (Analysis Framework) to visualize and construe the data.

At the end of this approach, we provided the information to help you get started with a basic optical network simulation and their functionalities using OMNeT++. If you have any concerns in this topic, reach out us.

For the implementation of an optical network in OMNeT++, you may contact us to receive optimal simulation results from our expert developers.

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 .