Analysis and Design of a Policy Based Approach to Software Download in a Distributed Automotive Middleware
Total Page:16
File Type:pdf, Size:1020Kb
Analysis and Design of a Policy based approach to Software Download in a Distributed Automotive Middleware ANDREAS LINDELL Master of Science Thesis Stockholm, Sweden 2007 This sentence was intentionally made white. Analysis and Design of a Policy based approach to Software Download in a Distributed Automotive Middleware Andreas Lindell This sentence was intentionally made white. Master of Science Thesis MMK 2007:76 fMDA 308g KTH Industrial Engineering and Management Machine Design SE-100 44 Stockholm This sentence was intentionally made white. This Master Thesis was written at, and in cooperation with, Keywords: Automotive Middleware, Embedded System, Distributed System, Software Load, Policy, Repository, Policy Repository, DySCAS, AUTOSAR, OSE Epsilon, Linux, Polyhedra The contents, results and conclusions of this master thesis represents the au- thor's opinion only, and is not in any way affiliated with those of the DySCAS or AUTOSAR consortium, or that of Enea AB or the Royal Institute of Technology. c 2007 Andreas Lindell . Master of Science Thesis MMK2007:76 MDA 308 Analysis and Design of a Policy based approach to Software Download in a Distributed Automotive Middleware Andreas Lindell Approved: Examiner: Supervisor: 2007-12-18 Martin T¨orngren Magnus Persson Commissioner: Contact Person: Enea Detlef Scholle . Abstract . DySCAS is an automotive research project with the purpose of providing a future standard within the vehicle electronics layer satisfying the needs of both today's and tomorrow's automotive producers. This master thesis was carried out at Enea during the fall of 2007 with the purpose of investigating the implementation of software download through an external and secure communication link to every node in a DySCAS system. Furthermore it aimed at investigating how policies, which are a part of making the system behave autonomously, should be managed in the DySCAS project when it came to storing these in a repository. Finally, the AUTOSAR standard- ization, another automotive project, was studied for an investigation to be made about which requirements that should be set on the architecture of DySCAS, for it to co-exist with the AUTOSAR standardization. After an initial literature study, addressing the issues presented above, a design of the software system was carried out followed by an implementation and testing of this software. A general design of a system supporting software load, allowing both the replacement of one middleware component as well as the update of an entire node running in the DySCAS middleware, has been presented. In the subse- quent implementation the possibility of using the CAN network to upgrade the software running on one or more DySCAS nodes with the help of an externally connected "upgrading node" has been explored and successfully implemented in the demonstrator platform. Furthermore, a Repository Service, using Enea's Polyhedra real-time database as the underlying repository, has been designed and implemented in the DySCAS demonstrator platform at Enea. The implemented software component supports the storage of policies and context information and thus aids the system in the objective of behaving autonomously. The Repository Service also provides the DySCAS system with a general storage facility, allowing other parts of the mid- dleware or applications running on top of the middleware to store data. Finally, a design of how DySCAS and AUTOSAR should be elaborated to fit together in one bigger system has been presented. iii . iv . Examensarbete MMK2007:76 MDA 308 Analys och Design av ett Policybaserad angrepss¨att till Programladdning i en Distribuerad Mellanprogramvara f¨orfordon Andreas Lindell Godk¨ant: Examinator: Handledare: 2007-12-18 Martin T¨orngren Magnus Persson Uppdragsgivare: Kontaktperson: Enea Detlef Scholle . Sammanfattning . DySCAS ¨arett forskningsprojekt inom bilindustrin som syftar till att ta fram en framtida standard f¨orelektroniksystemet i bilar som tillfredsst¨allerb˚adedagens och framtidens krav ifr˚anbiltillverkarna. Detta examensarbete genomf¨ordesp˚aEnea under h¨osten2007 med syftet att utreda hur programladdning genom en extern och s¨aker kommunikationsl¨anktill varje nod i ett DySCAS-system ska implementeras. Vidare ska examensarbetet utreda hur policys, som ¨aren del av angreppss¨attetf¨or att f˚asystemet att bete sig autonomt, ska hanteras inom DySCAS n¨ardet kommer till att lagra dessa i systemet. Slutligen ska AUTOSAR, som ¨aren redan befintlig standardisering inom bilindustrin, studeras f¨oratt utreda vilka krav som ska st¨allasp˚aDySCAS- arkitekturen f¨oratt den ska kunna samexistera med AUTOSAR. Efter en inledande litteraturstudie, d¨ar de ovan presenterade omr˚adenastud- erades ing˚aende,gjordes en design av mjukvarusystemet som senare skulle im- plementeras i referensplattformen p˚aEnea. Implementationen av detsamma f¨oljdes¨aven av omfattande tester. En allm¨andesign av hur systemet ska hantera programvaruladdning har tagits fram som till˚aterb˚adeenstaka komponenter likv¨alsom inneh˚alletp˚aen hel nod att uppdateras. I den efterf¨oljandeimplementationen s˚ahar m¨ojligheten att anv¨andasig av CAN-n¨atverket f¨oratt uppdatera programvaran som k¨orsp˚a en eller flera noder i ett DySCAS system, med hj¨alpav en externt p˚akopplad "uppdaterarnod", utnyttjats. Vidare s˚ahar en Repository Service, som anv¨anderEneas realtidsdatabas Polyhedra som den underliggande lagringsplatsen, designats och implementer- ats i DySCAS-demonstrator-plattformen p˚aEnea. Den implementerade mjuk- varukomponenten tillhandah˚allerm¨ojlighetenatt lagra policys och kontextin- formation och ¨ard¨arav en del i att f˚aDySCAS-systemet att bete sig autonomt. Repository Servicen tillhandah˚allerocks˚aDySCAS-systemet med en allm¨anla- gringsplats som l˚aterb˚adeandra mellanprogramvarukomponenter och applika- tioner som k¨orsovanp˚amellanprogramvaran att lagra data. Slutligen har en design av hur DySCAS och AUTOSAR b¨orutvecklas f¨or att de tv˚asystemet ska kunna samexistera i ett st¨orresystem tagits fram.. v vi Preface I would like to send a warm thank you to all the people at Enea that made this master thesis possible, especially to Detlef Scholle and Barbro Claesson for all your support during the course of my work. Also a big thank you to my supervisor Magnus Persson and my examiner Martin T¨orngrenat the Royal Institute of Technology for all your help and ideas and for having the patience to endure my wordy way of writing. And finally, thanks to all my master thesis colleagues at Enea for all your in- spiring ideas and our invaluable discussions during our months together. Bj¨orn, Joakim, Joakim, Martin and Mikael - thanks for 20 both funny and interesting weeks. /Andreas vii viii Contents 1 Introduction1 1.1 Purpose................................1 1.2 Goal..................................1 1.3 Delimitations.............................2 1.4 Method and Outline.........................2 1.5 Previous work.............................3 2 Background5 2.1 Layers of a Vehicle..........................5 2.2 DySCAS................................5 2.2.1 Use cases, functionalities and requirements........6 2.3 Autonomic Computing........................7 2.4 AUTOSAR..............................8 2.4.1 Purpose............................8 2.4.2 AUTOSAR today......................8 3 Use Cases and Existing Architecture9 3.1 Use Cases and Requirements....................9 3.1.1 Applicable Generic Use Cases................9 3.1.2 Selection of Specific Use Cases and System Requirements 10 3.2 Existing DySCAS Demonstrator Platform............. 11 3.2.1 Architecture......................... 12 3.2.2 APIs.............................. 13 3.2.3 Repository.......................... 13 3.3 Conceptual DySCAS Architecture................. 15 3.3.1 Software Load Management Service............ 15 3.3.2 Autonomic Configuration Management Service...... 17 3.3.3 Repository Service...................... 17 3.3.4 Independent Application (e.g. AUTOSAR)........ 17 4 Software Load in a Distributed System 19 4.1 Literature Study........................... 19 4.1.1 Linking and Loading..................... 20 4.1.2 Object File Formats..................... 21 4.1.3 Dynamic Linking and Loading............... 22 4.1.4 The Absence of Dynamic Linking.............. 24 4.1.5 On-Board Diagnostics.................... 27 4.1.6 Security, Safety and Software Load............. 28 ix 4.1.7 Conclusions.......................... 29 4.2 Design of a Software Load system.................. 30 4.2.1 General Design of a Software Load System........ 30 4.2.2 Software Load and Dynamic Linking............ 32 4.2.3 Software Load Without Dynamic Linking Capabilities.. 33 4.2.4 Software Load via the CAN network............ 33 4.2.5 Application-Triggered Software Load............ 34 4.2.6 Security and Software Load................. 35 4.2.7 Two Descriptive Examples................. 36 4.3 Implementation of Software Load via the CAN bus........ 37 4.3.1 The different modes of the Receiver node......... 38 4.3.2 The process of triggering the receiver mode........ 39 4.3.3 Provided functionality.................... 40 4.3.4 The CAN messages...................... 41 4.3.5 Using an Upgrade Server on the Epsilon platform..... 42 4.3.6 Summary........................... 42 4.4 Testing of the implemented components.............. 43 5 Storage of Policies in a Repository 45 5.1 Literature Study........................... 45 5.1.1 Policies............................ 45 5.1.2 Different types of policies.................. 46 5.1.3 Policy-driven