OPENFLOW OMNET++

OpenFlow is the promising area of future internet technology. OpenFlow has as great potential for enhancing current internet with new functionalities with better scheme.OpenFlow OMNeT++ code for enabling new smarter application to be created.

Behavior of controller:

  • Forwarding behavior.
  • Switch behavior.

OMNeT++ OpenFlow

Types of openflow nodes:

  • Utility modules.
    • Spanning tree module.
  • Openflow nodes.
    • Openflow controller.
    • Openflow switch.

Control plane functionalities in OPENFLOW:

  • Handling of controller-to-switch messages.
  • Handling of unmatched packets.
  • Communication with controller.

Download Sample Source Code for OMNeT++ OpenFlow


void OFA_controller::handleMessage(cMessage *msg)
{
    if (msg->isSelfMessage())
    {
        cMessage *data_msg = (cMessage *) msg->getContextPointer();
        delete msg;
        processQueuedMsg(data_msg);
        if (msg_list.empty())
        {

            busy = false;
        }
        else
        {
            cMessage *msgfromlist = msg_list.front();
            msg_list.pop_front();
            char buf[80];
            sprintf(buf, " %d pakets in queue", msg_list.size());
            getParentModule()->getDisplayString().setTagArg("t", 0, buf);
            std::list<cMessage *>::iterator i = msg_list.begin();
                while (i!=msg_list.end())
                {
                    EV << (*i)->getFullPath() << endl; i++; } cMessage *event = new cMessage("event"); event->setContextPointer(msgfromlist);
            scheduleAt(simTime()+serviceTime, event);
        }
    }
    else
    {
        if (busy) {
            msg_list.push_back(msg);
        }
        else
        {
            busy = true;
            cMessage *event = new cMessage("event");
            event->setContextPointer(msg);
            scheduleAt(simTime()+serviceTime, event);
        }
    }
}