OMNET++ PROGRAMMING TUTORIAL

OMNET++ has a domain-specific functionality such as support for sensor networks, wireless ad-hoc networks, Internet protocols, performance modeling, photonic networks, etc., is provided by model frameworks, developed as independent projects.OMNeT++ provides component architecture for models. Components (modules)are programmed in C++, and then assembled into larger components and models using a high-level language (NED).

 

OMNET++ simulation:

OMNeT++ IDE makes it possible to run simulations directly from the integrated environment. It is possible to run a simulation as a normal C/C++ application and perform C++ source-level debugging on it. The user can also run it as a standalone application or run batches of simulations where runs differ in module parameter settings or random number seeds.

Download Sample Source Code for OMNeT++ PROGRAMMING TUTORIAL

 


This is the code of PDN gateway in LTE.
module PgwStandard extends NodeBase
{
    parameters:
        string nodeType; // must be one between ENB and PGW
        @display("bgb=920,462;i=device/mainframe");
    gates:
        inout filterGate @labels(PPPFrame-conn);

    submodules:
        trafficFlowFilter: TrafficFlowFilter {
            ownerType = nodeType;
            @display("p=813,206");
        }
        pppInterface: PPPInterface {
            @display("p=727,386");
        }
        udp: UDP {
            @display("p=329,206");
        }
        gtp_user: GtpUser {
            @display("p=591,206");
        }
    connections:
        udp.ipOut --> networkLayer.transportIn++;
        udp.ipIn <-- networkLayer.transportOut++; pppInterface.upperLayerOut --> trafficFlowFilter.internetFilterGateIn;
        pppInterface.upperLayerIn <-- gtp_user.pppGate;
        pppInterface.phys <--> filterGate;
        udp.appOut++ --> gtp_user.udpIn;
        gtp_user.udpOut --> udp.appIn++;
        trafficFlowFilter.gtpUserGateOut --> gtp_user.trafficFlowFilterGate;
}