Using ModelSim, Matlab/Simulink and NS for Simulation of Distributed Systems U. Hatnik, S. Altmann Fraunhofer Gesellschaft EAS/ SDA 2004 8. September 2004
Outline Motivation Requirements Object Oriented Simulation Objects and Object Structure Open Model Object Communication Versions Conclusions 2
Motivation Analysis of communication systems through abstract network simulation Server Clients Network (WAN, LAN) Analysis of workload, bottlenecks, reserves and configurations Guarantee of the Quality of Service Effects of distributed services Development of new protocols Error simulation 3
Motivation Detailed simulation of single components of a distributed system Development of new soft- and hardware + + k0 k0 k1 k1 z 1 + z 1 + 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 Fault diagnostics 4
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 Not well suited to simulate communication networks 5
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 If real stimuli data necessary For validation and test (comparison of real components and models) 6
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 => Coupling of Simulators 7
The Object Oriented Approach other Objects Partitioning of the system Object Sim. Algorithm Obj. 1 Model Object is equivalent to subsystem Object = Model + Simulator + Object can use further objects Object encapsules implementation details Obj. 2.1 Obj. 3.1 Obj. 2.2 Obj. 3.2 => Simple replacement of objects => Object implementation can be changed easily => Integration of real soft- and hardware possible 8
Top Level View Client Models Clients C C C Network (WAN, LAN) Network Model Server S S S Server Models 9
The 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 Free software, source code available 10
The Network Simulator NS Version 2 Network Simulator NS-2 C C C S S S Top Level System Model 11
Top Level Object Network Simulator NS-2 C C C S S S Top Level System Model 12
Detailed Simulation of a single Component C C C Network Model S S S I1 I2 I3 O1 O2 I4 I5 13
ModelSim Object VHDL / Verilog Simulator ModelSim E1 E2 E3 E4 E5 A1 A2 hardware component 14
ModelSim Object VHDL / Verilog Simulator ModelSim E1 E2 E3 E4 E5 A1 A2 hardware component 15
Matlab/Simulink Object Matlab/Simulink signal processing 16
Matlab/Simulink Object Matlab/Simulink signal processing 17
User Mode Linux Object Linux System Virtual Network Module User Mode Linux System 1 Applications User Mode Linux System 2 Applications 18
User Mode Linux Object Linux System Virtual Network Module User Mode Linux System 1 Applications User Mode Linux System 2 Applications 19
Object Structure Network Simulator NS-2 C C C S S S Top Level System Model 20
Object Structure Network Simulator NS-2 C C C S S S Top Level System Model ModelSim E1 E2 E3 Hardware Component A1 A2 E4 E5 21
Object Structure Network Simulator NS-2 C C C S S S Top Level System Model ModelSim E1 E2 E3 E4 E5 Hardware Component A1 A2 System Software User Mode Linux Systems Applications 22
Object Structure Network Simulator NS-2 C C C S S S Top Level System Model ModelSim E1 E2 E3 E4 E5 Hardware Component A1 A2 System Software User Mode Linux Systems Applications Matlab/Simulink Signal Processing Algorithm 23
Object Structure Network Simulator NS-2 C C C S S S Top Level System Model ModelSim E1 E2 E3 E4 E5 Hardware Component A1 A2 System Software User Mode Linux Systems Applications Matlab/Simulink Signal Processing Algorithm System Hardware FPGA 24
Object Structure Network Simulator NS-2 C C C S S S Top Level System Model ModelSim E1 E2 E3 E4 E5 Hardware Component A1 A2 System Software User Mode Linux Systems Applications Matlab/Simulink Signal Processing Algorithm System Hardware FPGA 25
Open Model (OMI) Properties: 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 26
Basic Structure of the Open Model Library Model 1 Model 2 Application Model Manager OMI Instance 1 Instance 2 Instance 3 27
Basic Structure of the Open Model Network Simulator NS-2 C C C S S S Top Level System Model Library Model 1 Model 2 Model Manager OMI Instance 1 Instance 2 Instance 3 28
Basic Structure of the Open Model Network Simulator NS-2 C C C S S S Top Level System Model Library Model 1 Model 2 Model Manager OMI System Software User Mode Linux Systems Applications ModelSim E1 E2 E3 E4 E5 Hardware Component A1 A2 Matlab/Simulink Signal Processing Algorithm 29
Basic Structure of the Open Model Network Simulator NS-2 C C C S S S Top Level System Model OMI Model Manager System Software User Mode Linux Systems Applications ModelSim E1 E2 E3 E4 E5 Hardware Component A1 A2 Matlab/Simulink Signal Processing Algorithm 30
Basic Structure of the Open Model Network Simulator NS-2 C C C S S S Top Level System Model OMI Model Manager TCP/IP-Sockets (PVM, CORBA, HLA) System Software User Mode Linux Systems Applications ModelSim E1 E2 E3 E4 E5 Hardware Component A1 A2 Matlab/Simulink Signal Processing Algorithm 31
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) (transparent coupling of distributed objects, client server architectur) 32
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 Further coupling methods possible (PVM, CORBA, HLA) Very flexible and user comfortable simulation environment 33