simulation of complex computer networks lecture 1 and lecture 2

60
Simulation of Complex Computer Simulation of Complex Computer Networks Networks Lecture 1 and Lecture 2 Lecture 1 and Lecture 2 Urban Bilstrup (E327) Urban Bilstrup (E327) [email protected] [email protected] 100322 100322

Upload: loman

Post on 24-Feb-2016

21 views

Category:

Documents


1 download

DESCRIPTION

Simulation of Complex Computer Networks Lecture 1 and Lecture 2. Urban Bilstrup (E327) [email protected] 100322. Course Overview - Course Objectives. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

Simulation of Complex Computer NetworksSimulation of Complex Computer Networks

Lecture 1 and Lecture 2Lecture 1 and Lecture 2

Urban Bilstrup (E327)Urban Bilstrup (E327)[email protected]@hh.se

100322100322

Page 2: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

2

Course Overview - Course Overview - Course ObjectivesCourse Objectives

The goal of the course is to give a deeper understanding of different The goal of the course is to give a deeper understanding of different kinds of complex computer networks and their performance by kinds of complex computer networks and their performance by constructing simulation models and evaluating simulation results. constructing simulation models and evaluating simulation results.

Give an understanding of different simulation methods and their Give an understanding of different simulation methods and their limitations and possibilities. limitations and possibilities.

Be able to use modeling and simulation as a tool for evaluation of Be able to use modeling and simulation as a tool for evaluation of communication protocols and networks.communication protocols and networks.

Have an understanding of the limitations that are introduced when Have an understanding of the limitations that are introduced when using different simulation methods.using different simulation methods.

Independently specify, define, and implement simulation models.Independently specify, define, and implement simulation models.

Page 3: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

3

Course Overview – Course Overview – Primary ContentsPrimary Contents

Simulation methods, network topoogies, medium access, Simulation methods, network topoogies, medium access, TCP/IP and Internet, LAN, WAN, performance analyse of TCP/IP and Internet, LAN, WAN, performance analyse of simulation result.simulation result.

Focus is on Focus is on discrete event simulationdiscrete event simulation, data link layer, , data link layer, network toplogy level, and higher protocol level. network toplogy level, and higher protocol level.

Page 4: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

4

Course Overview – Teaching FormatsCourse Overview – Teaching Formats

Teaching includes lectures, and laboratory exercise with Teaching includes lectures, and laboratory exercise with mandatory written elaboration reports.mandatory written elaboration reports.

The course includes a theoretical part of 5 credits and an The course includes a theoretical part of 5 credits and an elaboration part of 2.5 credits. elaboration part of 2.5 credits.

The course is given in English.The course is given in English.

Page 5: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

5

Course Overview – Examination Course Overview – Examination

The examination of the theory part is conducted with a The examination of the theory part is conducted with a written exam; the grades of fail together with the pass written exam; the grades of fail together with the pass grades of 3, 4 and 5 will be awarded for this part of the grades of 3, 4 and 5 will be awarded for this part of the course.course.

The examination of the laboratory exercise is conducted The examination of the laboratory exercise is conducted through through written laboratory exercise reportswritten laboratory exercise reports, grades of , grades of fail or pass will be awarded for each report.fail or pass will be awarded for each report. The student The student must have passed all must have passed all laboratory exercises laboratory exercises before the before the written exam can be taken.written exam can be taken.

The overall grade of fail together with the pass grades of The overall grade of fail together with the pass grades of 3, 4 and 5 will be awarded for the course.3, 4 and 5 will be awarded for the course.

Page 6: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

6

Course Overview - Course Overview - Course LiteratureCourse Literature

L. L. Petterson and B. S. Davie, Network Simulation L. L. Petterson and B. S. Davie, Network Simulation Experiments Manual, 2Experiments Manual, 2eded, Morgan Kaufman Publishers, , Morgan Kaufman Publishers, 2007, ISBN-13: 978-0-12-373974-2. (MANDATORY, 22$ 2007, ISBN-13: 978-0-12-373974-2. (MANDATORY, 22$ at Amazon.us)at Amazon.us)

L. L. Petterson and B. S. Davie, L. L. Petterson and B. S. Davie, Computer Networks A Computer Networks A system approachsystem approach, 4, 4eded, Morgan Kaufman Publishers, 2007, , Morgan Kaufman Publishers, 2007, ISBN-13: 978-0-12-374013-7. (OPTIONAL)ISBN-13: 978-0-12-374013-7. (OPTIONAL)

A. M. Law, A. M. Law, Simulation Modeling and AnalysisSimulation Modeling and Analysis, 4, 4eded, , McGraw-Hill 2006, ISBN-13: 978-007-125519-6. McGraw-Hill 2006, ISBN-13: 978-007-125519-6. (OPTIONAL)(OPTIONAL)

Page 7: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

7

Course Overview - ScheduleCourse Overview - Schedule

Labs 5 x 2 hLabs 5 x 2 h

Page 8: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

8

INTRODUCTION TO COMPUTER SIMULATION

Page 9: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

9

OutlineOutline

The Nature of SimulationsThe Nature of Simulations Application Areas of Computer SimulationApplication Areas of Computer Simulation Advantages with Computer SimulationAdvantages with Computer Simulation Drawbacks with Computer SimulationDrawbacks with Computer Simulation Pitfalls with Computer SimulationPitfalls with Computer Simulation Systems, Models and SimulationSystems, Models and Simulation Elements of Simulation AnalysisElements of Simulation Analysis

Page 10: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

10

The Nature of SimulationsThe Nature of Simulations

“The process of designing a mathematical or logical model of a real system and then conduct computer-based experiments with the model to describe, explain, and predict the behavior of the real system”

T. H. Naylor et al., Computer Simulation Techniques, John Wiley and Sons, 1966.

Page 11: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

11

The Nature of SimulationsThe Nature of Simulations

A computer simulation A computer simulation imitatesimitates the operationthe operation of various of various kinds of real-world kinds of real-world facilitiesfacilities or or physical physical processesprocesses..

The The facilityfacility or or processprocess is usually referred to as a is usually referred to as a systemsystem..

In order to study it scientifically one have to make a set of In order to study it scientifically one have to make a set of assumptions about how the system works. These assumptions about how the system works. These assumptions usually take the form of assumptions usually take the form of mathematicalmathematical or or logical relationshipslogical relationships that constitutes a that constitutes a modelmodel of the of the real-real-world systemworld system. .

Page 12: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

12

The Nature of SimulationsThe Nature of Simulations

If the If the relationshipsrelationships, that compose the , that compose the modelmodel, are simple , are simple enough, it may be possible to use enough, it may be possible to use analytic methodsanalytic methods to to obtain an exact answer on questions of interest.obtain an exact answer on questions of interest.

However, most However, most real-world systemsreal-world systems are are too complextoo complex to to be evaluated analytically (only a very limited set of be evaluated analytically (only a very limited set of algebraic equations can be solved analytically) and these algebraic equations can be solved analytically) and these must be studied by means of must be studied by means of simulationsimulation..

In a simulation a computer is used to In a simulation a computer is used to evaluate a model evaluate a model numericallynumerically where data is gathered to where data is gathered to estimateestimate the the characteristicscharacteristics of the of the modelmodel..

Page 13: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

13

Application Areas of Computer SimulationApplication Areas of Computer Simulation

Designing and analyzing manufacturing systemsDesigning and analyzing manufacturing systems Evaluate military systems or logistics requirements.Evaluate military systems or logistics requirements. Determining requirements or evaluating protocols for Determining requirements or evaluating protocols for

communication protocols.communication protocols. Determining hardware and software requirements for Determining hardware and software requirements for

a computer systems.a computer systems. Designing and operating transportation systems such Designing and operating transportation systems such

as airports, freeways, ports and subways.as airports, freeways, ports and subways. Evaluating designs for service organizations such as Evaluating designs for service organizations such as

contact centers, fast-food restaurants, hospitals, post contact centers, fast-food restaurants, hospitals, post offices.offices.

Reengineering of business processesReengineering of business processes

Page 14: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

14

Application Areas of Computer SimulationApplication Areas of Computer Simulation

Analyzing supply chainsAnalyzing supply chains Determining ordering policies for inventory systemsDetermining ordering policies for inventory systems Analyzing mining operationsAnalyzing mining operations

Page 15: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

15

Advantages with Computer SimulationAdvantages with Computer Simulation

Most complex, real world systems with stochastic elements Most complex, real world systems with stochastic elements cannot be accurately described by a mathematical model cannot be accurately described by a mathematical model that can be evaluated analytically, simulation is the only that can be evaluated analytically, simulation is the only available type of evaluation.available type of evaluation.

Simulation allow one to estimate the performance of an Simulation allow one to estimate the performance of an existing system under some projected set of operation existing system under some projected set of operation conditions.conditions.

Alternative proposed system designs can be pre-evaluated Alternative proposed system designs can be pre-evaluated via simulation to see which design that meets the system via simulation to see which design that meets the system requirements best. requirements best.

Much better control over experimental conditions can be Much better control over experimental conditions can be maintained in a simulation than experimenting with a real maintained in a simulation than experimenting with a real system.system.

Page 16: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

16

Drawbacks with Computer SimulationDrawbacks with Computer Simulation

Models to study large-scale systems tend to be very Models to study large-scale systems tend to be very complex, writing computer programs that execute these complex, writing computer programs that execute these models can be a very tedious and hard task. models can be a very tedious and hard task.

A second problem is that the A second problem is that the computational complexitycomputational complexity of large scale simulations, extremely large amount of of large scale simulations, extremely large amount of computer time is sometimes required. computer time is sometimes required.

Verification of the Verification of the correctnesscorrectness of the simulation model of the simulation model and its implementation can be hard to accomplish. and its implementation can be hard to accomplish.

Page 17: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

17

Drawbacks with Computer SimulationDrawbacks with Computer Simulation

There exist an impression that simulation is just an There exist an impression that simulation is just an exercise in computer programming (a complicated one).exercise in computer programming (a complicated one).• Consequently, many simulation studies have been composed of Consequently, many simulation studies have been composed of

ad hoc models, ad hoc implementation and just run the simulator ad hoc models, ad hoc implementation and just run the simulator once to obtain the answer, attitude.once to obtain the answer, attitude.

• This attitude, which neglects the important issue of how a properly This attitude, which neglects the important issue of how a properly coded model should be used, has doubtless led to that erroneous coded model should be used, has doubtless led to that erroneous conclusions have been drawn in many simulation studies. conclusions have been drawn in many simulation studies.

Stochastic simulation models produce output that is itself Stochastic simulation models produce output that is itself random, and must therefore be treated as only an estimate random, and must therefore be treated as only an estimate of the true characteristics of the model. This is one of the of the true characteristics of the model. This is one of the disadvantages of simulation. disadvantages of simulation.

Page 18: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

18

Pitfalls with Computer SimulationPitfalls with Computer Simulation

Failure to have a well-defined set of objectives at the Failure to have a well-defined set of objectives at the beginning of the simulation.beginning of the simulation.

Failure to have the entire project team involved at the Failure to have the entire project team involved at the beginning of the study.beginning of the study.

Inappropriate level of model detail.Inappropriate level of model detail. Failure to communicate with management throughout the Failure to communicate with management throughout the

course of the simulation study. course of the simulation study. Misunderstanding of simulation by the management.Misunderstanding of simulation by the management. Treating simulation as if it were primarily an exercise in Treating simulation as if it were primarily an exercise in

computer programming.computer programming. Failure to have people with a knowledge of simulation Failure to have people with a knowledge of simulation

methodology and statistics on the modeling team.methodology and statistics on the modeling team.

Page 19: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

19

Pitfalls with Computer SimulationPitfalls with Computer Simulation

Failure to collect good system data, e.g. not enough data Failure to collect good system data, e.g. not enough data to create a good model.to create a good model.

Inappropriate simulation software.Inappropriate simulation software. Belief that easy-to-use simulation tools require a Belief that easy-to-use simulation tools require a

significantly lower level of technical competence. significantly lower level of technical competence. Failure to account correctly for sources of randomness in Failure to account correctly for sources of randomness in

the system under consideration.the system under consideration. Using arbitrary random distributions as input to the Using arbitrary random distributions as input to the

simulation.simulation. Analyzing the output from the simulation using formulas Analyzing the output from the simulation using formulas

that assumes independence.that assumes independence.

Page 20: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

20

Pitfalls with Computer SimulationPitfalls with Computer Simulation

Making single replication of a particular system Making single replication of a particular system design and treating the output statistics as true design and treating the output statistics as true answers.answers.

Failure to have warm up period, if the steady state Failure to have warm up period, if the steady state behavior of a system is of interest.behavior of a system is of interest.

Comparing alternative system designs on the basis of Comparing alternative system designs on the basis of one replica for each design.one replica for each design.

Using wrong performance measures.Using wrong performance measures.

Page 21: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

21

Systems, Models and SimulationSystems, Models and Simulation

A A systemsystem is defined as collection of is defined as collection of entitiesentities, (e.g. , (e.g. people or machines) that people or machines) that actsacts and and interactsinteracts towards towards the accomplishment of some the accomplishment of some logical endlogical end..• In practice what is meant by the system depends on the In practice what is meant by the system depends on the

objectives of a particular study. objectives of a particular study.

The The statestate of a system is defined as the collection of of a system is defined as the collection of variables necessary to describe a system at a variables necessary to describe a system at a particular time, relative to the objectives of a study. particular time, relative to the objectives of a study.

Page 22: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

22

Systems, Models and SimulationSystems, Models and Simulation

Systems can be categorized in to two types: Systems can be categorized in to two types: discretediscrete and and continuouscontinuous..• A A discrete systemdiscrete system is one for which the state variables is one for which the state variables

change instantaneously at separated point in time.change instantaneously at separated point in time.• A A continuous systemcontinuous system is one for which the state variables is one for which the state variables

change continuously with respect to time. change continuously with respect to time.

Page 23: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

23

Systems, Models and SimulationSystems, Models and Simulation

System

Experiment with the actual system

Experiment with a model of the system

Physical model

Mathematical model

Analytical Solution Simulation

Page 24: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

24

Systems, Models and SimulationSystems, Models and Simulation

Experiment with the actual systemversus

Experiment with a model of the system If it is possible to alter an existing system physically and If it is possible to alter an existing system physically and

then let it operate under the new conditions it is probably then let it operate under the new conditions it is probably desirable to do so. However, it is rarely feasible to do so desirable to do so. However, it is rarely feasible to do so caused by that:caused by that:• The system may not existThe system may not exist• The stimulus may not exist The stimulus may not exist • High cost to alter a existing systemHigh cost to alter a existing system• Dangerous elaborate with a existing systemDangerous elaborate with a existing system• ……………………..

Page 25: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

25

Systems, Models and SimulationSystems, Models and Simulation

Sometimes small scale physical models are used to Sometimes small scale physical models are used to evaluate constructions, e.g. air plane or car models in wind evaluate constructions, e.g. air plane or car models in wind tunnels, ship models in swimming pools etc.tunnels, ship models in swimming pools etc.

The vast majority of used models are mathematical, The vast majority of used models are mathematical, representing a system in terms of logical and quantitative representing a system in terms of logical and quantitative relationships that are possible to manipulate and change relationships that are possible to manipulate and change to see how the model reacts.to see how the model reacts.

Faster, lower cost, etc…..Faster, lower cost, etc…..

Physical model versus Mathematical model

Page 26: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

26

Systems, Models and SimulationSystems, Models and Simulation

The vast majority of used models are mathematical, e.g. The vast majority of used models are mathematical, e.g. dd==rtrt, where , where rr is the rate of is the rate of

travel, travel, tt is the time spent traveling, and is the time spent traveling, and dd is the distance traveled, the closed form is the distance traveled, the closed form

solution of this model is very simple to find.solution of this model is very simple to find.

However, a closed form solution can become extraordinary complex to find, e.g. However, a closed form solution can become extraordinary complex to find, e.g.

inverting a large non-sparse matrix is a well known example. The formula is well inverting a large non-sparse matrix is a well known example. The formula is well

known, but obtaining the solution is far from trivial.known, but obtaining the solution is far from trivial.

Many systems are highly complex, so that valid mathematical models of them are Many systems are highly complex, so that valid mathematical models of them are

themselves complex precluding any possibility of analytical solutions.themselves complex precluding any possibility of analytical solutions.

In these cases the model must be studied by means of simulation, i.e. numerically In these cases the model must be studied by means of simulation, i.e. numerically

exercising the model for the inputs in question to see how they affect the output exercising the model for the inputs in question to see how they affect the output

measures of performance. measures of performance.

Analytic solution versus Simulation

Page 27: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

27

Systems, Models and SimulationSystems, Models and Simulation

Given that there exist a mathematical (simulation) model, we must Given that there exist a mathematical (simulation) model, we must then look for a particular then look for a particular tooltool to do this. to do this.

For this purpose it useful to classify simulation models along three For this purpose it useful to classify simulation models along three different different dimensionsdimensions::

• Static versus Dynamic simulation modelsStatic versus Dynamic simulation models• Deterministic versus Stochastic simulation modelsDeterministic versus Stochastic simulation models• Continuous versus Discrete simulation models Continuous versus Discrete simulation models

Page 28: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

28

Systems, Models and SimulationSystems, Models and Simulation

A A static simulation modelstatic simulation model is a representation of a system is a representation of a system at a particular time, or a model that may be used to at a particular time, or a model that may be used to represent a system in which time have no role.represent a system in which time have no role.

A A dynamic simulation modeldynamic simulation model evolves over time, i.e. the evolves over time, i.e. the state variables are time dependent.state variables are time dependent.

Static versus dynamic simulation modelStatic versus dynamic simulation model

Page 29: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

29

Systems, Models and SimulationSystems, Models and Simulation

If a model does not contain any probabilistic components, If a model does not contain any probabilistic components, it is called deterministic, often a complicated system of it is called deterministic, often a complicated system of differential equation (analytically intractable).differential equation (analytically intractable).

Many systems must however be modeled as having at Many systems must however be modeled as having at least some random input component, and these gives rise least some random input component, and these gives rise to stochastic simulation models, e.g. communication, to stochastic simulation models, e.g. communication, queuing and inventory systems are modeled queuing and inventory systems are modeled stochastically.stochastically.

Stochastic simulation models produce output that is itself Stochastic simulation models produce output that is itself random, and must therefore be treated as only an estimate random, and must therefore be treated as only an estimate of the true characteristics of the model.of the true characteristics of the model.

Deterministic versus Stochastic simulation modelsDeterministic versus Stochastic simulation models

Page 30: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

30

Systems, Models and SimulationSystems, Models and Simulation

Discrete and continuous simulation models analogously to Discrete and continuous simulation models analogously to the way discrete and continuous systems.the way discrete and continuous systems.• A A discrete simulation modeldiscrete simulation model is one for which the state variables is one for which the state variables

change instantaneously at separated point in time.change instantaneously at separated point in time.• A A continuous simulation modelcontinuous simulation model is one for which the state is one for which the state

variables change continuously with respect to time. variables change continuously with respect to time.

Continuous versus Discrete simulation models

Page 31: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

31

Dynamic, Stochastic, Continuous

Dynamic, Deterministic, Continuous

Systems, Models and SimulationSystems, Models and Simulation

Static vs. Dynamic

Deterministic vs. Stochastic

Continuous vs. Discrete

Dynamic, Deterministic,Discrete

Static, Deterministic, Discrete

Dynamic, Stochastic, Discrete

Static, Stochastic, Discrete

Static, Deterministic, Continuous

Static, Stochastic, Continuous

Page 32: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

32

Elements of Simulation Analysis – Introduction Elements of Simulation Analysis – Introduction

Simulation analysis is a descriptive modeling technique. Simulation analysis is a descriptive modeling technique.

As such, simulation analysis does not provide the explicit As such, simulation analysis does not provide the explicit problem formulation and solution steps. problem formulation and solution steps.

Consequently, one must specify in detail a procedure for Consequently, one must specify in detail a procedure for the development and use of simulation models to assure the development and use of simulation models to assure successful outcome from a simulation study. successful outcome from a simulation study.

Page 33: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

33

Elements of Simulation Analysis – IntroductionElements of Simulation Analysis – Introduction

Problem FormulationProblem Formulation: questions for which answer are : questions for which answer are sought, the variables involved and measures of system sought, the variables involved and measures of system performance to be usedperformance to be used

Data Collection and AnalysisData Collection and Analysis: assembling the : assembling the information necessary to further refine our understanding information necessary to further refine our understanding of the problem. of the problem.

Model DevelopmentModel Development: building and testing the model of the : building and testing the model of the real system, selecting simulation tool (programming real system, selecting simulation tool (programming language), coding the model and debugging it.language), coding the model and debugging it.

Page 34: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

34

Elements of Simulation Analysis – IntroductionElements of Simulation Analysis – Introduction

Model Verification and ValidationModel Verification and Validation: establish that the model is an : establish that the model is an appropriate accurate representation of the real system.appropriate accurate representation of the real system.

Model Experimentation and OptimizationModel Experimentation and Optimization: precision issues, how : precision issues, how large sample (simulation time) is necessary to estimate the large sample (simulation time) is necessary to estimate the performance of the system. The design of effective experiments with performance of the system. The design of effective experiments with which to answer the question asked in the problem formulation.which to answer the question asked in the problem formulation.

Implementation and Simulation result:Implementation and Simulation result: acceptance of the result by acceptance of the result by the users and improved decision making stemming from the analysis.the users and improved decision making stemming from the analysis.

Page 35: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

35

Elements of Simulation Analysis – IntroductionElements of Simulation Analysis – Introduction

Problem Formulation

Data Collection and Analysis

Model development

Model Verification and Validation

Model Experimentation and Optimization

Implementation of Simulation Results

Major Iterative Loops in a Simulation Study

Page 36: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

36

Elements of Simulation Analysis – Problem FormulationElements of Simulation Analysis – Problem Formulation

Problem formulation is the most important step in a Problem formulation is the most important step in a simulation study.simulation study.

Problem formulation often include:Problem formulation often include:• Technical aspectsTechnical aspects• Economical aspectsEconomical aspects• Political aspectsPolitical aspects

The problem formulation can have a significant impact on The problem formulation can have a significant impact on the success of the simulation study.the success of the simulation study.

Page 37: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

37

Elements of Simulation Analysis – Problem FormulationElements of Simulation Analysis – Problem Formulation

Four fundamental design issues must be addressed in the Four fundamental design issues must be addressed in the problem formulation phase.problem formulation phase.

• Identify Identify decisiondecision and and uncontrolleduncontrolled variable variable• Specify Specify constraintsconstraints on the decision variable on the decision variable• Define Define measuresmeasures of the system performance and their of the system performance and their objectivesobjectives• Develop a preliminary Develop a preliminary model structuremodel structure to interrelate the system to interrelate the system

variable and the measure of performance variable and the measure of performance

But let us concentrate on the required tasks from a technical perspective !!!!!

Page 38: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

38

Elements of Simulation Analysis – Problem FormulationElements of Simulation Analysis – Problem Formulation

The first step is the specification of variables that define the The first step is the specification of variables that define the system and its outputs. Variables may be classified as system and its outputs. Variables may be classified as exogenousexogenous or or endogenousendogenous..• ExogenousExogenous (input variables) are external to the model and exist (input variables) are external to the model and exist

independently of the model.independently of the model.• EndogenousEndogenous are internal to the model and are a function of the are internal to the model and are a function of the

exogenous variables and the model structure.exogenous variables and the model structure.

Exogenous variables can be further classified as Exogenous variables can be further classified as controllablecontrollable and and uncontrollableuncontrollable..• Exogenous controllable variablesExogenous controllable variables (decision variables) can be (decision variables) can be

manipulated within some limit by the decision maker.manipulated within some limit by the decision maker.• Exogenous uncontrollable variableExogenous uncontrollable variable (parameters) is beyond the (parameters) is beyond the

control of the decision maker.control of the decision maker.

Page 39: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

39

Elements of Simulation Analysis – Problem FormulationElements of Simulation Analysis – Problem Formulation

To evaluate the effectiveness of a system, we must To evaluate the effectiveness of a system, we must identify a measure (or measures) of performance by which identify a measure (or measures) of performance by which to judge it.to judge it.

Performance measure (or measures) of the system are Performance measure (or measures) of the system are selected from the selected from the endogenous variablesendogenous variables..

The measure (or measures) which we chose to optimize The measure (or measures) which we chose to optimize on, on, minimize/maximize,minimize/maximize, in a simulation are referred to as in a simulation are referred to as the the objective functionobjective function..

Page 40: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

40

Elements of Simulation Analysis – Problem FormulationElements of Simulation Analysis – Problem Formulation

If multiple measures of performance are identified it is hard If multiple measures of performance are identified it is hard to optimize on several of them simultaneously since to optimize on several of them simultaneously since minimizing one tends to produce large value for the other.minimizing one tends to produce large value for the other.

There exist two approaches to this dilemma:There exist two approaches to this dilemma:• Make explicit trade-offs among the measures by combining several Make explicit trade-offs among the measures by combining several

measures using some common dimension, e.g., cost.measures using some common dimension, e.g., cost.• Select the measure of most concern to optimize while constraining Select the measure of most concern to optimize while constraining

the others to be at a constant value or within some minimal range.the others to be at a constant value or within some minimal range. If one is fortune, one measure will dominate the If one is fortune, one measure will dominate the

performance for all other alternatives. performance for all other alternatives. When dominance cannot be shown, one must deal with the When dominance cannot be shown, one must deal with the

problem of combining several measures into one common problem of combining several measures into one common dimension for all measures. dimension for all measures.

Page 41: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

41

Elements of Simulation Analysis – Problem FormulationElements of Simulation Analysis – Problem Formulation

cost

Cashier salaries

Cost of customer waiting time

Total cost

A simple example: combining several measures in a simulation of a supermarket multi-lane checkout system.

Number of cashiers

Page 42: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

42

Elements of Simulation Analysis – Problem FormulationElements of Simulation Analysis – Problem Formulation

Developing the model is often a trade off between the Developing the model is often a trade off between the level of detail the simulation model should include and the level of detail the simulation model should include and the understandability of the measures, i.e. too many variable understandability of the measures, i.e. too many variable to optimize on.to optimize on.

But how much detail to be included in the model of a But how much detail to be included in the model of a system?system?

It depends upon the purpose for which the model is being It depends upon the purpose for which the model is being developed and the marginal contribution of the additional developed and the marginal contribution of the additional detail.detail.

Page 43: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

43

Elements of Simulation Analysis – Problem FormulationElements of Simulation Analysis – Problem Formulation

The level of detail must be based on a subjective trial and The level of detail must be based on a subjective trial and error derived assessment of the marginal cost of obtaining error derived assessment of the marginal cost of obtaining the necessary data and including the required relationship the necessary data and including the required relationship in the model, versus the additional accuracy with which in the model, versus the additional accuracy with which estimates of system performance can be made.estimates of system performance can be made.

The ultimate goal of any simulation is to assist in decision The ultimate goal of any simulation is to assist in decision making, and this must dictate the problem formulation.making, and this must dictate the problem formulation.

Page 44: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

44

Elements of Simulation Analysis – Data collection and Elements of Simulation Analysis – Data collection and analysisanalysis

Data collection methods are as varied as the problems to Data collection methods are as varied as the problems to which they are applied, manual approaches to very which they are applied, manual approaches to very sophisticated high technology techniques.sophisticated high technology techniques.

The data collection method should be tail ordered to the The data collection method should be tail ordered to the particular system model that should be derived. particular system model that should be derived.

Following issues can be considered:Following issues can be considered:• Ability to record the data, achieving the desired level of accuracyAbility to record the data, achieving the desired level of accuracy• Impact of the data collection process on the system under Impact of the data collection process on the system under

observationobservation• Ease of conversion of the sampled data to a computer Ease of conversion of the sampled data to a computer

processable formprocessable form• Cost of the methodCost of the method

Page 45: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

45

Elements of Simulation Analysis – Data collection and analysisElements of Simulation Analysis – Data collection and analysis

Some of the data that defines simulation models are Some of the data that defines simulation models are deterministic, that is, known with certainty, but much of it is deterministic, that is, known with certainty, but much of it is often probabilistic.often probabilistic.

Given a set of probabilistic data, there are two main ways Given a set of probabilistic data, there are two main ways to include it in a simulation mode:to include it in a simulation mode:• Use the actual sample data to represent the probabilistic Use the actual sample data to represent the probabilistic

distribution distribution • Determine a theoretical probability distribution which is similar to Determine a theoretical probability distribution which is similar to

the sample data.the sample data. If possible, it is often better to use a theoretical distribution. If possible, it is often better to use a theoretical distribution.

It provides a better understanding of the simulation model It provides a better understanding of the simulation model and most often a more efficient execution of the simulation and most often a more efficient execution of the simulation model.model.

Page 46: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

46

Elements of Simulation Analysis – Model developmentElements of Simulation Analysis – Model development

In the model development step the description of the In the model development step the description of the system being modeled by system being modeled by quantifying the relationships quantifying the relationships among all of the variable and the performance measuresamong all of the variable and the performance measures..

In order to develop an accurate computer program which In order to develop an accurate computer program which implements our model, we must implements our model, we must fully understand the fully understand the system and all of its intricaciessystem and all of its intricacies..

Acquiring this understanding of the system to develop an Acquiring this understanding of the system to develop an appropriate model is one of the most difficult tasks in appropriate model is one of the most difficult tasks in simulation studies.simulation studies.

Very often any specific approach or clear description of Very often any specific approach or clear description of how to do it is lacking, or it is very hard to communicate how to do it is lacking, or it is very hard to communicate the used approach. the used approach.

Page 47: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

47

Elements of Simulation Analysis – Model developmentElements of Simulation Analysis – Model development

There exist two commonly used approaches:There exist two commonly used approaches:

The physical flow approachThe physical flow approach

State change approachState change approach

Page 48: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

48

Elements of Simulation Analysis – Model developmentElements of Simulation Analysis – Model development

To use the To use the physical flow approachphysical flow approach, one identifies the , one identifies the physical entities for which processing or transformation physical entities for which processing or transformation constitutes the main purpose of the system.constitutes the main purpose of the system.

These entities are then tracked through the system, noting These entities are then tracked through the system, noting points of processing and branching decision rules that points of processing and branching decision rules that determine their route.determine their route.

A diagram of the entity flow and the system processing A diagram of the entity flow and the system processing elements then provides the representation of the system elements then provides the representation of the system from which the model and its associated computer from which the model and its associated computer program can be developed.program can be developed.

Page 49: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

49

Elements of Simulation Analysis – Model developmentElements of Simulation Analysis – Model development

Queue choice

Customer queue

Customer queue

Cashier and bagger

Tally purchases

Pay for purchases

Bag purchases

Cashier and bagger

Tally purchases

Pay for purchases

Bag purchases

Physical flow chart for supermarket checkout system

Page 50: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

50

Elements of Simulation Analysis – Model developmentElements of Simulation Analysis – Model development

In order to describe the In order to describe the state change approachstate change approach it is it is necessary to define additional endogenous variable necessary to define additional endogenous variable classification classification state variablestate variable and introduce the concept of and introduce the concept of an an eventevent..

State variableState variable describes the present status of the system describes the present status of the system e.g. number of people in a queue, number of people e.g. number of people in a queue, number of people presently served etc.presently served etc.

Event is the particular point in time when a person arrives Event is the particular point in time when a person arrives and joins a queue etc.and joins a queue etc.

By incorporating into the model the ability to update state By incorporating into the model the ability to update state variables as time advances and events occur we can variables as time advances and events occur we can describe the system behavior.describe the system behavior.

Page 51: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

51

Elements of Simulation Analysis – Model developmentElements of Simulation Analysis – Model development

A useful approach for the A useful approach for the state change approach state change approach is to is to represent this as an event graph. represent this as an event graph.

Events are represented as nodes and progression from Events are represented as nodes and progression from event to event as arrows. event to event as arrows.

Page 52: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

52

Elements of Simulation Analysis – Model developmentElements of Simulation Analysis – Model development

Event graph for the supermarket checkout system

1 2 3 4

5 6 7

Events

1. Customer arrives

2. Customer selects cashier

3. Cashier begins checkout

4. Cashier finish checkout

5. Bagger begins packing

6. Bagger Finish packing

7. Customers leaves

Page 53: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

53

Elements of Simulation Analysis – Model developmentElements of Simulation Analysis – Model development

With an understanding of the type of model that is to With an understanding of the type of model that is to be developed the next step is to do the actual model be developed the next step is to do the actual model construction.construction.

The major tasks in this step are:The major tasks in this step are:• Developing a computer program flow chart for the simulation Developing a computer program flow chart for the simulation

model.model.• Selecting programming language or simulation toolSelecting programming language or simulation tool• Providing entities for the generation of random numbers and Providing entities for the generation of random numbers and

random distributions.random distributions.• Writing and debugging program code.Writing and debugging program code.

Page 54: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

54

Elements of Simulation Analysis – Model developmentElements of Simulation Analysis – Model development

The first step is to produce a logic flow chart of the The first step is to produce a logic flow chart of the computer program.computer program.

If the physical flow approach was followed, the previous If the physical flow approach was followed, the previous flow chart can more or less be used but one other factors flow chart can more or less be used but one other factors must be considered.must be considered.

Page 55: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

55

Elements of Simulation Analysis – Model developmentElements of Simulation Analysis – Model development

The dynamic nature of discrete event simulation models The dynamic nature of discrete event simulation models require that the current value of the require that the current value of the simulated timesimulated time must must be known and it also need a mechanism to advance the be known and it also need a mechanism to advance the simulated time from one value to another.simulated time from one value to another.

This variable is called the This variable is called the simulation clock.simulation clock. The unit of time for the simulation clock is never stated The unit of time for the simulation clock is never stated

explicitly when a model is written in a general purpose explicitly when a model is written in a general purpose programming language as: C, Pascal, Java etc. It is programming language as: C, Pascal, Java etc. It is assumed to be in the same unit as the input parameters.assumed to be in the same unit as the input parameters.

There is There is no no relationship between relationship between simulated timesimulated time and the and the time needed to run a simulationtime needed to run a simulation, i.e. the run time is , i.e. the run time is dependent on the complexity of simulation model.dependent on the complexity of simulation model.

Page 56: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

56

Elements of Simulation Analysis – Model developmentElements of Simulation Analysis – Model development

There exist two principle approaches for advancing the simulation clock: There exist two principle approaches for advancing the simulation clock:

• Fixed increment time advanceFixed increment time advance

• Next-event time advanceNext-event time advance

When When fixed increment time advancefixed increment time advance is applied, the clock is advanced in is applied, the clock is advanced in

increments of exactly increments of exactly tt. After each update of the clock a check is made to . After each update of the clock a check is made to

determine if any events have occurred during the interval determine if any events have occurred during the interval tt..

The primary use of this approach is in systems where it can be assume that The primary use of this approach is in systems where it can be assume that

all events occur at one of the times all events occur at one of the times nnt t ((nn=1,2,3,4…….) for an appropriate =1,2,3,4…….) for an appropriate

chosen chosen t .t .

Page 57: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

57

Elements of Simulation Analysis – Model developmentElements of Simulation Analysis – Model development

The The next-event time advance approachnext-event time advance approach is used in most discrete event simulation is used in most discrete event simulation models, i.e. by all simulation tools and by most people programming their model in models, i.e. by all simulation tools and by most people programming their model in general purpose programming languages.general purpose programming languages.

The simulation clock is initialized to zero and the time of occurrence of future events are The simulation clock is initialized to zero and the time of occurrence of future events are determined (event list).determined (event list).

The simulation clock is then advanced to the time of the occurrence of the most The simulation clock is then advanced to the time of the occurrence of the most imminent (first) event, at which point the state of the system is updated to account for imminent (first) event, at which point the state of the system is updated to account for that event and future events may be added.that event and future events may be added.

Then the simulation clock is then advanced to the time of the next most imminent event Then the simulation clock is then advanced to the time of the next most imminent event in the event list and so forth.in the event list and so forth.

Page 58: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

58

Elements of Simulation Analysis – Model developmentElements of Simulation Analysis – Model development

Random generatorsRandom generators, Random variables and performance , Random variables and performance statistics are of vital importance.statistics are of vital importance.

To represent particular values of a probabilistic input To represent particular values of a probabilistic input variable, one must be able to efficiently select variable, one must be able to efficiently select random random samplessamples from the given from the given probabilistic distributionsprobabilistic distributions..

Although we refer to numbers used in simulations for Although we refer to numbers used in simulations for sampling as random, they are not purely random since they sampling as random, they are not purely random since they are generated from deterministic algorithms, i.e. pseudo are generated from deterministic algorithms, i.e. pseudo random numbers generated by so called random numbers generated by so called pseudorandom pseudorandom generators generators (linear congruential generators). (linear congruential generators).

Page 59: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

59

Elements of Simulation Analysis – Model developmentElements of Simulation Analysis – Model development

The generator is defined by the recurrence relation:The generator is defined by the recurrence relation:

XXn+1 n+1 = = aXaXn n + + cc mod mod mm

where where XXnn is the sequence of random values, and is the sequence of random values, and0 < 0 < m,m, the "modulus" the "modulus" 0 0 aa < < mm, the "multiplier" , the "multiplier" 0 0 c < m the "increment" the "increment" 0 0 X0 < m the "seed" or "start value" are integer the "seed" or "start value" are integer constants that specify the generator.constants that specify the generator.

A A linear congruential generatorlinear congruential generator ( (LCGLCG) represents one of ) represents one of the oldest and best-known pseudorandom number the oldest and best-known pseudorandom number generator algorithms. The theory behind them is easy to generator algorithms. The theory behind them is easy to understand, and they are easily implemented and fast.understand, and they are easily implemented and fast.

Page 60: Simulation of Complex Computer Networks Lecture 1 and Lecture 2

60

Elements of Simulation Analysis – Model developmentElements of Simulation Analysis – Model development

SourceSource mm aa cc

Numerical RecipesNumerical Recipes 223232 16645251664525 10139042231013904223

Borland C/C++ Borland C/C++ 2232 32 22695477 22695477 11

GNU Compiler GNU Compiler

CollectionCollection

2232 32 69069 69069 55

ANSI CANSI C 2232 32 1103515245 1103515245 1234512345

Borrland DelphiBorrland Delphi 2232 32 134775813 134775813 11

Microsoft VisualMicrosoft Visual 2232 32 214013 214013 1531101115311011

Apple CarbonApple Carbon 2232 32 -1-1 16807 16807 00