U. Hatnik, S. Altmann
Fraunhofer Gesellschaft EAS/IIS
SDA 2004
8. September 2004
Using ModelSim, Matlab/Simulink and NS for
Simulation of Distributed Systems
Outline
• Motivation • Requirements
• Object Oriented Simulation • Objects and Object Structure • Open Model Interface
• Object Communication Versions • Conclusions
Motivation
Analysis of communication systems through abstract network simulation
• Analysis of workload, bottlenecks, reserves and configurations
• Guarantee of the Quality of Service • Effects of distributed services
• Development of new protocols • Error simulation
Server
Network (WAN, LAN)
z−1 + 0 k z−1 + 1 k k k 0 1 + +
Motivation
Detailed simulation of single components of a distributed system
• Development of new soft- and hardware e.g. network adapter, protocol accelerator, signal processing algorithms
• Exploration of existing components e.g. with hardware debugger
• Simplification of the design process • Validation and test
Motivation
Network Simulator NS-2:
• Based on abstract models, without real reference data
• Provided with extensive libraries (e.g. protocols, transmission lines)
• Not well suited for circuit simulation (absence of libraries, languages, tools)
VHDL/Verilog Simulator ModelSim:
• Modelling with low abstraction level possible • Provided with extensive circuit libraries
Motivation
Matlab/Simulink
• Models mainly based on differential and difference equations
• More and more libraries and toolboxes available (e. g. for signal processing) • Not well suited to simulate circuits or for protocol development
Real system components, e. g. User-Mode Linux:
• If no model available
Requirements for a Suitable Simulation Environment
• Combination of models with different abstraction levels • Less restrictions in terms of modelling languages
• Good extensibility (models, simulation algorithms) • High flexibility at low complexity of the framework • Integration of soft- und hardware components • Distributed simulation
Obj. 2.2 Obj. 2.1 Obj. 3.2 Obj. 3.1 Obj. 1 Interface Sim. Algorithm Object other Objects Model
The Object Oriented Approach
• Partitioning of the system
• Object is equivalent to subsystem
• Object = Model + Simulator + Interface • Object can use further objects
• Object encapsules implementation details
=> Simple replacement of objects
=> Object implementation can be changed easily => Integration of real soft- and hardware possible
Top Level View
Network Model Server Network (WAN, LAN) Clients S S S C C C Server Models Client ModelsThe Network Simulator NS Version 2
• LAN, WAN, mobile- and satellit networks
• Simulator- and model implementation with oTcl and C++ • Library and examples (protocols, network types etc.) • Dynamic scenarios
• Animation tool NAM
The Network Simulator NS Version 2
Network Simulator NS-2 C C C S S STop Level Object
Interface
Network Simulator
Top Level System Model
NS-2
C C C
Detailed Simulation of a single Component
I1 I2 I3 I4 I5 O1 O2 Network Model S S S C C CModelSim Object
E1 E2 E3 E4 E5 A1 A2 VHDL / Verilog Simulator ModelSim hardware componentModelSim Object
Interface VHDL / Verilog Simulator ModelSim E1 E2 E3 E4 E5 A1 A2 hardware componentMatlab/Simulink Object
Matlab/Simulink
Matlab/Simulink Object
Matlab/Simulink
signal processing
Applications User Mode Linux
System 1
Virtual Network Module
Applications User Mode Linux
System 2 Linux System
User Mode Linux Object
Interface
Applications User Mode Linux
System 1
Virtual Network Module
Applications User Mode Linux
System 2 Linux System
Object Structure
Interface
Network Simulator NS-2
Top Level System Model C C C S S S
Object Structure
Interface E1 E2 E3 E4 E5 A1 A2 ModelSim Hardware Component Interface Network Simulator NS-2Top Level System Model C C C S S S Interface E1 E2 E3 E4 E5 A1 A2 ModelSim Hardware Component
Object Structure
Interface E1 E2 E3 E4 E5 A1 A2 ModelSim Hardware Component Interface Network Simulator NS-2Top Level System Model C C C S S S Interface E1 E2 E3 E4 E5 A1 A2 ModelSim Hardware Component Interface System Applications User Mode Linux
Systems
Object Structure
Interface E1 E2 E3 E4 E5 A1 A2 ModelSim Interface Signal Processing Hardware Component Interface Network Simulator NS-2Top Level System Model C C C S S S Interface E1 E2 E3 E4 E5 A1 A2 ModelSim Hardware Component Interface System Applications User Mode Linux
Systems
Object Structure
Interface E1 E2 E3 E4 E5 A1 A2 ModelSim InterfaceMatlab/Simulink Signal Processing Hardware Algorithm Component Interface Network Simulator NS-2
Top Level System Model C C C S S S Interface E1 E2 E3 E4 E5 A1 A2 ModelSim Hardware Component Interface System Applications User Mode Linux
Systems
Software
Object Structure
Interface E1 E2 E3 E4 E5 A1 A2 ModelSim Interface Signal Processing Hardware Component Interface Network Simulator NS-2Top Level System Model C C C S S S Interface E1 E2 E3 E4 E5 A1 A2 ModelSim Hardware Component Interface System Applications User Mode Linux
Systems
Software
Open Model Interface (OMI)
• IEEE standard
• Object oriented approach
• Open and independent interface • Dynamic simulation control
• Intellectual property (IP) protection • Visibility of intern signals
• Licence and version management • Flexible model creation
• Model query functions Properties:
Basic Structure of the Open Model Interface
Model Manager OMI Library Model 1 Model 2Instance 1 Instance 2 Instance 3 Application
Basic Structure of the Open Model Interface
Model Manager OMI Library Model 1 Model 2Instance 1 Instance 2 Instance 3
Interface
Network Simulator NS-2
Top Level System Model C C C S S S
Basic Structure of the Open Model Interface
Model Manager OMI E1 E2 E3 A1 A2 ModelSim Hardware Component System User Mode LinuxSystemsSoftware Matlab/Simulink Signal Processing Algorithm Interface Network Simulator NS-2
Top Level System Model C C C S S S
Library Model 1
Basic Structure of the Open Model Interface
Model Manager OMI E1 E2 E3 A1 A2 ModelSim Hardware Component System Applications User Mode LinuxSystems Software Matlab/Simulink Signal Processing Algorithm Interface Network Simulator NS-2
Top Level System Model C C C S S S
Basic Structure of the Open Model Interface
Model Manager OMI TCP/IP-Sockets E1 E2 E3 A1 A2 ModelSim Hardware Component System User Mode LinuxSystemsSoftware Matlab/Simulink Signal Processing Algorithm Interface Network Simulator NS-2
Top Level System Model C C C S S S
Object Communication Versions
• TCP/IP-Sockets
(high effort, dependent on platform)
• Parallel Virtual Machine (PVM) (low effort, independent of platform)
• High Level Architecture (HLA)
(developed especially for simulator coupling, mechanism for synchronisation)
• Common Object Request Broker Architecture (CORBA)
Conclusions
• Simulation of distributed systems via simulator coupling => Combination of suitable simulators (abstraction level, modelling language, available libraries)
• OOS approach (autonomous objects, optimale adaption on requirements, integration of real soft- and hardware components possible)
• OMI (interface standard for object coupling) • Object communication via TCP/IP-Sockets
=> distributed simulation is easily possible