OMNeT++ Single Node Tutorial
This is an introductory tutorial to start with OMNeT++. It is made for people with no or very little experience with discrete event simulation and has a low pace. It should be completed before the oficial OMNeT++ tic-toc tutorial.
Introduction
This tutorial is organized into three chapters: Chapter 1 will cov...
Chapter 1: Setup a simple simulation
In this section, will cover how to navigate in OMNeT++, how to create and program a single node, ...
Installing and running OMNeT++
Step 1. Install and run OMNeT++ Download the current OMNeT++ version and install i...
Excursion: Discrete events and simulation time
This is an excursion from the tutorial into the theory of discrete events and sim...
Exploring the code
Let's explore the code you just imported. When you expand all of the folders, you will no...
Setup a simple simulation: Summary
Let us summarize what we have until now. We set up our very first simulation, which consists of a...
Chapter 2: Self messages
In this section, we will explore the simplest messages in OMNeT++: messages to "self". We will se...
Creating and handling a self message
Creating and handling a self message In the last section, we have explored the code of our simpl...
Exercise 1: Play with the self message
Try to change the scheduled time for the message first to 20, then to 10000. Re-run the simulatio...
Exercise 1: Discussion
In fact, you should not see any difference. As explained in discrete event simulation, it doesn't...
Exercise 2: Resend the message
Now, let's us resend the message to ourselves. In handleMessage(), instead of deleting the messag...
Exercise 2: Discussion
The difference is obvious this time: the message keeps turning back and the simulation never stop...
State variables
State variables are a very handy tool to track the internal state of a module: for example, to co...
Different self messages
We can of course define and use also different self messages, for example, to switch to blue or t...
Random behavior
It is relatively simple to schedule a message randomly in OMNeT++. In fact, the kernel offers you...
Chapter 3: Two nodes
In this section, we will extend our simulation to two nodes and see how we can send messages betw...
Two nodes side by side
We have seen how to create a single node and how to implement its behavior. Now, we will create t...
Exploring messages
OMNeT++ has some very powerful tools to log information during a simulation and to analyze it lat...
Connecting nodes to each other
OMNeT++ is quite strict on how to exchange messages between any nodes (or modules) - you have to ...
Sending messages to another node
We will start over with our code, for simplicity. We will write a simulation with two blue nodes....
Add delays to connections
OMNeT++ allows you to easily setup a delay for any connection in Network.NED like this : node1.m...
Add parameters
Setting up parameters for a module in OMNeT++ always consists of three steps: Define the param...
More parameters
Parameters and the way you set them up and use them is one of the most useful features in OMNeT++...
Two nodes: Summary
Sending messages from one node to another is simple. You need to define gates in the nodes, conne...
Chapter 4: Control and debug
In this last chapter of our tutorial, we will see in more details how the simulation actually wor...
The event queue
The event queue is very important in discrete event simulations, as we already discussed shortly ...
The simulation kernel
The simulation kernel is the heart of OMNeT++ and any other discrete event simulator. It is the o...
Control the simulation end
Usually, the simulation will end automatically once there are no more events in the queue. Rememb...
The End
This is the end of our tutorial. We hope you understood the basics of discrete event simulations ...