Girts Strazdins Wireless Sensor Network Software Design Rules
Total Page:16
File Type:pdf, Size:1020Kb
UNIVERSITY OF LATVIA FACULTY OF COMPUTING Girts Strazdins Wireless Sensor Network Software Design Rules DOCTORAL THESIS FOR THE ACADEMIC DEGREE OF DR.SC.COMP FIELD: COMPUTER SCIENCE SUB-FIELD: SYSTEMS OF DATA PROCESSING AND COMPUTER NETWORKS ADVISOR: DR.SC.COMP. LEO SELAVO RIGA, 2014 This work has been supported by the European Social Fund within the project "Support for Doctoral Studies at University of Latvia". Abstract In the last decade wireless sensor networks (WSNs) have evolved as a promis- ing approach for smart investigation of our planet, providing solutions for environment and wild animal monitoring, security system development, hu- man health telemonitoring and control, industrial manufacturing and other domains. Lack of unified standards and methodologies leads to limited sensor network solution interoperability and portability. Significant number of WSN oper- ating systems, virtual machines, query languages and other software tools already do exist. Also a significant number of communication protocols have been invented. However, sensor network designers and programmers still face serious problems related to new platform and application development. The goal of this work is to propose wireless sensor network software develop- ment design rules that serve as a unified methodology for operating system and application development. The design rules are based on 40 existing WSN deployment extensive analysis and common trend inference. The proposed rules are evaluated in different aspects. Improvements for existing WSN de- ployments and operating systems are identified, design and implementation of an object-oriented WSN operating system according to proposed rules is described. In addition, a WSN application use-case is evaluated and improve- ments are suggested according to design rules. The evaluation shows the proposed design rules as an important tool for WSN software development at different stages, from planning to testing and change request analysis. Keywords: wireless sensor networks, methodology, design rules, operating systems, deployment survey, case study To my grandfather Modris and son Martins. Acknowledgements I would like to thank my advisor Leo Selavo, who has introduced the beauty of research work to me and acted as a successful role model. My deepest appreciation to my wife for support during the long run. Thanks to my playful and active kids for not allowing my head to overheat. I'm grateful to my parents and grandparents for cultivating importance of education since my childhood, especially my mother, who motivated me to always strive for more. Thanks to my sister for always being there in critical moments; persisting in goal reaching; and showing sincere humanity. I'm thankful to my father for creating environment where my passion to information technologies could thrive; while enough severity was maintained to motivate me explore beyond computer games. Thanks to director of Institute of Electronics and Computer Science (EDI), Modris Greitans, for opportunity to work in research full time and meet many talented young researchers, especially Atis Elsts, Artis Mednis and Reinholds Zviedris, who supplied me invaluable technical and scientific advise, and with whom I had the honor to have inspiring informal discussions. Thank you to Sashidharan Komandur and Hans Petter Hildre for patience and support during the final stretch that took much longer than initially planned. I appreciate the patience and professional comments of Guntis Arnicans, Guntis Barzdins, Valerijs Zagurskis, Michael Huhns, Yushan Pan, Cong Liu and other reviewers who made this thesis better in multiple iterations. Warm thanks to secretaries Ella Arsa, Anita Ermusa and Ruta Ikauniece at the University of Latvia, who helped to solve many stressful situations, and always were armed with eternal smile and positive attitude. I express my gratitude to my elementary school teachers Sigita Blumfelde and Gunta Dance for awakening the interest to math in me; and Uldis Jansons for teaching me the fascinating first steps in BASIC programming environment. I'm thankful to Ilze Zarinova and Iveta Mezatuca for bringing me back on track every time I experienced serious health problems on the way. And finally, thanks to the reviewer who has improved the thesis significantly by not allowing to accept the first version. It was a long journey, full of reasoning, discoveries and surprises. Contents List of Figures 5 List of Tables 7 Glossary 10 1 Introduction 13 1.1 Project experience . 14 1.2 Scope and motivation . 15 1.3 Contribution of the thesis . 17 1.4 Related work . 18 1.5 Summary and thesis outline . 19 2 Sensor network software abstractions 21 2.1 Operating systems . 23 2.1.1 MansOS . 24 2.1.2 TinyOS . 27 2.1.3 Contiki . 28 2.1.4 LiteOS . 29 2.1.5 Mantis . 29 2.1.6 Arduino . 29 2.2 Middleware . 30 2.3 Summary . 31 3 Deployment survey 32 3.1 Methodology . 32 3.2 Survey results . 32 3.2.1 Deployment state and attributes . 37 3.2.2 Sensing . 38 3.2.3 Lifetime and energy . 39 1 CONTENTS 3.2.4 Sensor motes . 41 3.2.5 Sensor mote: microcontroller . 41 3.2.6 Sensor mote: external memory . 42 3.2.7 Communication . 42 3.2.8 Network . 43 3.2.9 Networking stack . 44 3.2.10 Operating system and middleware . 45 3.2.11 Software level tasks . 45 3.2.12 Task scheduling . 47 3.2.13 Time synchronization . 47 3.2.14 Localization . 48 3.2.15 Real-time data access . 48 3.2.16 Discussion of future trends . 49 3.2.17 Summary . 51 4 Sensor network software design rules 52 4.1 Problem identification . 52 4.1.1 Portability and usability . 52 4.1.2 Wireless communication . 53 4.1.3 Services and efficiency . 53 4.2 Design rule definition . 54 4.2.1 Communication . 56 4.2.2 Portability . 57 4.2.3 Task scheduling . 58 4.2.4 Services . 59 4.2.5 User support . 59 4.3 Addressing problems by rules . 60 4.3.1 Portability and usability . 60 4.3.2 Wireless communication . 62 4.3.3 Services and efficiency . 62 4.4 Summary . 63 5 Design rule impact on existing systems 65 5.1 Impact on deployments . 65 5.2 Impact on operating systems . 67 5.2.1 TinyOS . 67 5.2.2 Contiki . 69 2 CONTENTS 5.2.3 LiteOS . 70 5.2.4 Mantis . 70 5.2.5 MansOS . 71 5.2.6 Arduino . 72 5.2.7 Summary . 73 5.3 Use case study: wearable sensor network . 73 5.3.1 Research problem . 74 5.3.2 Approach . 74 5.3.3 Sensor network aspects . 75 5.3.4 System prototype . 76 5.3.4.1 Hardware components . 76 5.3.4.2 Software components . 78 5.3.5 Prototype conformance to design rules . 78 5.3.5.1 Communication . 78 5.3.5.2 Portability . 79 5.3.5.3 Task scheduling . 80 5.3.5.4 Services . 80 5.3.5.5 User support . 80 5.3.6 Improvements by matching design rules . 81 5.3.6.1 Network lifetime extension . 81 5.3.6.2 Multi-hop communication . 83 5.3.6.3 Multitasking support . 83 5.3.7 Use case summary . 84 5.4 Summary . 84 6 New operating system design according to rules 85 6.1 OOMOS' advantages over MansOS . 85 6.2 Object-oriented programming for WSNs . 86 6.3 OOMOS implementation . 87 6.3.1 Portability . 87 6.3.2 Scheduling . 90 6.3.3 Services and API . 92 6.3.4 Summary . 93 6.4 OOMOS evaluation . 93 6.4.1 RAM and flash memory usage . 94 6.4.2 Performance . 96 6.4.2.1 Sensor sampling performance . 97 3 CONTENTS 6.4.2.2 Wireless data transmission performance . 98 6.4.2.3 Wireless data reception performance . 100 6.4.3 Optimizations . 101 6.4.4 Portability . ..