Network Simulation with OMNet++
Simon Bachmeier, Benedikt Jaeger∗ , Kilian Holzinger∗
∗ Chairof Network Architectures and Services, Department of Informatics
Technical University of Munich, Germany
Email:
[email protected],
[email protected],
[email protected]Abstract— overview. OMNeT++’s approach to simulation is quite
In view of the current development, computer networks different from other simulators like NS-3 [7] or JiST [8].
are increasing in size and complexity. For development OMNeT++ does not provide simulation components di-
reasons simulations became more important in this area. rectly, but gives a framework, which can be seen as a
OMNeT++ is a discrete event simulation environment. It basic building block. It also differs in its modularity,
was available and present for over 20 years and designed components can be reused in all kinds of simulations.
not as a network simulator, but for all-purpose use. This In Chapter 3 there are examples and an explanation of
results in its area of application being not only in computer extensions for OMNeT++, so called frameworks, related
science fields. Over the years OMNeT++ has built a revenue to network simulations. These frameworks, e.g. INET [9]
for being able to simulate all kinds of areas. From queuing or MiXim [10] are developed independently and follow
to wireless networks simulation, everything is possible. In their own update cycles. Over the years a many simulation
this paper the OMNeT++ framework is presented with a models, have been developed in a broad field, e.g. IPv6-
detailed view into network simulation. Also, OMNeT++ is , peer-to-peer-, storage area-, and optical networks. Also
compared to other popular network simulators, where its companies like IBM, Intel and Cisco are using OMNeT++
strengths and weaknesses are discussed. successfully in commercial projects or for in-house re-
search [5]. In this paper the author gives an overview of
Index Terms—OMNet++, Network Simulation, NS-3, INET, OMNeT++, in order to understand why it was able to
MiXiM remain and be popular over all those years since existing.
Therefore, it is important to understand how it works and
1. Introduction what makes it different from its competitors.
The papers’s structure is divided into to the following
The Internet backbone changed from a connection sections: Section 2 gives an overview of OMNeT++, to
between research communitys to commercial use. This provide a basic understanding. How network simulation is
means already after eight and a half years of its lifetime, done, is shown in Section 3. Finally, Section 4, compares
it developed from six nodes with 56 kbps links to 21 OMNeT++ to other simulators in its class.
nodes with multiple 45 Mbps links. During the early
stages, the Internet already grew to over 50,000 networks, 2. Structure of OMNeT++
including outer space and all continents [1]. 2016 the
LTE networks nearly had 1.5 billion users with peak data
OMNeT++ is a multipurpose network simulation
rates of 450 Mbps [2]. The number of deployed devices
framework. It provides a building kit for many kinds of
using the Internet by 2020 has been estimated to be as
simulations. At its core are reusable modules, which is
high as 20.8 billion [3]. These numbers show that it is
the reason why OMNeT++ is considered a component
crucial that networks are functioning without errors. For
architecture. The structure can be compared to LEGO
development reasons testing is needed when working with
blocks [11], which is a good illustration. When there
networks. Testing with real networks can be very expen-
are well implemented modules, they can be reused in
sive and does not scale, therefore network simulations
various ways in all kinds of simulations, just like LEGO
became very popular. Much hardware is needed for an
blocks. The following sections describe the functionality
experiment. The size of the current networks makes it
of OMNeT++’s internal and external structure.
hard to build a real simulation. A simulation breaks down
the functionality of a network and is able to build large
networks. A simulator capable of such is OMNeT++. 2.1. Modeling and Modules
OMNeT++ stands for Objective Modular Network Test
bed in C++ [4]. It was introduced in 1997 [5] and is a C++ OMNeT++’s architecture is built of modules commu-
based discrete event simulator. OMNeT++ software is free nicating by messages. There are two types of modules,
for academic and non-profit use. Its commercial version the active modules, referred to as simple modules and
OMNEST can be obtained on the official website [6]. As compound modules. Simple modules can be grouped into
Vargas states, OMNeT++ can be seen as a gap filler [5]. It compound modules, the second module type. Compound
positions itself between open-source, research orientated modules group other modules an can be therefore seen
software and expensive commercial alternatives. To get a as passive only representing the internal functionalities.
better understanding of OMNeT++, Section 2 gives an Hierarchy levels are not limited, that is why OMNeT++’s
Seminar IITM SS 20,
37 doi: 10.2313/NET-2020-11-1_08
Network Architectures and Services, November 2020
Network
Simple modules
Cmdenv,
Executing Tkenv,
Compound module SIM ENVIR
Model or
Qtenv
Model
Component
Library
Figure 2: Logical architecture of an OMNeT++ simulation
Figure 1: Simple and compound modules. Arrows repre- programm [11].
sent connections between modules via gates [11].
2.3. Architecture
structure is considered hierachical [11]. The entire sim-
ulation model represented by a network, therefore is a The previous sections gave a short overview of OM-
compound module. Simple modules are written in C++. NeT’s internal structure. Figure 2 gives a understanding of
The communication of modules is done by messages. In the high level and logical architecture. ENVIR, CMDENV
order to send messages, simple modules have input and and TKENV describe the user interface libraries. This is
output gates for sending and receiving. It is also possible the environment where the simulation is executed. It also
to send messages directly to their destination, but normally describes the origin of input data and where simulations
it is done using gates. In a simulation, messages can repre- result go to. ENVIR is a library, which presents itself
sent customers in queues or packages in a network. Input as a connection, containing all common user interface
and output gates can be linked by so-called connections. code. CMDENV and TKENV are ENVIR based libraries
Compound modules also have such gates and connections that have a specific user interface implementation. The
to communicate with external modules. Connections can all-purpose interface is CMDENV, known as the com-
only be established in a single level of module hierarchy mand line user interface. It is a small portable and fast
i.e sub modules can have connections to the compound interface that works on all platforms, which provides a
module gate or other sub modules inside a compound console e.g. linux and is mainly used for batch execution.
module , but not to the outside. That is needed to maintain TKENV is a graphical user interface, for debugging and
the reusability of modules. These connections can be seen visualization of simulations. This environment describes
as an own entity with parameters like bit error- rate or the simulation’s execution, from debugging to visualizing.
delay. Connections with predefined parameters, so called It is possible to embed a OmNeT++ simulation into a
termed channels, can also be reused [11]. larger application by replacing the user interface. The
component library is built by the code of compiled simple
2.2. Design of a Model and compound modules [5]. At the beginning of the
simulation execution phase, the simimulation kernel builds
An OMNeT++ model has a starting module, the sys- the simulation model, which is the model created for the
tem module. From the system module at the top level simulation. [13]
there are nested modules with a hierarchical structure with
no boundaries to the bottom. With no limits in depth the
user has the opportunity to build every structure he wants. 3. Network Simulation with OMNeT++
The model structure is written in OMNeT++ network
As stated in the previous sections OMNeT++ itself is
description language, short NED. The simple modules at
merely a framework. That means in the base version only
the bottom are programmed in C++ using the simulation
supports routing messages [5]. This feature traversions
class library provided by OMNeT++. Listing 1 shows a
of a network and building a graph data structures. In
C++ code example by TU-Ilmenau [12].
addition, a user could further use graph algorithms to
# i n c l u d e " omnetpp . h " traverse it. But with nothing more provided the user has to
c l a s s MyModule : p u b l i c c S i m p l eM o d u le implement a whole network with protocols and network
{ associated structures himself. With the design of OM-
/ / a macro t h a t c a l l s c o n s t r u c t o r NeT++, however, a simulation can be easily extended by a
and s e t s network framework. Network simulation with OMNeT++
/ / up i n h e r i t a n c e r e l a t i o n s h i p s : is simplified by extending it with existing frameworks
Module_Class_Members ( MyModule , such as INET [9] elaborated in section 3.1 or, specialized
cSimpleModule , 0 ) on mobile and wireless networks, the MiXiM framework,
/ / user − s p e c i f i e d f u n c t i o n a l i t y elaborated in section 3.2 [10]. Importing a framework is
follows : . . . similar to importing libraries in Java [11]. Framework
}; files are added to the project and can be accessed via
D e f i n e _ M o d u l e ( MyModule ) ; / / a n n o u n c e the import [11].
t h i s c l a s s a s a module t o OMNeT
Listing 1: Example of a simple module’s C++ code. The 3.1. INET
class MyModule describes the functionality of a simple
module. User can specify how to react on messages. INET is a model library, which is specialized in de-
signing new protocols [14]. With INET the user can build
Seminar IITM SS 20,
38 doi: 10.2313/NET-2020-11-1_08
Network Architectures and Services, November 2020
hosts, routers and other network devices by using reusable 3.3. Recent Use of OMNeT++
components. INET provides components that are easy to
modify and understand so that users can build their own This section provides an overview of projects featuring
components [14]. Some of INET’s features are: IPv4/IPv6 OMNeT++.
network stacks, pluggable protocol implementation for
• UAV (Unmanned aerial vehicle) Swarm Network:
various layers, wired/wireless interfaces and many more.
The paper, deals with a swarm intelligence-based
In the following a project by Mohammed Alasmar and
damage-resilient mechanism for UAV swarm net-
George Parisis will be presented which uses INET [15]. It
works. The authors build a simulation in OM-
uses the OMNeT++ with the INET framework to evaluate
NeT++, which presents a mechanism to recover a
modern data center transport protocols.
unified UAV swarm network after suffering dam-
Data center networks (DCNs) are getting more important,
age [17].
because they are used for the infrastructure of search ser-
• Secure Data Transmission and Sinkhole Detection:
vices such as Google, social networks, cloud services and
OMNeT++ is used for evaluating better methods
video streaming (e.g. Disney+). Alasmar et al. state that
for improved security in a multi-clustering wire-
OMNeT++ in addition to INET is perfect for simulating
less sensor network by homomorphic encryption
and evaluating data transport protocols in DCNs [15]. The
and watermarking [18].
reason lies within INET’s flexibility. New protocols can
• Novel Segment Based Safety Message Broadcast-
be easily added to the project and network devices (e.g.
ing in Cluster-Based Vehicular Sensor Network:
switches, routers etc.) are already provided. For example,
With multiple vehicles sending messages in vehic-
there are simple module implementations for TCP and
ular sensor networks, data collisions occur more
UDP, which users can use and extend. Within this project,
often, leading to corrupted packages. To counter-
a simulation model for the neighbor discovery protocol
act, OMNeT++ ist used for validation [19].
(NDP) and a FatTree network topology generator was
built. Also, a data center environment that can be used
to evaluate and compare data transport protocols, such as 4. Comparison to other Network Simulators
NDP and TCP, was developed. This outlines the possibil-
ities with OMNeT++, not only creating simulations, but Over the last years computer hardware has signif-
also creating a framework for other evaluations. In the icantly improved. Also, networks as a topic got more
simulations specialized on NDP protocols they used OM- attention, with the world being more connected than ever.
NeT++’s save tool command line to process and compare The complexity of systems and networks topology is in-
the results [15]. creasing drastically. To implement new network structure
or protocols, it is indispensable to test, before actually
deploying them. For example, when an untested defective
new structure is pushed into an established network, fixing
3.2. MiXiM it will be costly and effort to fix that, while the system is
still running. There are two kinds of test environments.
A real system with existing hardware or a simulation.
As already mentioned, the increased complexity makes it
Another example for a network simulation framework very expensive to build real systems for testing. Therefore,
which runs on OMNeT++ is MiXiM (mixed simulator). simulations have gained a lot of attention over the past
This framework is specialized for mobile and wireless years. Two network simulators which gained a lot of
networks. It offers detailed models of radio wave prop- popularity during the last years are OMNeT++ and NS-
agation, interference estimation, radio transceiver power 3 [20]. In the following sections a comparison between
consumption and wireless MAC protocols [10]. these two simulators takes place. Also taking OMNeT++
Following there is a short example of a simulation using design decisions, described in the previous sections, into
the MiXiM framework, in order to improve the Quality of account described by A. Vargas and R. Hornig [5] and
Service (QoS) in a wireless sensor network (WSN) [16]. comparing them to other simulators. After the comparison
This paper was written by Kodali et al [16]. The reason to NS-3, the paper presents a short comparison to other
behind it was, that in a real time environment WSN are popular simulators.
often unreliable and inaccessible, which has a bad effect
on the QoS. In the paper the authors discuss adjustments 4.1. Comparison to NS-3
of power, range and bit rates to attain adaptive topology
control (ATC), in order to maintain the QoS of a WSN, NS-3 (network simulator version 3) is the successor
which have a broad spectrum of usage. For example, it of the of NS-2, which is not supported anymore nor
is used by the military or for weather monitoring, with has backwards-compatibility. It is an open source discrete
the core concept of sensing, computing and communica- event network simulator [21], that tries to maintain an
tion. MiXiM was chosen because it supports the mobility open environment for researchers to share their projects.
framework which is used for the WSN network. The The simulator itself is a C++ library and an integrated
performance of Carrier Sense Multiple Access (CSMA) development environment is needed. During a simulation
was measured in packet end-to-end delivery ratio and the network data traffic can be collected in a pcap-file.
throughput. As Kodali et al state in their conclusion, they Then it is possible to analyze the file via wireshark or
were able to improve the network performance by 29%, similar software. Wenhan Yao compared these two simula-
by varying the range and power adaption [16]. tors in his master thesis [21]. Other sources are the general
Seminar IITM SS 20,
39 doi: 10.2313/NET-2020-11-1_08
Network Architectures and Services, November 2020
comparisons to other simulators in various scenarios [22]–
[24]
4.1.1. Structural Differences of the Simulators. In OM-
NeT++, a NED file is used to describe the structure
of a model, while the behavior of modules is written
in C++. For simulations, the user has to choose a user
interface (e.g. CMDENV,TKENV) see Figure 2 and define
the starting parameter in an omnetpp.ini file. Then the
result of a simulation is written into vector and scalar
files, which can be evaluated by external software. For a
simulation in NS-3, the user starts with a script written
in C++ or Python. The script defines the topology of the
network and how the simulations is run. A network is
described by its nodes, connections and devices and their
usage [21]. The models, which can be used for simulation,
can be found in the NS-3 library. All the parameters of
simulation are also written into the script, for example data Figure 3: Example of a GUI in an OMNeT++ Simula-
rate, IP address and positioning of nodes. The resulting tion [26].
data can go to a pcap file, which can also be analyzed.
Both simulators are using C++ to describe their mod-
ules. NS-3’s connection to modules is more direct than simulation approach as a process-oriented discrete-event
OMNeT++’s. In NS-3, the script can directly access the simulator and is written in Python [20], [23]. Another
modules from the library, while in OMNeT++ the NED different simulation approach is presented by JiST. It is a
files are interposed. In other words, in OMNeT++ you high performance Java based simulation environment and
need NED files to create and access modules, which just a simulation kernel [5], [20]. The authors built equal
makes the simulation more complex. OMNeT++ has visu- simulation scenarios for all the simulators, to compare
alization options already included. This simplifies network them to each other. Their result was that only SimPy had
simulation decisions for less experienced users, compared slightly higher loss rates, still acceptable results thou. Af-
to NS-3 with no included visualization. It is possible, terwards they went to performance testing of the different
though, to visualize the output files from NS-3, in order simulators under equal conditions. Overall, the conclusion
to have a visualization of graphs. This works similar to was that NS-3 has the best performance, while JiST
OMNeT++, where the output files can be processed by advantages are in simulation run time. But OMNeT++
various programms [21]. is the only simulator providing a GUI. JiST and NS-3
simulations are source code developed. The authors wrote
4.1.2. Differentiation between OMNeT++ and NS-3. that all of them are equally suited for network simulations,
The GUI is one of OMNeT++’s main advantage, com- but it depends on the situation which one to choose [20],
pared to NS-3. It can picture signals e.g TCP packages [23], [24].
and components of a network structure. An example of
a GUI screen can be seen in Figure 3. In simulations 5. Conclusion
OMNeT++ always uses more computer resources than
NS-3 [21], [25]. Also, OMNeT++ takes longer to execute. Varga and Hornig describe in their paper the core
Another core difference is that NS-3 was built for network elements of OMNeT++’s design, which is also crucial
simulation, while OMNeT++ is multipurpose. Therefore, for large scale simulation [5]. The hierarchical structure
it is less workload for the user to create a simulation with its reusable components, takes a huge part in its
in NS-3, because the whole structure can be written in success. It means less work for the user by just reusing
one script rather than having to implement modules, NED finished modules as much as possible. Another key point
files and specify user interfaces. Both simulators deliver which differentiates OMNeT++ to many other simulators
good performances, with similar workloads on the testing is its GUI and the possibility to visualize the simulation,
system and messages throughput. An outstanding feature debugging and the structure. Debugging consumes a lot
is OMNeT++ visualization. The integrated GUI and the of time in projects. Visualization often helps and reduces
possibility to visualize the simulation, debugging process time consumption. Simulations are modular customizable
or even the structure of a simulation are one of the out- allowing a user to embed an emulation into a larger
standing features of OMNeT++ [21], [22], [24]. But it is application. This integration opens up many areas of
important to mention that both simulators are giving good application. As other simulators, OMNeT++ can produce
simulation results for similar simulations in execution time output files to have a better analysis with other programs.
and workload of the system [20]–[22], [24]. However, the structure of OMNeT++ with its layers makes
small simulations often more complex than they need
4.2. OMNeT++ and Other Simulators to be. For example, when a user just wants to create
a test simulation, where two nodes send each other a
This section provides a summary of the comparison package, in OMNeT++ you need to define the kernel and
from OMNeT++, NS-3, NS-2, SimPy and JiST, done by structure of al parts from the system . The NED language
Weingartner et al [20]. SimPy incorporates a different was designed to scale well. With increasing complexity
Seminar IITM SS 20,
40 doi: 10.2313/NET-2020-11-1_08
Network Architectures and Services, November 2020
in networks, however, it reaches its limits. Therefore, [14] “INET introduction,” https://inet.omnetpp.org/Introduction, [On-
improvements to the software itself had to be made, where line; accessed 12-May-2020].
the user has to adjust too. Furthermore, the environment is [15] M. Alasmar and G. Parisis, “Evaluating modern data centre
clearly divided in parts like NED modules which requires transport protocols in omnet++/inet,” in Proceedings of 6th
International OMNeT++ Community Summit 2019, ser. EPiC
more computer resources for network simulations. Over- Series in Computing, M. Zongo, A. Virdis, V. Vesely, Z. Vatandas,
all, however, OMNeT++ follows a clear structure, which A. Udugama, K. Kuladinithi, M. Kirsche, and A. F\"orster,
makes it easy to handle, also within large simulations. Eds., vol. 66. EasyChair, 2019, pp. 1–10. [Online]. Available:
https://easychair.org/publications/paper/4xwP
References [16] R. Kodali and M. Vijay Kumar, “Mixim framework simulation of
wsn with qos,” 05 2016, pp. 128–131.
[1] B. Leiner, V. Cerf, D. Clark, R. Kahn, L. Kleinrock, D. Lynch, [17] M. Chen, H. Wang, C. Chang, and X. Wei, “Sidr: A swarm
J. Postel, L. Roberts, and S. Wolff, “A brief history of the internet,” intelligence-based damage-resilient mechanism for uav swarm net-
Computer Communication Review, vol. 39, pp. 22–31, 10 2009. works,” IEEE Access, vol. 8, pp. 77 089–77 105, 2020.
[2] D. López-Pérez, D. Laselva, E. Wallmeier, P. Purovesi, P. Lundén, [18] H. A. Babaeer and S. A. AL-ahmadi, “Efficient and secure data
E. Virtej, P. Lechowicz, E. Malkamaki, and M. Ding, “Long term transmission and sinkhole detection in a multi-clustering wireless
evolution-wireless local area network aggregation flow control,” sensor network based on homomorphic encryption and watermark-
IEEE Access, vol. 4, pp. 9860–9869, 2016. ing,” IEEE Access, pp. 1–1, 2020.
[3] Z. Yan, H. Li, S. Zeadally, Y. Zeng, and G. Geng, “Is dns ready for [19] I. S. Alkhalifa and A. S. Almogren, “Nssc: Novel segment based
ubiquitous internet of things?” IEEE Access, vol. 7, pp. 28 835– safety message broadcasting in cluster-based vehicular sensor net-
28 846, 2019. work,” IEEE Access, vol. 8, pp. 34 299–34 312, 2020.
[4] “OMNet++ Homepage,” http://www.omnetpp.org, [Online; ac- [20] E. Weingartner, H. vom Lehn, and K. Wehrle, “A performance
cessed 8-May-2020]. comparison of recent network simulators,” in 2009 IEEE Interna-
tional Conference on Communications, 2009, pp. 1–5.
[5] A. Varga and R. Hornig, “An overview of the omnet++ simulation
environment,” 01 2008, p. 60. [21] W. Yao, “Analyse und vergleich der netzsimulatorenns-3
und omnet++,” p. 74, 05 2018, [Online; accessed 21-May-
[6] “OMNEST Homepage,” https://omnest.com/, [Online; accessed 24- 2020]. [Online]. Available: http://midas1.e-technik.tu-ilmenau.de/
May-2020]. ~webkn/Abschlussarbeiten/Masterarbeiten/ma_yao_sw.pdf
[7] “NS-3 Homepage,” https://www.nsnam.org/, [Online; accessed 24- [22] Xiaodong Xian, Weiren Shi, and He Huang, “Comparison of
May-2020]. omnet++ and other simulator for wsn simulation,” in 2008 3rd
[8] “JiST Homepage,” http://jist.ece.cornell.edu/, [Online; accessed 24- IEEE Conference on Industrial Electronics and Applications, 2008,
May-2020]. pp. 1439–1443.
[9] “INET Framework,” https://inet.omnetpp.org/, [Online; accessed [23] V. Oujezsky and T. Horvath, “Case study and comparison of simpy
11-May-2020]. 3 and omnet++ simulation,” in 2016 39th International Conference
on Telecommunications and Signal Processing (TSP), 2016, pp.
[10] “MiXiM Framework,” http://mixim.sourceforge.net/, [Online; ac- 15–19.
cessed 11-May-2020].
[24] A. Zarrad and I. Alsmadi, “Evaluating network test scenarios for
[11] “OMNet++ Simulation Manual,” https://doc.omnetpp.org/omnetpp/ network simulators systems,” International Journal of Distributed
manual/, [Online; accessed 9-May-2020]. Sensor Networks, vol. 13, no. 10, p. 1550147717738216, 2017.
[12] “C++ code snippet,” https://www.tu-ilmenau.de/fileadmin/ [Online]. Available: https://doi.org/10.1177/1550147717738216
media/telematik/lehre/Projektseminar_Simulation_Internet_ [25] S. B. A. Khana and M. Othmana, “A performance comparison of
Protokollfunktionen/Material/03_OmNet__.pdf, [Online; accessed network simulatorsfor wireless networks,” pp. 1–6.
27-May-2020].
[26] [Online; accessed 11-June-2020]. [Online]. Available: https:
[13] [Online; accessed 15-August-2020]. [Online]. Available: https:
//docs.omnetpp.org/tutorials/tictoc/part2/
//ewh.ieee.org/soc/es/Nov1999/18/userif.htm
Seminar IITM SS 20,
41 doi: 10.2313/NET-2020-11-1_08
Network Architectures and Services, November 2020