0% found this document useful (0 votes)
14 views73 pages

Omnetpp L1. 2. 3

The document provides an overview of discrete event simulation (DES) and its application using the OMNeT++ framework, which is designed for modeling complex systems across various domains. It outlines the benefits of DES, such as risk-free experimentation and improved decision-making, and includes examples from computer networks, traffic systems, manufacturing lines, and hospitals. Additionally, it details the steps for creating and running simulations in OMNeT++, including programming models and enhancing functionalities.

Uploaded by

jale.cavus
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views73 pages

Omnetpp L1. 2. 3

The document provides an overview of discrete event simulation (DES) and its application using the OMNeT++ framework, which is designed for modeling complex systems across various domains. It outlines the benefits of DES, such as risk-free experimentation and improved decision-making, and includes examples from computer networks, traffic systems, manufacturing lines, and hospitals. Additionally, it details the steps for creating and running simulations in OMNeT++, including programming models and enhancing functionalities.

Uploaded by

jale.cavus
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 73

1

Analysis of Algorithms
using OMNeT++
DR. MOHAMMED HUSSEIN AL HUBAISHI
2
Introduction
3
Outlines

https://docs.omnetpp.org/tutorials/tictoc/part1/
4
Discrete event simulator (DES)

► A discrete event simulator (DES) is a powerful tool for modeling and


analyzing systems where changes happen at specific points in time, rather
than continuously.
► Imagine it like a movie projector showing snapshots of your system instead
of a smooth video. Each "snapshot" represents an event that alters the
system's state.
5
Examples to illustrate how DES works:

1.Computer Network:
► Computer networks are complex systems connecting
numerous devices like computers, servers, and other
equipment through various communication channels.
► Events: Data packet arrival, router forwarding, link failure
constantly occur, dictating the flow of information.
► Simulation: You can evaluate network
performance, optimize routing protocols, and test new
technologies.

https://en.wikipedia.org/wiki/Computer_network_diagram
6
Examples to illustrate how DES works:

2.Traffic Network:
► Events: Vehicle arrival, lane change, traffic light change.
► Simulation: You can test different traffic management
strategies, predict congestion, and evaluate infrastructure
improvements.

https://www.ironnet.com/blog/the-truth-is-in-the-traffic-the-advantages-of-network-traffic-based-cybersecurity
7
Examples to illustrate how DES works:

3. Manufacturing Line:
► Events: Arrival of raw materials, machine
breakdown, product completion.
► Simulation: You can model the flow of materials, identify
bottlenecks, optimize machine usage, and estimate
production capacity.

https://www.eflexsystems.com/lean-manufacturing-blog/scenarios-of-common-assembly-line-issues
8
Examples to illustrate how DES works:

4. Hospital Emergency Room:


► Events: Patient arrival, doctor assignment, treatment
completion.
► Simulation: You can assess resource allocation, identify
patient waiting times, and optimize staffing levels.

https://www.ironnet.com/blog/the-truth-is-in-the-traffic-the-advantages-of-network-traffic-based-cybersecurity
9
Key benefits of using DES:

► Experimentation without risk: You can test different scenarios and


configurations without impacting the real system.
► Improved decision-making: You gain insights into system behavior and
identify potential problems before they occur.
► Cost-effectiveness: It's cheaper than building and testing physical
prototypes.
► Scalability: You can model complex systems with many moving parts.

Remember, DES focuses on discrete events, meaning things happen at distinct points in time. If your
system involves continuous processes like fluid flow or temperature changes, you might need a different
type of simulation, like continuous simulation.
10
OMNeT++

OMNeT++ is a discrete event simulation framework that provides libraries,


tools, and APIs for building simulations of various systems. It allows developers
to model complex systems using components called modules, which interact
with each other through message passing.
► Let's consider a simple example of a network simulation where we model
the behavior of nodes sending packets to each other over a network.
1. tictoc tutorial omnet++
2. https://docs.omnetpp.org/tutorials/tictoc/
11
OMNeT++ is a discrete event simulation

► OMNeT++ is a discrete event simulation framework primarily used for modeling


and simulating complex systems in various domains such as networking,
telecommunications, and distributed systems. Here's an explanation with
examples
Discrete Event Simulation:
► In discrete event simulation, the system is modeled as a series of events that
occur at specific points in time. These events represent changes in the system
state, such as the arrival of a packet in a network or the completion of a task in
a distributed system. Time in discrete event simulation progresses in discrete
steps, with events occurring at specific simulation time points.
12
What does OMNET++ provide ?
13
Omnetpp.ini
14
15
16
17
18
What does an OMNET++ simulation
model look like?
19
How do I run simulation program ?
20
How do I program a model in C++?
21
How do I program a model in C++ .. Cont’d
22
How do I program a model in C++
23
Working with OMNET++: Flow Chart
24
Getting Started
25
Describe your Example Network by
creating a Topology File
26
Implement the Functionality
27
Create the Makefile, Compile, and Link the
Simulation
28
Create the omnetpp.ini File
29
Start the Executable, Run, Play, Exit
30
Enhancing the 2-node TicToc
31
Part 3 - Enhancing the 2-node TicToc

https://docs.omnetpp.org/tutorials/tictoc/p
art3/
32
Step 2: Refining the Graphics, and Adding
Debugging Output
33
Step 2: Refining the Graphics, and
Adding Debugging Output (cont’d)
34
Step 3: Adding State Variables
35
Step 4: Adding Parameters
36
Step 4: Adding Parameters (cont’d)
37
Step 5: Using Inheritance
38
Step 6: Modeling Processing Delay
Step 6: Modeling Processing Delay (cont’d) 39
40
Step 7: Random Numbers and
Parameter
41
Step 8: Timeout, Cancelling Timers
42
Step 9: Retransmitting the Same Message
43
Step 9: Retransmitting the Same
Message (cont’d)
44
45
Turning it into a real network
46
Part 4 - Turning it Into a Real Network

https://docs.omnetpp.org/tutorials/tictoc/part4/
47
Step 10: More Than Two Nodes
48
Step 10: More Than Two Nodes
(cont’d)
49
Step 11: Channels and Inner Type
Definitions
50
Step 12: Using Two-Way Connections
51
Step 12: Using Two-Way Connections
(cont’d)
52
Step 13: Defining our Message Class
53
Step 13: Defining our Message Class
(cont’d)
54
Step 13: Defining our Message Class
(cont’d)
55
Adding statistics collection
56
Part 5 - Adding Statistics Collection

https://docs.omnetpp.org/tutorials/tictoc/part5/
57
Step 14: Displaying the Number of
Packets Sent/Received
58
Step 14: Displaying the Number of
Packets Sent/Received (cont’d)
59
Step 15: Adding statistics collection
60
Step 15: Adding statistics collection
(cont’d)
61
Step 15: Adding statistics collection
(cont’d)
62
Step 15: Adding statistics collection
(cont’d)
63
Step 16: statistics collection without
modifying your model
64
Step 16: statistics collection without
modifying your model (cont’d)
65
Step 16: statistics collection without
modifying your model (cont’d)
66
Visualizing the results with the OMNet+
+ IDE
67
Visualizing the results with the OMNet+
+ IDE (cont’d)
68
Visualizing the results with the OMNet+
+ IDE (cont’d)
69
Visualizing the results with the OMNet+
+ IDE (cont’d)
70
Visualizing the results with the OMNet+
+ IDE (cont’d)
71
Conclusions
72

Result Analysis with Python - OMNeT++ Technical Articles (omnetpp.org)


73

…questions, comments, etc. are welcome…

You might also like