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 Content centric network in OMNeT++

To implement the Content-Centric Network (CCN) in OMNeT++ has encompasses to building a recreation situation that contains enabling announcement founded on content names slightly than host addresses, consumers, producers and content routers. It is encompass possibly and we used by INET framework. The following procedure are to support to become ongoing by the basic CCN simulation in OMNeT++ by using the INET framework.

Step-by-Step Implementation:

Step 1: Install OMNeT++ and INET Framework

  1. Download OMNeT++:
    • Download the latest version of OMNeT++.  
  2. Install OMNeT++:
    • We provides on the website for the operating system only follow on the installation instructions.
  3. Download and Install INET Framework:
    • It is used by OMNeT++ and for the network protocols gives the INET framework.
    • From the INET website we must download itStep 2: Set Up Your Project
  1. Create a New OMNeT++ Project:
    • Exposed the OMNeT++ IDE.
    • Move to File -> New -> OMNeT++ Project.
    • Choice the appropriate options to arrive a project name.
  2. Set Up Directory Structure:
    • The efficient folders, like src for the source file to make sure the project and simulating for NED files and formations.
    • In the Project Explorer to right-click on the project. Choice Properties -> Project References.
    • Form the box for INET.

Step 3: Define CCN Models Using NED

  1. Create NED Files:
    • Build a new NED file like CCNNetwork.ned on the src directory. In the NED file to express the network topology. Here’s a modest example:

package ccn;

import inet.node.inet.StandardHost;

import inet.node.inet.Router;

import inet.node.ethernet.EtherSwitch;

import inet.physicallayer.common.packetlevel.RadioMedium;

network CCNNetwork

{

parameters:

int numConsumers = default(4);

int numProducers = default(2);

int numRouters = default(3);

submodules:

radioMedium: RadioMedium {

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

}

consumer[numConsumers]: StandardHost {

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

}

producer[numProducers]: StandardHost {

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

}

router[numRouters]: Router {

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

}

switch: EtherSwitch {

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

}

connections allowunconnected:

for i=0..numConsumers-1 {

consumer[i].ethg++ <–> switch.ethg++;

}

for i=0..numProducers-1 {

producer[i].ethg++ <–> switch.ethg++;

}

for i=0..numRouters-1 {

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

}

}

Step 4: Implement CCN Communication Logic

  1. Create C++ Modules for Content Routers, Consumers, and Producers:
    • To make a new C++ classes like ContentProducer.cc, ContentRouter.cc, and ContentConsumer.cc in the src directory.
    • Explain a CCN communication logic and to contain necessary OMNeT++.
  2. Content Router Implementation:

#include <omnetpp.h>

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

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

using namespace omnetpp;

using namespace inet;

class ContentRouter : public ApplicationBase

{

protected:

virtual void initialize(int stage) override;

virtual void handleMessageWhenUp(cMessage *msg) override;

void handleInterest(Packet *pkt);

void handleData(Packet *pkt);

 

};

Define_Module(ContentRouter);

void ContentRouter::initialize(int stage)

{

ApplicationBase::initialize(stage);

}

void ContentRouter::handleMessageWhenUp(cMessage *msg)

{

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

if (strcmp(pkt->getName(), “Interest”) == 0) {

handleInterest(pkt);

} else if (strcmp(pkt->getName(), “Data”) == 0) {

handleData(pkt);

} else {

delete msg;

}

}

void ContentRouter::handleInterest(Packet *pkt)

{

// Handle Interest packet

EV << “Received Interest packet: ” << pkt->getName() << endl;

// Implement Interest forwarding logic

delete pkt;

}

void ContentRouter::handleData(Packet *pkt)

{

// Handle Data packet

EV << “Received Data packet: ” << pkt->getName() << endl;

// Implement Data forwarding logic

delete pkt;

}

  1. Content Consumer Implementation:

#include <omnetpp.h>

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

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

using namespace omnetpp;

using namespace inet;

class ContentConsumer : public ApplicationBase

{

protected:

virtual void initialize(int stage) override;

virtual void handleMessageWhenUp(cMessage *msg) override;

void sendInterest();

void handleData(Packet *pkt);

cMessage *sendEvent = nullptr;

};

Define_Module(ContentConsumer);

void ContentConsumer::initialize(int stage)

{

ApplicationBase::initialize(stage);

if (stage == INITSTAGE_LOCAL) {

sendEvent = new cMessage(“sendInterest”);

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

}

}

void ContentConsumer::handleMessageWhenUp(cMessage *msg)

{

if (msg == sendEvent) {

sendInterest();

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

} else {

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

handleData(pkt);

}

}

void ContentConsumer::sendInterest()

{

// Create and send an Interest packet

EV << “Sending Interest packet” << endl;

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

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

send(pkt, “lowerLayerOut”);

}

void ContentConsumer::handleData(Packet *pkt)

{

// Handle received Data packet

EV << “Received Data packet: ” << pkt->getName() << endl;

delete pkt;

}

  1. Content Producer Implementation:

#include <omnetpp.h>

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

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

using namespace omnetpp;

using namespace inet;

class ContentProducer : public ApplicationBase

{

protected:

virtual void initialize(int stage) override;

virtual void handleMessageWhenUp(cMessage *msg) override;

void handleInterest(Packet *pkt);

};

Define_Module(ContentProducer);

void ContentProducer::initialize(int stage)

{

ApplicationBase::initialize(stage);

}

void ContentProducer::handleMessageWhenUp(cMessage *msg)

{

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

if (strcmp(pkt->getName(), “Interest”) == 0) {

handleInterest(pkt);

}else {

delete msg;

}

}

void ContentProducer::handleInterest(Packet *pkt)

{

// Handle Interest packet

EV << “Received Interest packet: ” << pkt->getName() << endl;

// Create and send a Data packet in response to the Interest

Packet *dataPkt = new Packet(“Data”);

dataPkt->setByteLength(par(“dataSize”));

send(dataPkt, “lowerLayerOut”);

delete pkt;

}

Step 5: Integrate CCN Modules into Network Model

  1. Modify NED File to Use CCN Modules:
  • To custom the producer application modules, consumer, and the custom content router to inform the NED file.

package ccn;

import inet.node.inet.StandardHost;

import inet.node.inet.Router;

import inet.node.ethernet.EtherSwitch;

import inet.physicallayer.contract.packetlevel.IRadioMedium;

import inet.physicallayer.common.packetlevel.RadioMedium;

network CCNNetwork

{

parameters:

int numConsumers = default(4);

int numProducers = default(2);

int numRouters = default(3);

submodules:

radioMedium: RadioMedium {

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

}

consumer[numConsumers]: StandardHost {

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

@children:

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

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

}

producer[numProducers]: StandardHost {

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

@children:

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

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

}

router[numRouters]: Router {

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

@children:

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

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

}

switch: EtherSwitch {

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

}

connections allowunconnected:

for i=0..numConsumers-1 {

consumer[i].ethg++ <–> switch.ethg++;

}

for i=0..numProducers-1 {

producer[i].ethg++ <–> switch.ethg++;

}

for i=0..numRouters-1 {

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

}

}

Step 6: Configure Simulation Parameters

  1. Create omnetpp.ini:
    • To make an omnetpp.ini file in the simulations manual.
    • To state the simulation parameters like network parameters, duration

[General]

network = CCNNetwork

sim-time-limit = 100s

# Mobility

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

# Content consumer application parameters

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

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

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

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

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

# Content producer application parameters

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

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

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

**.producer[*].udpApp.localPort = 3000

**.producer[*].udpApp.destPort = 4000

# Content router application parameters

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

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

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

**.router[*].udpApp.localPort = 5000

**.router[*].udpApp.destPort = 6000

Step 7: Build and Run the Simulation

  1. Build the Project:
    • To choice the build project in the  OMNeT++ IDE, right-click on the project
  2. Run the Simulation: When the Run -> Run Outlines.
    • Run the simulation for the project to setting up a new run outlines.

Step 8: Analyze Results

  1. View Simulation Results:
    • To analysing the results and to go ion completes, by using OMNeT++.
    • Understand the information and to envision for open the ANF which is Analysis Framework.

From the following scripts are label in technique to execute the Content Centric Network in ns3. We learn how to succeed in the Content centric network and their development. We are motivated to put forward the expressive script and views describe the Content centric network in ns3. Reach out to us for exceptional simulation and project performance on content-centric networks in OMNeT++, crafted by leading developers for your projects. We utilize the INET framework to deliver the best ideas tailored to your needs.

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 .