A brief introduction to network simulation and the difference between simulator and emulator along with the most important types of simulations techniques.
1. Network Simulation/ Third year
Al-Mamoun University College - Computer Engineering Techniques Dept. - Dr. Ahmed L. Khalaf
1
Introduction to Networks Simulation
Simulation serves to imitate a real system or process. A simulation allows us to
examine the system’s behavior under different scenarios, which are assessed
(evaluated) by re-enactment within a virtual computational world. Simulation
can be used, among other things, to identify bottle-necks in a process, provide a
safe and relatively cheaper (in term of both cost and time) test bed to evaluate
the side effects, and optimize the performance of the system-all before
realizing these systems in the physical world.
Today, modeling and simulation are used extensively. They are used not
just to find if a given system design works, but to discover a system design that
works best. More importantly, modeling and simulation are often used as an
inexpensive technique to perform exception and “what-if” analyses, especially
when the cost would be prohibitive when using the actual system. They are also
used as a reasonable means to carry out stress testing under exceedingly elevated
volumes of input data. Japanese companies use modeling and simulation to
improve quality, and often spend more than 50% of their design time in this
phase. The rest of the world is only now beginning to emulate this procedure.
Many American companies now participate in rapid prototyping, where computer
models and simulations are used to quickly design and test product concept ideas
before committing resources to real-world in-depth designs.
Key issues in simulation include acquisition of valid source information about
the referent, selection of key characteristics and behaviors, the use of simplifying
approximations and assumptions within the simulation, and fidelity and validity
of the simulation outcomes. Simulation enables goal-directed experimentation
with dynamical systems, i.e., systems with time-dependent behavior. It has
become an important technology, and is widely used in many scientific
2. Network Simulation/ Third year
Al-Mamoun University College - Computer Engineering Techniques Dept. - Dr. Ahmed L. Khalaf
2
research areas. In addition, modeling and simulation are essential stages in the
engineering design and problem-solving process and are undertaken before a
physical prototype is built. Engineers use computers to draw physical structures
and to make mathematical models that simulate the operation of a device or
technique. 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?
Table provides a summary of some typical uses of simulation modeling in
academia and industry to provide students and professionals with the right skill
set. 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 modification.
● 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.
3. Network Simulation/ Third year
Al-Mamoun University College - Computer Engineering Techniques Dept. - Dr. Ahmed L. Khalaf
3
Simulation can be used in many situations, such as:
• When the analytical model/solution is not possible or feasible. In such
cases, experts resort to simulations.
• Many times, simulation results are used to verify analytical solutions in
order to make sure that the system is modeled correctly using analytical
approaches.
• Dynamic systems, which involve randomness and change of state with
time. An example is an electric car charging station where cars come and go
4. Network Simulation/ Third year
Al-Mamoun University College - Computer Engineering Techniques Dept. - Dr. Ahmed L. Khalaf
4
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.
• 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.
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).
2. Simulator Vs. Emulator
The terms emulation and simulation are often used interchangeably. In
most cases, either term will generally get the point across, but there’s a big
difference between a network emulator and network simulator. A
simulator can perform tasks in abstract to demonstrate the behavior of a network
and its components, while an emulator can copy the behavior of a network to
functionally replace it.
2.1 Network Simulators
Simulators are software solutions and different types are available for different
applications. While used primarily for research and educational purposes, they
can also act as crucial testing tools in the design and development of a network.
5. Network Simulation/ Third year
Al-Mamoun University College - Computer Engineering Techniques Dept. - Dr. Ahmed L. Khalaf
5
Simulators, such as ns-3, are used to simulate networking and routing protocols.
OPNET also provided a standalone simulation environment.
Both of these network simulators use discrete event simulation which
chronologically queues and processes events like data flow. This allows a
network architect or engineer to build and evaluate an experimental model of a
network, including its topology and application flow. Since a variety of
theoretical scenarios can be introduced to a network where anything can be built
and applied, performance can be hypothesized before the network itself has even
been implemented within the real-world.
Although testing a network using simulators can save both time and money,
network simulators aren’t without their limitations. These highly complex
operations require a degree of experience and training to properly configure in
order to acquire reliable results.
2.2 Network Emulators
A network emulator is used to test the performance of a real network. These
devices can also be used for such purposes as quality assurance, proof of concept,
or troubleshooting. Available as hardware or software solutions, a network
emulator allows network architects, engineers, and developers to accurately
gauge an application’s responsiveness, throughput, and quality of end-user
experience prior to applying making changes or additions to a system.
Understanding the difference between a network simulator and a network
emulator will expand your testing tool kit and optimize your engineering efforts.
Both are useful and necessary tools and each serve their own distinct purpose.
A network simulator will help you design a network from the ground-up without
the need for physical appliances. Looking to develop a satellite communications
network from scratch? Use a network simulator. Once that network is designed
6. Network Simulation/ Third year
Al-Mamoun University College - Computer Engineering Techniques Dept. - Dr. Ahmed L. Khalaf
6
and built, a network emulator will help you test and validate application
performance, troubleshoot, and provide proof-of-concept.
3. 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 or firmware
(i.e., prototype) that imitates the functionality of the real system.
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 (tank) 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; (2) the number of events is
finite. All discrete-event simulations have the following components:
• Event queue: A list that contains all the events waiting to happen (in
future). The implementation of the event list and the functions to be performed
on it can significantly affect the efficiency of the simulation program.
7. Network Simulation/ Third year
Al-Mamoun University College - Computer Engineering Techniques Dept. - Dr. Ahmed L. Khalaf
7
• Simulation clock: A global variable that represents the simulated
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. On the other hand, in the
event-driven approach, 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.
• State variables: Variables that together completely describe the state of
the system.
• Event routines: Routines (fixed programs regularly followed) that handle
the occurrence of events. If an event occurs, its corresponding event routine is
executed to update the state variables and the event queue appropriately.
• Input routine: The routine that gets the input parameters from the user and
the supplies them to the model.
• Report generation routine: The routine responsible for calculating results
and printing them out to the end user.
• 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.
• 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.