To implement the Software-Defined Networking (SDN) with Named Data Networking (NDN) in OMNeT++ has includes to generate the emulation scenarios that has contains the SDN controllers, NDN routers, and communication links among them. The INET framework can be protracted to provision both SDN and NDN functionalities. The below are the detailed procedures on how to implement the SDN NDN in OMNet++:
Step-by-Step Implementation:
Step 1: Install OMNeT++ and INET Framework
Step 2: Set Up Your Project
Step 3: Define SDN-NDN Network Models Using NED
package sdn_ndn;
import inet.node.inet.StandardHost;
import inet.node.inet.Router;
import inet.node.ethernet.EtherSwitch;
import inet.networklayer.configurator.ipv4.Ipv4NetworkConfigurator;
network SDN_NDNNetwork
{
parameters:
int numHosts = default(4);
int numSwitches = default(2);
int numNDNRouters = default(2);
submodules:
configurator: Ipv4NetworkConfigurator {
@display(“p=100,100”);
}
sdnController: StandardHost {
@display(“p=200,100”);
}
switch[numSwitches]: EtherSwitch {
@display(“p=300,100+100*i”);
}
ndnRouter[numNDNRouters]: Router {
@display(“p=400,100+100*i”);
}
host[numHosts]: StandardHost {
@display(“p=500,100+100*i”);
}
connections allowunconnected:
for i=0..numSwitches-1 {
sdnController.ethg++ <–> Eth100M <–> switch[i].ethg++;
for j=0..numNDNRouters-1 {
switch[i].ethg++ <–> Eth100M <–> ndnRouter[j].ethg++;
}
for k=0..numHosts-1 {
ndnRouter[(i+k) % numNDNRouters].ethg++ <–> Eth100M <–> host[k].ethg++;
}
}
}
Step 4: Implement SDN Controller Logic
#include <omnetpp.h>
#include “inet/applications/base/ApplicationBase.h”
#include “inet/applications/tcpapp/TcpBasicClientApp.h”
#include “inet/applications/tcpapp/TcpServerHostApp.h”
#include “inet/common/packet/Packet.h”
#include “inet/networklayer/common/L3AddressResolver.h”
#include “inet/networklayer/contract/ipv4/Ipv4Address.h”
#include “inet/networklayer/contract/IL3AddressType.h”
#include “inet/linklayer/ethernet/switch/MacRelayUnit.h”
using namespace omnetpp;
using namespace inet;
class SDNControllerApp : public ApplicationBase
{
protected:
virtual void initialize(int stage) override;
virtual void handleMessageWhenUp(cMessage *msg) override;
void handlePacket(Packet *pkt);
void configureSwitch(cModule *switchModule);
cMessage *configEvent = nullptr;
};
Define_Module(SDNControllerApp);
void SDNControllerApp::initialize(int stage)
{
ApplicationBase::initialize(stage);
if (stage == INITSTAGE_LOCAL) {
configEvent = new cMessage(“configSwitch”);
scheduleAt(simTime() + par(“configStartTime”), configEvent);
}
}
void SDNControllerApp::handleMessageWhenUp(cMessage *msg)
{
if (msg == configEvent) {
for (cModule::SubmoduleIterator it(getSystemModule()); !it.end(); ++it) {
cModule *submodule = *it;
if (strstr(submodule->getName(), “switch”)) {
configureSwitch(submodule);
}
}
delete configEvent;
} else {
Packet *pkt = check_and_cast<Packet *>(msg);
handlePacket(pkt);
}
}
void SDNControllerApp::configureSwitch(cModule *switchModule)
{
// Implement switch configuration logic (e.g., flow table setup)
EV << “Configuring switch: ” << switchModule->getFullPath() << endl;
}
void SDNControllerApp::handlePacket(Packet *pkt)
{
// Handle received packets (e.g., process control messages)
EV << “Received packet: ” << pkt->getName() << endl;
delete pkt;
}
Step 5: Implement NDN Router Logic
#include <omnetpp.h>
#include “inet/applications/base/ApplicationBase.h”
#include “inet/common/packet/Packet.h”
#include “inet/networklayer/common/L3AddressResolver.h”
using namespace omnetpp;
using namespace inet;
class NDNRouterApp : public ApplicationBase
{
protected:
virtual void initialize(int stage) override;
virtual void handleMessageWhenUp(cMessage *msg) override;
void handleNDNPacket(Packet *pkt);
};
Define_Module(NDNRouterApp);
void NDNRouterApp::initialize(int stage)
{
ApplicationBase::initialize(stage);
}
void NDNRouterApp::handleMessageWhenUp(cMessage *msg)
{
if (msg->isSelfMessage()) {
delete msg;
} else {
Packet *pkt = check_and_cast<Packet *>(msg);
handleNDNPacket(pkt);
}
}
void NDNRouterApp::handleNDNPacket(Packet *pkt)
{
// Handle received NDN packet
EV << “Received NDN packet: ” << pkt->getName() << endl;
// Implement NDN processing logic (e.g., forwarding based on content name)
delete pkt;
}
Step 6: Integrate SDN and NDN Modules into Network Model
package sdn_ndn;
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 SDN_NDNNetwork
{
parameters:
int numHosts = default(4);
int numSwitches = default(2);
int numNDNRouters = default(2);
submodules:
radioMedium: RadioMedium {
@display(“p=100,100”);
}
configurator: Ipv4NetworkConfigurator {
@display(“p=200,100”);
}
sdnController: StandardHost {
@display(“p=200,200”);
@children:
wlan[0].radio.transmitter.typename = “SDNControllerApp”;
wlan[0].radio.receiver.typename = “SDNControllerApp”;
}
switch[numSwitches]: EtherSwitch {
@display(“p=300,100+100*i”);
}
ndnRouter[numNDNRouters]: Router {
@display(“p=400,100+100*i”);
@children:
wlan[0].radio.transmitter.typename = “NDNRouterApp”;
wlan[0].radio.receiver.typename = “NDNRouterApp”;
}
host[numHosts]: StandardHost {
@display(“p=500,100+100*i”);
}
connections allowunconnected:
for i=0..numSwitches-1 {
sdnController.ethg++ <–> Eth100M <–> switch[i].ethg++;
for j=0..numNDNRouters-1 {
switch[i].ethg++ <–> Eth100M <–> ndnRouter[j].ethg++;
}
for k=0..numHosts-1 {
ndnRouter[(i+k) % numNDNRouters].ethg++ <–> Eth100M <–> host[k].ethg++;
}
}
}
Step 7: Configure Simulation Parameters
network = SDN_NDNNetwork
sim-time-limit = 100s
# Mobility
**.host[*].mobility.bounds = “0,0,1000,1000”
# SDN Controller application parameters
**.sdnController.udpApp.startTime = uniform(0s, 10s)
**.sdnController.udpApp.sendInterval = exponential(1s)
**.sdnController.udpApp.messageSize = 256B
**.sdnController.udpApp.localPort = 1000
**.sdnController.udpApp.destPort = 2000
# NDN Router application parameters
**.ndnRouter[*].udpApp.localPort = 2000
Step 8: Build and Run the Simulation
Step 9: Analyse Results
As we discussed earlier about how to implement and evaluate the basic SDN NDN in OMNet++ simulator tool that creates the scenarios in the network then apply essential algorithm to execute the results. We plan to share the additional insights regarding the SDN NDN.
For the implementation of SDN and NDN in OMNeT++, you may contact us to obtain optimal simulation and project performance outcomes from our expert developers. We specialize in both SDN and NDN protocols.