Nothing Special   »   [go: up one dir, main page]

مقدمة محاكاة الشبكات

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

Networks Simulation By: Asst. Lec.

Abuther Mahmood
3 rd Class

The modeling of simulation

The modeling and simulation phases are often the longest part of
the engineering design process , When starting this phase ,
engineers keep several goals in mind :

 Does the product/problem meet its specifications ?

 What are the limits of the product/problem ?

 Do alternative designs/solutions work better ?

Figure 1 model of simulation


Networks Simulation By: Asst. Lec. Abuther Mahmood
3 rd Class

Simulation provides a method for checking one’s understanding


of the world and helps in producing better results faster.
A simulation environment like "MATLAB" is an important tool
that one can use to:
 Predict the course and results of certain actions.

 Understand why observed events occur.

 Identify problem areas before implementation.

 Explore the effects of modifications.

 Confirm that all variables are known.

 Evaluate ideas and identify inefficiencies.

 Gain insight and stimulate creative thinking.

 Communicate the integrity and feasibility of one’s plans.


Networks Simulation By: Asst. Lec. Abuther Mahmood
3 rd Class

One can use simulation when the analytical solution does not
exist, is to complicated, or requires more computational time
than the simulation. Simulation should not be used in the
following cases:

 The simulation requires months or years of CPU time. In this


scenario, it is probably not feasible to run simulations.

 The analytical solution exists and is simple. In this scenario, it


is easier to use the analytical solution to solve the problem
rather than use simulation (unless one wants to relax some
assumptions or compare the analytical solution to the
simulation).

Simulator vs Emulator
Simulator : the simulator maintains a queue of events sorted by
the simulated time they should occur. The simulator reads the
queue and triggers new events as each event is processed. It is
not important to execute the simulation in real time. It is often
more important to be able to access the data produced by the
simulation, to discover logic defects in the design or the
sequence of events. Most computer, logic test and fault-tree
simulations are of this type.
Networks Simulation By: Asst. Lec. Abuther Mahmood
3 rd Class

Emulator : There are also emulators such as the Network


Emulation Tool, By operating at the IP level, it can emulate
critical end-to-end performance characteristics imposed by
various wide area network situations or by various underlying
sub network technologies in a laboratory test-bed environment.

Simulation of Networks
Simulation of a network frequently requires a collection of
interdependent nested concurrent sub-simulations arising from:

The entities that are the nodes of the network, and


the processes therein.

The links that are the edges of the network, and the
processes therein.

In the specific case of computer communication networks,


these elementary subcomponents span functionally distinct
elements of the system such as networks, links, circuits, the
propagation medium, etc.
Networks Simulation By: Asst. Lec. Abuther Mahmood
3 rd Class

In practice , simulation of these elementary subcomponents can


be conducted using different approaches — with certain
approaches being better suited to certain components. A broad
classification of approaches would include :

Discrete-event-driven simulations

Time-driven simulations

Algorithm simulations

Circuit simulations

Physical media simulations.

When to Use Simulations?


Simulation is used in many situations, such as:

1.When the analytical model/solution is not possible or


feasible. In such cases, experts resort to simulations.
2.Many times, simulation results are used to verify analytical
solutions in order to make sure that the system is modeled
correctly using analytical approaches.
3.Dynamic systems, which involve randomness and change of
state with time. An example is our electric car charging station
where cars come and go unpredictably to charge their batteries.
In such systems, it is difficult (sometimes impossible) to predict
exactly what time the next car should arrive at the station.
Networks Simulation By: Asst. Lec. Abuther Mahmood
3 rd Class

4. Complex dynamic systems, which are so complex that when


analyzed theoretically will require too many simplifications. In
such cases, it is not possible to study the system and analyze it
analytically. Therefore, simulation is the best approach to study
the behavior of such a complex system .

How to Simulate?
Suppose one is interested in studying the performance of an
electric car charging station (the example treated above). The
behavior of this system may be described graphically by plotting
the number of cars in the charging station and the state of the
system. Every time a car arrives, the graph increases by one
unit, while a departing car causes the graph to drop one unit.
This graph, also called a sample path, could be obtained from
observation of a real electric car charging station, but could also
be constructed artificially. Such artificial construction and the
analysis of the resulting sample path (or more sample paths in
more complex cases) constitute the simulation process.

Types of Simulation Techniques

The most important types of simulations described in the


literature that are of special importance to engineers are:

1. Emulation: The process of designing and building


hardware
,that imitates the functionality of the real system.
Networks Simulation By: Asst. Lec. Abuther Mahmood
3 rd Class

2.Monte Carlo simulation: Any simulation that has no time


axis. Monte Carlo simulation is used to model probabilistic
phenomena that do not change with time, or to evaluate non-
probabilistic expressions using probabilistic techniques.

3.Trace-driven simulation: Any simulation that uses an ordered


list of real-world events as input.

4.Continuous-event simulation: In some systems, the state


changes occur all the time, not merely at discrete times. For
example, the water level in a reservoir with given in- and
outflows may change all the time. In such cases
―continuous
simulation‖ is more appropriate, although discrete-event
simulation can serve as an approximation.

5.Discrete-event simulation: A discrete-event simulation is


characterized by two features:

(1) within any interval of time, one can find a subinterval in


which no event occurs and no state variables change ; the
number of events is finite.
Networks Simulation By: Asst. Lec. Abuther Mahmood
3 rd Class

All discrete event simulations have the following


components:

A ) Event queue: A list that contains all the events waiting to


happen (in the future). The implementation of the event list and
the functions to be performed on it can significantly affect the
efficiency of the simulation program.

B ) Simulation clock: A global variable that represents the


simulated time. Simulation time can be advanced by time-driven
or event-driven methods. In the time-driven approach, time is
divided into constant, small increments, and then events
occurring within each increment are checked. In the event
driven approach, on the other hand, time is incremented to the
time of the next imminent event. This event is processed and
then the simulation clock is incremented again to the time of the
next imminent event, and so on. This latter approach is the one
that is generally used in computer simulations.

C ) State variables: Variables that together completely describe


the state of the system.

D ) Event routines: Routines that handle the occurrence of


events. If an event occurs, its corresponding event routine is
Networks Simulation By: Asst. Lec. Abuther Mahmood
3 rd Class

executed to update the state variables and the event queue


appropriately.

E ) Input routine: The routine that gets the input parameters


from the user and supplies them to the model.
F ) Report generation routine: The routine responsible for
calculating results and printing them out to the end user.

G ) Initialization routine: The routine responsible for


initializing the values of the various state variables, global
variables, and statistical variables at the beginning of the
simulation program

H ) Main program: The program where the other routines are


called. The main program calls the initialization routine; the
input routine executes various iterations, finally calls the report
generation routine, and terminates the simulation.

You might also like