TB
TB
                                       Introduction to IoT
        Internet of Things, as a research field, piques the interest of a growing community
        of academics and scholars across the world. It has witnessed massive adoption and
        large-scale deployment in industries and other spheres of everyday life. Considerable
        theoretical information about IoT as well as tutorials, courses, implementations,
        use-cases, etc., is available across the web. However, all this available information
        is so scattered that even professionals in the field have trouble obtaining concise
        information on IoT and connecting the dots between the various technologies relating
        to it. This book serves as a textbook and also as a single point of reference for
        readers interested in the subject. Written by leading experts in the field, this lucid and
        comprehensive work provides a clear understanding of the operation and scope of
        IoT. It discusses the basics of networking, network security, precursor technologies
        of IoT and the emergence of IoT. It gives an overview of various connectivity,
        communication, and interoperability protocols prevalent in the field. While providing
        a dedicated overview and scope of implementation of various analytical methods
        used for IoT, the book discusses numerous case studies and provides hands-on IoT
        exercises, enabling readers to visualize the interdisciplinary nature of IoT applications
        and understand how they have managed to gain a foothold in the technology sector.
        The book also serves curious, non-technical readers, enabling them to understand
        necessary concepts and terminologies associated with IoT.
        Sudip Misra is a professor in the Department of Computer Science and Engineering
        at the Indian Institute of Technology Kharagpur. He has published over 300 research
        papers and 11 books in allied areas of IoT. He is Associate Editor of IEEE TMC, TVT
        and IEEE Network. He is a Fellow of the National Academy of Sciences (India), IET
        (UK), and BCS (UK), and is a distinguished lecturer of the IEEE Communications
        Society. His current research interests include wireless sensor networks and IoT.
        Anandarup Mukherjee is the co-founder and director of Sensor Drops Networks Pvt.
        Ltd., an IoT startup incubated at the Indian Institute of Technology Kharagpur. He
        has published more than 30 research papers. He works in the domain of IoT and
        unmanned aerial vehicle swarms.
        Arijit Roy is the co-founder and director of Sensor Drops Networks Pvt. Ltd. He is a
        senior researcher in the Smart Wireless Applications and Networking (SWAN) lab at
        the Indian Institute of Technology Kharagpur. His primary research areas include IoT,
        sensor networks, and sensor-cloud.
i i
    i                                                                                                i
    i                                                  i
i i
    i                                                  i
    i                                                   i
Introduction to IoT
                         Sudip Misra
                     Anandarup Mukherjee
                          Arijit Roy
i i
    i                                                   i
University Printing House, Cambridge CB2 8BS, United Kingdom
One Liberty Plaza, 20th Floor, New York, NY 10006, USA
477 Williamstown Road, Port Melbourne, VIC 3207, Australia
314 to 321, 3rd Floor, Plot No.3, Splendor Forum, Jasola District Centre, New Delhi 110025, India
79 Anson Road, #06–04/06, Singapore 079906
www.cambridge.org
Information on this title: www.cambridge.org/9781108842952
©   Sudip Misra, Anandarup Mukherjee and Arijit Roy 2021
This publication is in copyright. Subject to statutory exception
and to the provisions of relevant collective licensing agreements,
no reproduction of any part may take place without the written
permission of Cambridge University Press.
First published 2021
Printed in India
A catalogue record for this publication is available from the British Library
Library of Congress Cataloging-in-Publication Data
Names: Misra, Sudip, author. | Mukherjee, Anandarup, author. | Roy, Arijit,
    author.
Title: Introduction to IoT / Sudip Misra, Anandarup Mukherjee, Arijit Roy.
Description: United Kingdom ; New York : Cambridge University Press, 2020.
    | Includes bibliographical references and index.
Identifiers: LCCN 2020037656 (print) | LCCN 2020037657 (ebook) | ISBN
    9781108842952 (hardback) | ISBN 9781108959742 (paperback) | ISBN
    9781108913560 (ebook)
Subjects: LCSH: Internet of things.
Classification: LCC TK5105.8857 .I567 2020 (print) | LCC TK5105.8857
    (ebook) | DDC 004.67/8–dc23
LC record available at https://lccn.loc.gov/2020037656
LC ebook record available at https://lccn.loc.gov/2020037657
ISBN 978-1-108-84295-2 Hardback
ISBN 978-1-108-95974-2 Paperback
Cambridge University Press has no responsibility for the persistence or accuracy
of URLs for external or third-party internet websites referred to in this publication,
and does not guarantee that any content on such websites is, or will remain,
accurate or appropriate.
    i                                                 i
To Our Families
i i
    i                                                 i
    i                                                  i
i i
    i                                                  i
                                                       Contents
1 Basics of Networking 3
   1.1 Introduction                                             3
   1.2 Network Types                                            4
        1.2.1 Connection types                                  4
        1.2.2 Physical topology                                 6
        1.2.3 Network reachability                              9
   1.3 Layered Network Models                                  10
        1.3.1 OSI Model                                        10
        1.3.2 Internet protocol suite                          14
   1.4 Addressing                                              15
        1.4.1 Data link layer addressing                       15
        1.4.2 Network layer addressing                         16
   1.5 TCP/IP Transport layer                                  19
        1.5.1 Connectionless service                           20
        1.5.2 Connection-oriented service                      20
        Summary                                                22
        Exercises                                              23
        References                                             23
       2.4 Cryptography                                            30
          2.4.1 Symmetric key cryptography                         31
          2.4.2 Asymmetric key cryptography                        34
       2.5 Message Integrity and Authenticity                      35
          2.5.1 Digital signatures                                 36
       2.6 Key Management                                          38
       2.7 Internet Security                                       40
          2.7.1 Network layer security                             40
          2.7.2 Transport layer security                           41
          2.7.3 Application layer security                         43
       2.8 Firewall                                                44
           Summary                                                 46
           Exercises                                               46
           References                                              47
 3 Predecessors of IoT                                             48
       3.1 Introduction                                            48
       3.2 Wireless Sensor Networks                                49
          3.2.1 Architectural components of WSN                    51
       3.3 Machine-to-Machine Communications                       57
          3.3.1 Architectural components of M2M                    60
       3.4 Cyber Physical Systems                                  65
          3.4.1 Architectural components of CPS                    68
           Summary                                                 69
           Exercises                                               70
           References                                              70
 4 Emergence of IoT                                                75
       4.1 Introduction                                            75
       4.2 Evolution of IoT                                        80
          4.2.1 IoT versus M2M                                     83
          4.2.2 IoT versus CPS                                     84
          4.2.3 IoT versus WoT                                     84
Contents                                                               ix
7.24 The NB-IoT protocol stack with respect to its entities                       154
7.25 The IEEE 802.11 Wi-Fi stack                                                  155
7.26 The Wi-Fi deployment architecture                                            155
7.27 The Bluetooth device network architecture                                    156
7.28 The Bluetooth protocol stack                                                 157
 8.1 Various IoT communication protocol groups                                    164
 8.2 Differences between IPv4 and IPv6 packets and the IPv6 address notation      167
 8.3 The LOADng routing mechanism                                                 170
 8.4 RPL information flow mechanism with different intra-mesh addressing
     and paths                                                                    172
 8.5 6LoWPAN packet structure                                                     174
 8.6 6LoWPAN address format                                                       175
 8.7 6LoWPAN header structures                                                    176
 8.8 Differences between HTTP and QUIC protocols                                  176
 8.9 Differences between stream of packets over HTTP and QUIC protocols           177
8.10 The uIP protocol                                                             178
8.11 The nano-IP TCP and UDP protocols                                            179
8.12 Content centric networking operation and its scope                           180
8.13 The physical web model                                                       182
8.14 An outline of the basic UPnP stack                                           184
8.15 MQTT operation and its stakeholders                                          185
8.16 The MQTT-SN types                                                            188
8.17 Position of the CoAP protocol in a stack                                     189
8.18 Various CoAP response–response models.         (A): CON and NON
     messages, (B): Piggyback messages, and (C): Separate messages                190
8.19 AMQP components and their relationships                                      192
8.20 XMPP components                                                              193
8.21 A representation of the position of the SOAP API in a stack                  195
8.22 Working of SOAP                                                              196
8.23 A representation of the REST style and its components                        197
8.24 A representation of the position of websockets in a stack                    199
8.25 The EPC representation                                                       201
8.26 The operation of an uCode tag system                                         202
8.27 The representation of an URI link                                            203
Figures                                                                      xxi
i i
    i                                                     i
                                                                           Tables
i i
    i                                                     i
    i                                                                                                i
Foreword
        The Internet of Things (IoT) paradigm has grown by leaps and bounds in the
        past decade. Nowadays, IoT is a common presence in households, transportation,
        markets, retail, banking, industries, education, and logistics. Yet regular innovative
        developments in IoT continue to flood the market. IoT has given rise to many
        interesting applications and resulted in the development of new networking
        and communication technologies that are designed specifically for IoT-oriented
        tasks. Manually intensive, yet crucial, domains of healthcare, agriculture, and
        transportation now rely heavily on IoT applications. The inclusion of IoT applications
        in these domains has resulted in facilitating their automation, enhanced safety, and
        precision of operations and allowed the inclusion of scientifically optimized practices.
        It is popularly considered that the rapid rise of IoT resulted from the inclusion of
        the beneficial features from the paradigms and technologies of Internet computing,
        cloud computing, wireless sensor networks (WSN), cyber-physical systems (CPS), and
        machine-to-machine (M2M) communications. All through its development, IoT has
        been supported by the popular networking paradigms in distributed systems, namely
        of cloud computing and edge and fog computing. These have allowed the massive,
        yet affordable, deployment of IoT across various domains. The emergence of the
        recent paradigm of edge computing can be directly attributed to IoT. IoT has also
        motivated the development of numerous connectivity and communication protocols
        and technologies such as IPv6, MQTT, 6LoWPAN, and LoRA, amongst others.
            Unlike other books on IoT, already available on the market, this book provides
        detailed and interlinked coverage of topics related to IoT networks. The authors have
        designed this book carefully so that it acts as a guide and a single point of reference to
        IoT networks for beginners, as well as those already familiar with the technologies
        connected to IoT. With applications in the domains of agriculture, healthcare,
        electronics, power sector, industries, households, consumer electronics, computing,
        analytics, environment, transportation, logistics, security, military, surveillance, and
        many others, it is no wonder that the demand for deeper insights into IoT technologies
        is increasing day by day. The involvement of people from diverse backgrounds
        makes it necessary to create a concise repository of information on this new
        technology. The Internet hosts much information on IoT (theory, tutorials, courses,
        and implementations). However, they are so scattered that even professionals in this
        field have trouble obtaining connected and concise information.
i i
    i                                                                                                i
    i                                                                                                    i
xxviii Foreword
           This book has been purposefully designed by the authors as a textbook; it gradually
        exposes the readers to the technical details of IoT by first providing a primer on crucial
        networking technologies, which will help new readers in this domain to comfortably
        adopt and absorb the technical details of core IoT network technologies and its
        associated domains. Thereafter, the book gradually shifts focus to IoT networking
        technologies covering the emergence of IoT, addressing strategies in IoT, sensing and
        actuation, processing topologies, connectivity technologies, communication protocols,
        and interoperability. Later, this book expands its focus to cover the popular paradigms
        of cloud and fog computing, along with their applications in real life. The authors
        also provide real-life case studies on agriculture, healthcare, and vehicular IoT, aiming
        to get new learners motivated in the practical applicability of IoT in real-world
        applications. The authors have also provided chapters on IoT hardware projects and
        common analytical methods/tools used in IoT.
           This book is divided into five parts: 1) Introduction, 2) Internet of Things, 3)
        Associated IoT Technologies, 4) IoT Case Studies, and 5) IoT Hands-on. I especially
        found the following features quite attractive in this book:
           The authors of this book are globally acclaimed researchers, all of whom
        have published a number of research papers in this domain in highly impactful
        journals/magazines such as the IEEE Communications Magazine, IEEE Transactions
        on Communications, IEEE Transactions on Mobile Computing, IEEE Transactions on
        Sustainable Computing, IEEE Transactions on Vehicular Technology, IEEE Internet of Things
        Journal, Elsevier Computer Networks, IEEE Systems Journal, and many more. Sudip is
        well known in the community for his research achievements in the broad domain of
        Internet of Things. He has published more than a dozen books, which are published
        by globally renowned publishers such as Cambridge University Press, Wiley, Springer,
        World Scientific, and CRC Press. Due to his significant research contributions,
        his work has been recognized with different fellowships and awards such as the
        highly prestigious Abdul Kalam Technology Innovation National Fellow (India), the
        Fellow of the National Academy of Sciences (India), the Fellow of IETE (India), IET
        (U.K.), RSPH (U.K), IEEE Communications Society Outstanding Young Researcher
        Award, Humboldt Fellowship (Germany), Faculty Excellence Award (IIT Kharagpur),
        Canadian Governor General’s Academic Medal, NASI Young Scientist Award, IEI
        Young Engineers Award, SSI Young Systems Scientist Award and so on. He serves
        as the Editor of IEEE Transactions on Vehicular Technology, and the Associate Editor
i i
    i                                                                                                    i
    i                                                                                             i
Foreword xxix
i i
    i                                                                                             i
    i                                                    i
i i
    i                                                    i
    i                                                                                             i
Preface
        Pedagogical Aids
        We have included various pedagogical aids to help the reader swiftly grasp the
        contents and the treatment of the various topics covered in this book. We have
        provided a set of conceptual questions at the end of this book. For solving these
        questions, the reader must have completely grasped the concepts covered in this book.
i i
    i                                                                                             i
    i                                                                                              i
xxxii Preface
i i
    i                                                                                              i
    i                                                                                               i
Preface xxxiii
        The sensed data needs to be stored and continually updated in memory locations
        for further processing. As per requirement, a user has the option of utilizing the
        sensed information as either structured or unstructured data. In IoT, the where
        and how of processing is another critical issue. Therefore, the correct processing
        technique needs to be selected accordingly. This book covers the processing techniques
        required for IoT. The transmission of this processed IoT data between devices is
        mostly dependent on various communication and connectivity protocols. The authors
        illustrate and discuss these connectivity protocols in detail, which is lucid to both
        experts as well as novice audiences. Some of these discussed protocols have been
        developed, primarily due to various developments in IoT and its architectures.
        After successful establishment of connectivity between two or more IoT nodes, the
        subsequent steps involve establishing communication between these nodes. These
        nodes may be tasked with either sensing, actuation, or both functions with specific
        requirements concerning packetization, addressing, reliability, security, and other
        such measures. The authors discuss these needs by describing a significant number
        of communication protocols in a separate chapter dedicated to these communication
        protocols. Finally, Part II discusses the various types of interoperability and their
        importance concerning IoT and its technologies. As IoT involves the inclusion
        of legacy, present, and upcoming technologies, the primary challenge lies in the
        integration of hardware and software platforms, which are provided by various
        original equipment manufacturers (OEMs) following their proprietary solutions and
        technologies. Consequently, the inclusion of these devices into a single platform
        is a non-trivial task. Therefore, the establishment of connectivity among these
        diverse devices in IoT becomes a challenging issue. The paradigm of device and
        software interoperability is introduced to the readers, which highlights the urgency of
        equipment, technology, communication, and protocol standardization in the context of
        IoT. The authors discuss the challenges of interoperability along with its other aspects
        resulting in the shaping of the readers’ perspective; this would enable them to come up
        with IoT solutions and architectures, keeping the present and future interoperability
        challenges in mind.
            In a traditional IoT architecture, there is the option to store the sensed data
        from heterogeneous sensor nodes in various locations such as locally on the devices,
        on a remote server, on a fog, or a cloud. Part III of this book primarily covers
        cloud, fog, and edge computing. An IoT architecture consists of a large variety of
        different, multipurpose, and multifunctional devices. The authors of this book ensure
        that each of these storage schemes is described individually. Cloud computing, yet
        another crucial technology, plays a vital role in handling the massive amounts of data
        generated by these IoT devices. A cloud enables the features of enormous storage
        capabilities, processing resources, and unification of data on a single platform. This
        book elucidates the idea of cloud computing in a simplified manner. A few topics
        of cloud computing, primarily focused on its applicability in the context of IoT, are
        discussed. Additionally, various service models are briefly discussed as they are used
        with traditional cloud computing. To mitigate the issues of latency in data processing
i i
    i                                                                                               i
    i                                                                                              i
xxxiv Preface
        in a cloud, which can be crucial for applications such as healthcare, the authors also
        include brief overviews of fog and edge computing. The authors cover the different
        aspects of fog computing, starting from fundamental issues to issues relating to its
        architecture along with suitable use-cases in this book.
            After discussing the technical details of IoT and its backbone technologies, the
        authors highlight different application domains of IoT, such as agriculture, vehicular,
        and healthcare. These typical application domains of IoT are discussed in Part IV
        of this book as case-studies. Each chapter covers the application domains one-by-
        one employing real-life use-cases. These use-cases provide a clear idea about the real
        implementation of IoT in each application domain. This part is designed to enable both
        beginners, as well as advanced readers, to understand the needs, implementation,
        technologies, solutions, and implications of sustainable IoT architectures and solutions
        described in Parts I–III. Finally, the last chapter of this part concludes the various
        theoretical and practical aspects of IoT, its components, and architectures, with a
        discussion on newly emerging paradigms and various enabling ones.
            Finally, Part V of this book is designed to further strengthen the readers’ grasp on
        concepts through hands-on experience with IoT applications. The authors make use
        of commonly available hardware, including sensors, actuators, and processor boards,
        to demonstrate various sample integrations. These sample integrations are designed
        to enable readers to envision complicated device integrations and form complex
        IoT network architectures. Basic knowledge of Arduino and Python programming
        is required for pursuing this part. However, for readers with no prior experience
        in these languages, the hands-on section provides sample codes and explains the
        functionality of the integrations and its various aspects. Another chapter focuses on
        data informatics and analytics popularly used in IoT. The various types of analytics
        and terminologies associated with them are outlined; this chapter provides new
        readers and knowledge-seekers a starting point into IoT analytics.
            All the chapters in this book are accompanied by a set of basic questions on
        the topics covered in that chapter. However, the last part of this book contains a
        consolidated set of conceptual questions, which will require the readers to access
        various sources, besides this book, to be able to address them. This exercise will
        train the readers to selectively choose from the vast amount of information available
        elsewhere, and sieve the ones most crucial to their current problem.
        Target Audience
        This book primarily targets the undergraduate and postgraduate technical readers
        who are either looking to delve into the growing domain of IoT or are taking
        IoT targeted introductory as well as advanced courses. This book is additionally
        designed to address the curious, non-technical reader, as well as working professionals
        from non-computer science and electronics domains, enabling them to pick up the
        necessary concepts and terminologies associated with IoT. This multifaceted book
i i
    i                                                                                              i
    i                                                                                                i
Preface xxxv
        can also be used as a quick reference introducing the concepts and challenges in IoT
        research, which may be of significant use to working professionals, academicians as
        well as researchers across various industries.
        Acknowledgment
        The authors would like to thank Ms. Nidhi Pathak and Mr. Pallav Deb, who
        are doctoral research scholars at the Indian Institute of Technology Kharagpur,
        India. They have been instrumental in helping with various hardware and software
        implementations used in this book. Additionally, the authors would like to thank
        the various scholars/researchers in the Smart Wireless Applications and Networking
        (SWAN) Lab. for taking time out to go through this work and suggest improvements.
        The authors sincerely acknowledge the role of various, regular as well as online,
        students of Professor Misra’s course Architecting Protocols for the Internet of Things and
i i
    i                                                                                                i
    i                                                                                              i
xxxvi Preface
        his popular MOOC Introduction to IoT, which is hosted online by NPTEL (India).
        Finally, the authors are grateful to their families for being understanding and patient.
i i
    i                                                                                              i
    i                                                i
                       PART ONE
                    INTRODUCTION
i i
    i                                                i
    i                                                i
i i
    i                                                i
    i                                                                                              i
                                                                            Chapter      1
                                                Basics of Networking
        Learning Outcomes
        After reading this chapter, the reader will be able to:
           • Understand the basic principles of computer networking
           • List the basic terminologies and technologies
           • Relate new concepts of IoT with the basics of networking
           • Discuss various network configurations and topologies
           • Explain various OSI (open systems interconnections) and TCP/IP (transmission
             control protocol/Internet protocol) layers and their associated uses
           • Describe basics of network addressing
        1.1 Introduction
        In the present era of data- and information-centric operations, everything—right from
        agriculture to military operations—relies heavily on information. The quality of any
        particular information is as good as the variety and strength of the data that generates
        this information. Additionally, the speed at which data is updated to all members of
        a team (which may be a group of individuals, an organization, or a country) dictates
        the advantage that the team has over others in generating useful information from
        the gathered data. Considering the present-day global scale of operations of various
        organizations or militaries of various countries, the speed and nature of germane
        information are crucial for maintaining an edge over others in the same area. To sum it
        up, today’s world relies heavily on data and networking, which allows for the instant
        availability of information from anywhere on the earth at any moment.
            Typically, networking refers to the linking of computers and communication
        network devices (also referred to as hosts), which interconnect through a network
i i
    i                                                                                              i
    i                                                                                                    i
        (Internet or Intranet) and are separated by unique device identifiers (Internet protocol,
        IP addresses and media access control, MAC addresses). These hosts may be
        connected by a single path or through multiple paths for sending and receiving data.
        The data transferred between the hosts may be text, images, or videos, which are
        typically in the form of binary bit streams [1].
Points to ponder
              • The data generated from a camera sensor tells us more about a scene compared
                to the data generated from, say, a proximity sensor, which only detects the
                presence of people in its sensing range.
              • Furthermore, the simultaneous data generated from multiple cameras focusing
                on the same spot from various angles tell us even more about the scene than
                a single camera focused at that scene.
            As the primary aim of this chapter is to provide the reader with an overview of
        networking, we have structured the text in such a manner that the general concepts
        are covered. Additional Check yourself suggestions to review various associated
        technologies are provided along with the topics.
            We start our discussion with the different types of networks, followed by an
        overview of two popularly used layered network models: ISO-OSI (the open systems
        interconnection developed by the International Organization of Standardization) and
        TCP/IP (transmission control protocol/Internet protocol) suite. Subsequently, we will
        touch upon the various types of addressing mechanisms and set up the basic premise
        of how a message is transmitted between two devices/computers/hosts.
i i
    i                                                                                                    i
    i                                                                                          i
Basics of Networking 5
               designed to work over duplex links and are functional for both synchronous as
               well as asynchronous systems. Regarding computer networks, point to point
               connections find usage for specific purposes such as in optical networks.
Point-to-point link
Host A Host B
Point-to-point link
                                      Host C                               Host D
                                                   (a) Point-to-point
Point-to-multipoint links
Host B
Host A Host C
                                                                            Host D
                                                (b) Point-to-multipoint
                  The following requests for comments (RFCs) are associated with point-
                  to-point communication and its derivatives. RFC 1332: point-to-point
                  (PPP) Internet protocol control protocol (IPCP); RFC 1661: PPP; RFC
                  5072: IP Version 6 over PPP; RFC 2516: PPP over Ethernet; RFC 1963:
                  PPP serial data transport protocol; RFC 1962: PPP compression control
                  protocol (CCP); RFC 1990: PPP multilink protocol (MP); RFC 2615: PPP
                  over SONET/SDH (synchronous optical networking/synchronous digital
                  hierarchy).
i i
i i