SlideShare a Scribd company logo
Introduction to OMNet++
Prepared by
Md. Mahedee Hasan
M.Sc Engg. IICT, BUET
Web: http://mahedee.net
Reviewed by
Amit Karmaker
Md. Abir Hossain
M.Sc Engg. IICT, BUET
Supervised by
Dr. Mohammad Shah Alam
Assistant Professor
IICT, BUET
Contents
What is OMNeT++?.......................................................................................................................................2
Modeling concepts........................................................................................................................................2
Module..........................................................................................................................................................3
Message, gets and links ................................................................................................................................3
Parameters....................................................................................................................................................3
Classes that are part of simulation class library ...........................................................................................4
OMNeT++ Consists of....................................................................................................................................4
How OMNeT++ Works? ................................................................................................................................4
NED Features ................................................................................................................................................5
The Network .................................................................................................................................................5
.ini (Initialization) Files..................................................................................................................................6
.cc (C++) Files.................................................................................................................................................7
Channel .........................................................................................................................................................7
Simple and Compound Module ....................................................................................................................8
Simple Module............................................................................................................................................10
Compound Modules ...................................................................................................................................11
Channels......................................................................................................................................................12
Parameter ...................................................................................................................................................12
Gates...........................................................................................................................................................14
Sub Modules ...............................................................................................................................................15
Connections ................................................................................................................................................16
Inheritance..................................................................................................................................................16
Packages......................................................................................................................................................16
Create First Simulation Project using OMNeT++ ........................................................................................17
References ..................................................................................................................................................26
History Card ................................................................................................................................................26
What is OMNeT++?
 OMNeT++ is a Simulator
 For discrete event network
 It is object oriented and modular
 Used to simulate
o Modeling of wired and wireless communication networks
o Protocol modeling
o Modeling of queuing networks etc.
 Modules are connected using gates to form compound module
o In other system sometimes gates are called port
Modeling concepts
 Modules are communicate with message passing
 Active modules are called simple modules
 Message are sent through output gates and receive through input gates
 Input and output gates are linked through connection
 Parameters such as propagation delay, data rate and bit error rate, can be assigned to
connections
Fig – simple and compound module
Module
 In hierarchical module, the top level module is system module
 System module contains sub modules
 Sub modules contains sub modules themselves
 Both simple and compound modules are instance of module type
Message, gets and links
 Module communicate by exchanging message
 Message can represent frames or packets
 Gates are the input and output interface of modules
 Two sub modules can be connected by links with gates
 Links = connections
 Connections support the following parameter
o Data rate, propagation delay, bit error rate, packet error rate
Parameters
 Modules parameters can be assigned
o in either the NED files or
o the configuration file omnetpp.ini.
 Parameter can take string, numeric or Boolean data values or can contains XML data trees
Classes that are part of simulation class library
The following classes are the part of simulation class library
 Module, gates, parameter, channel
 Message, packet
 Container class (e.g. queue and array)
 Data collection classes
 Statistics and distribution estimated classes
 Transition and result accuracy detection classes.
OMNeT++ Consists of
 NED language topology description(s)(.ned files)
 Message definitions (.msg files)
 Simple module sources. They are C++ files, with .h/.cc suffix.
How OMNeT++ Works?
 When Program started
o Read all NED files containing model topology
o Then it reads a configuration file(usually called omnetpp.ini)
 Output is written in result file
 Graph is generated from result file using Matlab, Phython etc
NED Features
NED has several features which makes it scale well to large project
 Hierarchical
 Component-based
 Interfaces
 Inheritance
 Packages
 Metadata annotation
The Network
 Network consists of
o Nodes
o Gates and
o Connections
Fig: The network
network Network
{
submodules:
node1 : Node;
node2 : Node;
node3 : Node;
………………………
connections:
node1.port++<-->{datarate=100Mbps;}<-->node2.port++;
node2.port++<-->{datarate=100Mbps;}<-->node3.port++;
node3.port++<-->{datarate=100Mbps;}<-->node1.port++;
………………………
}
 The double arrow means bi-directional connection
 The connection points of the modules are called gates
 The port++ notation adds a new gate to the port[] gate vector
 Nodes are connected with a channel
 Specify the network option in to the configuration like below
[General]
network = Network
.ini (Initialization) Files
 Defines the network initialization point with/without some parameters
[General]
network = TicToc1
.cc (C++) Files
 Contains class definition and function for modules.
#include <string.h>
#include <omnetpp.h>
class Txc1 : public cSimpleModule
{
protected:
virtual void initialize();
virtual void handleMessage(cMessage *msg);
};
Define_Module(Txc1);
void Txc1::initialize()
{
// Am I Tic or Toc?
if (strcmp("tic", getName()) == 0)
{
cMessage *msg = new cMessage("tictocMsg");
send(msg, "out");
}
}
void Txc1::handleMessage(cMessage *msg)
{
send(msg, "out");
}
Channel
 Predefined Channel type
o IdealChannel
o DelayChannel
 delay (double with s, ms, us)
 diabled (boolean)
o DatarateChannel
 delay (double with s, ms, us)
 disabled (boolean)
 datarate (double with unit as bps, kbps, Mbps, Gbps)
 ber (double bit error rate [0,1])
 per (double packet error rate [0,1])
 One can create new channel type
network net
{
@display("bgb=340,233");
types:
channel customChannel extends ned.DatarateChannel{
datarate=100Mbps;
}
submodules:
computer1: computer {
@display("p=63,55");
}
computer2: computer {
@display("p=260,55");
}
connections:
computer1.out -->customChannel--> computer2.in;
computer2.out -->customChannel--> computer1.in;
}
Simple and Compound Module
 Simple module is a basic building block
 Denoted by simple keyword
simple App
{
parameters:
int destAddress;
...
@display("i=block/browser");
gates:
input in;
output out;
}
simple Routing
{
...
}
simple Queue
{
...
}
 Convention : Module name should be Pascal case
 Simple module combines into compound module
simple App
{
parameters:
int destAddress;
@display("i=block/browser");
gates:
input in;
output out;
}
simple Routing
{
gates:
input localIn;
output localOut;
}
simple Queue
{
gates:
input in;
output out;
}
module Node
{
parameters:
int address;
@display("i=misc/node_vs,gold");
gates:
inout port[];
submodules:
app: App;
routing: Routing;
queue[sizeof(port)]: Queue;
connections:
routing.localOut --> app.in;
routing.localIn <-- app.out;
for i=0..sizeof(port)-1 {
routing.out[i] --> queue[i].in;
routing.in[i] <-- queue[i].out;
queue[i].line <--> port[i];
}
}
Fig – The node compound module
 When simulation program started its load NED file first.
 Then it load corresponding simple module written in C++ such as App, Queue
Simple Module
 Simple module is the active component defined by simple keyword
simple Queue
{
parameters:
int capacity;
@display("i=block/queue");
gates:
input in;
output out;
}
 Parameters and gates sections are optional here
 Parameters keywords is optional too, parameters can be defined without parameters keyword
 One can explicitly specify the C++ class with the @class property
simple Queue
{
parameters:
int capacity;
@class(mylib::Queue);
@display("i=block/queue");
gates:
input in;
output out;
}
 The C++ classes will be mylib::App, mylib::Router and mylib::Queue
@namespace(mylib);
simple App{
...
}
simple Router{
...
}
simple Queue{
...
}
Compound Modules
 Groups other modules into a larger unit
 A compound modules may have gates and parameters like simple module but not active
 A compound modules may have several sections all of them optional
module Host
{
types:
...
parameters:
...
gates:
...
submodules:
...
connections:
...
}
 Modules contains in compound module are called sub module – are in sub module section
 Compound module may be inherited via sub classing
module WirelessHost extends WirelessHostBase
{
submodules:
webAgent:WebAgent;
connections:
webAgent.tcpOut-->tcp.appIn++;
webAgent.tcpIn<--tcp.appOut++;
}
module DesktopHost extends WirelessHost
{
gates:
inout ethg;
submodules:
eth:EthernetNic;
connections:
ip.nicOut++-->eth.ipIn;
ip.nicIn++<--eth.ipOut;
eth.phy<-->ethg;
}
Channels
 Channels are connections between nodes
 Predefined channel types are: ned.IdealChannel, ned.DelayChannel and ned.DatarateChannel
 Can use import ned.*
channel Ethernet100 extends ned.DatarateChannel
{
datarate = 100Mbps;
delay = 100us;
ber = 1e-10;
}
Or
channel DatarateChannel2 extends ned.DatarateChannel
{
double distance @unit(m); // @unit is a property
delay = this.distance/200000km * 1s;
}
Parameter
 Parameters are variables that belong to a module.
 Parameters can be used in building the topology (number of nodes, etc)
 To supply input to C++ code that implements simple modules and channels
 For the numeric types, a unit of measurement can also be specified (@unit property), to
increase type safety.
 Parameters can get their values from NED files or from the configuration(Omnetpp.ini)
simple App
{
parameters:
string protocol; //protocoltouse:"UDP"/"IP"/"ICMP"/...
int destAddress; //destinationaddress
volatile double sendInterval@unit(s)= default(exponential(1s));
//timebetweengeneratingpackets
volatile int packetLength@unit(byte)= default(100B);
//lengthofonepacket
volatile int timeToLive= default(32);
//maximumnumberofnetworkhopstosurvive
gates:
input in;
output out;
}
Assigning a Value
Another example
 * matches any index
 .. matches ranges
 If number of individual hosts instead of a sub module vector, network definition can be like this:
Example:
Gates
 Connection points of Module
 OMNeT++ has three types of gates
o Input, output and inout
Example 1:
Example 2:
Example 3:
 Gates around the edges of the grid are expected to remain unconnected, hence the @loose
annotation used.
Sub Modules
 Modules that a compound module is composed of are called its sub modules.
 A sub module has a name, and it is an instance of a compound or simple module type.
Example:
Connections
 Connections are defined in connections section in compound module
Inheritance
 In NED, a type may only extend an element of the same component type
 A simple module may only extend a simple module, compound module may only extend a
compound module, and so on.
 Single inheritance is supported for modules and channels
 Multiple inheritance is supported for module interfaces and channel interfaces
 Inheritance may:
o Add new properties, parameters, gates, inner types, sub modules, connections, as long
as names do not conflict with inherited names
o Modify inherited properties, and properties of inherited parameters and gates
Packages
 Group together similar modules
 Reduces name conflicts
 Before use the class, must reference the package
Create First Simulation Project using OMNeT++
Step 1: Create a OMNeT++ Project
Go to File -> New -> OMNeT++ Project
Step 2: Type project Name
Type project Name (ex. FirstSim) in Project Name text box
Step 3: Add Initial Contents
Here I add Empty project
Step 4: Choose C++ Project Type
Here we choose OMNeT++ simulation
Step 5: Select Configuration
Step 6: Create NED File
File -> New -> Network Description file (NED)
Step 7: Select Project for the NED file
Step 8: Choose initial content for NED file
Step 9: Click finish
Step 10: Modify and add the code below to source of ned file
//
// TODO documentation
//
simple computer
{
gates:
input in;
output out;
}
//
// TODO documentation
//
network net
{
@display("bgb=340,233");
submodules:
computer1: computer {
@display("p=63,55");
}
computer2: computer {
@display("p=260,55");
}
connections:
computer1.out --> computer2.in;
computer2.out --> computer1.in;
}
Step 11: Modify the source of Package.ned
//package firstsim;
//
//@license(LGPL);
@license(omnetpp);
Step 12: Create Initialization File (ini)
Step 13: Choose project for ini file
Step 14: Choose initial content for ini file
Step 15: Choose ned file for ini file
Step 16: Click finish
Step 17: Create a C++ source file
File->New->Source File
Step 18: Type name of the C++ File (example: computer.cc)
Step 19: Modify the computer.cc
/*
* computer.cc
*
* Created on: Aug 25, 2015
* Author: mahedee
*/
#include<string.h>
#include<omnetpp.h>
/*computer is a simple module. A simple module is nothing more than a C++ class which
has to be
sub classed from cSimpleModule,with one or more virtual member functions redefined to
define its behavior.*/
class computer : public cSimpleModule
{
protected:
virtual void initialize();
virtual void handleMessage(cMessage *msg);
};
/* The class has to be registered with OMNeT++ via the Define_Module() macro.The
Define_Module() line
should always be put into .cc or .cpp file and not header file (.h), because the
compiler generates code from it. */
Define_Module(computer);
void computer :: initialize()
{
if(strcmp("computer1",getName())==0)
{
cMessage *msg = new cMessage("checkMsg");
send(msg,"out");
}
}
void computer::handleMessage(cMessage *msg)
{
send(msg,"out");
}
Now build the project, if it succeed then run the project. Mission complete..
References
1. OMNeT++ User Manual – Version 4.4
2. OMNeT++ User Guide – Version 4.4
3. OMNeT++ Video Tutorial
4. Stack Overflow
5. A Quick Overview of OMNeT++ IDE
History Card
Version Description Update Date Published Date
1 Draft Preparation 14 Aug 2015
2

More Related Content

What's hot

Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMAC
Krishna Gehlot
 
Arp and rarp
Arp and rarpArp and rarp
Simple Mail Transfer Protocol
Simple Mail Transfer ProtocolSimple Mail Transfer Protocol
Simple Mail Transfer Protocol
Rajan Pandey
 
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
Qualcomm
 
Smtp
SmtpSmtp
Smtp
Eri Alam
 
Conceptos y Protocolos de Enrutamiento (Capitulo 9)
Conceptos y Protocolos de Enrutamiento (Capitulo 9)Conceptos y Protocolos de Enrutamiento (Capitulo 9)
Conceptos y Protocolos de Enrutamiento (Capitulo 9)
Cristiān Villegās
 
BAIT1103 Chapter 6
BAIT1103 Chapter 6BAIT1103 Chapter 6
BAIT1103 Chapter 6
limsh
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
JUW Jinnah University for Women
 
Cisco Packet Tracer Overview
Cisco Packet Tracer OverviewCisco Packet Tracer Overview
Cisco Packet Tracer Overview
Ali Usman
 
Snmp
SnmpSnmp
Firewall Design and Implementation
Firewall Design and ImplementationFirewall Design and Implementation
Firewall Design and Implementation
ajeet singh
 
Authentication methods
Authentication methodsAuthentication methods
Authentication methods
sana mateen
 
Network Security Issues
Network Security IssuesNetwork Security Issues
Network Security Issues
AfreenYousaf
 
An Introduction to OMNeT++ 5.4
An Introduction to OMNeT++ 5.4An Introduction to OMNeT++ 5.4
An Introduction to OMNeT++ 5.4
Alpen-Adria-Universität
 
IP based standards for IoT
IP based standards for IoTIP based standards for IoT
IP based standards for IoT
Michael Koster
 
X.509 Certificates
X.509 CertificatesX.509 Certificates
X.509 Certificates
Sou Jana
 
Ai lab manual
Ai lab manualAi lab manual
Ai lab manual
Shipra Swati
 
IPv4 Addressing
 IPv4 Addressing   IPv4 Addressing
IPv4 Addressing
TheGodfather HA
 
Domain name system
Domain name systemDomain name system
Domain name system
Siddique Ibrahim
 
CCNAv5 - S4: Chapter2 Connecting To The Wan
CCNAv5 - S4: Chapter2 Connecting To The WanCCNAv5 - S4: Chapter2 Connecting To The Wan
CCNAv5 - S4: Chapter2 Connecting To The Wan
Vuz Dở Hơi
 

What's hot (20)

Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMAC
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
 
Simple Mail Transfer Protocol
Simple Mail Transfer ProtocolSimple Mail Transfer Protocol
Simple Mail Transfer Protocol
 
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
 
Smtp
SmtpSmtp
Smtp
 
Conceptos y Protocolos de Enrutamiento (Capitulo 9)
Conceptos y Protocolos de Enrutamiento (Capitulo 9)Conceptos y Protocolos de Enrutamiento (Capitulo 9)
Conceptos y Protocolos de Enrutamiento (Capitulo 9)
 
BAIT1103 Chapter 6
BAIT1103 Chapter 6BAIT1103 Chapter 6
BAIT1103 Chapter 6
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
 
Cisco Packet Tracer Overview
Cisco Packet Tracer OverviewCisco Packet Tracer Overview
Cisco Packet Tracer Overview
 
Snmp
SnmpSnmp
Snmp
 
Firewall Design and Implementation
Firewall Design and ImplementationFirewall Design and Implementation
Firewall Design and Implementation
 
Authentication methods
Authentication methodsAuthentication methods
Authentication methods
 
Network Security Issues
Network Security IssuesNetwork Security Issues
Network Security Issues
 
An Introduction to OMNeT++ 5.4
An Introduction to OMNeT++ 5.4An Introduction to OMNeT++ 5.4
An Introduction to OMNeT++ 5.4
 
IP based standards for IoT
IP based standards for IoTIP based standards for IoT
IP based standards for IoT
 
X.509 Certificates
X.509 CertificatesX.509 Certificates
X.509 Certificates
 
Ai lab manual
Ai lab manualAi lab manual
Ai lab manual
 
IPv4 Addressing
 IPv4 Addressing   IPv4 Addressing
IPv4 Addressing
 
Domain name system
Domain name systemDomain name system
Domain name system
 
CCNAv5 - S4: Chapter2 Connecting To The Wan
CCNAv5 - S4: Chapter2 Connecting To The WanCCNAv5 - S4: Chapter2 Connecting To The Wan
CCNAv5 - S4: Chapter2 Connecting To The Wan
 

Viewers also liked

Introduction to om ne t++
Introduction to om ne t++Introduction to om ne t++
Introduction to om ne t++
Shivang Bajaniya
 
IWSN with OMNET++ Simulation
IWSN with OMNET++ SimulationIWSN with OMNET++ Simulation
IWSN with OMNET++ Simulation
@zenafaris91
 
Omnet++
Omnet++Omnet++
Omnet++
Ahmed Nour
 
Simulation using OMNet++
Simulation using OMNet++Simulation using OMNet++
Simulation using OMNet++
jeromy fu
 
Tutorial 5 adding more nodes
Tutorial 5   adding more nodes Tutorial 5   adding more nodes
Tutorial 5 adding more nodes
Mohd Batati
 
Tutorial 6 queues & arrays & results recording
Tutorial 6   queues & arrays & results recording Tutorial 6   queues & arrays & results recording
Tutorial 6 queues & arrays & results recording
Mohd Batati
 
Tutorial 4 adding some details
Tutorial 4   adding some details Tutorial 4   adding some details
Tutorial 4 adding some details
Mohd Batati
 
Tutorial 1 installing mixim and mixnet
Tutorial 1   installing mixim and mixnetTutorial 1   installing mixim and mixnet
Tutorial 1 installing mixim and mixnet
Mohd Batati
 
Using Omnet++ in Simulating Ad-Hoc Network
Using Omnet++ in Simulating Ad-Hoc Network Using Omnet++ in Simulating Ad-Hoc Network
Using Omnet++ in Simulating Ad-Hoc Network
Ahmed Nour
 
Tutorial 3 getting started with omnet
Tutorial 3   getting started with omnetTutorial 3   getting started with omnet
Tutorial 3 getting started with omnet
Mohd Batati
 
Feature and Future of ASP.NET
Feature and Future of ASP.NETFeature and Future of ASP.NET
Feature and Future of ASP.NET
Md. Mahedee Hasan
 
C#.net applied OOP - Batch 3
C#.net applied OOP - Batch 3C#.net applied OOP - Batch 3
C#.net applied OOP - Batch 3
Md. Mahedee Hasan
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
Md. Mahedee Hasan
 
Oop principles
Oop principlesOop principles
Oop principles
Md. Mahedee Hasan
 
C# - Part 1
C# - Part 1C# - Part 1
C# - Part 1
Md. Mahedee Hasan
 
The world of enterprise solution development with asp.net and C#
The world of enterprise solution development with asp.net and C#The world of enterprise solution development with asp.net and C#
The world of enterprise solution development with asp.net and C#
Md. Mahedee Hasan
 
MS SQL Server
MS SQL ServerMS SQL Server
MS SQL Server
Md. Mahedee Hasan
 
Introduction to TFS 2013
Introduction to TFS 2013Introduction to TFS 2013
Introduction to TFS 2013
Md. Mahedee Hasan
 
Generic repository pattern with ASP.NET MVC and Entity Framework
Generic repository pattern with ASP.NET MVC and Entity FrameworkGeneric repository pattern with ASP.NET MVC and Entity Framework
Generic repository pattern with ASP.NET MVC and Entity Framework
Md. Mahedee Hasan
 
Om net++
Om net++Om net++
Om net++
prisonbreak4950
 

Viewers also liked (20)

Introduction to om ne t++
Introduction to om ne t++Introduction to om ne t++
Introduction to om ne t++
 
IWSN with OMNET++ Simulation
IWSN with OMNET++ SimulationIWSN with OMNET++ Simulation
IWSN with OMNET++ Simulation
 
Omnet++
Omnet++Omnet++
Omnet++
 
Simulation using OMNet++
Simulation using OMNet++Simulation using OMNet++
Simulation using OMNet++
 
Tutorial 5 adding more nodes
Tutorial 5   adding more nodes Tutorial 5   adding more nodes
Tutorial 5 adding more nodes
 
Tutorial 6 queues & arrays & results recording
Tutorial 6   queues & arrays & results recording Tutorial 6   queues & arrays & results recording
Tutorial 6 queues & arrays & results recording
 
Tutorial 4 adding some details
Tutorial 4   adding some details Tutorial 4   adding some details
Tutorial 4 adding some details
 
Tutorial 1 installing mixim and mixnet
Tutorial 1   installing mixim and mixnetTutorial 1   installing mixim and mixnet
Tutorial 1 installing mixim and mixnet
 
Using Omnet++ in Simulating Ad-Hoc Network
Using Omnet++ in Simulating Ad-Hoc Network Using Omnet++ in Simulating Ad-Hoc Network
Using Omnet++ in Simulating Ad-Hoc Network
 
Tutorial 3 getting started with omnet
Tutorial 3   getting started with omnetTutorial 3   getting started with omnet
Tutorial 3 getting started with omnet
 
Feature and Future of ASP.NET
Feature and Future of ASP.NETFeature and Future of ASP.NET
Feature and Future of ASP.NET
 
C#.net applied OOP - Batch 3
C#.net applied OOP - Batch 3C#.net applied OOP - Batch 3
C#.net applied OOP - Batch 3
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Oop principles
Oop principlesOop principles
Oop principles
 
C# - Part 1
C# - Part 1C# - Part 1
C# - Part 1
 
The world of enterprise solution development with asp.net and C#
The world of enterprise solution development with asp.net and C#The world of enterprise solution development with asp.net and C#
The world of enterprise solution development with asp.net and C#
 
MS SQL Server
MS SQL ServerMS SQL Server
MS SQL Server
 
Introduction to TFS 2013
Introduction to TFS 2013Introduction to TFS 2013
Introduction to TFS 2013
 
Generic repository pattern with ASP.NET MVC and Entity Framework
Generic repository pattern with ASP.NET MVC and Entity FrameworkGeneric repository pattern with ASP.NET MVC and Entity Framework
Generic repository pattern with ASP.NET MVC and Entity Framework
 
Om net++
Om net++Om net++
Om net++
 

Similar to Introduction to OMNeT++

An Introduction to OMNeT++ 6.0
An Introduction to OMNeT++ 6.0An Introduction to OMNeT++ 6.0
An Introduction to OMNeT++ 6.0
Alpen-Adria-Universität
 
Computer Networks Omnet
Computer Networks OmnetComputer Networks Omnet
Computer Networks Omnet
Shivam Maheshwari
 
An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1
Alpen-Adria-Universität
 
Presentation on Behavioral Synthesis & SystemC
Presentation on Behavioral Synthesis & SystemCPresentation on Behavioral Synthesis & SystemC
Presentation on Behavioral Synthesis & SystemC
Mukit Ahmed Chowdhury
 
6. TinyOS_2.pdf
6. TinyOS_2.pdf6. TinyOS_2.pdf
6. TinyOS_2.pdf
Jesus Cordero
 
COinS (eng version)
COinS (eng version)COinS (eng version)
COinS (eng version)
Milan Janíček
 
2nd sem
2nd sem2nd sem
2nd sem
nastysuman009
 
2nd sem
2nd sem2nd sem
2nd sem
nastysuman009
 
Composite Message Pattern
Composite Message PatternComposite Message Pattern
Composite Message Pattern
YoungSu Son
 
WiMAX implementation in ns3
WiMAX implementation in ns3WiMAX implementation in ns3
WiMAX implementation in ns3
Mustafa Khaleel
 
Go faster with_native_compilation Part-2
Go faster with_native_compilation Part-2Go faster with_native_compilation Part-2
Go faster with_native_compilation Part-2
Rajeev Rastogi (KRR)
 
Go Faster With Native Compilation
Go Faster With Native CompilationGo Faster With Native Compilation
Go Faster With Native Compilation
PGConf APAC
 
Splunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the messageSplunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the message
Damien Dallimore
 
Metrics ekon 14_2_kleiner
Metrics ekon 14_2_kleinerMetrics ekon 14_2_kleiner
Metrics ekon 14_2_kleiner
Max Kleiner
 
EKON 23 Code_review_checklist
EKON 23 Code_review_checklistEKON 23 Code_review_checklist
EKON 23 Code_review_checklist
Max Kleiner
 
The Ring programming language version 1.8 book - Part 95 of 202
The Ring programming language version 1.8 book - Part 95 of 202The Ring programming language version 1.8 book - Part 95 of 202
The Ring programming language version 1.8 book - Part 95 of 202
Mahmoud Samir Fayed
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
Mohamed Abdallah
 
M sc in reliable embedded systems
M sc in reliable embedded systemsM sc in reliable embedded systems
M sc in reliable embedded systems
vtsplgroup
 
Summarizing Software API Usage Examples Using Clustering Techniques
Summarizing Software API Usage Examples Using Clustering TechniquesSummarizing Software API Usage Examples Using Clustering Techniques
Summarizing Software API Usage Examples Using Clustering Techniques
Nikos Katirtzis
 
embeddedc-lecture1-160404055102.pptx
embeddedc-lecture1-160404055102.pptxembeddedc-lecture1-160404055102.pptx
embeddedc-lecture1-160404055102.pptx
sangeetaSS
 

Similar to Introduction to OMNeT++ (20)

An Introduction to OMNeT++ 6.0
An Introduction to OMNeT++ 6.0An Introduction to OMNeT++ 6.0
An Introduction to OMNeT++ 6.0
 
Computer Networks Omnet
Computer Networks OmnetComputer Networks Omnet
Computer Networks Omnet
 
An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1
 
Presentation on Behavioral Synthesis & SystemC
Presentation on Behavioral Synthesis & SystemCPresentation on Behavioral Synthesis & SystemC
Presentation on Behavioral Synthesis & SystemC
 
6. TinyOS_2.pdf
6. TinyOS_2.pdf6. TinyOS_2.pdf
6. TinyOS_2.pdf
 
COinS (eng version)
COinS (eng version)COinS (eng version)
COinS (eng version)
 
2nd sem
2nd sem2nd sem
2nd sem
 
2nd sem
2nd sem2nd sem
2nd sem
 
Composite Message Pattern
Composite Message PatternComposite Message Pattern
Composite Message Pattern
 
WiMAX implementation in ns3
WiMAX implementation in ns3WiMAX implementation in ns3
WiMAX implementation in ns3
 
Go faster with_native_compilation Part-2
Go faster with_native_compilation Part-2Go faster with_native_compilation Part-2
Go faster with_native_compilation Part-2
 
Go Faster With Native Compilation
Go Faster With Native CompilationGo Faster With Native Compilation
Go Faster With Native Compilation
 
Splunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the messageSplunk Conf 2014 - Getting the message
Splunk Conf 2014 - Getting the message
 
Metrics ekon 14_2_kleiner
Metrics ekon 14_2_kleinerMetrics ekon 14_2_kleiner
Metrics ekon 14_2_kleiner
 
EKON 23 Code_review_checklist
EKON 23 Code_review_checklistEKON 23 Code_review_checklist
EKON 23 Code_review_checklist
 
The Ring programming language version 1.8 book - Part 95 of 202
The Ring programming language version 1.8 book - Part 95 of 202The Ring programming language version 1.8 book - Part 95 of 202
The Ring programming language version 1.8 book - Part 95 of 202
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
 
M sc in reliable embedded systems
M sc in reliable embedded systemsM sc in reliable embedded systems
M sc in reliable embedded systems
 
Summarizing Software API Usage Examples Using Clustering Techniques
Summarizing Software API Usage Examples Using Clustering TechniquesSummarizing Software API Usage Examples Using Clustering Techniques
Summarizing Software API Usage Examples Using Clustering Techniques
 
embeddedc-lecture1-160404055102.pptx
embeddedc-lecture1-160404055102.pptxembeddedc-lecture1-160404055102.pptx
embeddedc-lecture1-160404055102.pptx
 

More from Md. Mahedee Hasan

Azure Machine Learning
Azure Machine LearningAzure Machine Learning
Azure Machine Learning
Md. Mahedee Hasan
 
Chatbot development with Microsoft Bot Framework and LUIS
Chatbot development with Microsoft Bot Framework and LUISChatbot development with Microsoft Bot Framework and LUIS
Chatbot development with Microsoft Bot Framework and LUIS
Md. Mahedee Hasan
 
Chatbot development with Microsoft Bot Framework
Chatbot development with Microsoft Bot FrameworkChatbot development with Microsoft Bot Framework
Chatbot development with Microsoft Bot Framework
Md. Mahedee Hasan
 
ASP.NET MVC Zero to Hero
ASP.NET MVC Zero to HeroASP.NET MVC Zero to Hero
ASP.NET MVC Zero to Hero
Md. Mahedee Hasan
 
Introduction to Windows 10 IoT Core
Introduction to Windows 10 IoT CoreIntroduction to Windows 10 IoT Core
Introduction to Windows 10 IoT Core
Md. Mahedee Hasan
 
Whats new in visual studio 2017
Whats new in visual studio 2017Whats new in visual studio 2017
Whats new in visual studio 2017
Md. Mahedee Hasan
 
Increasing productivity using visual studio 2017
Increasing productivity using visual studio 2017Increasing productivity using visual studio 2017
Increasing productivity using visual studio 2017
Md. Mahedee Hasan
 
Exciting features in visual studio 2017
Exciting features in visual studio 2017Exciting features in visual studio 2017
Exciting features in visual studio 2017
Md. Mahedee Hasan
 
Generic Repository Pattern with ASP.NET MVC and EF
Generic Repository Pattern with ASP.NET MVC and EFGeneric Repository Pattern with ASP.NET MVC and EF
Generic Repository Pattern with ASP.NET MVC and EF
Md. Mahedee Hasan
 
ASP.NET Web form
ASP.NET Web formASP.NET Web form
ASP.NET Web form
Md. Mahedee Hasan
 

More from Md. Mahedee Hasan (10)

Azure Machine Learning
Azure Machine LearningAzure Machine Learning
Azure Machine Learning
 
Chatbot development with Microsoft Bot Framework and LUIS
Chatbot development with Microsoft Bot Framework and LUISChatbot development with Microsoft Bot Framework and LUIS
Chatbot development with Microsoft Bot Framework and LUIS
 
Chatbot development with Microsoft Bot Framework
Chatbot development with Microsoft Bot FrameworkChatbot development with Microsoft Bot Framework
Chatbot development with Microsoft Bot Framework
 
ASP.NET MVC Zero to Hero
ASP.NET MVC Zero to HeroASP.NET MVC Zero to Hero
ASP.NET MVC Zero to Hero
 
Introduction to Windows 10 IoT Core
Introduction to Windows 10 IoT CoreIntroduction to Windows 10 IoT Core
Introduction to Windows 10 IoT Core
 
Whats new in visual studio 2017
Whats new in visual studio 2017Whats new in visual studio 2017
Whats new in visual studio 2017
 
Increasing productivity using visual studio 2017
Increasing productivity using visual studio 2017Increasing productivity using visual studio 2017
Increasing productivity using visual studio 2017
 
Exciting features in visual studio 2017
Exciting features in visual studio 2017Exciting features in visual studio 2017
Exciting features in visual studio 2017
 
Generic Repository Pattern with ASP.NET MVC and EF
Generic Repository Pattern with ASP.NET MVC and EFGeneric Repository Pattern with ASP.NET MVC and EF
Generic Repository Pattern with ASP.NET MVC and EF
 
ASP.NET Web form
ASP.NET Web formASP.NET Web form
ASP.NET Web form
 

Recently uploaded

CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapitolTechU
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
ImMuslim
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
Nguyen Thanh Tu Collection
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
Celine George
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
David Douglas School District
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
danielkiash986
 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
OH TEIK BIN
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
Payaamvohra1
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
nitinpv4ai
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 

Recently uploaded (20)

CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 

Introduction to OMNeT++

  • 1. Introduction to OMNet++ Prepared by Md. Mahedee Hasan M.Sc Engg. IICT, BUET Web: http://mahedee.net Reviewed by Amit Karmaker Md. Abir Hossain M.Sc Engg. IICT, BUET Supervised by Dr. Mohammad Shah Alam Assistant Professor IICT, BUET Contents What is OMNeT++?.......................................................................................................................................2 Modeling concepts........................................................................................................................................2 Module..........................................................................................................................................................3 Message, gets and links ................................................................................................................................3 Parameters....................................................................................................................................................3 Classes that are part of simulation class library ...........................................................................................4 OMNeT++ Consists of....................................................................................................................................4 How OMNeT++ Works? ................................................................................................................................4 NED Features ................................................................................................................................................5 The Network .................................................................................................................................................5 .ini (Initialization) Files..................................................................................................................................6 .cc (C++) Files.................................................................................................................................................7 Channel .........................................................................................................................................................7 Simple and Compound Module ....................................................................................................................8
  • 2. Simple Module............................................................................................................................................10 Compound Modules ...................................................................................................................................11 Channels......................................................................................................................................................12 Parameter ...................................................................................................................................................12 Gates...........................................................................................................................................................14 Sub Modules ...............................................................................................................................................15 Connections ................................................................................................................................................16 Inheritance..................................................................................................................................................16 Packages......................................................................................................................................................16 Create First Simulation Project using OMNeT++ ........................................................................................17 References ..................................................................................................................................................26 History Card ................................................................................................................................................26 What is OMNeT++?  OMNeT++ is a Simulator  For discrete event network  It is object oriented and modular  Used to simulate o Modeling of wired and wireless communication networks o Protocol modeling o Modeling of queuing networks etc.  Modules are connected using gates to form compound module o In other system sometimes gates are called port Modeling concepts  Modules are communicate with message passing  Active modules are called simple modules  Message are sent through output gates and receive through input gates  Input and output gates are linked through connection  Parameters such as propagation delay, data rate and bit error rate, can be assigned to connections
  • 3. Fig – simple and compound module Module  In hierarchical module, the top level module is system module  System module contains sub modules  Sub modules contains sub modules themselves  Both simple and compound modules are instance of module type Message, gets and links  Module communicate by exchanging message  Message can represent frames or packets  Gates are the input and output interface of modules  Two sub modules can be connected by links with gates  Links = connections  Connections support the following parameter o Data rate, propagation delay, bit error rate, packet error rate Parameters  Modules parameters can be assigned o in either the NED files or o the configuration file omnetpp.ini.  Parameter can take string, numeric or Boolean data values or can contains XML data trees
  • 4. Classes that are part of simulation class library The following classes are the part of simulation class library  Module, gates, parameter, channel  Message, packet  Container class (e.g. queue and array)  Data collection classes  Statistics and distribution estimated classes  Transition and result accuracy detection classes. OMNeT++ Consists of  NED language topology description(s)(.ned files)  Message definitions (.msg files)  Simple module sources. They are C++ files, with .h/.cc suffix. How OMNeT++ Works?  When Program started o Read all NED files containing model topology o Then it reads a configuration file(usually called omnetpp.ini)  Output is written in result file  Graph is generated from result file using Matlab, Phython etc
  • 5. NED Features NED has several features which makes it scale well to large project  Hierarchical  Component-based  Interfaces  Inheritance  Packages  Metadata annotation The Network  Network consists of o Nodes o Gates and o Connections Fig: The network
  • 6. network Network { submodules: node1 : Node; node2 : Node; node3 : Node; ……………………… connections: node1.port++<-->{datarate=100Mbps;}<-->node2.port++; node2.port++<-->{datarate=100Mbps;}<-->node3.port++; node3.port++<-->{datarate=100Mbps;}<-->node1.port++; ……………………… }  The double arrow means bi-directional connection  The connection points of the modules are called gates  The port++ notation adds a new gate to the port[] gate vector  Nodes are connected with a channel  Specify the network option in to the configuration like below [General] network = Network .ini (Initialization) Files  Defines the network initialization point with/without some parameters [General] network = TicToc1
  • 7. .cc (C++) Files  Contains class definition and function for modules. #include <string.h> #include <omnetpp.h> class Txc1 : public cSimpleModule { protected: virtual void initialize(); virtual void handleMessage(cMessage *msg); }; Define_Module(Txc1); void Txc1::initialize() { // Am I Tic or Toc? if (strcmp("tic", getName()) == 0) { cMessage *msg = new cMessage("tictocMsg"); send(msg, "out"); } } void Txc1::handleMessage(cMessage *msg) { send(msg, "out"); } Channel  Predefined Channel type o IdealChannel o DelayChannel  delay (double with s, ms, us)  diabled (boolean) o DatarateChannel  delay (double with s, ms, us)  disabled (boolean)  datarate (double with unit as bps, kbps, Mbps, Gbps)  ber (double bit error rate [0,1])  per (double packet error rate [0,1])  One can create new channel type
  • 8. network net { @display("bgb=340,233"); types: channel customChannel extends ned.DatarateChannel{ datarate=100Mbps; } submodules: computer1: computer { @display("p=63,55"); } computer2: computer { @display("p=260,55"); } connections: computer1.out -->customChannel--> computer2.in; computer2.out -->customChannel--> computer1.in; } Simple and Compound Module  Simple module is a basic building block  Denoted by simple keyword simple App { parameters: int destAddress; ... @display("i=block/browser"); gates: input in; output out; } simple Routing { ... } simple Queue { ... }  Convention : Module name should be Pascal case  Simple module combines into compound module
  • 9. simple App { parameters: int destAddress; @display("i=block/browser"); gates: input in; output out; } simple Routing { gates: input localIn; output localOut; } simple Queue { gates: input in; output out; } module Node { parameters: int address; @display("i=misc/node_vs,gold"); gates: inout port[]; submodules: app: App; routing: Routing; queue[sizeof(port)]: Queue; connections: routing.localOut --> app.in; routing.localIn <-- app.out; for i=0..sizeof(port)-1 { routing.out[i] --> queue[i].in; routing.in[i] <-- queue[i].out; queue[i].line <--> port[i]; } }
  • 10. Fig – The node compound module  When simulation program started its load NED file first.  Then it load corresponding simple module written in C++ such as App, Queue Simple Module  Simple module is the active component defined by simple keyword simple Queue { parameters: int capacity; @display("i=block/queue"); gates: input in; output out; }  Parameters and gates sections are optional here  Parameters keywords is optional too, parameters can be defined without parameters keyword  One can explicitly specify the C++ class with the @class property simple Queue { parameters: int capacity; @class(mylib::Queue); @display("i=block/queue"); gates: input in; output out; }
  • 11.  The C++ classes will be mylib::App, mylib::Router and mylib::Queue @namespace(mylib); simple App{ ... } simple Router{ ... } simple Queue{ ... } Compound Modules  Groups other modules into a larger unit  A compound modules may have gates and parameters like simple module but not active  A compound modules may have several sections all of them optional module Host { types: ... parameters: ... gates: ... submodules: ... connections: ... }  Modules contains in compound module are called sub module – are in sub module section  Compound module may be inherited via sub classing module WirelessHost extends WirelessHostBase { submodules: webAgent:WebAgent; connections: webAgent.tcpOut-->tcp.appIn++; webAgent.tcpIn<--tcp.appOut++; } module DesktopHost extends WirelessHost { gates: inout ethg; submodules:
  • 12. eth:EthernetNic; connections: ip.nicOut++-->eth.ipIn; ip.nicIn++<--eth.ipOut; eth.phy<-->ethg; } Channels  Channels are connections between nodes  Predefined channel types are: ned.IdealChannel, ned.DelayChannel and ned.DatarateChannel  Can use import ned.* channel Ethernet100 extends ned.DatarateChannel { datarate = 100Mbps; delay = 100us; ber = 1e-10; } Or channel DatarateChannel2 extends ned.DatarateChannel { double distance @unit(m); // @unit is a property delay = this.distance/200000km * 1s; } Parameter  Parameters are variables that belong to a module.  Parameters can be used in building the topology (number of nodes, etc)  To supply input to C++ code that implements simple modules and channels  For the numeric types, a unit of measurement can also be specified (@unit property), to increase type safety.  Parameters can get their values from NED files or from the configuration(Omnetpp.ini)
  • 13. simple App { parameters: string protocol; //protocoltouse:"UDP"/"IP"/"ICMP"/... int destAddress; //destinationaddress volatile double sendInterval@unit(s)= default(exponential(1s)); //timebetweengeneratingpackets volatile int packetLength@unit(byte)= default(100B); //lengthofonepacket volatile int timeToLive= default(32); //maximumnumberofnetworkhopstosurvive gates: input in; output out; } Assigning a Value Another example  * matches any index  .. matches ranges  If number of individual hosts instead of a sub module vector, network definition can be like this:
  • 14. Example: Gates  Connection points of Module  OMNeT++ has three types of gates o Input, output and inout Example 1:
  • 15. Example 2: Example 3:  Gates around the edges of the grid are expected to remain unconnected, hence the @loose annotation used. Sub Modules  Modules that a compound module is composed of are called its sub modules.  A sub module has a name, and it is an instance of a compound or simple module type. Example:
  • 16. Connections  Connections are defined in connections section in compound module Inheritance  In NED, a type may only extend an element of the same component type  A simple module may only extend a simple module, compound module may only extend a compound module, and so on.  Single inheritance is supported for modules and channels  Multiple inheritance is supported for module interfaces and channel interfaces  Inheritance may: o Add new properties, parameters, gates, inner types, sub modules, connections, as long as names do not conflict with inherited names o Modify inherited properties, and properties of inherited parameters and gates Packages  Group together similar modules  Reduces name conflicts  Before use the class, must reference the package
  • 17. Create First Simulation Project using OMNeT++ Step 1: Create a OMNeT++ Project Go to File -> New -> OMNeT++ Project Step 2: Type project Name Type project Name (ex. FirstSim) in Project Name text box
  • 18. Step 3: Add Initial Contents Here I add Empty project Step 4: Choose C++ Project Type Here we choose OMNeT++ simulation
  • 19. Step 5: Select Configuration Step 6: Create NED File File -> New -> Network Description file (NED)
  • 20. Step 7: Select Project for the NED file Step 8: Choose initial content for NED file
  • 21. Step 9: Click finish Step 10: Modify and add the code below to source of ned file // // TODO documentation // simple computer { gates: input in; output out; } // // TODO documentation // network net { @display("bgb=340,233"); submodules: computer1: computer { @display("p=63,55"); } computer2: computer { @display("p=260,55"); } connections: computer1.out --> computer2.in; computer2.out --> computer1.in; } Step 11: Modify the source of Package.ned //package firstsim; // //@license(LGPL); @license(omnetpp);
  • 22. Step 12: Create Initialization File (ini) Step 13: Choose project for ini file
  • 23. Step 14: Choose initial content for ini file Step 15: Choose ned file for ini file
  • 24. Step 16: Click finish Step 17: Create a C++ source file File->New->Source File Step 18: Type name of the C++ File (example: computer.cc)
  • 25. Step 19: Modify the computer.cc /* * computer.cc * * Created on: Aug 25, 2015 * Author: mahedee */ #include<string.h> #include<omnetpp.h> /*computer is a simple module. A simple module is nothing more than a C++ class which has to be sub classed from cSimpleModule,with one or more virtual member functions redefined to define its behavior.*/ class computer : public cSimpleModule { protected: virtual void initialize(); virtual void handleMessage(cMessage *msg); }; /* The class has to be registered with OMNeT++ via the Define_Module() macro.The Define_Module() line should always be put into .cc or .cpp file and not header file (.h), because the compiler generates code from it. */ Define_Module(computer); void computer :: initialize() { if(strcmp("computer1",getName())==0) { cMessage *msg = new cMessage("checkMsg"); send(msg,"out"); } } void computer::handleMessage(cMessage *msg) { send(msg,"out"); } Now build the project, if it succeed then run the project. Mission complete..
  • 26. References 1. OMNeT++ User Manual – Version 4.4 2. OMNeT++ User Guide – Version 4.4 3. OMNeT++ Video Tutorial 4. Stack Overflow 5. A Quick Overview of OMNeT++ IDE History Card Version Description Update Date Published Date 1 Draft Preparation 14 Aug 2015 2