SlideShare a Scribd company logo
Simulation
Outline
 Introduction to Simulation
 Discrete Event Simulation
 Simulator
   CSIM (Simulation Language)
   GloMoSim
   NS-2
   NCTU-NS
 Conclusion
 Mini-Project: Using GloMoSim
 Project: Develop a MAC simulator using PARSEC
Outline
 Introduction to Simulation
 Discrete Event Simulation
 Simulator
   CSIM (Simulation Language)
   GloMoSim
   NS-2
   NCTU-NS
 Conclusion
 Mini-Project: Using GloMoSim
 Project: Develop a MAC simulator using PARSEC
Introduction to Simulation
 What is simulation?
   A simulation is the imitation of the operation of a real-world
   process or system over time.
Introduction to Simulation
 System and System Environment
   To model a system, it is necessary to understand the concept of a
   system and the system boundary.
   A system is defined as a group of objects that are joined together
   in some regular interaction or interdependence toward the
   accomplishment of some purpose.
   A system is often affected by changes occurring outside the
   system. Such changes are said to occur in the system environment.
   In modeling a system, it is necessary to decide on the boundary
   between the system and its environment.
Introduction to Simulation
 Components of a System
   An entity is an object of interest in the system.
   An attribute is a property of an entity.
   An activity represents a time period of specified length.
   The state of a system is defined to be that collection of variables
   necessary to describe the system at any time.
   An event is defined as an instantaneous occurrence that may
   change the state of the system.
 Discrete System
   A discrete system is one in which the state variables change only
   at a discrete set of points in time.
Introduction to Simulation
 Model of a System
   A model is a representation of a system for the purpose of
   studying the system.
   For most studies, it is enough to consider only those aspects of
   the system that affects the problem under investigation.
   Therefore, in most cases, a model is a simplification of the
   system.
   On the other hand, the model should be sufficiently detailed to
   permit valid conclusions to be drawn about the real system.
Introduction to Simulation
 Types of Models
   Static/Dynamic
      A static simulation model, sometimes called a Monte Carlo
      simulation, represent a system at a particular point in time.
      A dynamic simulation model represents a system as it changes
      over time.
   Deterministic/Stochastic
      Simulation models that contain no random variables are classified
      as deterministic
      Deterministic models have a known set of inputs that will result
      in a unique set of outputs.
      On the other hand, a stochastic simulation model has one or more
      random variables as inputs. (e.g., random backoff timers)
Introduction to Simulation
 Types of Models (Continue)
   Discrete/Continuous
     Like the definitions for discrete and continuous systems, discrete
     and continuous models are defined similarly.
     However, a discrete simulation model is not always used to
     model a discrete system, nor is a continuous model always used
     to model a continuous system.
 Discrete-Event System Simulation
   Discrete-event system simulation is widely used and is the focus
   of this course.
   Discrete-event system simulation is the modeling of the systems
   in which the state variables change only at a discrete set of points
   in time.
Outline
 Introduction to Simulation
 Discrete Event Simulation
 Simulator
   CSIM (Simulation Language)
   GloMoSim
   NS-2
   NCTU-NS
 Conclusion
 Mini-Project: Using GloMoSim
 Project: Develop a MAC simulator using PARSEC
Discrete Event Simulation
 Strategies of discrete event simulation
   Activity-oriented simulation
   Event-oriented simulation
   Process-oriented simulation
Discrete Event Simulation
 Activity-oriented simulation
   The programmer defines activities which are started when certain
   conditions are satisfied.
   In many cases, this type of simulation uses a simulated clock
   which advance in constant increments of time.
   With each advance, a list of activities is scanned, and those
   which have become eligible are started.
   This type of model is used more often with simulating physical
   devices.
   Simulate Network System
      Going to be very slow to execute
      Most time increments will produce no change to the system at all
Discrete Event Simulation
 Activity-oriented simulation

                           the list of activities at time 1



     Scan                                      the list of activities at time 2



            Scan




 1    2      3     4   5         6       7        8           9
Discrete Event Simulation
 Event-oriented simulation
   The simulation programmer defines events and then writes
   routines which are invoked as each kind of event occurs
   Simulated time may pass between the events
   Usually, a priority queue will be used
Discrete Event Simulation
                                                  Array
   Event-oriented simulation
                                                          struct sensor
                                                          {
                                        Event A             int id;
                  7:28                                      int location;
                  7:25                                    };

                  7:21




                              Event B

void                   void
Process_Event_A() {}   Process_Event_B() {}
Discrete Event Simulation
 Process-oriented simulation
   The programmer defines the processes (entities, transactions, etc.)
   and the model in terms of interacting processes.
   A process is an independent program or procedure which can
   execute in parallel with other processes.
     The notion of in parallel is used with some liberty
   The processes will use the resources of the system.
     Resource-oriented
     Transaction-oriented
   Time Advance
     Hold
     Send a message to itself in the future
Discrete Event Simulation
 Process-oriented simulation
                  Process
   Process        (Entity)     Process
   (Entity)                    (Entity)



                 Resource
                 (Facility)

                  Process
                  (Entity)


    Process                    Process
    (Entity)                   (Entity)
Outline
 Introduction to Simulation
 Discrete Event Simulation
 Simulator
   CSIM (Simulation Language)
   GloMoSim
   NS-2
   NCTU-NS
 Conclusion
 Mini-Project: Using GloMoSim
 Project: Develop a MAC simulator using PARSEC
Simulation Language –
CSIM
 Mesquite Software Inc.
 CSIM 19 is the latest version of the widely-used CSIM
 simulation toolkit, which was initially developed in 1985
 at Austin's Microelectronics and Computer Technology
 Corporation (MCC).
 CSIM is a library of routines for use by C or C++
 programmers.
 Can be used to implement process-oriented, discrete-
 event simulation models of complex system
Simulators –
GloMoSim
 UCLA Parallel Computing Laboratory
   http://pcl.cs.ucla.edu/
 GloMoSim (Global Mobile system Simulator) is a
 library-based simulator for wireless networks.
 It is designed as a set of library modules, each of which
 simulates a specific wireless communication protocol in
 the protocol stack.
   The communication protocol stack for wireless networks is
   divided into a set of layers, each with its own API.
 The library has been developed using PARSEC, a C-
 based parallel simulation language
   New protocols and modules can be programmed and added to the
   library using PARSEC.
Simulators –
NS-2
 An object-oriented, discrete event network simulator
 developed at UC Berkely
 Mainly used for simulating local and wide area networks
 It is written in C++ and OTcl (Object-oriented Tcl) and
 primarily uses OTcl as command and configuration
 language.
   OTcl: Network Topology
   C++: Network Component
Simulators –
NCTU-NS
 The NCTUns network simulator is developed at
 NCTU, Taiwan. Its predecessor is the Harvard
 network simulator.
 By using a novel simulation methodology, it can
 do several tasks that traditional network
 simulators cannot easily do.
 More and more people are using it. (Use the
 Google to search it for yourself.)
Outline
 Introduction to Simulation
 Discrete Event Simulation
 Simulator
   CSIM (Simulation Language)
   GloMoSim
   NS-2
   NCTU-NS
 Conclusion
 Mini-Project: Using GloMoSim
 Project: Develop a MAC simulator using PARSEC
Conclusion
 Discrete Event Simulation
   Three approaches
   The choice is in some sense a matter of taste, as any
   model developed using one approach could have been
   implemented using the other.
 Simulation Language and Simulator
   CSIM, PARSEC
   GloMoSim, NS-2, NCTUns
References
 Jerry Banks, John S. Carson, Barry L. Nelson, David M. Nicol , "Discrete
 Event System Simulation", 4th edition, Prentice Hall, 2005, ISBN 0131293427
 Herb Schwetman, “CSIM: A C-Based, Process-oriented Simulation Language”,
 in Proceedings of the Winter Simulation Conference, 1986
 Mesquite Software Inc. (CSIM19) http://www.mesquite.com/index.htm
 Xiang Zeng, Rajive Bagrodia, and Mario Gerla, “GloMoSim: A Library for
 Parallel Simulation of Large-scale Wireless Networks”, in Proceedings of the
 12th Workshop on Parallel and Distributed Simulations -- PADS '98, May 26-
 29, 1998 in Banff, Alberta, Canada
 NS-2, http://www.isi.edu/nsnam/ns/
 Marc Greis, “Tutorial for the Network Simulator “ns””,
 http://www.isi.edu/nanam/ns/tutorial/index.html
 The ns Manual, http://www.isi.edu/nsnam/ns/ns-documentation.html
 S.Y. Wang, “NCTUns 1.0”, In the column "Software Tools for Networking",
 IEEE Network, Vol.17, No.4, July 2003.
Outline
 Introduction to Simulation
 Discrete Event Simulation
 Simulator
   CSIM (Simulation Language)
   GloMoSim
   NS-2
   NCTU-NS
 Conclusion
 Mini-Project: Using GloMoSim
 Project: Develop a MAC simulator using PARSEC
Mini-Project:
Using GloMoSim
 Download
   UCLA Parallel Computing Laboratory
   http://pcl.cs.ucla.edu/


 Install
   ~/parsec (depend on your OS)
     linux3.csie.nctu.edu.tw
           RedHat Linux 9.0 Powered by Kernel 2.4.27)
           gcc version 3.3.1
   ~/glomosim
Mini-Project:
Using GloMoSim
 Compile

   ~/glomosim/main (make)
   ~/glomosim/bin
 Related Files
   ~/glomosim/bin/config.in
   ~/glomosim/bin/app.in
   ~/glomosim/bin/glomo.stat
   ~/glomosim/bin/mobility.in
   ~/glomosim/bin/nodes.input
Mini-Project:
Using GloMoSim
 Example
   Application: 2 FTP Flows
   Routing: AODV, DSR


 Demonstrate
   How to set?
   How to observe results?
Outline
 Introduction to Simulation
 Discrete Event Simulation
 Simulator
   CSIM (Simulation Language)
   GloMoSim
   NS-2
   NCTU-NS
 Conclusion
 Mini-Project: Using GloMoSim
 Project: Develop a MAC simulator using PARSEC
Project: Develop a MAC
Simulator Using PARSEC
 Introduction to PARSEC
   PARSEC was developed by members of the UCLA Parallel
   Computing Laboratory
      Web page: http://pcl.cs.ucla.edu/
   PARSEC (for PARallel Simulation Environment for Complex
   systems) is a C-based discrete-event simulation language.
   It adopts the process interaction approach to discrete-event
   simulation.
Project: Develop a MAC
Simulator Using PARSEC
 Entity (Driver Entity)
 entity NODE(int myno) {
            ename neighbor[6];
            int i, N, count;
            receive () {}
            while (1) {
                       receive (MSG msg) {
                       }
            }
            finalize { }
 }
 entity driver(){
 }
Project: Develop a MAC
Simulator Using PARSEC
 Message
 message MSG {
         int source;
 };
 receive (MSG msg) {
 }
 send MSG{myno} to neighbor[GET_NEIGHBOR(N)];
Project: Develop a MAC
Simulator Using PARSEC
      Example
 1.    Topology

 2.    When a node receives a message, it will transmit a message to
       one of its neighbors within 10~20 time units. (Initially, each
       node can send a message to itself to start simulation.)
 3.    The neighbor is chosen randomly.
 4.    When the program terminates, each node will report how many
       messages it receives.
 5.    The maximum simulation time. 100000 time units.
Project: Develop a MAC
Simulator Using PARSEC
 Project Goal:
   Unslotted CSMA defined in IEEE 802.15.4
     IEEE standard for information technology -
     telecommunications and information exchange between
     systems - local and metropolitan area networks specific
     requirements part 15.4: wireless medium access control
     (MAC) and physical layer (PHY) specifications for low-rate
     wireless personal area networks (LR-WPANs)
Project: Develop a MAC
Simulator Using PARSEC
1.   Topology (You can assume that interference range is equal to communication range)
2.   Transmission Mechanism (http://www.eecs.berkeley.edu/~csinem/) “ZigBee/IEEE
     802.15.4 Summary” (unslotted CSMA/CA)
3.   States: {IDLE, RECEIVING, PENDING, TRANSMITTING}
        A node will not receive any packet when it is in TRANSMITTING state.
        A node can transmit a packet only when it is in IDLE state.
4.   When a node transmits a packet, the packet will be broadcasted due to broadcast
     nature in wireless environment. However, the packet will carry the neighborid
     information (The neighbor is chosen randomly). Only the neighbor whose id is equal
     to neighbored will increase its receiving count.
5.   When the program terminates, each node will report how many messages it receives
     successfully (receiving count) and how many messages it transmits (transmitting
     count). (Collision should be simulated.)
6.   After a node transmits a packet successfully or receives a packet successfully or
     discards a packet (due to NB > macMaxCSMABackoffs), it will send a packet again
     within RANDOM_INTERVAL~(RANDOM_INTERVAL + RANDOM_MIN) time
     units.
7.   The maximum simulation time. 100000000 time units.
8.   Transmission delay and propagation delay should be simulated.
Project: Develop a MAC
Simulator Using PARSEC

More Related Content

PDF
Parallel and Distributed Computing chapter 1
PPTX
Introduction to simulation and modeling
PDF
Swarm intelligence and particle swarm optimization
PDF
Deep Learning for Time Series Data
PPT
Models of Interaction
PPTX
Software Engineering Diversity
PPTX
Fundamental Cloud Architectures
PPTX
OS concepts 6 OS for various computing environments
Parallel and Distributed Computing chapter 1
Introduction to simulation and modeling
Swarm intelligence and particle swarm optimization
Deep Learning for Time Series Data
Models of Interaction
Software Engineering Diversity
Fundamental Cloud Architectures
OS concepts 6 OS for various computing environments

What's hot (20)

PPTX
Ensemble learning
PPTX
Evolutionary Computing
PPT
Chapter 02 simulation examples
PDF
Random number generator
PPTX
Computer Simulation And Modeling
PPTX
Introduction to deep learning
PPT
Data Flow Diagram and USe Case Diagram
PPT
Open Source Cloud Computing -Eucalyptus
PPT
Discreate Event Simulation_PPT1-R0.ppt
PPTX
Distributed Systems Real Life Applications
PPT
Random number generation
PPT
Lamport’s algorithm for mutual exclusion
PDF
User Interface Design Module 5 screen based controls
ODP
Introduction to Virtualization
PPTX
Human Computer Interaction-Basics
PPTX
Peer to peer system
PDF
Modelling and evaluation
PPT
Deep Learning
PPT
HCI 3e - Ch 19: Groupware
PPTX
Pseudo Random Number
Ensemble learning
Evolutionary Computing
Chapter 02 simulation examples
Random number generator
Computer Simulation And Modeling
Introduction to deep learning
Data Flow Diagram and USe Case Diagram
Open Source Cloud Computing -Eucalyptus
Discreate Event Simulation_PPT1-R0.ppt
Distributed Systems Real Life Applications
Random number generation
Lamport’s algorithm for mutual exclusion
User Interface Design Module 5 screen based controls
Introduction to Virtualization
Human Computer Interaction-Basics
Peer to peer system
Modelling and evaluation
Deep Learning
HCI 3e - Ch 19: Groupware
Pseudo Random Number
Ad

Viewers also liked (20)

PPT
Chapter3 general principles of discrete event simulation
PDF
Introduction to Discrete-Event Simulation Using SimPy
PPTX
SIMULATION
PPT
Introduction to Simulation
PPTX
8. probabilidad y variables aleatorias
DOCX
Ejercicio de Simulación
PPTX
Unit 5 general principles, simulation software
PPT
Simulation Powerpoint- Lecture Notes
PPT
Introduction to simulation
PDF
Mourão Moura - input2012
PDF
Introduction to Simulation- Predictive Analytics
PPTX
Unit 1 introduction
PDF
Simulation Technology Challenges
PDF
The use of 3D simulation technology to improve health and safety performance ...
PPT
02 20110314-simulation
PPTX
An Introduction to Simulation in the Social Sciences
PPT
Future Of Simulation In Healthcare Education
DOC
Distribuciones de probabilidad discretas
PPTX
Adm ventas i parcial
PPTX
Retailing cruz azul
Chapter3 general principles of discrete event simulation
Introduction to Discrete-Event Simulation Using SimPy
SIMULATION
Introduction to Simulation
8. probabilidad y variables aleatorias
Ejercicio de Simulación
Unit 5 general principles, simulation software
Simulation Powerpoint- Lecture Notes
Introduction to simulation
Mourão Moura - input2012
Introduction to Simulation- Predictive Analytics
Unit 1 introduction
Simulation Technology Challenges
The use of 3D simulation technology to improve health and safety performance ...
02 20110314-simulation
An Introduction to Simulation in the Social Sciences
Future Of Simulation In Healthcare Education
Distribuciones de probabilidad discretas
Adm ventas i parcial
Retailing cruz azul
Ad

Similar to Simulation (20)

PDF
PPT
PPT
Communication
PDF
A Survey on Wireless Network Simulators
ODP
From Simulation to Online Gaming: the need for adaptive solutions
PPT
PDF
Modeling & Simulation Lecture Notes
PPTX
Topic 3 - Measuring Simulation Performance.pptx
PPTX
System Simulation and Modelling with types and Event Scheduling
PDF
Open modeling and simulation framework for evolutive analysis
PDF
Jerry banks introduction to simulation
PPT
Software.ppt
PPTX
Lecture 1 - Introduction.pptx
PDF
SIMULATION.pdf
PDF
Introduction to simulation.pdf
PPTX
Discrete Event Simulation, CASE tool built using C#
PDF
Bank entities.pdf
PDF
Introduction to networks simulation
PDF
Parallel and Distributed Simulation from Many Cores to the Public Cloud
Communication
A Survey on Wireless Network Simulators
From Simulation to Online Gaming: the need for adaptive solutions
Modeling & Simulation Lecture Notes
Topic 3 - Measuring Simulation Performance.pptx
System Simulation and Modelling with types and Event Scheduling
Open modeling and simulation framework for evolutive analysis
Jerry banks introduction to simulation
Software.ppt
Lecture 1 - Introduction.pptx
SIMULATION.pdf
Introduction to simulation.pdf
Discrete Event Simulation, CASE tool built using C#
Bank entities.pdf
Introduction to networks simulation
Parallel and Distributed Simulation from Many Cores to the Public Cloud

More from Leonardo Daniel López Condoy (20)

DOC
Distribuciones de probabilidad continuas
DOC
Distribucion 3 weibull
DOCX
Distribucion 4 erlang
DOC
Distribucion 2 beta
DOC
Distribucion 1 gamma
PDF
Analisis tecnico bursatil
PPT
3 unidad 2 ejemplos de simulacion
PPT
2 simulacion unidad 1
PPTX
1 simulacion unidad1
PPT
Ejemplos sim manual cap 4
PPT
Técnicas y administración de ventas ii (color)
PPT
PPT
Retail marketing espol iche bpl
PPTX
9. distribuciones continuas
PPTX
5. regresión lineal multiple
PPTX
4. estadística descriptiva
PPTX
Tablas dinamicas de excel
PPTX
1. estadistica descriptiva
PPTX
2. estadistica descriptiva
Distribuciones de probabilidad continuas
Distribucion 3 weibull
Distribucion 4 erlang
Distribucion 2 beta
Distribucion 1 gamma
Analisis tecnico bursatil
3 unidad 2 ejemplos de simulacion
2 simulacion unidad 1
1 simulacion unidad1
Ejemplos sim manual cap 4
Técnicas y administración de ventas ii (color)
Retail marketing espol iche bpl
9. distribuciones continuas
5. regresión lineal multiple
4. estadística descriptiva
Tablas dinamicas de excel
1. estadistica descriptiva
2. estadistica descriptiva

Recently uploaded (20)

PDF
Zenith AI: Advanced Artificial Intelligence
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
project resource management chapter-09.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Encapsulation theory and applications.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
August Patch Tuesday
PDF
Heart disease approach using modified random forest and particle swarm optimi...
Zenith AI: Advanced Artificial Intelligence
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
OMC Textile Division Presentation 2021.pptx
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
cloud_computing_Infrastucture_as_cloud_p
project resource management chapter-09.pdf
Approach and Philosophy of On baking technology
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Group 1 Presentation -Planning and Decision Making .pptx
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Getting Started with Data Integration: FME Form 101
Encapsulation_ Review paper, used for researhc scholars
TLE Review Electricity (Electricity).pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A comparative study of natural language inference in Swahili using monolingua...
Encapsulation theory and applications.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
MIND Revenue Release Quarter 2 2025 Press Release
August Patch Tuesday
Heart disease approach using modified random forest and particle swarm optimi...

Simulation

  • 2. Outline Introduction to Simulation Discrete Event Simulation Simulator CSIM (Simulation Language) GloMoSim NS-2 NCTU-NS Conclusion Mini-Project: Using GloMoSim Project: Develop a MAC simulator using PARSEC
  • 3. Outline Introduction to Simulation Discrete Event Simulation Simulator CSIM (Simulation Language) GloMoSim NS-2 NCTU-NS Conclusion Mini-Project: Using GloMoSim Project: Develop a MAC simulator using PARSEC
  • 4. Introduction to Simulation What is simulation? A simulation is the imitation of the operation of a real-world process or system over time.
  • 5. Introduction to Simulation System and System Environment To model a system, it is necessary to understand the concept of a system and the system boundary. A system is defined as a group of objects that are joined together in some regular interaction or interdependence toward the accomplishment of some purpose. A system is often affected by changes occurring outside the system. Such changes are said to occur in the system environment. In modeling a system, it is necessary to decide on the boundary between the system and its environment.
  • 6. Introduction to Simulation Components of a System An entity is an object of interest in the system. An attribute is a property of an entity. An activity represents a time period of specified length. The state of a system is defined to be that collection of variables necessary to describe the system at any time. An event is defined as an instantaneous occurrence that may change the state of the system. Discrete System A discrete system is one in which the state variables change only at a discrete set of points in time.
  • 7. Introduction to Simulation Model of a System A model is a representation of a system for the purpose of studying the system. For most studies, it is enough to consider only those aspects of the system that affects the problem under investigation. Therefore, in most cases, a model is a simplification of the system. On the other hand, the model should be sufficiently detailed to permit valid conclusions to be drawn about the real system.
  • 8. Introduction to Simulation Types of Models Static/Dynamic A static simulation model, sometimes called a Monte Carlo simulation, represent a system at a particular point in time. A dynamic simulation model represents a system as it changes over time. Deterministic/Stochastic Simulation models that contain no random variables are classified as deterministic Deterministic models have a known set of inputs that will result in a unique set of outputs. On the other hand, a stochastic simulation model has one or more random variables as inputs. (e.g., random backoff timers)
  • 9. Introduction to Simulation Types of Models (Continue) Discrete/Continuous Like the definitions for discrete and continuous systems, discrete and continuous models are defined similarly. However, a discrete simulation model is not always used to model a discrete system, nor is a continuous model always used to model a continuous system. Discrete-Event System Simulation Discrete-event system simulation is widely used and is the focus of this course. Discrete-event system simulation is the modeling of the systems in which the state variables change only at a discrete set of points in time.
  • 10. Outline Introduction to Simulation Discrete Event Simulation Simulator CSIM (Simulation Language) GloMoSim NS-2 NCTU-NS Conclusion Mini-Project: Using GloMoSim Project: Develop a MAC simulator using PARSEC
  • 11. Discrete Event Simulation Strategies of discrete event simulation Activity-oriented simulation Event-oriented simulation Process-oriented simulation
  • 12. Discrete Event Simulation Activity-oriented simulation The programmer defines activities which are started when certain conditions are satisfied. In many cases, this type of simulation uses a simulated clock which advance in constant increments of time. With each advance, a list of activities is scanned, and those which have become eligible are started. This type of model is used more often with simulating physical devices. Simulate Network System Going to be very slow to execute Most time increments will produce no change to the system at all
  • 13. Discrete Event Simulation Activity-oriented simulation the list of activities at time 1 Scan the list of activities at time 2 Scan 1 2 3 4 5 6 7 8 9
  • 14. Discrete Event Simulation Event-oriented simulation The simulation programmer defines events and then writes routines which are invoked as each kind of event occurs Simulated time may pass between the events Usually, a priority queue will be used
  • 15. Discrete Event Simulation Array Event-oriented simulation struct sensor { Event A int id; 7:28 int location; 7:25 }; 7:21 Event B void void Process_Event_A() {} Process_Event_B() {}
  • 16. Discrete Event Simulation Process-oriented simulation The programmer defines the processes (entities, transactions, etc.) and the model in terms of interacting processes. A process is an independent program or procedure which can execute in parallel with other processes. The notion of in parallel is used with some liberty The processes will use the resources of the system. Resource-oriented Transaction-oriented Time Advance Hold Send a message to itself in the future
  • 17. Discrete Event Simulation Process-oriented simulation Process Process (Entity) Process (Entity) (Entity) Resource (Facility) Process (Entity) Process Process (Entity) (Entity)
  • 18. Outline Introduction to Simulation Discrete Event Simulation Simulator CSIM (Simulation Language) GloMoSim NS-2 NCTU-NS Conclusion Mini-Project: Using GloMoSim Project: Develop a MAC simulator using PARSEC
  • 19. Simulation Language – CSIM Mesquite Software Inc. CSIM 19 is the latest version of the widely-used CSIM simulation toolkit, which was initially developed in 1985 at Austin's Microelectronics and Computer Technology Corporation (MCC). CSIM is a library of routines for use by C or C++ programmers. Can be used to implement process-oriented, discrete- event simulation models of complex system
  • 20. Simulators – GloMoSim UCLA Parallel Computing Laboratory http://pcl.cs.ucla.edu/ GloMoSim (Global Mobile system Simulator) is a library-based simulator for wireless networks. It is designed as a set of library modules, each of which simulates a specific wireless communication protocol in the protocol stack. The communication protocol stack for wireless networks is divided into a set of layers, each with its own API. The library has been developed using PARSEC, a C- based parallel simulation language New protocols and modules can be programmed and added to the library using PARSEC.
  • 21. Simulators – NS-2 An object-oriented, discrete event network simulator developed at UC Berkely Mainly used for simulating local and wide area networks It is written in C++ and OTcl (Object-oriented Tcl) and primarily uses OTcl as command and configuration language. OTcl: Network Topology C++: Network Component
  • 22. Simulators – NCTU-NS The NCTUns network simulator is developed at NCTU, Taiwan. Its predecessor is the Harvard network simulator. By using a novel simulation methodology, it can do several tasks that traditional network simulators cannot easily do. More and more people are using it. (Use the Google to search it for yourself.)
  • 23. Outline Introduction to Simulation Discrete Event Simulation Simulator CSIM (Simulation Language) GloMoSim NS-2 NCTU-NS Conclusion Mini-Project: Using GloMoSim Project: Develop a MAC simulator using PARSEC
  • 24. Conclusion Discrete Event Simulation Three approaches The choice is in some sense a matter of taste, as any model developed using one approach could have been implemented using the other. Simulation Language and Simulator CSIM, PARSEC GloMoSim, NS-2, NCTUns
  • 25. References Jerry Banks, John S. Carson, Barry L. Nelson, David M. Nicol , "Discrete Event System Simulation", 4th edition, Prentice Hall, 2005, ISBN 0131293427 Herb Schwetman, “CSIM: A C-Based, Process-oriented Simulation Language”, in Proceedings of the Winter Simulation Conference, 1986 Mesquite Software Inc. (CSIM19) http://www.mesquite.com/index.htm Xiang Zeng, Rajive Bagrodia, and Mario Gerla, “GloMoSim: A Library for Parallel Simulation of Large-scale Wireless Networks”, in Proceedings of the 12th Workshop on Parallel and Distributed Simulations -- PADS '98, May 26- 29, 1998 in Banff, Alberta, Canada NS-2, http://www.isi.edu/nsnam/ns/ Marc Greis, “Tutorial for the Network Simulator “ns””, http://www.isi.edu/nanam/ns/tutorial/index.html The ns Manual, http://www.isi.edu/nsnam/ns/ns-documentation.html S.Y. Wang, “NCTUns 1.0”, In the column "Software Tools for Networking", IEEE Network, Vol.17, No.4, July 2003.
  • 26. Outline Introduction to Simulation Discrete Event Simulation Simulator CSIM (Simulation Language) GloMoSim NS-2 NCTU-NS Conclusion Mini-Project: Using GloMoSim Project: Develop a MAC simulator using PARSEC
  • 27. Mini-Project: Using GloMoSim Download UCLA Parallel Computing Laboratory http://pcl.cs.ucla.edu/ Install ~/parsec (depend on your OS) linux3.csie.nctu.edu.tw RedHat Linux 9.0 Powered by Kernel 2.4.27) gcc version 3.3.1 ~/glomosim
  • 28. Mini-Project: Using GloMoSim Compile ~/glomosim/main (make) ~/glomosim/bin Related Files ~/glomosim/bin/config.in ~/glomosim/bin/app.in ~/glomosim/bin/glomo.stat ~/glomosim/bin/mobility.in ~/glomosim/bin/nodes.input
  • 29. Mini-Project: Using GloMoSim Example Application: 2 FTP Flows Routing: AODV, DSR Demonstrate How to set? How to observe results?
  • 30. Outline Introduction to Simulation Discrete Event Simulation Simulator CSIM (Simulation Language) GloMoSim NS-2 NCTU-NS Conclusion Mini-Project: Using GloMoSim Project: Develop a MAC simulator using PARSEC
  • 31. Project: Develop a MAC Simulator Using PARSEC Introduction to PARSEC PARSEC was developed by members of the UCLA Parallel Computing Laboratory Web page: http://pcl.cs.ucla.edu/ PARSEC (for PARallel Simulation Environment for Complex systems) is a C-based discrete-event simulation language. It adopts the process interaction approach to discrete-event simulation.
  • 32. Project: Develop a MAC Simulator Using PARSEC Entity (Driver Entity) entity NODE(int myno) { ename neighbor[6]; int i, N, count; receive () {} while (1) { receive (MSG msg) { } } finalize { } } entity driver(){ }
  • 33. Project: Develop a MAC Simulator Using PARSEC Message message MSG { int source; }; receive (MSG msg) { } send MSG{myno} to neighbor[GET_NEIGHBOR(N)];
  • 34. Project: Develop a MAC Simulator Using PARSEC Example 1. Topology 2. When a node receives a message, it will transmit a message to one of its neighbors within 10~20 time units. (Initially, each node can send a message to itself to start simulation.) 3. The neighbor is chosen randomly. 4. When the program terminates, each node will report how many messages it receives. 5. The maximum simulation time. 100000 time units.
  • 35. Project: Develop a MAC Simulator Using PARSEC Project Goal: Unslotted CSMA defined in IEEE 802.15.4 IEEE standard for information technology - telecommunications and information exchange between systems - local and metropolitan area networks specific requirements part 15.4: wireless medium access control (MAC) and physical layer (PHY) specifications for low-rate wireless personal area networks (LR-WPANs)
  • 36. Project: Develop a MAC Simulator Using PARSEC 1. Topology (You can assume that interference range is equal to communication range) 2. Transmission Mechanism (http://www.eecs.berkeley.edu/~csinem/) “ZigBee/IEEE 802.15.4 Summary” (unslotted CSMA/CA) 3. States: {IDLE, RECEIVING, PENDING, TRANSMITTING} A node will not receive any packet when it is in TRANSMITTING state. A node can transmit a packet only when it is in IDLE state. 4. When a node transmits a packet, the packet will be broadcasted due to broadcast nature in wireless environment. However, the packet will carry the neighborid information (The neighbor is chosen randomly). Only the neighbor whose id is equal to neighbored will increase its receiving count. 5. When the program terminates, each node will report how many messages it receives successfully (receiving count) and how many messages it transmits (transmitting count). (Collision should be simulated.) 6. After a node transmits a packet successfully or receives a packet successfully or discards a packet (due to NB > macMaxCSMABackoffs), it will send a packet again within RANDOM_INTERVAL~(RANDOM_INTERVAL + RANDOM_MIN) time units. 7. The maximum simulation time. 100000000 time units. 8. Transmission delay and propagation delay should be simulated.
  • 37. Project: Develop a MAC Simulator Using PARSEC