1 84 Compressed
1 84 Compressed
In this module
Let us explore the need and
motivation to perform
Network
Modeling and Simulation
(NeMS)
Need for NeMS
Technology Landscape
(1 of 4)
Communications systems:
Evolving rapidly
User demands:
High performance networks
Service providers: Rapidly
expanding their network
infrastructure
Need for NeMS
Technology Landscape
(2 of 4)
Network researchers face the
protocol war
Developing new
communications
techniques, architectures and
capabilities
Need for NeMS
Technology Landscape
(3 of 4)
Equipment vendors:
Release new devices with
increasing capability and
complexity
Need for NeMS
Technology Landscape
(4 of 4)
Technology developers and
OEMs:
Developing NG equipment
Need for NeMS
Stakeholders challenges
Network developer
Network Designer
Operational Engineer
Architect
Need for NeMS
Network designer/
developer
How do I satisfy the QoS
demands of users amidst
emerging technologies and
techniques viz a viz legacy
counterparts?
Need for NeMS
Network Engineer in
operations
What is the right approach to
solving my problem?
Do I buy latest device from
company X that claims to solve
all my problems?
Do I replace underlying
technology of my system with
the latest generation?
Need for NeMS
Next Generation Network
Architect
How do I know how this new
approach will interact with
already existing protocols?
Cost Abstraction
What is NeMS?
In this module
We shall understand NeMS as
a single concept and break it
further down
What is modeling?
What is simulation?
What is NeMS?
Network Modeling and
Simulation is often considered
a single term.
Simulation is
Imitation of behaviour of real-
world system
Computational re-enactment
model
What is NeMS?
Modeling precedes simulations
Together they form an
iterative process
Approximate the real world
systems
What is NeMS?
Stop Start
Design unsatisfactory:
Reconsider
Validation Modeling
Thru For
Simulation System
System Design
What is NeMS?
Consider a simple signal
detection circuit
What is NeMS?
Its simulation could give out
– Correct result
– Incorrect result
– No result
Why!
What is NeMS?
Because its behaviour has to
be governed by its model
– Transceiver design
(Detection theory)
– Digital circuit (Boolean
algebra)
What is NeMS?
Model
Logical representation
– Complex entity
– System
– Phenomena
– Process
What is NeMS?
Network Model
In communications
– Analytical representation
– Mathematical form
– State Machine
– Closed or approximate
form
What is NeMS?
Computer Simulation
Computer software
– Reproduces behavior
– Certain degree of accuracy
– Provides visual insight
End
What is Model?
In this module
We shall learn
What is a computer model?
Computer Model
A template on which a
computer program runs
• Inputs
• Outputs
• Behaviour
•Model definition
Descriptive
Analytical
Mathematical
Algorithmic
What is Model?
Stochastic vs
Deterministic
Deterministic models have
no randomness
Given input always
Stochastic vs Deterministic
Stochastic models don't have
unique input–output
mapping
Unpredictable execution
Associated simulations are
pseudo-random using
random number generators
Not widely employed
What is Model?
Continuous vs Discrete
•State variables assume
any value in continuous
•State variables assume only
discrete values in discrete-state
models
Continuous or discrete-time
models
•Discrete computer models need
clocks and timers
What is Model?
Steady state vs Dynamic
Steady state models establish
input-output relation in
equilibrium
Simpler
Need synchronization
A B
C
Supra-modeling
A+B'+C
A'+C'
End
Modeling Perspective & Intra-Model Relation
In this module
We shall learn
What needs to be modeled?
model?
How to do most appropriate
modeling?
Modeling Perspective & Intra-Model Relation
Model only what you
understand
• Utility of model is as good as
it mimicks real world system
• Knowledge of system is pre-
requisite
• Wireless model requires
Free space path loss
Hidden terminal
Absorption
Modeling Perspective & Intra-Model Relation
Understand Your Model
• Your model has
Your perspective
Your assumptions
Your analytics/maths
• Caching server
Response time
Infinite buffer
Queuing theory
Modeling Perspective & Intra-Model Relation
Caching server
Oversimplistic
Practical
A B C
Unachievable
Modeling Fidelity
End
A. Poor utility
B. Optimum utility
C. Marginal increase in utility
What is Simulation?
In this module
We shall understand
Simulated outputs
What is Simulation?
Computer
Software
{
Modeled Inputs Simulated Outputs
Algorithms
Routines
}
Parameter Explanation
Simulated outputs
What is Simulation?
Parameter Explanation
Simulated outputs
What is Simulation?
Parameter Explanation
Simulated outputs
What is Simulation?
In this module
simulation terminologies
What is Simulation?
Take inputs
Give outputs
What is Simulation?
Computer
Software
{
Modeled Inputs Simulated Outputs
Algorithms
Routines
}
Parameter Explanation
Modeled inputs
What is Simulation?
Parameter Explanation
Modeled inputs
What is Simulation?
Parameter Explanation
Modeled inputs
What is Simulation?
Parameter Explanation
Retransmission Throughput, Delay
Protocol
GoBackN
Selective Repeat
Modeled inputs
What is Simulation?
Parameter Explanation
Modeled inputs
What is Simulation?
Parameter Explanation
Modeled inputs
What is Simulation?
Parameter Explanation
Modeled inputs
What is Simulation?
Parameter Explanation
Modeled inputs
What is Simulation?
Parameter Explanation
Simulated outputs
What is Simulation?
Parameter Explanation
Simulated outputs
What is Simulation?
Parameter Explanation
Simulated outputs
Simulation Building Process
In this module
Inside computer
Simulation run
Simulation Building Process
Remember!
One hop communication
scenario
Simulation building process
Entities
Wireless computers
instance)
Creates wireless computers
number of packets
Each packet successful/failed
Simulation Building Process
Packet generation
Wireless AP activity
No of frames per
wireless computer
No. of wireless
computers
BER and PER
Write output ()
Initialization ()
Print status ()
computer variables
States
++ Iteration
Events
Timing ()
Print status ()
Queues
Scheduling
Event Type = Type 1 Event routine of Type 1
disciplines
Randomness
Distributions
Event Type = Type 2 Event routine of Type 2
End
Simulation Building Process
Simulation run
Inputs created/initialized
Events of transmission,
reception and noise occur
Randomness causes queues to
behave and err
Packet successes/failures
Simulation logs/compiles
outputs
End
Components of Simulator
In this module
We shall determine
Components of a typical
simulator
Their relationship and
organization
Components of Simulator
Simulations run on
simulator
A self-contained program
Event queue
Simulation clock
State variables
Event routines
Input routine
Report generation routine
Initialization routine
Main program
Components of Simulator
Event queue
Number of events in an ordered
list
Determines complexity
Total simulation time
Components of Simulator
Simulation clock
Global variable
Clock ticks (constant and small
increments)
Time driven
Events occurring
occurrence of event
Components of Simulator
State variables
Together define the state of the
system
Components of Simulator
Event routines
Handle the occurrence of event
Event creation
Event action
Updates state variables
Updates event queue
Components of Simulator
Input routines
Provide user interface
(UI)
Takes parameters
(UI)
Components of Simulator
Initialization routine
Initializes
State variables
Global variables
Statistical variables
Components of Simulator
Main program
Calls other routines
Initializes and terminates
simulation
Types of Simulations
In this module
We shall summarize
Performance evaluation
techniques
Types of simulations
Types of Simulations
Performance Evaluation
Techniques (PETs)
Simulation: behavior of
interconnected subsystems &
subprocesses
Evaluation: measure of
an aggregate systemic
property
Efficient and confident
Types of Simulations
PETs
Direct measurement
Not abstracted
Monte Carlo
Trace driven
simulation
Discrete Continuous
events events
Types of Simulations
Monte Carlo
No time axis
Model probabilistic phenomena
that do not change with time
Types of Simulations
Trace driven
Ordered list of events
as input
Expected outputs!
Types of Simulations
Continuous event
States change to inputs
at non discrete times
Consequently has a very large
Discrete event
No events between intervals
Finite events and output
Common Simulation Pitfalls
In this module
We shall understand
General and programming
mistakes
Simulation inaccuracies
Misleading results
Common Simulation Pitfalls
When to simulate!
Analytical model not feasible
(complex)
Analytical model not possible
(too simple)
Simulate to verify analysis
Otherwise simulations
are unnecessary
Common Simulation Pitfalls
General mistakes
Inappropriate levels of details
Improper selection of
programming language
Unverified models
Improper initial
conditions
Common Simulation Pitfalls
General mistakes
(continued...)
Short run times
Poor random number
generators
Inadequate time
estimate
No achievable goals
Common Simulation Pitfalls
General mistakes
(continued...)
Incomplete mix of essential
skills
Inadequate level of user
participation
Inability to manage simulation
project
Common Simulation Pitfalls
Simulation inaccuracies
Over reliance on link budget
methods for abstraction
Overly simplistic modeling of
radio
layers
Common Simulation Pitfalls
In this module
We shall understand
General and programming
mistakes
Simulation inaccuracies
Misleading results
Common Simulation Pitfalls
General mistakes
Inappropriate levels of details
Include what is relevant
computationally heavy
– Many interdependent
parameters
– Difficult to assess
their interplay
Tip: Necessity & sufficiency
Common Simulation Pitfalls
General mistakes
Improper programming language
Scope & type of simulation
determine
best choice
Object oriented vs procedural
– Types/diversity of
simulation parameters
Interpreted vs compiled
– Machine dependence
– Speed
Common Simulation Pitfalls
General mistakes
Unverified models
Programming is non trivial
Semantic mistakes
Wrong results
Misleading results
Modular verification a
must
Common Simulation Pitfalls
General mistakes
Improper initial conditions
Initial condition not steady state
Surprisingly wrong
results
May never converge
Common Simulation Pitfalls
General mistakes
Short run times
Strong dependence on Initial
conditions
Don't achieve true
steady state
Common Simulation Pitfalls
In this module
We shall understand
General and programming
mistakes
Simulation inaccuracies
Misleading results
Common Simulation Pitfalls
General mistakes
Poor random number generators
Lacking pseudo-random
General mistakes
Inadequate time estimate
Models overstate the
simulations
– Implementations get
delayed
Software development life
General mistakes
No achievable goals
Goals not defined
– Tangible output
analysis
– Logs and trace files
Goals are unreal
– Affects simulation
complexity and
implementation
Common Simulation Pitfalls
General mistakes
Incomplete mix of essential
skills
Domain knowledge
Statistics
Programming
Project management
Past experience
Common Simulation Pitfalls
General mistakes
Inadequate level of user
participation
From modeling to
implementation
UI design
Output analysis
Common Simulation Pitfalls
General mistakes
Inability to manage
simulation project
Simulations are not
monolithic
Need software engineering
tools
– Multivariate design
– Code management
– Track changes
Common Simulation Pitfalls
In this module
We shall understand
General and programming
mistakes
Simulation inaccuracies
Misleading results
Common Simulation Pitfalls
Simulation inaccuracies
Over reliance on link budget
methods for abstraction
Link budget losses overly static
Simulation inaccuracies
Overly simplistic modeling of
radio layers
Lowest layer often ignored
use cases
Common Simulation Pitfalls
Solve the !
We shall understand
The process of development of
systems simulations
Development life cycle
Development of Systems Simulation
A “Still I am not dead yet!” scenario
uncontrollable inputs
Development of Systems Simulation
Development Process
Data collection & analysis
What to collect
off
Development of Systems Simulation
Development Process
Simulation development
Codify, codify and codify!
Development of Systems Simulation
Development Process
Model validation,
verification, & calibration
Validation
right?
Implementation must
Parameter estimation
Tweaking/tuning to ensure
each other
Development of Systems Simulation
Life cycle of Simulation Development
Recommended Text and References
In this module
We shall assess
NeMS coverage of contents
Text books
References Books
Online Resources
Recommended Text and References
Uptill now
Basics of NeMS
Mohsen Guizani et al,
Uptill now
Basics of NeMS
Jack Burbank et al, “An
Introduction to Network
Modeling & Simulation for
the Practicing Engineer”
John Wiley , 2011.
Recommended Text and References
Uptill now
Basics of NeMS
John A. Sokolowski &
Catherine M. Banks,
“Modeling and Simulation
Fundamentals” John Wiley ,
2010.
Recommended Text and References
Next Roadmap (1 of 2)
Recommended Text and References
Next Roadmap (2 of 2)
TicToc tutorial
OMNET++ Manual
Website: https://omnetpp.org
INET Framework for OMNeT++
OMNET++ Wiki
Mixim Sourceforge Page
Introduction to OMNET++
In this module
We shall cover
What is OMNET++?
copy?
How to compile and install on
Windows?
Running for the first
time
Introduction to OMNET++
What is OMNET++
Objective Modular Network
Testbed in
C++
– Simulation kernel
– Component-based
simulation library
• A framework, not a simulator
Designed to create &
Simulation Kernel
Introduction to OMNET++
– C++ compiler
– CMD line build
environment
•Download source code
Introduction to OMNET++
Debug is elaborate
but slow
Release is optimized
and fast
Introduction to OMNET++
Debug mode
Does not optimize the binary it
produces
Source code and generated
instructions relationship is
complex
Allows accurate breakpoints
setting
Allows code step-through one
line at a time
Compiled with full symbolic
debug information
Introduction to OMNET++
Release mode
Enables optimizations
Generates instructions without
any debug data
Lots of code could be completely
removed or rewritten
Resulting executable may not
match with written code
Introduction to OMNET++
In this module
We shall cover
Design of OMNET++
Model structure
Overview of OMNET++
Design of OMNET++
Requirements Design features
Hierarchical Simulation
Large Scale Simulations
Models
Reusable components
Model Structure
Model consists of modules
Modules communicate with
message passing
Modules are C++ files
– Implement simulation class
library
– Run in simulation kernel
Module types
– Simple (active modules)
– Compound
Overview of OMNET++
Model Structure
Simple modules can be grouped into compound modules and
so forth
Modules communicate through gates (connections)
– Directly between modules or through intermediaries
Overview of OMNET++
Model Structure
No. of hierarchy levels not limited
No of components
Types of components
Overview of OMNET++
Model Structure
Gates
– Input output interfaces of modules
– Allow message passing
– Linked via connection (TPROP, RDATA, BER)
1. Define
Module
types
2. Instantiate
3. Network implements system model
them
Overview of OMNET++
Model Structure
Channels
– Connection types with specific properties
– Reusable at several places
– StandardHost talking to another StandardHost via an Ethernet cable
1. Define
Module
types
2. Instantiate
3. Network implements system model
them
Overview of OMNET++
Model Structure
Message; tuple (time stamp, arbitrary data, ...)
Network; A compound module with no external gates
1. Define
Module
types
2. Instantiate
3. Network implements system model them
Overview of OMNET++
Module Parameters
Pass configuration data to
simple modules
Define model topology
String, numeric, boolean
Constants, random
numbers
Expressions as
references
Overview of OMNET++
Module Parameters
Logical Architecture of OMNET++ Simulation Program
In this module
We shall cover
Internal architecture of
OMNET++
Contents of the Simulation
Library
Logical Architecture of OMNET++ Simulation Program
Internal Architecture
OMNeT++ simulation programs possess a modular structure
Logical Architecture of OMNET++ Simulation Program
Model Component
Library
Consists of the code of compiled
simple and compound modules
Logical Architecture of OMNET++ Simulation Program
Internal Architecture
OMNeT++ simulation programs possess a modular structure
Logical Architecture of OMNET++ Simulation Program
Internal Architecture
OMNeT++ simulation programs possess a modular structure
Logical Architecture of OMNET++ Simulation Program
output
Controls the simulation execution
Internal Architecture
OMNeT++ simulation programs possess a modular structure
Overview of OMNET++
In this module
We shall cover
Introduction to NED Language
Graphical Editor
Overview of OMNET++
Typical Ingredients of
NED description
Network definitions
Compound module
definitions
Simple module declarations
Overview of OMNET++
Network Definition
Network definitions are
compound modules
– Self-contained
simulation models
Overview of OMNET++
Simple Module
Declaration
Describes the interface of
modules
– Gates
– Parameters
Overview of OMNET++
Compound module
definitions
Declaration of external
interface
– Gates
– Parameters
Definition of
– Submodules
– Their interconnections
Overview of OMNET++
Network name
=
My_Network
Overview of OMNET++
Module name
=
My_Module
Overview of OMNET++
Compound module
name=
standardHost
Overview of OMNET++
Inside
standardHost
More About NED Language
In this module
Interfaces
Packages
Inner types
More About NED Language
Inheritance
Modules and channels can be
subclassed
Derived modules and channels
may add
– New parameters
– Gates
Similarly compound modules
may add
– New submodules
– Connections
More About NED Language
Examples
Simple Compound
Module GenericTCPClientApp BaseHost
Derived
FTPApp BaseHost + WebClientApp
(Extended)
Module
More About NED Language
Interface instantiation
Module and channel interfaces
can be used as a placeholder
– where normally a module
or channel type would be
used
Concrete module or channel
type determined
– At network setup time by a
parameter
More About NED Language
Example
Run time
ConstantSpeedMobility RandomWayPointMobility
More About NED Language
Packages
Addresses name clashes
between different models
Simplifies specifying which NED
files are needed by a specific
simulation model
More About NED Language
Example
package book.simulations;
Package is a mechanism to organize various classes and files. The simulation
project inside of OMNeT++ is called "Book" and this NED file is found in the
"simulations" folder of the
Project.
Configuring OMNET++ Simulations
In this module
We shall understand
Need for separating
models and
experiments
Configuring simulations
INI files
editor
Configuring OMNET++ Simulations
Configuring simulations
How to capture the effect of
different inputs?
– Run to run variables
C++ and NED code do not have
such variables
INI files provide a mechanism to
specify these parameters
– omnet.ini
Configuring OMNET++ Simulations
<key>=<value>
Configuring OMNET++ Simulations
INI File Editor
INI File Editor lets the user configure simulation models for execution
Both form-based and source editing
Configuring OMNET++ Simulations
Compound modules
Channels, etc
We shall cover
Build Process
How to build
OMNET++ simulations
Building Simulation Programs
End-to-End Process
(Build + Configure+ Run + Analyze)
Building Simulation Programs
Process of Build
Same as building
any C/C++ program from source
– All C++ sources need to be
compiled into object files
– All object files need to be
linked with
necessary libraries to get
• Executable
• Or shared library
Building Simulation Programs
Using Mingwenv
Once you have the source files ( *.ned, *.msg, *.cc, *.h) in a directory
– Change the working directory to there
Type
$ opp_makemake
This will create a file named Makefile
Type
$ make
Your simulation program should build
We shall cover
What is a simulation
run?
Quick Run
Creating run
configuration
Running Simulations
Run numbers
Command mode
(Cmdenv)
Simulation configuration
Debug support
Running Simulations
Quick Run
In Project Explorer, select a
project
Clicking Run button on the
toolbar
Runs vary
– Folder
• Runs if single ini file
present
– ini file
• Use this as the main ini
file
– NED file
• Scan for available ini file
Running Simulations
Launch Configuration
Run omnet.ini
From /queuenet
queuenet Launch
Configuration
Running Simulations
Launch Configuration
One or more
ini files
Running Simulations
Launch Configuration
Run number
R=0
One omnet.ini
one exe
Running Simulations
Launch Configuration
Directories where
the NED files
are read from
Running Simulations
Where to next!
Animation and Tracing
In this module
We shall cover
What is animation
of simulation?
What is traceability of
simulation models?
Object inspection
set
Animation and Tracing
Animating Simulation(1 of
2)
OMNeT++ is capable of
Animating
– Flow of messages on
network charts
Reflecting
simulating engineer
Suitable network simulations
output window
– Special window to
display output stream
Eases following the module
execution
Animation and Tracing
Simulation Object
Inspection
An object inspector is a GUI
window associated with a
simulation object
– Displays contents and
properties
Three types
– Network Display
– Log Viewer
– Object Inspector
Animation and Tracing
Tkenv (1 of 2)
Tkenv is a graphical runtime
interface for simulations
It provides
– Network visualization
– Message flow animation
– Log of message flow
– Display of textual module
logs
Animation and Tracing
Tkenv (2 of 2)
Inspectors
Visualization of statistics
– Histograms, etc. during
simulation execution
Event log recording for later
analysis
Animation and Tracing
Tkenv in action
Timeline
Object inspector
Future Events Set (FES) on log scale
Network Log
display viewer
Organizing and Performing Experiments
In this module
We shall understand
Need for organizing experiments
experiments
Organizing and Performing Experiments
Need for organizing
experiments
(1 of 4)
Stuart Kurkow, “MANET
Simulation
Studies:
The Incredibles,” ACM’s
MobileComputing and
Communications
Review, 9(4):
50-61, 2005
Organizing and Performing Experiments
Need for organizing
experiments
(2 of 4)
Repeatable
Fellow researcher
should be able to
repeat
Unbiased
Results must not be specific to
scenario
used in experiment
Organizing and Performing Experiments
Need for organizing
experiments
(3 of 4)
Rigorous
Scenarios & conditions
Courtesy:
Organizing and Performing Experiments
Relationship between terminologies
Organizing and Performing Experiments
How to organize
experiments
(1 of 6)
Model
The executable
NED files
Invariant for the
purpose of experimentation
INI file not part of
model
Organizing and Performing Experiments
How to organize
experiments
(2 of 6)
Study
One or more
experiments
to investigate a phenomenon
Usually many experiments
space on a model
Only and only one model
Organizing and Performing Experiments
How to organize
experiments
(4 of 6)
Measurement
A set of simulation runs on
averaging out
Organizing and Performing Experiments
How to organize
experiments
(5 of 6)
Replication
One repetition of a
measurement
Replication can be
exact time/date
Handover
optimization
for
Mobile IPv6
Organizing and Performing Experiments
Example
Mobile IPv6
nodes
Organizing and Performing Experiments
Example
Effect of
No. of hosts
Traffic load
Organizing and Performing Experiments
Example
No of hosts
= 10
Load
= 3.8
Sequence Charts
In this module
We shall explore
What are event log
tables?
What are sequence
charts?
Sequence Charts
Event Log Tables
(1 of 2)
An eventlog file contains
― Tabulated log of messages
Self-messages (timers)
such sending
or reception
Sequence Charts
Event Log Tables
(2 of 2)
User can control
― Amount of data
recorded from
messages
― Start/stop time
the log
Sequence Charts
Event Log File Creation (1 of
2)
Type
$ record-eventlog = true
Output placed in
/results directory
Filename
${configname}-
${runnumber}.elog
Sequence Charts
Event Log File Creation (2 of 2)
Using INI file event log configuration
Record event
Sequence Charts
Sequence Chart
Displays eventlog files
in a graphical form
• Helps focus on causes
& consequences of
events/messages
• Helps users understand
― Complex simulation models
desired behavior
Sequence Charts
Understanding the Legend
Simple module
Axis
Sequence Charts
Understanding the Legend
Compound module
Axis
Sequence Charts
Understanding the Legend
Initialization event
Sequence Charts
Understanding the Legend
Self-message
processing event
Sequence Charts
Understanding the Legend
Message processing
event
Sequence Charts
Understanding the Legend
Event number
Sequence Charts
Understanding the Legend
Self-message
Sequence Charts
Understanding the Legend
Message send
Sequence Charts
Understanding the Legend
Message reuse
Sequence Charts
Understanding the Legend
Method call
Sequence Charts
Understanding the Legend
Message send
that goes far away
Sequence Charts
Understanding the Legend
Message name
Sequence Charts
Understanding the Legend
Method name
Sequence Charts
Understanding the Legend
Zero simulation
time region
Sequence Charts
Understanding the Legend
Simulation time
hairline
Sequence Charts
In this module
We shall understand
Parts of sequence charts
What is timeline?
Types of timelines
Interesting ways to
interpret sequence charts
Sequence Charts
Parts of Sequence Charts
Timeline gutters
Sequence Charts
Parts of Sequence Charts
Horizontal growth
w.r.t. time
Sequence Charts
Parts of Sequence Charts
Vertical growth
w.r.t. no. of modules
Sequence Charts
Parts of Sequence Charts
– Intervals between
interesting events
often of different magnitudes
Example
– MAC (s)
– Higher layers (ms)
Sequence Charts
Types of Timeline
(1 of 2)
Linear: simulation time
proportional to distance
measured in pixels
Event number: event number
proportional to the distance
measured in pixels
Sequence Charts
Types of Timeline
(2 of 2)
Step: distance between
subsequent events is same
Nonlinear: distance between
subsequent events is
nonlinear function of
simulation time between
them
Sequence Charts
Interpreting Sequence
Charts
Zero Simulation Time Regions
Gutter
Events
Messages
Displaying Module State on
Axes
Sequence Charts
Zero Simulation Time Regions
Nonlinear time
Sequence Charts
Events Processing
Receiving
Message proc
Sequence Charts
Messages
Message
Sequence Charts
Displaying Module State on Axes
Understanding C++
file
How to make the
project?
Preparing INI file
Sequence chart
Recap: TicToc Tutorial
TicToc with 2-nodes
• Two nodes, Tic and Toc
• One node initializes by sending
a message
to the other
• Every time a node receives the
message
― Sends it back
• Continue indefinitely
― Till user stops
Recap: TicToc Tutorial
Creating an empty project
• Open the OMNeT++
IDE
• Navigate to File | New |
OMNeT++ Project
• Enter a Name for the project
• Next
Recap: TicToc Tutorial
Select the Tictoc example file in the Examples folder
You have created Tictoc example project
Recap: TicToc Tutorial
Opening NED file
• In newly created
project, navigate to the
simulations folder in the Project
Explorer
• Open
Tictoc.ned
Recap: TicToc Tutorial
Understanding toctoc1.ned
package example.simulations;
import example.Txc;
//
// Two instances (tic and toc) of Txc connected.
//
network Tictoc
{
submodules: Original simple
tic: Txc; module
toc: Txc;
connections:
tic.out --> {delay = 100ms;} --> toc.in;
tic.in <-- {delay = 100ms;} <-- toc.out;
}
Recap: TicToc Tutorial
Opening Simple Module
• Open project explorer
• Open src folder of this
project
• Open
Txc.ned
Recap: TicToc Tutorial
Understanding Txc.ned
package example;
//
// Immediately sends out any message it receives. It can optionally
generate
// a message at the beginning of the simulation, to bootstrap the
process.
//
simple Txc Implements Txc.cc
{
parameters:
bool sendInitialMessage = default(false);
gates:
input in;
output out; One input gate
} One output gate
Recap: TicToc Tutorial
Opening Simple Module
• Open project explorer
• Open src folder of this
project
• Open
Txc.cc
Recap: TicToc Tutorial
Understanding Txc.ned
#include "Txc.h" OMNET++
namespace example { Module
Define_Module(Txc); Initialize method
void Txc::initialize()
{
if (par("sendInitialMessage").boolValue())
{
cMessage *msg = new cMessage("tictocMsg");
send(msg, ""out"");
} HandleMessage
} method
void Txc::handleMessage(cMessage *msg)
{
// just send back the message we received
send(msg, "out"");
} Echo back
}; // namespace
Recap: TicToc Tutorial
Understanding omnet.ini
[General]
network = Tictoc Starts the activity
cpu-time-limit = 60s
#debug-on-errors = true
**.tic.sendInitialMessage = true
Recap: TicToc Tutorial
Compiling &
Running on Tkenv
Recap: TicToc Tutorial
Tictoc.tic
Tictoc.toc
Extending TicToc
In this module
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
Refine graphics &
Tictoc2.ned
Add debugging output
• Txc2.cc
Extending TicToc
Extending TicToc
Tictoc2.ned (1 of 2)
// "block/routing" icon to the simple module. All
submodules of type
// Txc2 will use this icon by default
//
simple Txc2
{
parameters:
@display("i=block/routing"); // add a default
icon
gates:
input in; Add icon
output out;
}
//
Extending TicToc
Tictoc2.ned (2 of 2)
// Make the two module look a bit different with
colorization effect.
// Use cyan for `tic', and yellow for `toc'.
//
network Tictoc2
{
submodules: Change color
tic: Txc2 {
parameters:
@display("i=,cyan"); // do not change
the icon (first arg of i=) just colorize it
}
toc: Txc2 {
parameters:
@display("i=,gold"); // here too
}
connections:
Extending TicToc
Txc2.cc (1 of 2)
class Txc2 : public cSimpleModule
{
protected:
virtual void initialize();
virtual void handleMessage(cMessage *msg);
};
Define_Module(Txc2); Debug
Message name
information
void Txc2::initialize()
{
if (strcmp("tic", getName()) == 0)
{
// The 'ev' object works like 'cout' in C++.
EV << "Sending initial message\n";
cMessage *msg = new cMessage("tictocMsg");
send(msg, "out");
}
}
Extending TicToc
Txc2.cc (2 of 2)
void Txc2::handleMessage(cMessage *msg)
{
// msg->getName() is name of the msg object, here
it will be "tictocMsg".
EV << "Received message `" << msg->getName() <<
"', sending it out again\n";
send(msg, "out");
}
Debug
information
Extending TicToc
Tkenv output
Extending TicToc
Tkenv output
Extending TicToc
In this module
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
Add State Variables
if (strcmp("tic", getName()) == 0)
{
EV << "Sending initial message\n";
cMessage *msg = new cMessage("tictocMsg");
send(msg, "out");
} Decrement counter
}
void Txc3::handleMessage(cMessage *msg)
{
// Decrement counter and check value.
counter--; If counter is zero,
if (counter==0) delete message
{
EV << getName() << "'s counter reached zero,
deleting message\n";
delete msg;
Extending TicToc
Txc3.cc (3 of 3)
} Or show current
else counter value
{
EV << getName() << "'s counter is " <<
counter << ", sending back message\n";
send(msg, "out");
}
}
Extending TicToc
Extending TicToc
In this module
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
Adding parameters (1 0f
2)
• Add add input
parameters to the
simulations
– Count = 10 now into
a parameter that the
user can define
• tictoc4.ned
• Txc4.cc
• Omnet.ini
Extending TicToc
Adding parameters (1 0f
2)
– Boolean parameter
(decides if module
should send out first
message in its
initialization code)
• tictoc4.ned
• Txc4.cc
• Omnet.ini
Extending TicToc
tictoc4.ned (1 of 2)
simple Txc4
{
parameters:
bool sendMsgOnInit = default(false); //
whether the module should send out a message on
initialization
int limit = default(2); // another parameter
with a default value
@display("i=block/routing");
gates: Simple module
input in;
output out; Parameters
} Send message on Initialization
Limit parameter
Extending TicToc
tictoc4.ned (2 of 2)
// Adding module parameters.
//
network Tictoc4
{
submodules:
tic: Txc4 {
parameters:
sendMsgOnInit = true;
@display("i=,cyan"); Network
}
toc: Txc4 {
parameters:
sendMsgOnInit = false;
@display("i=,gold"); Assign values to
} parameters
Extending TicToc
Txc4.cc
void Txc4::initialize()
{
// Initialize the counter with the "limit" module
parameter, declared in the NED file (tictoc4.ned).
counter = par("limit");
Tictoc4.toc.limit = 5
// or Tictoc4.t*c.limit=5
// or Tictoc4.*.limit=5
// or **.limit=5
Value assignment to
limit parameter
Through ini file
(wildcard support)
Extending TicToc
In this module
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
Using Inheritance
What is different
between tic and toc?
― Parameter values
― Display string
Inheritance allows to
create a simple module
― Then derive modules
from it
• tictoc5.ned
Extending TicToc
tictoc5.ned (1 of 4)
simple Txc5
{
parameters:
bool sendMsgOnInit = default(false);
int limit = default(2);
@display("i=block/routing");
gates:
input in;
output out;
} Base module
Generalized parameters
Extending TicToc
tictoc5.ned (2 of 4)
simple Tic5 extends Txc5
{
parameters: Declare tic
@display("i=,cyan");
sendMsgOnInit = true; // Tic modules should
//send a message on init
}
Assign value
Extending TicToc
tictoc5.ned (3 of 4)
simple Toc5 extends Txc5
{
parameters: Declare toc
@display("i=,gold");
sendMsgOnInit = false; // Tic modules should
// not send a message on init
}
Assign value
Extending TicToc
tictoc5.ned (4 of 4)
network Tictoc5
{ Create network
submodules:
tic: Tic5; // the limit parameter is still unbound here.
We will get it from the ini file
toc: Toc5;
connections:
Use them as
submodule
Extending TicToc
In this module
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
Modeling processing
delay
So far, no processing
delay in tictoc
We need timer in
Tictoc module to send
itself “Event” message
• tictoc6.ned
• txc6.cc
Extending TicToc
Strategy
Initialize after 5 seconds
Hold the message for 1 simulated second
― Send a message to itself
tic toc
5s 1s 1s
Extending TicToc
tx6.cc (1 of 2)
void Txc6::initialize()
{
// Create the event object (ordinary message) for
//timing
event = new cMessage("event");
tictocMsg = NULL;
if (strcmp("tic", getName()) == 0)
EV << "Scheduling first send to t=5.0s\n";
tictocMsg = new cMessage("tictocMsg");
scheduleAt(5.0, event);
}
Defining event
}
Operation of event
Extending TicToc
tx6.cc (2 of 2)
void Txc6::handleMessage (cMessage * msg)
{
if (msg==event)
{EV << "Wait period is over, sending back message\n";
send(tictocMsg, "out");
tictocMsg = NULL;
} Self message
Else
{
EV << "Message arrived, starting to wait 1 sec...\n";
tictocMsg = msg;
scheduleAt(simTime()+1.0, event);
}
}
External message
(from the other side)
Extending TicToc
Extending TicToc
In this module
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
Modeling processing
delay
So far, no processing
delay in tictoc
We need timer in
Tictoc module to send
itself “Event” message
• tictoc6.ned
• txc6.cc
Extending TicToc
Strategy
Initialize after 5 seconds
Hold the message for 1 simulated second
― Send a message to itself
tic toc
5s 1s 1s
Extending TicToc
tx6.cc (1 of 2)
void Txc6::initialize()
{
// Create the event object (ordinary message) for
//timing
event = new cMessage("event");
tictocMsg = NULL;
if (strcmp("tic", getName()) == 0)
EV << "Scheduling first send to t=5.0s\n";
tictocMsg = new cMessage("tictocMsg");
scheduleAt(5.0, event);
}
Defining event
}
Operation of event
Extending TicToc
tx6.cc (2 of 2)
void Txc6::handleMessage (cMessage * msg)
{
if (msg==event)
{EV << "Wait period is over, sending back message\n";
send(tictocMsg, "out");
tictocMsg = NULL;
} Self message
Else
{
EV << "Message arrived, starting to wait 1 sec...\n";
tictocMsg = msg;
scheduleAt(simTime()+1.0, event);
}
}
External message
(from the other side)
Extending TicToc
Extending TicToc
In this module
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
Random numbers and
parameters
Introduce random
numbers in simulation
– Randomly lose
packet
– Change delay from
1s to a random value
• txc7.cc
• tictoc7.ned
Or omnetpp.ini
Extending TicToc
txc7.cc (1 of 2)
void Txc7::handleMessage(cMessage *msg)
{
if (msg==event)
{
EV << "Wait period is over, sending back
message\n";
send(tictocMsg, "out");
tictocMsg = NULL;
Lose the message
}
with 0.1 probability
else
{
if (uniform(0,1) < 0.1)
{
EV << "\"Losing\" message\n";
delete msg;
}
Extending TicToc
txc7.cc (2 of 2)
else
{
// The "delayTime" module parameter set
// to "exponential(5)" in tictoc7.ned so
// we'll get a different delay every time.
Tictoc7.tic.delayTime = exponential(3s)
mean
Extending TicToc
In this module
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
Timeout, cancelling
timers
Getting closer to real
world working
protocols
Stop-and-wait protocol
• txc8.cc
• tictoc8.ned
• omnetpp.ini
Extending TicToc
Strategy
Timeout = 1
Send out “tictocMsg”
Toc
Initial Wait for Timeout
state Msg from resend Msg If probability > .1
toc
Lose Msg
Msg arrived
Wait for
cancel timer
Msg from
Resend message
tic
Tic
If probability < .1
Echo Msg
Extending TicToc
txc8.cc (1 of 3)
void Tic8::initialize()
{
// Initialize variables. Initialize with timeout
= 1 to start operation
timeout = 1.0;
timeoutEvent = new cMessage("timeoutEvent");
}
}
Extending TicToc
Extending TicToc
In this module
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
Retransmitting same
message (1 of 2)
So far we used
“tictocMsg”
It was created afresh
everytime
– At tic
– At toc
Extending TicToc
Retransmitting same
message (2 of 2)
In reality, original
packet needs to be
retransmitted
Solution: Keep a copy
with tic
• txc9.cc
• tictoc9.ned
• omnetpp.ini
Extending TicToc
Strategy
Create two new functions
Conditionally call them in tic and toc
generateNewMessage() sendCopyOf()
Tic Toc
Extending TicToc
Txc9.cc (1 of 2)
void Tic9::handleMessage(cMessage *msg)
{
if (msg==timeoutEvent)
{
EV << "Timeout expired, resending message and
restarting timer\n";
sendCopyOf(message);
scheduleAt(simTime()+timeout, timeoutEvent);
}
Retransmit the same
packet
Extending TicToc
Txc9.cc (2 of 2)
else // message arrived
{
// Acknowledgement received!
// Ready to send another one.
message = generateNewMessage();
sendCopyOf(message);
scheduleAt(simTime()+timeout, timeoutEvent);
}
Transmit a new
packet
Extending TicToc
generateNewMessage()
{
// Generate a message with a different name every time.
char msgname[20];
sprintf(msgname, "tic-%d", ++seq);
cMessage *msg = new cMessage(msgname);
return msg;
} Increments seq no
and is value of %d
Prints the string on
Location of length 20
pointed by msgname Displays string which
is seq no as decimal
Extending TicToc
sendCopyOf(cMessage *msg)
{
// Duplicate message and send the copy.
send(copy, "out");
} Creates & returns an
exact copy of msg
Value of copy
taken from msg
Casts return value of
dup() to a pointer of
cMessage type
Extending TicToc
In this module
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
More than 2 nodes (1 of
2)
Create several tic
modules
Connect them into a
network
One of the nodes
generates a message
Extending TicToc
More than 2 nodes (2 of
2)
Others toss it around
in random directions
Until it arrives at a
predetermined
destination
tictoc10.ned
omnetpp.ini
txc10.cc
Extending TicToc
Tictoc10.ned (1 of 2)
simple Txc10
{
parameters:
@display("i=block/routing");
gates:
input in[]; // declare in[] and out[] to be
vector gates
output out[];
}
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
Channels & inner type
definitions (1 of 2)
With growing topology
– We can improve
connection section
tictoc11.ned
omnetpp.ini
txc11.cc
Extending TicToc
Channels & inner type
definitions (2 of 2)
Connections with
same delay parameter
can be typified as
channel
Such channel can then
be replicated between
gates
Extending TicToc
Tictoc11.ned (1 of 2)
network Tictoc11
{ types section defines
types: new channel type
channel Channel extends ned.DelayChannel {
delay = 100ms;}
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
Using two-way
connections (1 of 2)
So far, each node pair is
connected with two
connections
Two-way connection can
reduce coding size
tictoc12.ned
txc12.cc
omnetpp.ini
Extending TicToc
Using two-way
connections (2 of 2)
We define two-way
(inout) gates
– Instead of in and out
gates
Extending TicToc
Tictoc12.ned (1 of 2)
simple Txc12
{
parameters:
@display("i=block/routing");
gates:
inout gate[]; // declare two way connections
}
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
Defining our message
class
Instead of hardcoding
tic[3], we need flexibility
Draw out a random
destination
Add Destination address
tictoc13.ned
txc13.cc
tictoc13.msg
omnetpp.ini
Extending TicToc
Strategy (1 of 2): Avoid boilerplate code writing
tictoc13.msg
subclasses cMessage
& adds destination as
a data member
Extending TicToc
Strategy (2 of 2): Avoid boilerplate code writing
HeaderFile
generates
tictoc13_m.h
FileName ClassName
Included in
tictoc13.msg c++ code TicTocMsg13
CPlusPlusFile
The class has getter
and setter (mutator)
tictoc13_m.cc
Compiling and methods for every
linking field
Extending TicToc
Txc13.cc (1 of 3)
TicTocMsg13 *Txc13::generateMessage()
{
// Produce source and destination addresses.
msg->setHopCount(msg->getHopCount()+1);
}
Extending TicToc
Extending TicToc
In this module
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
Displaying no. of packets
sent/received
No. of messages at each
node
tictoc14.ned
txc14.cc
tictoc14.msg
omnetpp.ini
Extending TicToc
Txc14.cc (1 of 3)
class Txc14 : public cSimpleModule
{
private:
long numSent; Declared
long numReceived;
protected:
virtual void updateDisplay();
void Txc14::initialize()
{
// Initialize variables set to zero & WATCH'ed
numSent = 0; in initialize() method
numReceived = 0;
WATCH(numSent);
WATCH(numReceived);
Extending TicToc
Txc14.cc (2 of 3)
void Txc14::handleMessage(cMessage *msg)
{
if (ttmsg->getDestination()==getIndex())
{ info appears
if (ev.isGUI()) above module
{ icons
updateDisplay();
}
}
}
Extending TicToc
Txc14.cc (3 of 3)
void Txc14::updateDisplay() Similar to bubble
{ text but without
char buf[40]; bubble
sprintf(buf, "rcvd: %ld sent: %ld", numReceived,
numSent);
getDisplayString().setTagArg("t",0,buf);
}
Extending TicToc
Object Inspector in Tkenv
Extending TicToc
Extending TicToc
In this module
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
Adding statistics
collection
When packet traverses
multiple hops, it
becomes important to
collect network statistics
– Average hop count
– Max, min etc
tictoc15.ned
txc15.cc
tictoc15.msg
omnetpp.ini
Extending TicToc
Strategy
Histogram object
(calculates mean,
SD etc)
//Results directory
Tictoc15-0.vec Tictoc15-0.sca
Extending TicToc
Txc15.cc (1 of 3)
class Txc15 : public cSimpleModule
{
private: The finish() function is
long numSent; called by OMNeT++
long numReceived; at the end of the
cLongHistogram hopCountStats; simulation
cOutVector hopCountVector;
virtual void finish();
HopCountVector.record
outputs to vector file
Extending TicToc
Txc15.cc (2 of 3)
void Txc15::handleMessage(cMessage *msg)
{
// Message arrived
int hopcount = ttmsg->getHopCount();
EV << "Message " << ttmsg << " arrived after "
<< hopcount << " hops.\n";
bubble("ARRIVED, starting new one!");
numReceived++;
hopCountVector.record(hopcount);
hopCountStats.collect(hopcount);
}
hopCountStats.recordAs("hop count");
}
Extending TicToc
Records the vector as time
series
Extending TicToc
Histogram during the
simulation run
Extending TicToc
In this module
debugging output
Add state variables
Add parameters
And more!
Extending TicToc
6. Modeling processing 11. Channels & inner 16. Sequence charts and
delay type definitions event logs
Extending TicToc
Visualizing output scalars
& vectors
OMNET++ allows to
visualize outputs of
scalar and vector files
– Filtering
– Processing
– Displaying
Extending TicToc
We shall cover
What is simulations analysis?
Analysis files
What is Simulation
Analysis?
Analyzing simulation results is
lengthy and time consuming
process
Result are recorded as scalar
values, vector values and
histograms
User can apply statistical
methods
– Extract the relevant
information
– Draw conclusions
Analyzing Results
Explorer View
Open the New Analysis File dialog
Browsing input
Filter expressions
Analyzing Results
Using the Analysis Editor
Input files
Browsing input
Filter expressions
Analyzing Results
Using the Analysis Editor
Input files A filter expression is composed of atomic
patterns with the AND, OR, NOT operators
Selecting input files
It has the form <field_name> (<pattern>)
Example
Browsing input
module(**.sink) AND (name("queuing
time") OR
name("transmission time"))
Filter expressions
Results in queuing times and transmission
times that are written by modules
named sink.
Analyzing Results
Using the Analysis Editor
Datasets
Editing datasets
Computing vectors
Computing scalars
Analyzing Results
Using the Analysis Editor
Datasets
Describe a set of input data, the processing applied to
them and the charts
Displayed as a tree of processing steps and charts
Nodes are used for
― Adding and discarding data
We shall understand
How to edit datasets?
Computing vectors
Computing scalars
Computation examples
Editing Datasets
Datasets
Describe a set of input data, the processing applied
to them and the charts
Displayed as a tree of processing steps and charts
Nodes are used for
― Adding and discarding data
Throughput
total number of
transport packets
Modules with largest
RTTs
Computation Examples 2
Packet loss per client-server pair
3 clients (cli0, cli1, cli2) and 3 servers (srv0, srv1,
srv2) in the network
Each client sends datagrams to the corresponding
server
Packet loss per client-server pair computed from
the number of sent and received packets.
We use the i variable to match the corresponding
clients and servers.
Value: Net.cli${i={0..2}}.pkSent -
Net.srv{i}.pkRcvd
Name: pkLoss
Module: Net.srv${i}
Computation Examples 2
Total No. of Transport Packets
When input scalars are recorded by different
modules
– We need the host variable to match TCP and
UDP modules under the same host
Compute the total number of transport packets (the
sum of the TCP and UDP packet counts) for each
host
Value: ${host=**}.udp.pkCount +
${host}.tcp.pkCount
Name: transportPkCount
Module: ${host}
Computation Examples 2
Modules with largest RTT (1 of 2)
A network has various modules recording ping
round-trip delays (RTT)
We want to count the modules with large RTT values
(where the average RTT is more than twice the
global average in the network)
We need to do it in steps
Step 1:
Value: mean('rtt:vector')
Name: average
Computation Examples 2
Modules with largest RTT (2 of 2)
Step 2:
Value: average / mean(**.average)
Name: relativeAverage
Step 3:
Value: count(relativeAverage)
Grouping: value > 2.0 ? "Above" : "Normal"
Name: num${group}
Module: Net
Simulation Models and INET
In this module
We shall cover
What is a simulation
model?
Types of Simulation Models
INET
Simulation Models and INET
What is Simulation
Model?
As we know that
OMNET++ is not a simulation
itself
It is a framework that allows
simulation libraries
– Implement protocols
Simulation Models and INET
Types of Simulation Model
(1 of 2)
Domain-specific functionality is
provided by model frameworks
– WSNs
– Ad-hoc networks
– Internet protocols,
– Performance modeling
– Photonic networks, etc.,
Developed as independent
projects
Simulation Models and INET
Types of Simulation Model
(2 of 2)
Reusability of models in
OMNeT++ is due to its
modular architecture
Simulation models are easily
integrated into OMNET++
https://omnetpp.org/models
Simulation Models and INET
Some Well-known Types
INET Framework
OverSim
Veins
INETMANET
MIXIM
Castalia
Simulation Models and INET
INET (1 of 2)
The INET Framework can be
considered the standard
protocol model library of
OMNeT++
Contains models for the
Internet stack
― TCP, UDP, IPv4, IPv6, OSPF,
BGP, etc
Simulation Models and INET
INET (2 of 2)
Wired and wireless link layers
― Ethernet, PPP, 802.11, etc)
― Kademlia
― Pastry
Unstructured
― GIA
Simulation Models and INET
Veins
Inter-Vehicular
Communication (IVC)
simulation framework
It is a road traffic
microsimulation model
Simulation Models and INET
INETMANET
Fork of INET framework
Simulation framework for
mobile ad-hoc networks
Written and maintained by
Alfonso Ariza.
Simulation Models and INET
MIXIM
Modeling framework created
for
― Mobile wireless
― Fixed wireless
― WSNs
― Ad-hoc networks
Radiowave propagation
Interference estimation
Power consumption
Wireless MAC protocols
Simulation Models and INET
CASTALIA
Simulation framework for
networks of low-power
embedded devices
Offers models for
― Temporal path loss
― Fine-grain interference
― RSSI calculation
― MAC protocols
Design Tour of INET 1
In this module
in Ethernet environments
Walk through features of
INET
Peek into various
– Packets
– Queues
– Internal tables
Design Tour of INET 1
On simulation start
Ethernet autoconfiguration precedes
ARP
Design Tour of INET 2
In this module
in Ethernet environments
Walk through features of
INET
Peek into various
– Packets
– Queues
– Internal tables
Design Tour of INET 2
Entities at work
Various compound modules interact
with each other
TCP host on Ethernet
Router
TCP server
How end-to-end transmission
takes place?
Design Tour of INET 2
TCP Client
SYN sent
Activates
Network layer
that activates ARP
Design Tour of INET 2
Router
ARP request
Activates
Router to send ARP
reply
Design Tour of INET 2
TCP Server
ARP request/reply
Retrieve MAC addresses
at every hop till TCP
SYN request reaches in
IP packet at the server
that sends TCP
SYN/ACK
Design Tour of INET 2
End-to-end transmission
Yellow: Node
Red: Collided and
transmitting on link
backing off
Design Tour of INET 3
In this module
in Ethernet environments
Walk through features of
INET
Peek into various
– Packets
– Queues
– Internal tables
Design Tour of INET 3
Ethernet Compound
Module
In order to further understand how
INET works, let us explore Ethernet
(Compound Module)
Consists of
― Arp
― Encap
― And Mac
Design Tour of INET 3
Ethernet Compound Module
Right click to see the
module output
ARP)arpTest.client.eth[0
].arp
Design Tour of INET 3
arpTest.client.eth[0].arp
module output
Design Tour of INET 3
Inside ARP Packet
ARP Broadcast
Message
Design Tour of INET 3
ARP Packet Class (Generated by .msg file)
This packet is
// file: ARPPacket.msg appended with
message ARPPacket broadcast address in
{ control info (a small
fields: data structure)
int opcode enum(ARPOpcode);
MACAddress srcMACAddress;
MACAddress destMACAddress;
IPAddress srcIPAddress;
IPAddress destIPAddress;
};
Design Tour of INET 3
We shall understand
What is top-down approach
to NeMS?
Phased roll-out
User-centric aspects
Introduction to top-down approach to modelling and
simulation
Top-down approach
to NeMS
Networks are complex to
design
One-time design of
simulation is cumbersome
Top-down: Phased roll-out
of model-simulate cycle
― Iterative
Introduction to top-down approach to modelling and
simulation
Rolling-out of model at every layer to Design
a Network
Application Throughput
Application
Transport
Network
Link
Physical
Introduction to top-down approach to modelling and
simulation
Strategy
In this module
We develop an understanding
of
Quantification
Formalism
mathematical expressions
Rules for Mathematical Reading
Quantification
The act of counting and
measuring that maps
human sense, observations
and experiences into
members of some set of
numbers
Facts represented as
quantitative facts are the
basis of science
Rules for Mathematical Reading
Formalism
Mathematics creates models
that have certain relationships
Statements of mathematics
can be considered to be
statements about the
consequences of certain string
manipulation rules
Rules for Mathematical Reading
In this module
We shall know
Constituents of an equation
What is an equation?
A statement that the values of
two mathematical expressions
are equal
indicated by “=” sign
Constituents of an
equation?
Expressions consist of one or
more of these arguments
– Numerical constants
– Symbolic names
– Mathematical operators
– Functions
– Conditional expressions
Rules for Mathematical Writing
– Definite start
– Definite end
Segments should be
represented linearly
Rules for Mathematical Writing
Hierarchical
Rules for Mathematical Writing
Nonlinear
with
crossing
Rules for Mathematical Writing
Linear
Rules for Mathematical Writing
In this module
We shall know
Constituents of an equation
What is an equation?
A statement that the values of
two mathematical expressions
are equal
indicated by “=” sign
Constituents of an
equation?
Expressions consist of one or
more of these arguments
– Numerical constants
– Symbolic names
– Mathematical operators
– Functions
– Conditional expressions
Rules for Mathematical Writing
– Definite start
– Definite end
Segments should be
represented linearly
Rules for Mathematical Writing
Hierarchical
Rules for Mathematical Writing
Nonlinear
with
crossing
Rules for Mathematical Writing
Linear
QoE—Usability
In this module
We shall explore
What is usability?
Connotations of usability on
network model
QoE—Usability
What is usability? (1 of 2)
Usability (Ub) is defined as the
ease of use with which
network users can access the
network and services
Ergonomic and technological
facilitation
– Networks should make
users’ jobs easier
QoE—Usability
What is usability? (2 of 2)
Some design decisions have a
negative affect on usability
– Strict security
Some choices are user friendly
– WiFi
– DHCP
QoE—Usability
Understanding usability
Usability expressions
QoE—Usability
Connotations
Usability (Ub) is expressed as a
function of network devices
The top-down approach
implies that the assessment of
overall usability has to be
based on the performance of
– Hubs/switches
– Routers/gateways
QoE—Scalability
In this module
We shall explore
What is Scalability?
Scalability analysis
Connotations of scalability
on network model
QoE—Scalability
Ability to grow
What is scalability?
Scalability refers to the ability
to grow (or add)
Factors to be added
― Number of applications
― Number of sites
― Addressing at sites
― No. of users
― No. of servers
QoE—Scalability
Effects of growth
Efficiency decreases with
increasing factors
– But increases with
increasing “other” factors
Execution time increases with
increasing factors
– But decreases with
increasing “other” factors
QoE—Scalability
Tmsg = ts + twL
QoE—Scalability
Connotations
Scalability is expressed as a
function of factors in the
network
This criteria affects the design
choices made for the network
model
QoE—Planning for Expansion
In this module
We shall understand
Why plan to expand?
Why plan?
Expansion is unavoidable
Unplanned expansion causes
performance degradation
– Execution time
– Efficiency
Planning is necessary
– Preemption is key
– Late planning is no
planning
QoE—Planning for Expansion
In this module
We shall understand
What is data access?
Metcalfe's law
Connotations
QoE—Expanding Access to Data
Access to data
Social networking has emerged
Extranets need topology
definitions & dedicated
bandwidth allocation
– Classic 80-20 rule
Increased access
– Data available to more
departments
– Increased utilization of
network services
QoE—Expanding Access to Data
Metcalfe's Law
Community value of a network
grows as the square of the
number of its users
Often cited as an explanation
for the rapid growth of the
Internet
QoE—Expanding Access to Data
Connotations
Network model is more scalable
than the number of nodes and
servers in the topology
The total traffic load generated
depends upon the user activity
QoE—Constraints on Scalability
In this module
We shall understand
Parts of model
Constraints of scalability
Connotations
QoE—Constraints on Scalability
― Memory
Protocols
― Operation
― Message formats
Devices
― Ports
― Specifications
And more!
QoE—Constraints on Scalability
Maximum scaled up
network
Given by MinMax decision rule
Min(Nmax,Omax,Mmax,Smax)
• The strength of the chain is
determined by the weakest link
QoE—Constraints on Scalability
Specific example
Constrained addressing
― IPv4
on 31 Jan 2011
― 24 Sep 2015 for North
America
Unconstrained addressing (for
now!)
― IPv6
In this module
We shall understand
What is availability?
Vs reliability
Vs capacity
Vs Redundancy
Specifying availability
requirements
QoE—Availability
The degree to which a system, subsystem or
equipment is in a specified operable and
committable state
In this module
We shall understand
The question
In this module
We shall understand
What is availability
specification?
Per year (365 days)
Per calendar year
Per spurt
QoE—Specifying Requirements
Measurable is achievable
In this module
We shall understand
What is 5 9s?
Impact on costs
Example
QoE—Five Nines Availability
Enterprise
In this module
We shall understand
or methodology
QoE—Cost of downtime
Prioritize Business
Functions
Business functions
necessary to sustain that
core competency
― And associated IT
infrastructure
• 80% of available resources
restore 20 % systems,
applications, and data
QoE—Cost of downtime
Outage Types,
Frequencies, &
Duration
Branch Outage
Regional outage
Data center outage
National outage
QoE—Cost of downtime
Calculate cost
― Costing $300/hour
In this module
We shall understand
What is typical
representation of
availability?
Availability of components
and service
Example
QoE—MTBF AND MTTR
In this module
We shall understand
Definition
An overall working
Many different ways to
measure the performance
of a network
― Each network is different
Network
Performance
Response Optimum
Capacity
time Utilization
QoE—Network Performance
The data-carrying capability of a circuit or network, usually
measured in bits per second (bps)
Response Optimum
Capacity
time Utilization
QoE—Network Performance
The percent of total available capacity in use
Response Optimum
Capacity
time Utilization
QoE—Network Performance
Maximum average utilization before network is considered
saturated
Response Optimum
Capacity
time Utilization
QoE—Network Performance
Quantity of error-free data successfully transferred between
nodes/sec
Response Optimum
Capacity
time Utilization
QoE—Network Performance
Sum of all the data all network nodes have ready to send at
particular time
Response Optimum
Capacity
time Utilization
QoE—Network Performance
The amount of useful traffic that is correctly transmitted, relative
to total traffic
Response Optimum
Capacity
time Utilization
QoE—Network Performance
An analysis of how much effort is required to produce a certain
amount of data throughput
Response Optimum
Capacity
time Utilization
QoE—Network Performance
Time between a frame being ready for transmission from a node and delivery
of the frame elsewhere in the network
The amount of time average delay varies)
Response Optimum
Capacity
time Utilization
QoE—Network Performance
The amount of time between a request for some network service
and a response to the request
Response Optimum
Capacity
time Utilization
QoE—Optimum Network Utilization
In this module
We shall understand
What is optimum?
What is optimum network
utilization?
– At WANs
– At LANs
– Typical values
QoE—Optimum Network Utilization
Definition of optimum
Selection of a best element
(with regard to some
criteria) from some set of
available alternatives
QoE—Optimum Network Utilization
Optimum network
utilization (1 of 4)
•How much % of bandwidth
capacity in a specific time
period?
•Time varying phenomenon
– Instantaneous,
averaged, weighted)
• Both goal & constraint
QoE—Optimum Network Utilization
Optimum network
utilization (2 of 4)
•Typical value is 70$%
– Exceeding this results in
performance
degradation
QoE—Optimum Network Utilization
Optimum network
utilization (3 of 4)
•WAN links utilization is more
crucial than LAN
– Pay per packet
•Compression, caching and
concatenation used to reduce
WAN utilization
QoE—Optimum Network Utilization
Optimum network
utilization (4 of 4)
•LANs are over-budgeted
– Fast Ethernet)
•Full-duplex vs half duplex
switches
•User activity levels
•LANs suffer from exceeding
utilization in switch-to-switch
QoE—Throughput
In this module
We shall understand
What is throughput?
Throughput vs offered load
QoE—Throughput
Definition of throughput
•Quantity of error free data
transmitted/ sec
– Erroneous
transmissions futile
• Ideally, should be the same
as capacity
QoE—Throughput
Deviation indicates the limitations of media type,
device and network
QoE—Throughput of devices
In this module
We shall understand
What is throughput?
Throughput vs offered load
QoE—Throughput of devices
Types of device
throughputs
•Inter-networking devices
give throughput as in
– TCP/IP: Packets per
second
– ATM: Cells per second
•Sizes vary from 53, 64 to
1518 Bytes
QoE—Throughput of devices
Example—CISCO devices
•Traffic generators-device-
traffic checkers in tandem
measure throughput
– Smaller packets give
better pps
Cisco claims of 400 million
In this module
We shall understand
Definition
Factors affecting goodput
Mathematical formulation
QoE—Application Layer Throughput
Definition
•Application layer throughput
= goodput + badput
•Goodput vs badput
•Badput contributed by
retxns, header etc
– Fraction of packets that
collided/lost
• Fc = C/N
• Fc = L/N
QoE—Application Layer Throughput
Factors affecting
goodput (1 of 3)
•End-to-end error rates
•Protocol functions
(handshaking, windows, &
acks)
•Protocol parameters (frame
size, retx timers)
•pps rate of networking
devices
•Lost packets at networking
devices
QoE—Application Layer Throughput
Factors affecting
goodput (2 of 3)
•Workstation & server
performance factors:
– Disk-access speed
– Disk-caching size
– Device driver
performance
•Computer bus performance
(capacity/arbitration)
QoE—Application Layer Throughput
Factors affecting
goodput (3 of 3)
•Processor (CPU)
performance
•Memory performance
(access time for real and
virtual memory)
•Operating system
inefficiencies
•Application inefficiencies or
bugs
QoE—Application Layer Throughput
Application layer
goodput
QoE—Application Layer Throughput
Connotations
•Application layer throughput
provides insight into “useful'
transmissions
– It relates resource
allocation down to
physical layer
throughput
QoE—Efficiency
In this module
We shall understand
Definition
Factors affecting efficiency
Throughput vs efficiency
Average efficiency
QoE—Efficiency
Definition
•Application layer throughput
= goodput + badput
•Goodput vs badput
•Badput contributed by
retxns, header etc
– Fraction of packets that
collided/lost
• Fc = C/N
• Fc = L/N
QoE—Efficiency
Factors affecting
efficiency (1 of 3)
•Access protocols
– high number of users
showing activity
– Ethernet not efficient
at high collision rates
QoE—Efficiency
Factors affecting
efficiency (2 of 3)
•Frame size
– Using large frame is
useful for single user on
WAN links
•Serialization delay on WAN
links results in unfair
treatment
– for real-time shorter
frames enqueued in
router
QoE—Efficiency
In this module
We shall understand
Definition of delay
Definition of delay variation
QoE—Delay and Jitter
Delay
•Voice and video applications
(especially interactive)
demand minimum delay
•Other applications such as
Telnet remote echo need
timed performance
QoE—Delay and Jitter
Sources of packet delay
transmission
A
propagation
B
nodal
processing queueing
In this module
We shall understand
Causes of delay
Effect of utilization on delay
QoE—Causes of Delay
Causes of Delay (1 of 3)
•Propagation
– Media type
– Length
•Transmission (serialization)
– 1024 Bytes on T1
•Switching delay
– upto 5-20 microsec for
64 Bytes frame
QoE—Causes of Delay
Causes of Delay (2 of 3)
•Router delay
– Look-up, router
architecture,
configuration
– Software features that
optimize the
forwarding of packets
•NAT, IPSEC, QoS, ACL
QoE—Causes of Delay
Causes of Delay (3 of 3)
•Queuing delay
– Dependent upon
utilization
Formula
Queue depth = Utilization/(1
– Utilization)
QoE—Causes of Delay
Queue Depth vs Utilization
QoE—Delay and Jitter
Implications of queuing delay
traffic intensity
QoE—Delay variation
In this module
We shall understand
Measurement of jitter
QoE—Delay variation
All animals are equal, but some animals are more equal
than others (George Orwell)
Delay variation (1 of 2)
Amount of time average
delay varies
Voice, video, and audio are
intolerant of delay variation
Tradeoffs needed for
efficiency for high-volume
applications versus low
QoE—Delay variation
Delay variation (2 of 2)
Concept of jitter buffer to
smoothen out the jitter
Variations on the input side
are smaller than the buffer
Acceptable variation is 1-2%
of the delay
QoE—Delay variation
Jitter types (1 of 4)
Jitter is quantified in two
ways
Delay jitter
― bounds maximum
perfectly periodic
QoE—Delay variation
Jitter types (2 of 4)
Used for Interactive
communication
voice and video
teleconferencing
Helps to translate to
maximum buffer size
needed at the destination
QoE—Delay variation
Jitter types (3 of 4)
Second measure is rate
jitter
Bounds difference in
Jitter types (4 of 4)
Useful measure for many
real time applications
Video broadcast over the
net
Slight deviation of rate
translates to only a small
deterioration in the
perceived quality
QoE—Delay variation
Jitter Analysis Points
Kay, Rony. "Pragmatic network latency engineering
fundamental facts and analysis." cPacket Networks,
White Paper (2009): 1-31.
QoE—Delay variation
Measurement of jitter
QoE—Response Time
In this module
We shall understand
Mathematical form
QoE—Response Time
Definition
•The amount of time
between a request for some
network service and a
response to the request
QoE—Response Time
Measurement Points Locations
Tim R Norton. "End-To-End Response Time: Where to
Measure?" Computer Measurement Group Conference
Proceedings, 1999.
QoE—Response Time
Measurement of Response Time
[1] Reinder J., Bril., System Architecture and Networking. TU/e
Informatica
[2] Sjodin, Mikael, and Hans Hansson. "Improved response-
time analysis calculations." Real-Time Systems Symposium,
1998. Proceedings., The 19th IEEE. IEEE, 1998.
QoE—Response Time
Measurement of Response Time
QoE—Response Time
Measurement of Response Time
Ceiling function represents maximum number of
pre-emptions by higher priority processes
In this module
We shall understand
What is security?
Implementation
QoE—Security
Definition
Protection of information
systems from threat
Hardware
Software
Information on them
Avoidance from
Disruption
Misdirection of the
Implementation
Includes controlling physical
access to the hardware
Protecting against harm via
Network access
Data
Code injection
QoE—Security
Tradeoff
Security and deployment
•Operational ease
•Too much secure:
bothersome inviting
workarounds
•Thumb rule: cost of security
implementation << cost of
recovering from security
lapse
QoE—Identifying Network Assets
In this module
We shall understand
Bell-Lapadula Model
•Users as Subjects
•Predicates
– Devices and data as
Objects
•Process algebra provides the
action (verb) of subject over
predicates
QoE—Reconnaissance Attacks
In this module
We shall understand
What is reconnaissance?
How to measure and
Definition
• Reconnaissance is a type of
computer attack
•Intruder engages with the
targeted system
– Gathers information
about vulnerabilities
QoE—Reconnaissance Attacks
Types
Active
reconnaissance
Port scanning
Passive reconnaissance
Sniffing
War driving
War dialing
QoE—Reconnaissance Attacks
In this module
We shall understand
Definition
•Enlist all the activities,
actions, hardware/software
• Confidentiality
• Integrity
• Authorization
• Authenticity
• Availability
• Encryption
QoE—Security Requirements
Common Vulnerability
Scoring System
Provides a repeatable
quantitative score for
computer security
vulnerabilities
QoE—Security Requirements
In this module
We shall understand
What is manageability?
Manageability metric
QoE—Manageability
SMART goals - Specific, Measurable, Achievable,
Realistic and Timely
Definition
•The level of human effort
required to keep that system
operating at a satisfactory
level
– Deployment
– Configuration
– Upgrading
– Tuning
– Backup
– Failure recovery
QoE—Manageability
Assessing Manageability
Candea, George. "Toward Quantifying System
Manageability." UseNix HotDep. 2008.
QoE—Manageability
Manageability Metric
Commentary (1 of 3)
Manageability is reduced
proportionally to how long
the management tasks take
And to how many atomic
steps are involved in each
such task
QoE—Manageability
Commentary (2 of 3)
The fewer steps there are,
the lower the exposed
complexity of the system
The faster the management
tasks can be completed, the
lower the likelihood of
trouble
QoE—Manageability
Commentary (3 of 3)
Less management a system
requires (i.e., the longer
TotalTimeeval for the same
Ntotal), the easier it is to
manage
Equivalently, the less the
system needs to be
managed, the better
QoE—DoS Attack
In this module
We shall understand
Analysis
QoE—DoS Attack
Definition
An attempt to make a
machine or network
resource unavailable
to its intended users,
Temporarily
Indefinitely
QoE—DoS Attack
Implementation
Transmit a large number of
packets
TCP Syn attack
Ping attack
In this module
We shall understand
Analysis
QoE—DoS Attack
Definition
An attempt to make a
machine or network
resource unavailable
to its intended users,
Temporarily
Indefinitely
QoE—DoS Attack
Implementation
Transmit a large number of
packets
TCP Syn attack
Ping attack