Title: Network Simulation
1Network Simulation
- Dave Lin
- 2001/3/31
- R89055_at_im.ntu.edu.tw
2Overview
- Simulation Modeling
- Probability and Statistics in Simulation
- Elements of Discrete Simulation
- Queue Model Example
- MAC and PHY Layer Simulation Example
- Conclusion
- References
3Simulation Modeling
4Why Simulation?
- To represent a real system by a model.
- Simulation is the next best ting to observing a
real system in operation. - To collect pertinent observations about the
system over time. - Queuing theory? Queuing models are rather
restrictive.
5Types of Simulation
- Discrete
- Observation are gathered only at selected points
in time when certain changes take place in the
system. - Ex. M/M/1 model
- Continuous
- Observations be collected continuously at every
point in time. - Ex. Oil level in tank
6How the Simulation Clock Ticks
- Automatic internal clock is designed to initiate
the action of collecting observations at the
moment changes take palace in the system. - Continuous simulation
- Looking at the system at equally spaced time
intervals.
7How the Simulation Clock Ticks (Contd)
- Discrete Simulation
- System is observed only when specific changes
occur. - Ex. single source, single queue, single server.
A1
A2
A3
A4
Simulation Time
D1
D2
8Randomness Element in Simulation
- Process of arrival at and departure from a
facility occurs in a random fashion. - Only way we can represent this randomness is by
using probability distributions to describe the
variables under consideration. - Ex. Poisson arrival process
- Ex. Random select between two servers
9Discrete Simulation Languages
- Event-scheduling
- Deal directly with the individual action
associated with the occurrence of each event
type. - Highly flexible in representing complex situation
since user must provide details. - Process-based
- Represent the movement of an instance from it
enters the system until it is discharged. - Relieving the user form programming most of the
detial.
10Other Simulation Language
- Object-Oriented Language
- Natural Simulation Language
- Good and easy way to model system
- Network Simulation Language
- OPNET Modeler - down to finite state machine,
state logic - COMNET III network nodes, links and protocols
11Two Sides of Simulation
- Analysis, Design, Construction, Testing and
running of the model - Interpretation of model output
- Most crucial and probably the most neglected
among simulation users. - Simulation study must be subjected to all the
proper statistical techniques just as in any
other physical experiment.
12Probability and Statistics in Simulation
13Role of Probability and Statistics in Simulation
- Randomness is a key element in the description of
the system. - Simulation output must be viewed as a sample in a
statistical inference tests. - Measures of performance of a simulation model
typically must be expressed in terms of
appropriate confidence intervals.
14Identifying Distribution Based on Historical Data
- Summarizing historic or observed data in the form
of an appropriate histogram. - Hypothesizing a theoretical distribution based on
the shape of the histogram and then testing its
goodness-of-fit using an appropriate statistical
model. - Chi-Square Test
- Kolmogrov-Smirnov Test
15Statistical Output Analysis
- Confidence Intervals
- Simulation results should thus be presented in
the form of statistical confidence intervals. - Hypothesis Testing
- Hypothesis testing is used in simulation
experiments when it is desired to test whether a
mean of a given measure of performance is equal
to a specified value.
16Elements of Discrete Simulation
17Concept of Events in Simulation
- In discrete simulation, changes in the systems
statistics are triggered by the occurrences of
certain key event. - The use of events is fundamental to the
development of all discrete simulation languages.
18Common Simulation Approaches
- Event-Scheduling Approach
- Activity-Scanning Approach
- Process-Simulation Approach
19Event-Scheduling Approach
- Event include two basic attributes
- Type of event
- Occurrence time
- Event calendar file (E.FILE)
- List which store event chronologically
- Represents the automatic time advancing mechanism
20Event-Scheduling Approach (Contd)
- Single source, single queue, single server
example - Gather information (statistics)
- Length of QUEUE
- Waiting time in QUEUE
- Utilization of SERVER
- Idle time of FACILITY
- Events
- Arrival Event
- Departure Event
21Event-Scheduling Approach (Contd)
- Arrival Event
- Generate and store chronologically the occurrence
time of the next arrival ( Current simulation
time interarrival time) - If SERVER is idle
- Enter customer in service and indicate the SERVER
is busy - Update SERVER idle time statistics.
- Generate and store chronologically the occurrence
time of the departure event ( current simulation
time service time) - Go to 3c.
- If SERVER is busy
- Place the customer in QUEUE.
- Update QUEUE length statistics.
- Destroy the current event, select the next one on
time scale.
22Event-Scheduling Approach (Contd)
- Departure Event
- IF QUEUE is empty
- Declare the server idle.
- Go to 2c.
- If QUEUE is not empty
- Remove a customer from queue and update QUEUE
waiting time statistics. - Generate and store the occurrence time of the
departure event ( current simulation time
service time). - Destroy the current event and select the next one
on the time scale.
23Event-Scheduling Approach (Contd)
Select the most imminent event (next event on
the time scale)
Implement departure event actions and insert new
events chronologically in the E.FILE
Implement arrival event actions and insert new
events chronologically in the E.FILE
Y
N
Arrival Event?
24Activity-Scanning Approach
- Similar to the event-scheduling approach.
- Events
- Arrival event
- Departure event
- Service start event
- Arrival Event
- Place arrival customer in QUEUE.
- Generate and sore the next arrival event.
25Activity-Scanning Approach (Contd)
- Departure Event
- Declare SERVER idle.
- Service Start Event
- Remove a customer from QUEUE and start service in
SERVER. - Generate departure event from SERVER.
- Service start event would be executed under two
conditions are satisfied - QUEUE is not empty.
- SERVER is idle.
26Activity-Scanning Approach (Contd)
- Check to execute service start event after each
Arrival event or Departure event is executed
repeatedly. - Obviously inefficient process of repeatedly
checking. - Usually is simpler than event scheduling.
- Lack of widespread use in practice.
27Process-Simulation Approach
- Same concept of events utilized in event
scheduling. - Processor of simulation language with no
interference form the user, deals with
transaction generation, statistics collection
jobs. - More compact than in event scheduling.
- Less flexibility than event scheduling approach.
- Needs simulation language support.
28Collection Data in Simulation
- Observation-based and Timer-based statistical
variables. - Histograms.
- Queue statistics
- Avg. queue length, avg. waiting time
- Server statistics
- Avg. utilization, avg. busy time per server, avg.
idle time per server.
29Queue Model Example
- M/M/1 example
- M/M/m/m example
30Queue Model Example
Timer
Server 1
. . .
Recorder
Traffic Generator
Traffic Queue
Server m
31MAC and PHY Layer Simulation Example
- Bluetooth MAC layer
- 802.11b MAC layer
- Coexistence of Bluetooth and 802.11b PHY layer
32BTG
WTG
Timer
BMACM
WMAC SEND
BMACS
WMAC REC
PHY
BR
WR
PECM
33Conclusion
- Special attributes of wireless network simulation
- Time domain and Frequency domain interference.
- Simulation is a useful tool for studying network
behaviors. - There are good rules and tools for the
construction network simulation.
34References
- Hamdi A. Taha, Prentice-Hall ,Simulation Modeling
and Simnet ISBM 0-13-8811621-0