Internet of Things - IoT by Raj Kamal Text Book PDF
Document Details
Uploaded by JoyfulProtactinium
2017
Raj Kamal
Tags
Summary
This book, 'Internet of Things - IoT by Raj Kamal', provides an overview of IoT architecture and design principles. It delves into various aspects, including hardware and software designs. The book is suitable for undergraduates and postgraduates in computer science and related fields.
Full Transcript
INTERNET OF THINGS Architecture and Design Principles About the Author Dr. Raj Kamal is presently, Professor of Computer Science and Engineering at Medi-Caps Institute of Science and Technology...
INTERNET OF THINGS Architecture and Design Principles About the Author Dr. Raj Kamal is presently, Professor of Computer Science and Engineering at Medi-Caps Institute of Science and Technology, Indore. He has worked with reputed institutions like Devi Ahilya Vishwavidyalaya, Indore; Punjabi University, Patiala; Kalasalingam University, Krishnankoil; and Guru Nanak Engineering College, Hyderabad. He completed his M.Sc. at the age of 17 and published his first research paper in Physics Letters Volume journal at the age of 18. He was awarded a Ph.D. degree by the prestigious Indian Institute of Technology, Delhi, at the age of 22. He completed his post- doctoral studies Uppsala University in Sweden. Professor Raj Kamal is immensely popular among students and academicians. He is lovingly addressed by his colleagues as a ‘learning machine’ or ‘human dynamo’. He is known in the country for his constant drive for understanding emerging technologies and passion for acquiring latest knowledge and its dissemination. His areas of interest include Mobile Computing, Embedded Systems, and Cloud Computing and Analytics. Professor Raj Kamal has over 49 years of teaching and research experience. He has successfully guided 17 Ph.D. students and has published around 150 research papers in various national and international conferences and journals that include IEEE Transactions on Industrial Electronics. He has authored 10 textbooks in areas such as Computer Science, Electronics and Communication, and Information Technology. Professor Raj Kamal has also authored the following titles: Embedded Systems—Architecture, Programming and Design, 3/e Computer Architecture, 2/e Internet and Web Technologies INTERNET OF THINGS Architecture and Design Principles Raj Kamal Professor, Computer Science and Engineering Medi-Caps University Rau, Indore, Madhya Pradesh, India McGraw Hill Education (India) Private Limited CHENNAI McGraw Hill Education Offices Chennai New York St Louis San Francisco Auckland Bogotá Caracas Kuala Lumpur Lisbon London Madrid Mexico City Milan Montreal San Juan Santiago Singapore Sydney Tokyo Toronto McGraw Hill Education (India) Private Limited Published by McGraw Hill Education (India) Private Limited 444/1, Sri Ekambara Naicker Industrial Estate, Alapakkam, Porur, Chennai - 600 116 Internet of Things: Architecture and Design Principles Copyright © 2017 by McGraw Hill Education (India) Private Limited. No part of this publication may be reproduced or distributed in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise or stored in a database or retrieval system without the prior written permission of the publishers. The program listings (if any) may be entered, stored and executed in a computer system, but they may not be reproduced for publication. This edition can be exported from India only by the publishers, McGraw Hill Education (India) Private Limited Print Edition ISBN-13: 978-93-5260-522-4 ISBN-10: 93-5260-522-5 E-Book ISBN-13: 978-93-5260-523-1 ISBN-10: 93-5260-523-3 Managing Director: Kaushik Bellani Director—Science & Engineering Portfolio: Vibha Mahajan Lead—Science & Engineering Portfolio: Hemant Jha Specialist—Product Development: Mohammad Salman Khurshid Content Development Lead: Shalini Jha Specialist—Custom Products: Ranjana Chaube Production Head: Satinder S Baveja Assistant Manager—Production: Jagriti Kundu General Manager—Production: Rajender P Ghansela Manager—Production: Reji Kumar Information contained in this work has been obtained by McGraw Hill Education (India), from sources believed to be reliable. However, neither McGraw Hill Education (India) nor its authors guarantee the accuracy or completeness of any information published herein, and neither McGraw Hill Education (India) nor its authors shall be responsible for any errors, omissions, or damages arising out of use of this information. This work is published with the understanding that McGraw Hill Education (India) and its authors are supplying information but are not attempting to render engineering or other professional services. If such services are required, the assistance of an appropriate professional should be sought. Typeset at The Composers, 260, C.A. Apt., Paschim Vihar, New Delhi 110 063 and printed at Cover Printer: Preface Overview What if an umbrella could sense the local weather and remind the user if it is needed to be carried along that day; or if some kind of wearable device could monitor a patient’s health and when it is about to deteriorate, communicate the nature of emergency to the doctor directly and promptly; or if a car could have some computation and predictive analytics system which could apprise the user about the upcoming servicing schedules to avoid any sudden component failures beforehand? Internet of Things (IoT) and Internet-connected Cloud Platform-as-a-Service (PaaS) can make the above cases come true as real-life situations. In this book, the author takes the readers through all the important design and implementation details of various functions possible with IoT. For instance, the first chapter of the book introduces the concept of a smart umbrella which can, using specific sensors and computational devices and connectivity to the Internet, share weather updates with its users. A chapter on smart cars or connected cars elucidates how such cars can perform automatic detection of service requirements by direct transfer of service-relevant data to the car maintenance and service center or to the driver/car user server, and also send automatic reminders of servicing appointments, thereby lessening service visits. IoT is now widely researched and being rapidly implemented as well. A TCS study, ‘Internet of Things: The Complete Re-Imaginative Force’, 2015, quotes technology researcher Gartner Projection as, ‘There will be 4.9 billion ‘connected things’ (or ‘smart-connected products’, as Harvard Business School Professor Michael Porter refers to them) this year, and we haven’t seen anything yet. The number is predicted to grow five times by the end of the decade, to 25 billion vi Preface connected things, including a quarter billion vehicles. Gartner says, by 2020, a quarter billion connected vehicles will enable new in-vehicle services and automated driving capabilities.’1 Target Audience Internet of Things design and IoT products, services and applications development need a team of hardware as well as software professionals. These professionals in turn need a reserve to make them aware of latest in this field. Thus, this book would suffice the needs of these individuals and also of undergraduate and postgraduate students of engineering, computer science and information technology. About the Book The book has been written in an easy-to-understand and student-friendly manner, and includes several illustrative figures and examples, sample codes and project case studies. The text explains architecture, design principles, hardware and software designs, while keeping multidisciplinary under-graduates and post-graduates in mind as primary readers. Each chapter begins by defining the learning objectives for each section, recall from previous chapters, introduction and the important terms covered in that chapter. End of each section enlists the points understood and provides self-assessment questions, classified as per three difficulty levels. Additionally, key concepts, learning outcomes, objective questions, short-answer questions, review questions and practice exercises are provided to revise and apply concepts learned from the chapter. Learning and Assessment Tools Learning Objectives Learning Objectives (LO) have been drafted for content in this book. This is an educational process that emphasizes on developing required skills amongst students and tests the outcomes of the study of a course, as opposed to routine learning. This approach creates an ability to acquire knowledge and apply fundamental principles to analytical problems and applications. Self-assessment Exercises Each learning objective is followed by a set of questions for self-assessment of students. This offers great retention through looping mechanism. Pedagogical Classification The pedagogy is arranged as per levels of difficulty. All checkpoint problems are linked with Learning Objectives (LOs) and marked with Levels of Difficulty (LOD), to help assess 1 http://www.gartner.com/newsroom/id/2970017 (January 2015). Preface vii the student’s learning. This assessment of levels of difficulty is derived as per Bloom’s Taxonomy. ★ Indicates Level 1 and Level 2, i.e. knowledge and comprehension based easy-to- solve problems. ★★ Indicates Level 3 and Level 4, i.e. application and analysis based medium-to- difficult problems. ★★★ Indicates Level 5 and Level 6, i.e. synthesis and evaluation based very difficult problems. Learning Outcomes Summary points specific to each LO are provided at the end of each chapter. It helps in recapitulating the ideas initiated with the outcomes achieved. Chapter-end Exercises More than 500 carefully designed chapter-end exercises are arranged as per levels of difficulty and are constructed to enhance knowledge and test technical skills. These include objective questions, short-answer questions, review problems and practice problems. Salient Features New IoT/M2M architecture, reference models, standards and protocols covered in detail Latest topics such as Industrial IoT, Industry 4.0, Participative Sensing, Connected Car form a part of this edition Explains architecture, design principles, hardware and software designs and applications/services/processes Additional online material for students and instructors shared via web resources. Rich pedagogy ❍ Illustrations: 101 ❍ Objective questions: 133 ❍ Solved examples: 88 ❍ Short-answer questions: 172 ❍ Case studies: 4 ❍ Review questions: 129 ❍ Self-assessment questions: 422 ❍ Practice questions: 118 Chapter Organisation Chapter 1 gives an overview of ‘Internet of Things’. It first gives vision and definitions of IoT, and meaning of smart hyperconnected devices which enable the IoT applications/ services. Next, the chapter describes IoT conceptual framework and architectural views, technology behind IoTs, communication modules and protocols such as MQTT. Then the chapter describes the sources of IoTs, such as RFIDs and wireless sensor networks. viii Preface Machine-to-machine communication technologies now enhanced to IoTs. The chapter also introduces the concept of wearbale watches, smart home and smart cities. Chapter 2 describes the design principles for connected devices. It describes IETF six- layered design for IoT applications, ITU-T reference model and ETSI M2M domains and high-level capabilities. It then describes first architectural layer/device and gateway domain wireless and wired communication protocols and technologies. It then describes second architectural layer/device and gateway domain functionalities which are data enrichment, transcoding, consolidation, privacy issues, and device configuring, management, and ID management. The chapter also explains the need of ease of designing and affordability. Chapter 3 describes the design principles for web connectivity, the data format standards JSON, TLV and MIME for communication, and devices CoAP, CoAP-SMS, CoAP-MQ, MQTT and XMPP protocols for the devices connectivity to the web. The chapter also describes SOAP, REST, HTTP RESTful and WebSockets methods, which the communication gateway deploys. Chapter 4 describes Internet connectivity principles. Concepts such as IPv4, IPv6, 6LowPAN, TCP/IP suite of protocols; IP addressing of the IoT devices and MAC address of communication circuits are covered. HTTP, HTTPS, FTP, Telnet and other protocols used at IETF layer 6, application layer by IoT applications/services/processes have also been discussed. Chapter 5 defines the methods of data acquiring, organising and analytics in IoT/M2M applications/services/business processes. The chapter covers data generation, acquisition, validation, data and events assembly and data store processes. Data centre and server management functions have also been described along with organisation of data as database, spatial and time series database, SQL and NOSQL methods, and concepts of queries processing, transactions and events processing, OLTP, business processes, business intelligence and Internet-enabled embedded devices and their network protocols. Most important conceptual aspects such as distributed business processes, complex applications integration and service-oriented architecture, integration and enterprise systems, IoT/M2M descriptive, events, real-time, prescriptive and predictive analytics using databases and big data form the highlights of this chapter. The chapter towards the end describes concepts of knowledge acquiring, managing and storing. Chapter 6 describes the concepts of data collection, storage and computing using a cloud platform for IoT/M2M applications/services. The chapter describes cloud computing paradigm, cloud deployment SaaS, IaaS, Paas, DaaS models, Everything-as-a-Service and cloud service models. The chapter further explains the methods of cloud platforms for device collection, device data store and computing at the cloud. The usage of two cloud-based services, viz., Xively (Pachube/COSM) and Nimbits have been considered as examples. Chapter 7 describes sensors, their examples, working principles and usage technologies. A highlight of this chapter is description of latest topics of participatory sensing Preface ix and Industrial IoT. It describes automobile IoT and includes how IoT Innovations are reshaping future automobiles and usages of Internet connectivity of cars, and Vehicle-to- Infrastructure (V2I) technology. The chapter also describes usages of actuators, RFID and wireless sensor network technology in detail. Chapter 8 describes the prototyping of the embedded devices for IoTs. The chapter explains the embedded computing basics and embedded devices hardware and software for embedded computing. It also describes the features of Arduino, Intel Galileo, Edison, Raspberry Pi, BeagleBone and mBed Boards which are the popular embedded platforms for prototyping. Usages of mobiles and tablets in IoT Apps and things always connected to the Internet/cloud have also been covered. Chapter 9 describes prototyping of devices embedded device software, gateways, Internet and web/cloud services and software components. The chapter describes prototyping of programs for the embedded devices using popular Arduino platform IDE. The chapter describes programming the embedded Galileo, Raspberry Pi, BeagleBone and mBed device platforms for IoT. The chapter also explains how to prototype online-component APIs and web APIs required in apps, web apps and web services, developed using IoT devices data store, databases and analytics. Chapter 10 covers the most important issues in uses of IoT applications and connected de- vices need data privacy, security and vulnerabilities solutions. It describes vulnerabilities, security requirements and threat analysis and importance of use cases as well as misuse cases for provisioning of right security for IoT. The chapter then describes IoT security tomography and layered attacker models and connected sources identity management, identity establishment and access control. Chapter 11 provides insight with business models and business model innovation. The chapter explains concept of value creation using IoTs. The chapter introduces Industry 4.0 model and familiarises with business model scenarios for usages IoT devices, mobile APIs and customer data. Chapter 12 first explains the designing levels (stages) during an IoT prototype and product development and introduces six complexity levels in designing with examples of IoT systems of each complexity level. The chapter covers the uses of connected platform-as- a-Service (PaaS) cloud with examples of AWS IoT platform and TCS Connected Universe Platform that accelerates the design, development and deployment of the M2M, IoT, IIoT applications and services. The chapter further outlines the applications of PaaS platforms for IoT/IIoT in globally trending usages in four core business categories/areas. A new viz. concept, connected car, with the example of Tesla and its usages in the automobiles of future has also been covered in this chapter. The chapter familiarises the reader with approaches to IoT applications for smart homes, smart cities, smart environment monitoring, smart agriculture and smart production using illustrative examples. The chapter then explains a new IoT project design case study, ‘Smart city streetlights control and monitoring’. x Preface Web Resources The web has become the best companion of teachers and students, and is needed much like food and water. The web supplements for the book are available at http://www.mhhe.com/rajkamal/iot. The web link has the following material which will be periodically updated: For Instructors Solution guide to Short answer questions, Review Questions and Practice Exercises Chapter-wise PowerPoint slides with diagrams and notes for effective presentation For Students New case studies Answers to queries raised by students through author’s website: http://www.rajkamal.org Acknowledgements The author is grateful to Shri R.C. Mittal, Chancellor; Shri Gopal Agrawal, Pro-Chancellor; Dr. Sunil K Somani, Vice Chancellor; and Dr. Shamsher Singh, ex-Chief Executive Director, Medi-Caps University for providing a great platform to learn and continue research and teaching activities in new exciting areas of computer science and engineering. The author is also grateful to Prof. Sanjay K. Tanwani, Prof. Maya Ingle, Dr. Preeti Saxena, Dr. Shraddha Masih, Prof. Abhay Kumar, Dr. Manju Chattopadhaya and other colleagues at Devi Ahilya Vishwavidyalaya, Indore, for continuous encouragement. Thanks are due to Sushil Mittal (wife) for love and affection and being a constant source of support during this endeavour, and family members Dr. Shilpi Kondaskar (daughter), Dr. Atul Kondaskar (son-in-law), Shalin Mittal (son), Needhi Mittal (daughter-in-law) and Arushi Kondaskar, Atharv Raj Mittal, Shruti Shreya Mittal and Ishita Kondaskar (grandchildren) for their love and affection. The author would also like to thank the team at McGraw Hill Education for bringing out this publication. Invitation for Feedback The author expects that students and professionals will love this book and it will help the students hone their design skills and key concepts in the domain of Internet of Things— architecture, designing principles and applications. Although much care has been taken to ensure an error-free text, some errors may have crept in. The author shall be grateful to the readers for pointing out these errors to him. The feedback on content of the book as well as supplementary web material will be highly appreciated. The author can be contacted at [email protected] or [email protected]. Raj Kamal Publisher’s Note McGraw Hill Education (India) invites suggestions and comments, all of which can be sent to [email protected] (kindly mention the title and author name in the subject line). Piracy-related issues may also be reported here. Contents Preface v Acknowledgements xi List of Abbreviations and Acronyms xix 1. Internet of Things: An Overview 1 1 6 9 13 19 22 26 2. Design Principles for Connected Devices 36 37 40 47 2.4 Data Enrichment, Data Consolidation and Device Management at 60 66 xiv Contents 3. Design Principles for Web Connectivity 74 75 79 91 3.4 Web Connectivity for Connected-Devices Network using Gateway, 104 4. Internet Connectivity Principles 120 121 123 124 143 4.6 Application Layer Protocols: HTTP, HTTPS, FTP 145 5. Data Acquiring, Organising, Processing and Analytics 155 156 160 166 5.4 Transactions, Business Processes, Integration and 174 192 Contents xv 6. Data Collection, Storage and Computing Using a Cloud Platform 202 203 6.2 Cloud Computing Paradigm for Data Collection, Storage and 203 211 6.4 IoT Cloud-Based Services Using the Xively, Nimbits and 213 7. Sensors, Participatory Sensing, RFIDs, and Wireless Sensor Networks 231 232 233 252 257 260 266 273 8. Prototyping the Embedded Devices for IoT and M2M 292 293 295 302 317 9. Prototyping and Designing the Software for IoT Applications 326 327 333 9.3 Devices, Gateways, Internet and Web/Cloud Services 363 xvi Contents 9.4 Prototyping Online Component API 10. IoT Privacy, Security and Vulnerabilities Solutions 396 400 406 10.5 Identity Management and Establishment, Access Control and Secure 412 11. Business Models and Processes Using IoT 426 427 436 12. IoT Case Studies 445 447 12.2 Design Layers, Design Complexity and Designing Using 450 12.3 IoT/IIot Applications in the Premises, Supply-Chain and 460 471 12.5 IoT Applications for Smart Homes, Cities, 499 Contents xvii Solutions to Multiple Choice Questions 519 Bibliography 521 Index 525 List of Abbreviations and Acronyms 3GPP 3G Partnership Project Protocols 6LoWPAN IPv6 over Low power Wireless Personal Area Networks ACID Atomicity, Consistency, Isolation and Durability of transactions ADAS Advance Driver Assistance Systems ADC Analog-to-Digital Converter ADFG Acrylic Data Flow Graph ADSL Asymmetric Digital Subscriber Line AES Advanced Encryption 128- or 192- or 256- bit key length Algorithm AES-CCM AES with CCM API Application Programming Interface AQI Air Quality Index ARP Address Resolution Protocol ASCII American Standard Code for Information Interchange ASIC Application Specific Integrated Circuit ATM Automated Teller Machine AWS Amazon Web Services BB BeagleBone BI Business Intelligence BJT Bipolar Junction Transistor xx List of Abbreviations and Acronyms Bootpc Bootstrap Protocol Client Bootps Bootstrap Protocol Server BP Business Process BT BR Bluetooth Basic data rate in 1.0, 2.0, 3.0 or 4.0 device BT EDR Bluetooth Enhanced Data Rate BT LE Bluetooth Low Energy CA Certification Authority CAN Controller Area Network bus CAP Consistency, Availability and Partitions CBC Cryptographic Block Cipher for block ciphers with a block length of 128 bits CCD Charge Coupled Device CCM Counter with CBC-MAC CEP Complex Event Processing CGA Cryptographically Generated Addresses CIDR Classless Inter-Domain Routing CIMD Computer Interface to Message Distribution CoAP Constrained Application Protocol CORE Constrained RESTful Environment CRC Cyclic Redundancy Check CRM Customer Relations Management CSMA/CD Carrier Sense Multiple Access with Collision Detection CUP Connected Universe Platform CVS Concurrent Versions System CWI Cloud Web Interface DAG Directed Acrylic Graph DB Database DBMS Database Management System DBP Distributed Business Process DFG Data Flow Graph DHCP Dynamic Host Control Protocol DLL Dynamically Linked Library DM Device Management DNS Domain Name System DODAG Destination Oriented Directed Acrylic Graph List of Abbreviations and Acronyms xxi DoS Denial-of-Service DSL Digital Subscriber Line DSP Digital Signal Processor DSSS Direct Sequence Spread Spectrum DTLS Datagram Transport Layer Security DWI Device Web Interface ECU Electronic Control Unit EPC Electronic Product Code ESP Event Stream Processing ETL Extract, Transform and Load FC Functional Component FG Functional Group FHSS Frequency Hopping Spread Spectrum FOTA Firmware Over-The-Air FPT Phototransistor FTP File Transfer Protocol GPIO General Purpose Input-Output GPRS General Packet Radio Service GSM Global System for Mobiles HAB Home Automation Bus HAN Home Area Network HDFS Hadoop File System HLR Home Location Register HSPA High Speed Packet Access HTML HyperText Markup Language HTTP Hypertext Transfer Protocol HTTPS HTTP over TLS/SSL I/O Input-Output I2C Inter-Integrated Circuit IaaS Infrastructure-as-a-Service IANA Internet Assigned Number Authority ICCM Internet Connected Car Maintenance ICMP Internet Control Message Protocol ICSP In-Circuit Serial Programming xxii List of Abbreviations and Acronyms ICT Information and Communications Technology IDE Integrated Development Environment IdM Identity Management IEC International Electrotechnical Commission for Standards IETF Internet Engineering Task Force IFTTT If This Then That service IIC Industrial Internet Consortium IIoT Industrial IoT IM Instant Messaging IO Input-Output IoT Internet of Things IP Internet Protocol IPSec IP Security Protocol IPSP Internet Protocol Support Profile IPv4 Internet Protocol version 4 IPv6 Internet Protocol version 6 iq Information/Query IR-LED Infrared Light Emitting Diode ISDN Integrated Services Data Network ISM Industrial, Scientific and Medical ISO International Organization for Standardization JAR Java Archive JID Jabber ID JMS Java Message Service JSON Java Script Object Notation KPI Key Performance Indicators LAN Local Area Network (of Computers) LED Light Emitting Diode LIDAR Light + Radar, also Laser Imaging, Detection and Ranging LIN Local Interconnect Network Bus LLN Low Power Lossy Networks LoRaWAN Low-power and Range WAN LPWAN Low-power WAN LTE Long Term Evolution List of Abbreviations and Acronyms xxiii LWM2M Lightweight M2M Protocol LWT Last Will and Testament on failure of a session, for example, between a client and broker or server M2M Machine-to-Machine MAC Media Access Control mDNS Multicast Domain Name System MEMS Micro-Electro-Mechanical Sensor MFLOPS Million Floating Point Operations Per Second MIME Multipurpose Internet Mail Extension MINA Multi-Hop Infrastructure Network Architecture MIPS Million Instructions Per Second MMC Multimedia Card MO Mobile Origin MOSFET Metal-oxide Field Effect Transistor MOST Media Oriented System Transport Mote Mobile Terminal MPLS Multiprotocol Label Switching MPP Massively Parallel Processing MQ Message Queue MQTT Message Queue Telemetry Transport protocol MS Mobile Station MSISDN Mobile Station ISDN Number MT Mobile Terminal MTC Machine Type Communication MTU Maximum Transmission Unit MUT Multi-User Chat NAN Neighbourhood Area Network ND Neighbour Discovery NDP Network Discovery Protocol NFC Near Field Communication NFV Network Function Virtualization NIST National Institute of Standards and Technology OASIS Organization for the Advancement of Structured Information Standards ODBC Open Database Connectivity xxiv List of Abbreviations and Acronyms OID Object Identifier OLAP On-Line Analytical Processing OLTP On-Line Transactions Processing OMA Open Mobile Alliance ONS Object Name Service ORCHID Overlay Routable Cryptographic Hash Identifier OS Operating System OSGi Open Services Gateway initiative OWASP Open Web Application Security Project P2P Point-to-Point PaaS platform-as-a-service PAN Personal Area Network PCI Peripheral Component Interconnect PCMCIA Personal Computer Memory Card International Association PDU Protocol Data Unit for a layer PII Personally Identifiable Information PKI Public Key Infrastructure PPP Point-to-Point Protocol PS Participatory Sensing PSK Pre-Shared Key pubsub Publication by a service and subscription by end point or client or server PWM Pulse Width Modulator QoS Quality of Service QR code Quick Response code RAM Random Access Memory RARP Reverse Address Resolution Protocol RDMS Relational Database Management System REST Representational State Transfer RF Radio Frequency of MHz RFC IETF Request for Comments standardisation document RFD Reduced Function Device RFIC RF Integrated Circuits RFID Radio Frequency Identification ROLL Routes Over the Low power and Lossy network List of Abbreviations and Acronyms xxv ROM Read Only Memory RPC Remote Procedure Call RPi Raspberry Pi RPK Random Pair-wise Keys, Raw-Public-key RPL IPv6 Routing Protocol for LLNs (Low Power Lossy Networks) RPM Revolution per Minute RPMP Re-Planning Manufacturing Process RTC Real Time Clock RTOS Real Time Operating System Rx Receiver RxD Receiver Data line SaaS Software as a Service SASL Simple Authentication and Security Layer SCADA Supervisory Control and Data Acquisition SCL Serial Clock SCOVARS Supply Chain Order Verification, Automated Reordering and Shipping SD Service Discovery SDA Serial Data SDK Software Development Kit SHA Secure Hash Algorithm SIM Subscriber Identity Module (generally a card) in mobile SLA Service Level Agreement SMPP Short Message Peer to Peer SMS Short Message Service SNMP Simple Network Management Protocol SOAP Simple Object Access Protocol SPI Serial Peripheral Interface Bus SPINS Security Protocols in Network of Sensors SQL Structured Query Language SS7 Signaling Service Protocol SSID Service Set Identifier SSL Secure Scoket Layer STP Spanning Tree Protocol SWE Sensor Web Enablement services xxvi List of Abbreviations and Acronyms TCCICDD Tracking of Customer Carrying Internet Connected Digital Devices TCP Transmission Control Protocol TCUP TCS Connected Universe Platform TFTP Trivial File Transfer Protocol TLS Transport Layer Security TLS Transport Layer Security TLV Tag Length Value TSDB Time Series Database TTP Trusted Third Party Tx Transmitter TxD Transmitter Data line UART Universal Asynchronous Receiver and Transmitter UCP/UMI Universal Computer Interface Protocol/Machine Interface UDP User Datagram Protocol UI User Interface UPC Universal Product Code URI Universal Resource Identifier URL Universal Resource Locator USB Universal Serial Bus V2I Vehicle to Infrastructure Communication VLAN Virtual Local Area Network W3C World Wide Web Consortium WAN Wide Area Network WEP Wired Equivalent Privacy WIDL Web Interface Definition Language Wi-Fi Wireless Fidelity WLAN Wireless 802.11 Local Area Network WPA Wireless Protected Access WSAPI WebSocket Application Programming Interface WSN Wireless Sensor Node/Network WWAN Wireless Wide Area Network XAAS Everything-as-a-Service xep XMPP Extension Protocol XHTML EXtensible HyperText Markup Language List of Abbreviations and Acronyms xxvii XML EXtensible Markup Language XMPP EXtensible Messaging and Presence Protocol XMPP-IoT XMPP xeps for the IoT/M2M XSF XMPP Standards Foundation Internet of Things: 1 An Overview Learning Objectives LO 1.1 Describe the basics, definition and vision of Internet of Things (IoT) LO 1.2 Analyse IoT in terms of a suggested IoT conceptual framework LO 1.3 Explain the suggested architectural views for IoTs amid diverse technologies LO 1.4 Describe enabler technologies which are used in designing of: (i) IoT devices, (ii) communication methods between devices and remote server, cloud and applications LO 1.5 Categorise the resources which enable the development of IoT prototype and product LO 1.6 Outline the functions of M2M architectural domains and relationships of an M2M system with an IoT system LO 1.7 Summarise IoT examples of usages in wearable devices, smart homes and smart cities, and understand the architectural frameworks for smart homes and smart cities 1.1 INTERNET OF THINGS LO 1.1 Describe the Internet of Things (IoT) is a concept which enables basics, definition communication between internetworking devices and vision of Internet of Things (IoT) and applications, whereby physical objects or ‘things’ communicate through the Internet. The concept of IoT began 2 Internet of Things: Architecture and Design Principles with things classified as identity communication devices. Radio Frequency Identification Device (RFID) is an example of an identity communication device. Things are tagged to these devices for their identification in future and can be tracked, controlled and monitored using remote computers connected through the Internet. The concept of IoT enables, for example, GPS-based tracking, controlling and monitoring of devices; machine-to-machine (M2M) communication; connected cars; communication between wearable and personal devices and Industry 4.0. The IoT concept has made smart cities a reality and is also expected to make self-driving cars functional very soon.1 The following subsections describe IoT basics, definition, vision, conceptual frameworks and architectures. 1.1.1 IoT Definition The Internet is a vast global network of connected servers, Meaning of the words computers, tablets and mobiles that is governed by standard Internet, Things and protocols for connected systems. It enables sending, receiving, Internet of Things or communication of information, connectivity with remote servers, cloud and analytics platforms. Thing in English has number of uses and meanings. In a dictionary, thing is a word used to refer to a physical object, an action or idea, a situation or activity, in case when one does not wish to be precise. Example of reference to an object is—an umbrella is a useful thing in rainy days. Streetlight is also referred to as a thing. Example of reference to an action is— such a thing was not expected from him. Example of reference to a situation is—such things were in plenty in that regime. Thus, combining both the terms, the definition of IoT can be explained as follows: Internet of Things means a network of physical things (objects) sending, receiving, or communicating information using the Internet or other communication technologies and network just as the computers, tablets and mobiles do, and thus enabling the monitoring, coordinating or controlling process across the Internet or another data network. Another source, defines the term IoT as follows: Internet of Things is the network of physical objects or ‘things’ embedded with electronics, software, sensors and connectivity to enable it to achieve greater value and service by exchanging data with the manufacturer, operator and/or other connected devices. Each thing is uniquely identifiable through its embedded computing system but is able to interoperate within the existing Internet infrastructure. 1 For more information refer http://en.wikipedia.org/wiki/Autonomous_car#cite_note-99 and http://www.dailycamera.com/ the-bottom-line/ci_24021170/self-driving-cars-could-be-decade-away Internet of Things: An Overview 3 1.1.2 IoT Vision Internet of Things is a vision where things (wearable watches, Vision of IoT—things alarm clocks, home devices, surrounding objects) become becoming intelligent, ‘smart’ and function like living entities by sensing, computing smart and behaving and communicating through embedded devices which interact alive with remote objects (servers, clouds, applications, services and processes) or persons through the Internet or Near-Field Communication (NFC) etc. The vision of IoT can be understood through Examples 1.1 and 1.2. Example 1.1 Through computing, an umbrella can be made to function like a living entity. By installing a tiny embedded device, which interacts with a web based weather service and the devices owner through the Internet the following communication can take place. The umbrella, embedded with a circuit for the purpose of computing and communication connects to the Internet. A website regularly publishes the weather report. The umbrella receives these reports each morning, analyses the data and issues reminders to the owner at intermittent intervals around his/her office-going time. The reminders can be distinguished using differently coloured LED flashes such as red LED flashes for hot and sunny days, yellow flashes for rainy days. A reminder can be sent to the owner’s mobile at a pre-set time before leaving for office using NFC, Bluetooth or SMS technologies. The message can be—(i) Protect yourself from rain. It is going to rain. Don’t forget to carry the umbrella; (ii) Protect yourself from the sun. It is going to be hot and sunny. Don’t forget to carry the umbrella. The owner can decide to carry or not to carry the umbrella using the Internet connected umbrella. Example 1.2 Streetlights in a city can be made to function like living entities through sensing and computing using tiny embedded devices that communicate and interact with a central control-and-command station through the Internet. Assume that each light in a group of 32 streetlights comprises a sensing, computing and communication circuit. Each group connects to a group-controller (or coordinator) through Bluetooth or ZigBee. Each controller further connects to the central command-and-control station through the Internet. The station receives information about each streetlight in each group in the city at periodic intervals. The information received is related to the functioning of the 32 lights, the faulty lights, about the presence or absence of traffic in group vicinity, and about the ambient conditions, whether cloudy, dark or normal daylight. The station remotely programs the group controllers, which automatically take an appropriate action as per the conditions of traffic and light levels. It also directs remedial actions in case a fault develops in a light at a specific location. Thus, each group in the city is controlled by the ‘Internet of streetlights’. Figure 1.1 shows the use of the IoT concept for streetlights in a city. 4 Internet of Things: Architecture and Design Principles Central command-and-control station Streetlights Streetlights Streetlights Streetlights Group 1 Group 2 Group 3 Group 4 Streetlight Streetlight Streetlight Streetlight Streetlight Streetlight Streetlight Streetlight Internet Group Controllers 1 and 2 Group Controllers 3 and 4 Streetlight Streetlight Streetlight Streetlight Streetlight Streetlight Streetlight Streetlight Figure 1.1 Use of Internet of Things concept for streetlights in a city 1.1.3 Smart and Hyperconnected Devices As per Collins Dictionary, hyperconnectivity means use of Hyperconnectivity multiple systems and devices to remain constantly connected to social means ‘constant networks and streams of information. Smart devices are devices connectivity between with computing and communication capabilities that can devices, network, constantly connect to networks. For example, a city network of server and multiple streetlights which constantly connects to the controlling station systems’. as shown in Figure 1.1 for its services. Another example is hyperconnected RFIDs. An RFID or a smart label is tagged to all consignments. This way many consignments sent from a place can be constantly tracked. Their movement through remote places, inventories at remote locations, sales and supply chain are controlled using a hyper-connected framework for Internet of RFIDs. Figure 1.2 shows a general framework for IoT using smart and hyperconnected devices, edge computing and applications. A device is considered at the edge of Internet infrastructure. Edge computing implies computations at the device level before the computed data communicates over the internet. Several new terms have been used in the figure. Chapters ahead will define and explain these terms in more detail. Internet of Things: An Overview 5 Applications (Reporting, analysis, control); Collaborations, services and processes (involving people and business processes); Servers for data accumulation (storage) at server; Connected data centre, cloud or enterprise server for data abstraction (means aggregation, fusion or compaction and access) 3G, 4G, Internet, Wi-Fi Edge computing (Data element analysis and transformation) units Bluetooth, ZigBee or NFC RFIDs, Wireless Sensor Network (WSNs) and others sources of analog and digital, audio media and video-media inputs; Physical devices with sensors for measuring the pressure, temperature, velocity, relative humidity, velocity, audio, video, calories spent and other health parameters Figure 1.2 A general framework for IoT using smart and hyperconnected devices, edge computing and applications Reconfirm Your Understanding Definition of Internet of Things Vision of Internet of Things Examples of communicating devices and the internet A general framework for smart and hyperconnected devices, edge computing and applications, collaborations, services and processes Self-Assessment Exercise 1. How can a tracking service track an object communicating its identity ★ whenever it comes close to an Internet Access Point (IAP) in a chain of IAPs at many locations? 2. Recall Example 1.1 of smart and alive umbrella. Draw a diagram showing ★★ communication of messages between the umbrella, Internet, web-based weather service and a mobile phone. Assuming that the service deploys publish/subscribe (pub/sub) communication mode, define the pub/sub mode of message communication between the two entities. 3. Recall Example 1.2 of smart and alive groups of streetlights. What is the ★★ advantage obtained when using a group controller programmed by a central station through the Internet as compared to direct connectivity of each streetlight with the station? 4. Write the definition for Internet of Things. ★ 5. Why is hyperconnectivity required for controlling, monitoring, collaborating, ★★★ rendering services, gathering and analysing information and extracting knowledge? Explain the entities required for each. Note: ★ Level 1 & Level 2 category ★★ Level 3 & Level 4 category ★★★ Level 5 & Level 6 category 6 Internet of Things: Architecture and Design Principles 1.2 IoT CONCEPTUAL FRAMEWORK LO 1.2 Analyse IoT Example 1.1 showed a single object (umbrella) communicating in terms of a with a central server for acquiring data. The following suggested IoT conceptual framework equation describes a simple conceptual framework of IoT2: Physical Object + Controller, Sensor and Actuators + Internet = Internet of Things … 1.1 Equation 1.1 conceptually describes the Internet of umbrellas as consisting of an umbrella, a controller, sensor and actuators, and the Internet for connectivity to a web service and a mobile service provider. Generally, IoT consists of an internetwork of devices and physical objects wherein a number of objects can gather the data at remote locations and communicate to units managing, acquiring, organising and analysing the data in the processes and services. Example 1.2 showed the number of streetlights communicating data to the group controller which connects to the central server using the Internet. A general framework consists of the number of devices communicating data to a data centre or an enterprise or a cloud server. The IoT framework of IoT used in number of applications as well as in enterprise and business processes is therefore, in general, more complex than the one represented by Equation 1.1. The equation below conceptually represents the actions and communication of data at successive levels in IoT consisting of internetworked devices and objects. Gather + Enrich + Stream + Manage + Acquire + Organise and Analyse … 1.2 Equation 1.2 is an IoT conceptual framework for the enterprise processes and services, based on a suggested IoT architecture given by Oracle (Figure 1.5 in Section 1.3). The steps are as as follows: 1. At level 1 data of the devices (things) using sensors or the things gather the pre data from the internet. 2. A sensor connected to a gateway, functions as a smart sensor (smart sensor refers to a sensor with computing and communication capacity). The data then enriches at level 2, for example, by transcoding at the gateway. Transcoding means coding or decoding before data transfer between two entities. 3. A communication management subsystem sends or receives data streams at level 3. 4. Device management, identity management and access management subsystems receive the device’s data at level 4. 5. A data store or database acquires the data at level 5. 6. Data routed from the devices and things organises and analyses at level 6. For example, data is analysed for collecting business intelligence in business processes. 2 McEwen, Adrian and Cassimally, Hakim, Designing Internet of Things, Wiley, 2014. Internet of Things: An Overview 7 The equation below is an alternative conceptual representation for a complex system. It is based on IBM IoT conceptual framework. The equation shows the actions and communication of data at successive levels in IoT. The framework manages the IoT services using data from internetwork of the devices and objects, internet and cloud services, and represents the flow of data from the IoT devices for managing the IoT services using the cloud server. Gather + Consolidate + Connect + Collect + Assemble + Manage and Analyse … 1.3 Equation 1.3 represents a complex conceptual framework for IoT using cloud-platform- based processes and services. The steps are as follows: 1. Levels 1 and 2 consist of a sensor network to gather and consolidate the data. First level gathers the data of the things (devices) using sensors circuits. The sensor connects to a gateway. Data then consolidates at the second level, for example, transformation at the gateway at level 2. 2. The gateway at level 2 communicates the data streams between levels 2 and 3. The system uses a communication-management subsystem at level 3. 3. An information service consists of connect, collect, assemble and manage subsystems at levels 3 and 4. The services render from level 4. 4. Real time series analysis, data analytics and intelligence subsystems are also at levels 4 and 5. A cloud infrastructure, a data store or database acquires the data at level 5. Figure 1.3 shows blocks and subsystems for IoT in the IBM conceptual framework. New terms in the figure will be explained in the subsequent chapters. Various conceptual frameworks of IoT find number of applications including the ones in M2M communication networks, wearable devices, city lighting, security and surveillance and home automation. Smart systems use the things (nodes) which consist of smart devices, smart objects and smart services. Smart systems use the user interfaces (UIs), application programming interfaces (APIs), identification data, sensor data and communication ports. Reconfirm Your Understanding Adrian McEwen and Hakim Cassimally equation is a simple conceptualisation of a framework for IoT with connectivity to a web service: Physical Object + Controller, Sensor and Actuators + Internet = Internet of Things An equation to conceptualise a general framework for IoT with connectivity to a data centre, application or enterprise server for data storage, services and business processes is: Gather + Enrich + Stream + Manage + Acquire + Organise and Analyse = Internet of Things Orcale suggested IoT architecture is the basis for this equation. Another equation which conceptualises the general framework for IoT using the cloud based services is: Gather + Consolidate + Connect + Collect + Assemble + Manage and Analyse = Internet of Things 8 Internet of Things: Architecture and Design Principles Connect + Collect + Assemble + Manage Sensors Gather (Levels 3 and 4) and Cloud Services (Level 5) (Level 1) Gateway Data Informix Data Network Consolidation Time Series Server Centre Manage- Smart Sensor (Level 2) Commu- Service Manage- ment nication ment Application Manage- Framework ment Device Register In-memory and Analytics IoT Commu- Protocol Connect Big nication Data and Handlers Framework Store Intelligence Gateway MQTT Database Firewall Sensor Data Internet Firewall Network Consoli- Collect Application dation Message NoSQL Framework Sight from Framework things. IoT Commu- IoT Commu- Message nication nication Router Manage Framework Framework a Time- Relational series Time Series Message View of Service Cache Data Spatial Storage Manage and Real Time Publish/ Analytics Subscribe Connections and Management Subscriptions Figure 1.3 IBM IoT conceptual framework IBM IoT conceptual framework blocks and components are the basis of this equation. In general, things refer to an internetwork of devices and physical objects. This framework consists of a number of subsystems. The data is acquired at remote locations in a database or data store. The services and processes need data managing, acquiring, organising and analysing. Self-Assessment Exercise 1. How does Equation 1.1 relate to the smart umbrella in Example 1.1. ★ 2. Recall Example 1.1 of the smart umbrella. Draw a conceptual framework ★ showing communication of messages between the umbrella, Internet, web- based weather service and mobile phone. Internet of Things: An Overview 9 3. Draw the conceptual framework for a tracking service to track an object which ★★ communicates its identity whenever it comes close to an Internet Access Point (IAP) in a chain of IAPs at many locations. 4. How does Equation 1.2 relate to smart and alive groups of streetlights ★★ in Example 1.2. Make a table relating the terms in the equation with the functionalities of units in Figure 1.1. 5. How does Equation 1.3 relate to the IBM IoT framework in Figure 1.3 for ★★★ Internet-connected cloud-based services? Explain. 1.3 IoT ARCHITECTURAL VIEW LO 1.3 Explain the An IoT system has multiple levels (Equations 1.1 to 1.3). suggested These levels are also known as tiers. A model enables architectural views for IoTs amid diverse conceptualisation of a framework. A reference model can technologies be used to depict building blocks, successive interactions and integration. An example is CISCO’s presentation of a reference model comprising seven levels (Figure 1.4). New terms in the figure will be explained in the subsequent chapters. Level 7- Collaboration and Processes (Involving people and business processes) CISCO seven leveled reference model Level 6- Application (Reporting, Analysis, Control) Level 5- Data Abstraction (Aggregation and Access) Level 4- Data Accumulation (Storage) Level 3- Edge Computing (Data Element Analysis and Transformation) Level 2- Connectivity (Communication and Processing Units) Level 1- Physical Devices and Controllers (the things in IoT) [Sensors, machines, devices, intelligent edge nodes of different types] Figure 1.4 An IoT reference model suggested by CISCO that gives a conceptual framework for a general IoT system 10 Internet of Things: Architecture and Design Principles A reference model could be identified to specify reference architecture. Several reference architectures are expected to co-exist in the IoT domain. Figure 1.5 shows an Oracle suggested IoT architecture. New terms in IoT architecture by the figure will be explained in the subsequent chapters. Oracle Gather Enrich Stream Manage Acquire Organise and Device Analyse Identity Management Data Server Centre Network Commu- and Manage- Smart Sensor Access Manage- ment nication Application Manage- Management ment Framework ment IoT Commu- Protocol Business nication Handlers Device Big Intelligence Framework Identity Data Internet Firewall Gateway Message Database Store Database Firewall Router Complex Applications Integration and SoA Application Sensor Framework Device Message Network Access Key Value Application Cache Manage- Data Store Framework IoT Commu- nication and ment IoT Commu- Management Device nication Proxy Identity Framework Manage- ment Database IoT Commu- RDBMS nication Device Framework Manage- ment Data Routing and Enterprise Analysis Integration Figure 1.5 Oracle’s IoT architecture (Device identity management means identifying a device, registering a device for actions after identifying, de-registering the device, assigning unique identity to the device. Device access management means enabling, disabling the device access, authenticating a device for access, authorizing a device for access to a subsystem. Chapter 2 will explain these in greater detail.) An architecture has the following features: The architecture serves as a reference in applications of IoT in services and business processes. A set of sensors which are smart, capture the data, perform necessary data element analysis and transformation as per device application framework and connect directly to a communication manager. Internet of Things: An Overview 11 A set of sensor circuits is connected to a gateway possessing separate data capturing, gathering, computing and communication capabilities. The gateway receives the data in one form at one end and sends it in another form to the other end. The communication-management subsystem consists of protocol handlers, message routers and message cache. This management subsystem has functionalities for device identity database, device identity management and access management. Data routes from the gateway through the Internet and data centre to the application server or enterprise server which acquires that data. Organisation and analysis subsystems enable the services, business processes, enterprise integration and complex processes (These terms are explained in Chapter 5). A number of models (CISCO, Purdue and other models) have been proposed at SWG (Sub Working Group) Teleconference of December 2014. Standards for an architectural framework for the IoT have been developed under IEEE project P2413. IEEE working group is working on a set of guidelines for the standards. IEEE suggested P24133 standard for architecture of IoT. It is a reference architecture which builds upon the reference model(s). The reference architecture covers the definition of basic architectural building blocks and their integration capability into multi-tiered systems. IEEE P2413 standard 4 provides reference P2413 architectural framework is a reference model that architecture for various defines relationships among various IoT verticals, for example, IoT domains transportation and healthcare. P2413 provides for the following: Follows top-down approach (consider top layer design first and then move to the lowest) Does not define new architecture but reinvent existing architectures congruent with it Gives a blueprint for data abstraction Specifies abstract IoT domain for various IoT domains Recommends quality ‘quadruple’ trust that includes protection, security, privacy and safety Addresses how to document Strives for mitigating architecture divergence(s) Scope of IEEE P2413 standard defines an architectural framework for the IoT. It includes descriptions of various IoT domains, definitions of IoT domain abstractions and identification of commonalities between different IoT domains. Smart manufacturing, smart grid, smart buildings, intelligent transport, smart cities and e-health are different IoT domains. P2413 leverages existing applicable standards. It identifies planned or ongoing projects with a similar or overlapping scope.5 3 http://grouper.ieee.org/groups/2413/Sept14_meeting_report-final.pdf 4 Jan Höller et al., From Machine-to-Machine to the Internet of Things, Academic Press, 2014. 5 http://grouper.ieee.org/groups/2413/April15_meeting_report-final.pdf. 12 Internet of Things: Architecture and Design Principles Reconfirm Your Understanding A reference model for architectural view consists of seven levels from physical devices to data storage, abstraction, application and collaboration processing (CISCO). IoT architecture builds to serve as a reference architecture in applications of IoTs in services and business processes (Oracle). IEEE P2413 standard provides reference architecture for the IoT that builds upon the reference models which cover the definition of basic architectural building blocks and their integration capability into multi-tiered systems. Several reference architectures are expected to co-exist in IoT domains. Specification of abstract IoT domain for various IoT domains have been discussed. Quality ‘quadruple’ trust that includes protection, security, privacy and safety has also been discussed. Self-Assessment Exercise 1. List the features of CISCO reference model. ★ 2. List the features of Oracle reference architecture. ★ 3. Describe the meaning of reference architecture and reference model. ★ 4. What should reference architecture cover in IoT general conceptual ★ framework? 5. How do the blocks and components in IoT IBM conceptual framework and ★★ Oracle reference architecture correlate? 6. How do the CISCO reference model and Oracle reference architecture ★★★ correlate in an IoT architecture? 7. Why does a smart sensor connect directly while a regular sensor connects ★ through a gateway to the communication management subsystem (Fig. 1.5)? 8. Why does a network of sensors and smart sensors need the functionalities of ★★ device identity database, device identity management, and device access and device management? 9. How does the IoT device data organise? ★★ 10. What are the uses of data after analysis of acquired data? ★★ 11. What are the provisions in the architectural framework in IEEE P2413? ★★★ Internet of Things: An Overview 13 1.4 TECHNOLOGY BEHIND IoT LO 1.4 Describe enabler The following entities provide a diverse technology- technologies which environment and are examples of technologies, which are are used in designing involved in IoT. of: (i) IoT devices, (ii) Hardware (Arduino Raspberry Pi, Intel Galileo, Intel communication Edison, ARM mBed, Bosch XDK110, Beagle Bone Black methods between and Wireless SoC) devices and remote Integrated Development Environment (IDE) for server, cloud and developing device software, firmware and APIs applications Protocols [RPL, CoAP, RESTful HTTP, MQTT, XMPP (Extensible Messaging and Presence Protocol)] Communication (Powerline Ethernet, RFID, NFC, 6LowPAN, UWB, ZigBee, Bluetooth, WiFi, WiMax, 2G/3G/4G) Network backbone (IPv4, IPv6, UDP and 6LowPAN) Software (RIOT OS, Contiki OS, Thingsquare Mist firmware, Eclipse IoT) Internetwork Cloud Platforms/Data Centre (Sense, ThingWorx, Nimbits, Xively, openHAB, AWS IoT, IBM BlueMix, CISCO IoT, IOx and Fog, EvryThng, Azure, TCS CUP) Machine learning algorithms and software. An example of machine-learning software is GROK from Numenta Inc. that uses machine intelligence to analyse the streaming data from clouds and uncover anomalies, has the ability to learn continuously from data and ability to drive action from the output of GROK’s data models and perform high level of automation for analysing streaming data.6 The following five entities can be considered for the five levels behind an IoT system (Figure 1.3): 1. Device platform consisting of device hardware and software using a microcontroller (or SoC or custom chip), and software for the device APIs and web applications 2. Connecting and networking (connectivity protocols and circuits) enabling internetworking of devices and physical objects called things and enabling the internet connectivity to remote servers 3. Server and web programming enabling web applications and web services 4. Cloud platform enabling storage, computing prototype and product development platforms 5. Online transactions processing, online analytics processing, data analytics, predictive analytics and knowledge discovery enabling wider applications of an IoT system 1.4.1 Server-end Technology IoT servers are application servers, enterprise servers, cloud servers, data centres and databases. Servers offer the following software components: Online platforms Devices identification, identity management and their access management Data accruing, aggregation, integration, organising and analysing Use of web applications, services and business processes 6 http://numenta.com/grok/ 14 Internet of Things: Architecture and Design Principles 1.4.2 Major Components of IoT System Major components of IoT devices are: 1. Physical object with embedded software into a hardware. 2. consisting of a microcontroller, firmware, sensors, control unit, actuators and communication module. 3. Communication module: Software consisting of device APIs and device interface for communication over the network and communication circuit/port(s), and middleware for creating communication stacks using 6LowPAN, CoAP, LWM2M, IPv4, IPv6 and other protocols. 4. for actions on messages, information and commands which the devices receive and then output to the actuators, which enable actions such as glowing LEDs, robotic hand movement etc. Sensors and Control Units Sensors Sensor types—analog Sensors are electronic devices that sense the physical environ- and digital output ments. An industrial automation system or robotic system has sensors multiple smart sensors embedded in it. Sensor-actuator pairs are used in control systems. A smart sensor includes computing and communication circuits. Recall Example 1.2 of Internet of streetlights. Each light has sensors for measuring surrounding light-intensity and surrounding traffic-proximity for sensing and transmitting the data after aggregation over a period. Sensors are used for measuring temperature, pressure, humidity, light intensity, traffic proximity, acceleration in an accelerometer, signals in a GPS, proximity sensor, magnetic fields in a compass, and magnetic intensity in a magnetometer. Sensors are of two types. The first type gives analog inputs to the control unit. Examples are thermistor, photoconductor, pressure gauge and Hall sensor. The second type gives digital inputs to the control unit. Examples are touch sensor, proximity sensor, metal sensor, traffic presence sensor, rotator encoder for measuring angles and linear encoders for measuring linear displacements. Sensors and circuits are explained in detail in Chapter 7. Control Units Most commonly used control unit in IoT consists of a Microcontroller Unit (MCU) or a custom chip. A microcontroller is an integrated chip or core in a VLSI or SoC. Popular microcontrollers are ATmega 328, ATMega 32u4, ARM Cortex and ARM LPC. An MCU comprises a processor, memory and several other hardware units which are interfaced together. It also has firmware, timers, interrupt controllers and functional IO units. Additionally, an MCU has application-specific functional circuits designed as per the specific version of a given microcontroller family. For example, it may possess Analog to Digital Converters (ADC) and Pulse Width Modulators (PWM). Figure 1.6 shows various functional units in an MCU that are embedded in an IoT device or a physical object. New terms in the figure will be discussed in detail in Chapter 8. Internet of Things: An Overview 15 Microcontroller Processor Internal RAM Internal Flash and Firmware Timers Programmable IO Ports General Purpose IO Ports Serial IO Ports PWM ADC Communication (Pulse Width Modulator) (Analog to Digital Converter) Network Interfaces Figure 1.6 Various functional units in an MCU that are embedded in an IoT device or a physical object Communication Module A communication module consists of protocol handlers, message queue and message cache. A device message-queue inserts the messages in the queue and deletes the messages from the queue in a first-in first-out manner. A device message-cache stores the received messages. Representational State Transfer (REST) architectural style can be used for HTTP access by GET, POST, PUT and DELETE methods for resources and building web services. Communication protocols and REST style are explained in detail Chapter 3 and 4. Software IoT software consists of two components—software at the IoT device and software at the IoT server. Figure 1.7 shows the software components for the IoT device hardware and server. Embedded software and the components are explained in Chapter 8. Software APIs, online component APIs and web APIs are explained in Section 9.4. Middleware OpenIoT is an open source middleware. It enables communication with sensor clouds as well as cloud-based ‘sensing as a service’. IoTSyS is a middleware which enables provisioning of communication stack for smart devices using IPv6, oBIX, 6LoWPAN, CoAP and multiple standards and protocols. The oBIX is standard XML and web services protocol oBIX (Open Building Information Xchange). Operating Systems (OS) Examples of OSs are RIOT, Raspbian, AllJoyn, Spark and Contiki. RIOT, Raspbian, RIOT is an operating system for IoT devices. RIOT supports AllJoyn, Spark and both developer and multiple architectures, including ARM7, Contiki OS for IoT Cortex-M0, Cortex-M3, Cortex-M4, standard x86 PCs and TI MSP430. Raspbian is a popular Raspberry Pi operating system that is based on the Debian distribution of Linux. 16 Internet of Things: Architecture and Design Principles IoT Server for Manage, Acquire, Organise and Analyse Integration, Collaboration and Processes (Involving people and business processes) and Services Application (Reporting, Analysis, Control) Edge Computing Data Analysis Data Abstraction (Aggregation and Access) Data Accumulation (Storage) and Management Connectivity (Communication and Processing Units) IoT Device Software for Gather Data, Enrich and Communication Connectivity Interface (Communication and Processing Units) Edge Computing (Data Element Analysis and Transformation) IoT device Hardware Physical Devices and Controllers (the Things in IoT) [Sensors, Machines, Devices, Intelligent Edge Nodes of Different Types] Figure 1.7 IoT software components for device hardware AllJoyn is an open-source OS created by Qualcomm. It is a cross platform OS with APIs available for Android, iOS, OS X, Linux and Windows OSs. It includes a framework and a set of services. It enables the manufacturers to create compatible devices. Spark is a distributed, cloud-based IoT operating system and web-based IDE. It includes a command-line interface, support for multiple languages and libraries for working with several different IoT devices. Contiki OS7 is an open-source multitasking OS. It includes 6LowPAN, RPL, UDP, DTLS and TCP/IP protocols which are required in low-power wireless IoT devices. Example of applications are street lighting in smart cities, which requires just 30 kB ROM and 10 kB RAM. Firmware Thingsquare Mist is an open-source firmware (software embedded in hardware) for true Internet-connectivity to the IoT. It enables resilient wireless mesh networking. Several microcontrollers with a range of wireless radios support Things MIST. 7 https://en.wikipedia.org/wiki/Contiki and http://anrg.usc.edu/contiki/index.php/Contiki_tutorials Internet of Things: An Overview 17 1.4.3 Development Tools and Open-source Framework for IoT Implementation Eclipse IoT (www.iot.eclipse.org) provides open-source implementation of standards such as MQTT CoAP, OMA-DM and OMA LWM2M, and tools for working with Lua, services and frameworks that enable an Open Internet of Things. Eclipse developed the IoT programming language—Lua. Eclipse website provides sandbox environments for experimenting with the tools and a live demo. Eclipse-related popular projects are Paho, Koneki and Mihini. Arduino development tools provide a set of software that includes an IDE and the Arduino programming language for a hardware specification for interactive electronics that can sense and control more of the physical world.8 Kinoma Create (kit for prototyping), Kinoma Studio development environment and Kinoma Platform Runtime are three different open-source projects. Kinoma Connect is a free app for iOS and Android smartphones and tablets with IoT devices. 1.4.4 APIs and Device Interfacing Components Connectivity interface consists of communication APIs, device interfaces and processing units. Figure 1.8 shows the mbedTM API and device interfacing components. REST API Administration and Security Management Data Flow and Device Management Multi-tenancy Authentication Directory Subscription REST Publish/Subscribe LWM2M Device Interface CoAP-SMS, CoAP-MQ, CoAP CoAP, HTTP, MQTT DTLS TLS Figure 1.8 mBedTM API and device interfacing components Example 1.3 List the development platform components for an ARM cortex microcontroller using mBedTM application and IoT prototype and product development platform. 8 http://www.datamation.com/ 18 Internet of Things: Architecture and Design Principles A development platform consists of the OS (real-time operating system) and prototype development hardware and software for the IoT. An mbedTM Software Development Kit (SDK) enables development of a firmware for smart devices. SDK has the following software components: mbed C/C++ software platform IDE consisting of tools for creating microcontroller firmware CoRE libraries, microcontroller peripheral drivers, RTOS, runtime environment, build tools and test and debug scripts Networking module An online IDE (freeware) consists of an editor and compiler. The code compiles within the web browser using ARMCC (ARM C/C++ Compiler). The application developer uses mbed IDE or Eclipse with GCC ARM embedded tools. 1.4.5 Platforms and Integration Tools ThingSpeak is an open data platform with an open API. It consists of APIs that enable real- time data collection, geolocation data, data processing and visualisations. It enables device status messages and plugins. It can process HTTP requests and store and process data. It can integrate multiple hardware and software platforms. It supports Arduino, Raspberry Pi,9 ioBridge/RealTime.io, and Electric Imp. An important feature of ThingSpeak is the support to MATLAB data analytics, mobile, web applications and social networks. Nimbits is a cloud platform which supports multiple programming languages, including Arduino, JavaScript, HTML or the Nimbits.io Java library.10 The software deploys on Google App Engine, any J2EE server on Amazon EC2 or Raspberry Pi. It processes a specific type of data and can also store the data. The data can be time- or geo-stamped. IoT Toolkit offers Smart Object API, HTTP-to-CoAP Semantic mapping and a variety of tools for integrating multiple IoT-related sensor networks and protocols.11 SiteWhere provisions a complete platform for managing IoT devices. It enables gathering of data and integrating it with external systems. SiteWhere can be used on Amazon’s cloud or downloaded. It also integrates MongoDB, ApacheHBase and multiple big data tools.12 Other platforms are Microsoft Azure,13 TCS connected universe platform (TCS CUP),14 Xively,15 smartliving16, thethings.io17 and exosite.18 Usage of Xively and Nimbits cloud are described in detail in Chapter 6. Details of TCS CUP are described in Chapter 12. 9 https://thingspeak.com/ 10 http://www.nimbit.com/and http://bsautner.github.io/com.nimbits/ 11 http:// www. iot-toolkit.com// 12 http://www.sitewhere.org/ 13 https://azure.microsoft.com/en-in/develop/iot/get-started/ 14 http://www.tcs.com/research/Pages/TCS-Connected-Universe-Platform.aspx 15 https://www.xively.com/ 16 http://www.smartliving.io 17 https://thethings.io/ 18 https://exosite.com/ Internet of Things: An Overview 19 Reconfirm Your Understanding IoT design involves number of technology areas for IoT applications and services. IoT design spans over number of technology areas: hardware, interfaces, firmware, communication protocols, internet connections, data storage, analytics and machine learning tools. IoT hardware needs sensors, actuators and device platform, IDE, development tools. IoT software needs device platform communication protocols, number of network communication protocols and network backbone protocols. IoT design needs platforms for prototyping and product development and integration tools. Several open-source software and OSs for system development are available. Several cloud platforms and data centres for system development are available. Self-Assessment Exercise 1. List the microcontrollers and device platforms which IoTs can use. ★ 2. What are the functions of various functional units in a microcontroller that ★★ embeds in an IoT device? 3. List the device platform communication protocols, network communication ★★ protocols and network backbone protocols which IoTs can use. 4. List the available open-source software which can be used. Specify the features ★★ of RIOT and Eclipse IoT. 5. List the available cloud platform and data centre open sources. ★ 6. What does platform and integration tool mean? What are the features of ★★ ThingSpeak? 7. Explain mBedTM application and IoT product development platform. ★★★ 1.5 SOURCES OF IoT LO 1.5 Categorise the Examples of hardware sources for IoT prototype development resources which are Arduino Yún, Microduino, Beagle Board and RasWIK. enable the development of IoT prototype and Hardware prototype needs an IDE for developing device product software, firmware and APIs. 1.5.1 Popular IoT Development Boards Arduino Yún Arduino Yún board uses microcontroller ATmega32u4 that supports Arduino and includes Wi-Fi, Ethernet, USB port, micro-SD card slot and three reset buttons. The board also combines with Atheros AR9331 that runs Linux. 20 Internet of Things: Architecture and Design Principles Microduino Microduino is a small board compatible with Arduino that can be stacked with the other boards. All the hardware designs are open source. Intel Galileo Intel Galileo is a line of Arduino-certified development boards. Galileo is based on Intel x86 architecture. It is open-source hardware that features the Intel SOC X1000 Quark based Soc. Galileo is pin-compatible with Arduino. It has 20 digital I/O (12 GPIOs fully native), 12-bit PWM for more precise control, six analog inputs and supports power over Ethernet (PoE). Intel Edison Intel Edison19 is a compute module. It enables creation of prototypes and fast development of prototyping projects and rapidly produces IoT and wearable computing devices. It enables seamless device internetworking and device-to-cloud communication. It includes foundational tools. The tools collect, store and process data in the cloud, and process rules on the data stream. It generates triggers and alerts based on advanced analytics. Beagle Board Beagle Bone based board has very low power requirement. It is a card-like computer which can run Android and Linux. Both the hardware designs and the software for the IoT devices are open source. Raspberry Pi Wireless Inventors Kit (RasWIK) RasWIK enables Raspberry Pi Wi-Fi connected devices. It includes documentation for 29 different projects or you can come up with one of your own. There is a fee for the devices but all of the included code is open source, and you can use it to build commercial products as well. Prototype development boards are described in detail in Chapter 8. 1.5.2 Role of RFID and IoT Applications Earlier IoT systems were internet-connected RFID based systems. RFID enables tracking and inventory control, identification in supply chain systems, access to buildings and road tolls or secured store centre entries, and devices such as RFID-based temperature sensors. RFID networks have new applications in factory design, 3PL-management, brand protection, and anti-counterfeiting in new business processes for payment, leasing, insurance and quality management. RFID systems are described in detail in Chapter 7. 19 http://www.intel.com/content/dam/support/us/en/documents/edison/sb/edison_pb_331179002.pdf Internet of Things: An Overview 21 1.5.3 Wireless Sensor Networks (WSNs) Sensors can be networked using wireless technology and can cooperatively monitor physical or environmental conditions. Sensors acquire data from remote locations, which may not be easily accessible. Each wireless sensor also has communication abilities for which it uses a radio-frequency transceiver. Each node either has an analog sensor with signal conditioner circuit or a digital sensor. Sensing can be done to monitor temperature, light intensity, presence of darkness, metal proximity, traffic, physical, chemical and biological data etc. WSN Definition Wireless Sensor Network (WSN) is defined as a network in which each sensor node connects wirelessly and has capabilities of computations for data compaction, aggregation and analysis plus communication and networking. WSN node is autonomous. Autonomous refers to independent computing power and capability to send requests and receive responses, and data forward and routing capabilities. A web source defines the WSN as “a wireless network consisting of spatially distributed autonomous devices using sensors to cooperatively monitor physical or environmental conditions, such as temperature, sound, vibration, pressure, motion or pollutants, at different locations.” WSN Node A WSN node has limited computing power. It may change topology rapidly. The WSN network in the topology-changing environment functions as an ad-hoc network. A WSN network in that environment is generally self-configuring, self-organising, self-healing and self-discovering. WSNs are described in detail in Chapter 7. Reconfirm Your Understanding IoT sources are microcontroller-based boards—Arduino, Intel Galileo, Intel Edison, Beagle Board and Raspberry Pi. The sources have open source IDEs and development tools. Arduino uses a microcontroller, for example, ATmega 328 or ATmega 32u4. Raspberry Pi uses ARM Cortex and ARM LPC microcontroller-based boards. RFIDs are identifying devices which communicate their identity and have number of IoT applications, such as inventory control, tracking and supply chain. Wireless Sensor Nodes are wireless sensors which form a self-configuring and self-discovering network. 22 Internet of Things: Architecture and Design Principles Self-Assessment Exercise 1. List the sources of IoT development board which can be used for prototype ★ development. 2. What are the features in Arduino Yún? ★ 3. When will Intel Galileo and Intel Edison be preferred in an IoT application? ★★ 4. What are RFIDs? Draw the architecture for their inventory control application. ★★★ 5. Define Wireless Sensor Network and list its applications. ★ 1.6 M2M COMMUNICATION