You are on page 1of 53

KKKT 6274

Modeling and Simulation of


Communication and Computer
Network
Prof. Dr. Mahamod Ismail
mahamod@eng.ukm.my
TEACHING PLAN (1/3)
Week Topics
1
(MBI)
Introduction to Simulation and Performance Modeling:
Analytical and Monte Carlo
2
(MBI)
Simulation Principle:
Event and Time Driven
3
(MBI)
Simulation Model:
Statistical, Random and Queue
4
(MBI)
Model Verification/Validation, Input/Output Analysis
LECTURE 3

SIMULATION MODEL
What is modeling?
A Model is a simplification of a real system
Modeling is the process of representing a system
with a specific tool to study its behavior
A model can be:
Analytic: when a mathematical approach is feasible (e.g.
Queuing Model)
Simulation: model used for complex systems
Experimental: when the real system already exists
A Model is a pattern, plan, representation
(especially in miniature), or description
designed to show the main object or workings
of an object, system, or concept.
Model may also refer to:
Abstractions, concepts, and theories
representations of objects
human and animal behavior
occupations
history and culture
lighting
In geography
http://en.wikipedia.org/wiki/Model
Model (Wikipedia)
6
In general, modeling is used for
systems with some sort of uncertainty
Waiting time in a restaurant/airport
Time to go from home to the University
Response time and Throughput of a web server
The productivity of manufacturing systems
Design of multi-processor machine
Performance of MAC protocols (e.g. CSMA/CA)
Examples
Examples: Movement
Consider a system when a given object move
This system can be modeled by the equation
S= V * t
Where S is the distance run through
V is the speed of the object
t is the time that has been observed.
This is simplification of the real world
Another model can take into account the direction of
movement, or the three dimension coordinate
It is therefore to study the behaviour of the system
based on a specific model
V
8
Source: HE et al.: AN ACCURATE MARKOV MODEL FOR SLOTTED
CSMA/CA ALGORITHM IN IEEE 802.15.4 NETWORKS, IEEE
COMMUNICATIONS LETTERS, VOL. 12, NO. 6, JUNE 2008
A. Kouba, M. Alves, E. Tovar
A Comprehensive Simulation Study of Slotted CSMA/CA
for IEEE 802.15.4 Wireless Sensor Networks
In IEEE WFCS 2006, Torino (Italy), June 2006.
Jelena Misic Vojislav B. Misic
Shairmina Shafi,
Performance of IEEE 802.15.4
beacon enabled PAN with uplink
transmissions in non-saturation
mode access delay for finite
buffers, Proceedings of the First
International Conference on
Broadband Networks
(BROADNETS04)
Example: MAC protocols (e.g.
CSMA/CA)
A radio propagation model is an
empirical mathematical formulation for
the characterization of radio wave
propagation as a function of frequency,
distance and other conditions.
Different types of models
Models for outdoor environments: Ground
wave, Sky wave, Environmental Attenuation,
Point-to-Point propagation models, Terrain
models, City Models
Models for indoor environments
Free Path Loss Model (Mathematical
Model)

Empirical Model of Radio Channel
Source: Kannan Srinivasan and Philip Levis,
RSSI is Under Appreciated, ACM Workshop on
Embedded Networked Sensors (EmNets 2006),
Example: Radio Propagation
Models
A model is never equal to the real system
because it is always simpler than the reality
The accuracy of a model is determined by its
tendency to approach the real system
Is that a problem?
Yes, if the model ignore important parameters of
the real system (over simplification)
No, if the model takes into account the important
parameters (ignoring some details is sometimes
not problematic)
Characteristics of a model
SYSTEM
Experiment with the
Actual System
Experiment with a
Model of the System
Analytical Solution Simulation
Too costly or disruptive
Not appropriate for the design
There is always the question
of whether it
actually reflects the system.
Mathematical Model
Make assumptions that take the
form of mathematical or logical
relationships
If the model is simple enough. E.g., calculus,
algebra, probability theory
Highly complex systems
Performance Evaluation of a
System
Simulation is not used when a suitable mathematical model exists
Simulations are often complex error-prone pieces of software
Simulation only produce approximate answers
Simulation can take a LONG time to execute
Mathematical models are less flexible, but they are exact and efficient
The problem is what model represents better the real world?
Simulation Model versus Analytical
Model
Dynamic Models
Represents a system
as it evolves over
time
Example: Cars arriving
to a parking
Static Models
Time plays no role
Represents the
system at a particular
point in time
Example: Mont Carlo
Method
Classification of Models
Deterministic Models
No probabilistic
component in the
system
Example: Worst-
Case Analysis of the
system
Stochastic Models
Some components
of the system has a
probablistic
behavior (Random
variable, event
probability)
Example: Queueing
systems
Classification of Models
# of cars in a parking lot
time
Bit Arrival in a Queue
Discrete Model
Continuous Model
time
bit bit
Continuous Models
The state of the
system changes
continuously
(e.g., chemical
processes)
Discrete Models
The state of the
system changes
only at discrete
points in time.
Classification of Models
Introduction
System
It is a collection of entities that act and interact
together toward the accomplishment of some
logical end (computer, network, communication
systems, queuing systems etc.)
Simulation
It is an experiment in a computer where the real
system is replaced by the execution of the
program
It is a program that mimics (imitate) the behaviour
of the real system
Introduction
Model
It is a simplification of the reality
A (usually miniature) representation of something;
an example for imitation or emulation
A model can be Analytical (Queuing Theory) or by
Simulation.
Performance evaluation (of a system)
It means quantifying the service delivered by the
System
Experimental, Analytical, or by simulation
Introduction
Queuing System
It is a system where entities ask service from a
shared resource(s) and have to wait for service
until resource is available.
Examples
Customers waiting in a bank
Packets waiting in a network router/switch
Travelers waiting in airport for flight registration
Tasks requesting execution in a processor (semaphors)
Bank Transactions requesting access to a database
A Simple Queuing Model
Use Queuing models to:
Describe the behavior of queuing systems
Evaluate system performance
A Queue System has:
Queue (Buffer): with a finite or infinite size
Server: with a given processing speed
Customers: Entities requesting the shared resource (i.e. server).
Events: Arrival/Departure (with given rates)





Queue Server
Queuing System
Examples
Real System (Motherboard)
Models of the system
Simulation models of the system
Examples
Examples
Example
Models of the System
Examples
Circuit Simulator
Models of the system
WHAT IS COMPUTER SIMULATION?

Computer Simulation
A Computer Simulation is a computer program
that attempts to simulate an abstract model of a
particular system.
that describes the behavior of a real (physical)
system and its evolution in time
How it works?
The behavior of the system is described by state
variables
The simulation program modifies the states
variables to emulate the evolution
Why we need simulation?
It may be too difficult, risky, or expensive to observe a
real, operational system
Parts of the system may not be observable (e.g.,
internals of a silicon chip or biological system)
Minimize
production
risk
Analyze systems (performance, behavior) before they
are built
Reduce the number of design errors
Optimize design to improve the behavior
Analyze operational systems
Create virtual environments for training, entertainment
Make
design more
efficient
System Analysis
Telecommunication Networks (ATM, IP, TCP, UDP, )
Transportation systems (Traffic, Urban planning, Metro Planning, )
Electronic systems (e.g., microelectronics, computer systems)
Battlefield simulations (blue army vs. red army)
Ecological systems, Manufacturing systems, Logistics
Virtual Environments
Physical phenomena (e.g. Trajectory of projectiles)
training and entertainment (e.g., military, medicine, emergency
planning, flight simulation)
Applications of Simulation
War gaming: test
strategies; training
Flight Simulator
Transportation systems:
improved operations;
urban planning
Computer communication
network: protocol design
Parallel computer systems:
developing scalable software
Games
A few more applications
Why Modeling and Simulation?
Why to use models?
Implementation on real systems is very complex and costly,
Experimentation on real systems may be dangerous (e.g. chemical
systems)
If models adequately describes the reality, experimenting with
them can save money and time, and reduce the development
complexity
When to use simulations?
Analytic models may be very complex to evaluate, and may lead
to over implication of the real system
Simulation can be a good alternative to evaluate the system
behavior very close to reality

PERFORMANCE EVALUATION
Performance Metrics
The delay metric
how much time do I need to wait?
The throughput metric
how much customer the system is able to serve per time unit?
Performance Metrics
The Queuing Times





Queue
Server
Queuing System
Queuing Time Service Time
Response Time (or Delay)
The Performance Metric is a measurable quantity
that precisely captures what we want to measure
(response time, throughput, delay, etc.).
Performance Metrics
For example, in computer systems, we might
evaluate
The response time of a processor to execute a
given task.
The execution time of two programs in a multi-
processor machine.
In network systems, we might evaluate
The (maximum/average) delay experienced by a
voice packet to reach the destination
The throughput of the network
The required bandwidth to avoid congestion
Performance Metrics
What does affect the
performance?
The performance of a system is dramatically affected by the Workload.
The Workload: it characterizes the
Quantity: e.g. number of cars
Nature: type of cars (cars, trucks,
motocycle, etc.)
In the context of Web Servers, system
inputs are http requests (GET or POST
requests). The workload characterizes:
The intensity of the requests: how many
requests are received by the web server.
High intensities deteriorate the
performance.
The nature of the requests: the request can
be simple GET request or a request that
require the access of a remote database.
The performance will be different for
different request types.
What does affect the
performance?
Benchmarks
Benchmarks: used to generate loads that is intended to
mimic a typical user behaviour.
Wikipedia definition:
In computing, a benchmark is the act of running a computer
program, a set of programs, or other operations, in order to
assess the relative performance of an object, normally by
running a number of standard tests and trials against it.
Benchmarking is usually associated with assessing
performance characteristics of computer hardware:
Example: the floating point operation performance of a CPU.
Software benchmarks: run against compilers or database
management systems.

CS433: Modeling and Simulation
Dr. Anis Kouba
Al-Imam Mohammad Ibn Saud University

02 October 2010
Lecture 02: Modeling
0
0.05
0.1
0.15
0.2
0.25
0 0.2 0.4 0.6 0.8 1 1.2
W
(
s
e
c
)

()
Waiting vs. Utilization
Deterministic Performance
Using Network Calculus
Queueuing System
Stochastic Performance
Using Queueing Theory
Example: Deterministic vs.
Stochastic
Define goals, objectives of study
Develop conceptual model
Develop specification of model
Develop computational model
Verify model
Validate model
Fundamentally an
iterative process
Model Development Lifecycle
Determine Goals and Objectives
What do you want to do with the model?
It may be an end in itself
More often, it is a means to an end
Goals may not be known when you start the project!
One often learns things along the way
Develop Conceptual Model
An abstract representation of the system
What should be included in model? What can be left out?
What abstractions should be used? What is the level of details?
Appropriate choice depends on the purpose of the model

Model Development Lifecycle
Develop Specification Model
A more detailed specification of the model including more specifics
Collect data to populate model
Example:
Traffic: Road geometry, signal timing, expected traffic demand, driver behavior
Communication: network topology, message type, inter-arrival time, data rates
Empirical data or probability distributions often used
Develop a Computational Model
Executable simulation model
Software approach
General purpose programming language
Special purpose simulation language
Other (non-functional) requirements
Performance
Interoperability with other models/tools/data

Model Development Lifecycle
Verification
Did I Build the Model Right?
Does the computational model match the specification model?
Debugging: checking if the program contains any programming errors.
Verification is different from Validation: (see model validation)!
Validation
Did I Build the Right Model?
Does the computational model match the actual (or envisioned) system?
Typically, the validation of a simulation model can be done by comparing
Measurements of actual system
An analytic (mathematical) model of the system
Another simulation model
By necessity, validation is always an incomplete activity!
Often can only validate portions of the model
If you can validate the simulation with 100% certainty, why build the simulation?
Model Development Lifecycle
Example: Airport Check-in Desk
Queuing
We consider flight check-in desks in an Airport. The administration of the airport
wants to improve its quality of service by reducing the waiting time of travelers.
For that purpose, they want to design what could be the best queuing strategy to
have the minimum waiting time.
The main problem is to know what is the best queuing strategy that reduces the
waiting time of travelers in check-in desks.
Step. 1. Define the objectives of the
study
Main Objective: what is the best queuing strategy
that reduces the waiting time of travelers in check-in
desks.
Find a model that enables to compute waiting time of
travelers
Solution 1. Queueing Theory (Analytical Model)
Solution 2. Simulation (Computer Program Model)
Two Possible Models

Model 1 Model 2
Step. 2. Develop Conceptual Model
One Queue
N=3 servers
Three Queues
N=3 servers
Model 1 Model 2
Customers: travelers that arrive to the check-in desk
Servers: represents the agent (officer) that makes the flight
registration
What are the elements of the system?
Step. 3. Develop Specification
Model
One Queue:
Length= 60 Travelers
N=3 Agents
Service rate: 30
travelers/hour
Travelers arrive with a rate
1 travelers/minute
Model 1 Model 2
What are the characteristics of the elements of the system?
Three Queue:
Length= 20 Travelers/Queue
N=3 Agents
Service rate: 30 travelers/hour
Travelers arrive with a rate 1
travelers/minute
Travelers choose a queue with a probability
of 1/3.
Step. 4. Develop Computation
Model
Model 1 Model 2
Analytical Model: Queueing Theory
( )
( )
1
1
2 6 minutes Delay Model

= =

( )
( )
0
2
1 26
( 1) 2.88 minutes
! 9
1
N
N
Delay Model N
N

t


| |
= + = = |
|

\ .
Model 1 is better than Model 2 because it has lower delay
Step. 4. Develop Computation
Model
Model 1 Model 2
Simulation Model: Arena
Model 1 is better than Model 2 because it has lower delay
( )
2 5.86 minutes Delay Model =
( 1) 2.93 minutes Delay Model =
Step. 4. Develop Computation
Model
Simulation Model: Arena
Simulation Tools
Symbolic versus numerical; Open and closed
loop
Software package
Mathematica
Simscript
Scilab
Mathcad
References
Dr. Anis Kouba, CS433: Modeling and Simulation
(http://coins.csrlab.org/imamu/akoubaa/cs433/)
ref

You might also like