4.3 Omnet++ Simulations: (I) Network
4.3 Omnet++ Simulations: (I) Network
4.3 Omnet++ Simulations: (I) Network
3 OMNeT++ Simulations
Now as we have done with the installation of OMNeT++ and with the build and configuration of
Frameworks as well now lets see what are the basic components that were used in order to run or
make simulations in OMNeT++
(i) Network:
Network in OMNeT++ acts as an object which holds different kinds of modules, sub
modules and defines the network. Modules inside network object can communicate to each other
via links known as channels. Figure 22 shows the network object named as My_ Network
when you run simulation with an empty network means no modules added in a network object.
(ii) Module:
A module object is inherited by Network object. A module could be anything which is able to
make communication by sending and receiving data between modules with the help of channels.
Figure 23 show a module named My_Module in a network object named as My_network
(iii)
Compound Module:
A compound module object is a type of object which contains one or more than one module
inside itself. In simple words a module inside a module is known as compound module. Let us
drag a module named as Standard Host these prebuilt modules can be found easily by
importing framework such as INET , MiXim and many other as well. A sample screen shot of a
compound module in a network is shown in figure 24.
Figure 3:
When you double click on the module named as Standard_Host you will see the modules
which were compounded inside a standard host module will look like the snap shot given in
figure 25.
Figure 4:
In the above figure it can be seen that a module named as standard host have compounded many
other modules inside such as tcp ,udp NICs routing table and many others as shown above.
(iv) Channels:
Channels were the objects that were used to connect both the modules together. A channel
can be Ethernet cable or any other link which connects two modules.
(v) NED language:
NED language stands for Network Description language which means that it is used for to
describe the topology of your network. NED have two option for to create topology one is with
the code editor and the other is with the graphical editor, the graphical editor will make write
code automatically for the module that were dragged into the network object. As far as for the
code editor is concern user have to write each and every step on their own. In figure 26 there
were snap shots of both the code editor view and the graphical one.
Figure 5:
Graphical view of Network (My Network) using NED (Network description file)
Figure 6:
Code editor view of Network (My Network) using NED (Network description file)
In figure 27 there is a coded view of the network that were designed graphically. Parameters for
the respective module can be set by both methods, graphically or by using NED language, in
figure 28 there is a snapshot of how to adjust parameters using graphical view.
Figure 8:
Step 3:
If you wish to create your own module based on C++ language, ini files, NED language
select Empty project and click finish
Step 4:
If you wish to create empty project but using the modules from some framework select
Empty project with src and simulation folders and click finish
Step 5:
If you wish to make some changes in modules or in NED, ini files of existing examples
or project select Examples and click finish.
Figure 32 below show all the possible options discussed in the steps above.
Figure 11:
Figure 12:
Step 2:
After opening the project , select the omnetpp.ini file right click, select run as OMNeT++
simulation. After clicking a window will appear similar to the interface as shown in figure 34.
Step 3:
After clicking the run button simulation began to start until the time limit reaches which
will define by the user in .ini file. As in the above image red dot represent the travelling of
acknowledgment packet.
4.5
perform calculation on the generated results in order to make improvement in the desired model.
This can be done by collecting the data and analyze it in a correct way to extract the desired
content out of results. For to do so in OMNeT++ we have to make slight change in our
omnetpp.ini file by writing record-event log=true. This will enable the simulation to record the
event as they occur time to time so that event log can be used later on to gather useful results.
There were four types of event log files which were listed by their extensions.
1. abc.elog
2. abc .sca
3. abc.vec
4. abc.vci Index file for vector file generate help in searching vector files.
In figure 35 there is a snapshot of how the .elog file will look like.
Figure 14:
This file shows us the graph of every single event that occurs during simulation. By
double clicking on the red dot enable us to see the detail of a particular event that what actually
happens in that particular event. When we click at red dot automatically the event shifted to
event log tab as shown in figure 36.
As we have set event log=true in our ini file which enable the option of recording events
occurring during simulation. At the end of simulation in project explorer window under the
project we can see that a folder named as results was created under which scalar (.sca) and vector
(.vec) files of event were recorded which can be used to plot bar or scatter graphs and these
vector and scalar can be filterized according to the needs of the research . In figure 38 and in
figure 39 there were snapshots which shows how scalar and vector data is used for plotting
graphs.
Figure 17: Showing scalar and vector data recorded from simulation using OMNeT++
Now if we want to plot a graph about specific module simply just right click on specific data set
and click on plot. It will generate a bar graph based on histograms as shown in figure 40
Figure 19: