Architecture of Distributed Real-Time Embedded System
Total Page:16
File Type:pdf, Size:1020Kb
Architecture of distributed real-time embedded system CHEUK WING LEUNG KTH Information and Communication Technology Master of Science Thesis Stockholm, Sweden 2013 TRITA-ICT-EX-2013:155 Architecture of distributed real-time embedded system Master of Science Thesis CHEUK WING LEUNG Supervisor: Examiner: Detlef Scholle, XDIN AB Mats Brorsson, KTH Barbro Claesson, XDIN AB TRITA-ICT-EX-2013:155 Acknowledgements My deepest gratitude goes to my supervisors Detlef Scholle and Barbro Claesson for giving me this opportunity to work in the project. They have inspired me and given me valuable advices throughout the project. I would like to thank the examiner Mats Brorsson for the support and guidance to my thesis project. I thank the employees in XDIN AB for good company and creating an good environment during the project. Especially Sebastian Ullström and David Skoglund for the help in testing of the system and developing the demonstration setup. I want to thank Joanna Larsson, Amir Kouhestani, José Pérez, Robin Hultman and Tobias Lindblad, the students who working together in the same project for moral support and inspiring discussions on details of the project. Finally, I would like to thank my parents and my friends, especially Markus Näslund for all of the support. Abstract CRAFTERS (Constraint and Application Driven Frame- work for Tailoring Embedded Real-time System) project aims to address the problem of uncertainty and heterogene- ity in a distributed system by providing seamless, portable connectivity and middleware. This thesis contributes to the project by investigating the techniques that can be used in a distributed real-time embedded system. The conclusion is that, there is a list of specifications to be meet in order to provide a transparent and real-time distributed system. This thesis has implemented a basic system that pro- vides support of scalability, accessibility, fault tolerant and consistency. The system is tested in different areas and it shows its potentials to be a well transparent real-time system. This built the basis for further development. Contents Contents List of Figures List of Tables List of Abbreviations 1 Introduction 1 1.1 Background . 1 1.2 Problemstatement............................ 2 1.3 Team goal . 2 1.4 Method .................................. 2 1.4.1 Theoretical study . 2 1.4.2 Implementation . 2 1.5 Delimitations ............................... 3 2 Requirements of the system 4 2.1 Overviewoftherequirements . 4 2.2 Explanations of the requirements . 5 3 Distributed Real-time Embedded System 7 3.1 Motivation on distributed system . 7 3.1.1 Centralizedsystem........................ 7 3.1.2 Decentralizedsystem....................... 8 3.1.3 Distributedsystem........................ 9 3.2 Background of Distributed Real-time Embedded System . 9 3.2.1 Real-time system . 10 3.2.2 Embeddedsystem ........................ 10 3.3 Challenges in distributed real-time embedded system . 11 3.3.1 Embedded concerns . 11 3.3.2 Distributed concerns . 11 3.3.3 Real-time concerns . 11 3.3.4 Dimensions of middleware . 12 CONTENTS 3.4 Summary of the distributed real-time embedded system . 14 4 Middleware Architecture 15 4.1 Structureofamiddleware ........................ 15 4.1.1 Communication within the system . 15 4.1.2 Synchronous protocol within the system . 16 4.1.3 QoS support . 17 4.1.4 Transparent to applications and system . 18 4.1.5 Fault-tolerant . 19 4.1.6 Consistency control . 19 4.1.7 Other coordinating units . 19 4.2 Related work: TAO . 20 4.2.1 Object-oriented middleware . 20 4.2.2 TAOStructure .......................... 21 4.2.3 Communication in TAO . 21 4.2.4 Synchronization Protocol in TAO . 22 4.2.5 QoS support in TAO . 23 4.2.6 Interface in TAO . 23 4.2.7 Fault-tolerant in TAO . 24 4.2.8 Consistency control in TAO . 25 4.2.9 Additional feature in TAO . 26 4.3 Related work: AUTOSAR . 27 4.3.1 Component-based middleware . 28 4.3.2 AUTOSAR Structure . 28 4.3.3 Communication in AUTOSAR . 29 4.3.4 Synchronization Protocol in AUTOSAR . 30 4.3.5 QoS support in AUTOSAR . 31 4.3.6 Interface in AUTOSAR . 32 4.3.7 Fault-tolerant in AUTOSAR . 32 4.3.8 Consistency control in AUTOSAR . 33 4.3.9 Additional feature in AUTOSAR . 34 4.4 Related work: DySCAS . 34 4.4.1 Policy-based middleware . 34 4.4.2 DySCAS Structure . 35 4.4.3 Communication in DySCAS . 36 4.4.4 Synchronization Protocol in DySCAS . 36 4.4.5 QoS support in DySCAS . 36 4.4.6 Interface in DySCAS . 38 4.4.7 Fault-tolerant in DySCAS . 38 4.4.8 Consistency control in DySCAS . 38 4.4.9 Additional feature in DySCAS . 39 4.5 Summary of middleware architecture . 39 5 Discussions on the Middleware 40 CONTENTS 5.1 Summary of architecture comparison . 40 5.2 Embeddedconcerns ........................... 40 5.3 Real-time performance . 42 5.4 Accessibilitytransparent. 42 5.5 Migratability transparent . 43 5.6 Concurrency transparent . 43 5.7 Scalability transparent . 44 5.8 Failure transparent . 44 5.9 Reconfigurability . 45 5.10 Summary of discussions . 46 6 Specification for System Design 48 6.1 System specification . 48 6.1.1 Approach . 48 6.1.2 Communication . 48 6.1.3 Synchronization protocol . 49 6.1.4 QoS support . 49 6.1.5 Fault-tolerant . 49 6.1.6 Consistency Control . 50 6.2 Summary of the system specification . 50 7 Design of the middleware 51 7.1 Overview ................................. 51 7.2 Operation in the system . 52 7.3 Systemobject............................... 52 7.3.1 System interface . 52 7.3.2 Database handler . 53 7.3.3 Scheduler ............................. 55 7.3.4 Signal handler . 56 7.3.5 Resource manager . 57 7.3.6 Fault detector . 58 7.3.7 Trace handler . 59 7.4 Wrapper object . 59 7.4.1 Wrapper interface . 59 7.4.2 Middleware . 59 7.4.3 Client handler . 60 7.5 Task object . 60 7.5.1 Task interface . 60 7.6 Summary of the design . 60 8 Implementation 62 8.1 Overview ................................. 62 8.2 Real-time support . 62 8.2.1 Task distribution . 62 CONTENTS 8.2.2 Simulation and results . 63 8.3 Scalability support . 64 8.3.1 Group sending . 64 8.3.2 Simulation and results . 65 8.3.3 Asynchronous method handling . 68 8.3.4 Simulation and results . 69 8.4 Accessibilitytransparency . 70 8.4.1 Trading and naming . 70 8.4.2 Centralized communication . 71 8.4.3 Simulation and results . 71 8.5 Fault tolerance . 72 8.5.1 Fault detection and signal redirection . 72 8.5.2 Simulation and results . 72 8.6 Consistency................................ 74 8.6.1 Resource locking . 74 8.6.2 Simulation and results . 74 8.7 Use case: brake-by-wire system . 75 8.7.1 Introduction of brake-by-wire system . 75 8.7.2 Simulation setup of the use case . 76 8.7.3 Challenges of brake-by-wire system . 77 8.7.4 Two-phased execution . 77 8.7.5 Group receiving . 77 8.7.6 Results of the use case . 78 8.8 Conclusion on the implementation . 78 9 Conclusion and Future Work 80 9.1 Conclusion on the project . 80 9.2 Limitations . 80 9.3 Futurework................................ 81 A System interface B Wrapper interface C Task interface Bibliography List of Figures 3.1 CentralizedSystem.............................. 8 3.2 DecentralizedSystem ............................ 8 3.3 DistributedSystem.............................. 9 4.1 Synchronous Communication . 16 4.2 Asynchronous Communication . 17 4.3 TAOStructure[15] .............................. 21 4.4 Middle-tier Server Blocking Protocol . 22 4.5 Asynchronous Method Handling Synchronization Protocol . 22 4.6 StructureoftheCORBAInterface . 24 4.7 Infrastructure of the Fault-Tolerant Service . 25 4.8 Server Queue-Based Worker Thread Pool Server . 27 4.9 Leader/Followers Thread Pool Server . ..