Fundamentals of Iot Communication Technologies: Rolando Herrero
Fundamentals of Iot Communication Technologies: Rolando Herrero
Rolando Herrero
Fundamentals
of IoT
Communication
Technologies
Textbooks in Telecommunication Engineering
Series Editor
Tarek S. El-Bawab,
Professor and Dean,
School of Engineering,
American University of Nigeria
Telecommunications have evolved to embrace almost all aspects of our everyday life, including
education, research, health care, business, banking, entertainment, space, remote sensing,
meteorology, defense, homeland security, and social media, among others. With such progress
in Telecom, it became evident that specialized telecommunication engineering education
programs are necessary to accelerate the pace of advancement in this field. These programs
will focus on network science and engineering; have curricula, labs, and textbooks of their own;
and should prepare future engineers and researchers for several emerging challenges. The IEEE
Communications Society’s Telecommunication Engineering Education (TEE) movement, led
by Tarek S. El-Bawab, resulted in recognition of this field by the Accreditation Board for
Engineering and Technology (ABET), November 1, 2014. The Springer’s Series Textbooks
in Telecommunication Engineering capitalizes on this milestone, and aims at designing,
developing, and promoting high-quality textbooks to fulfill the teaching and research needs
of this discipline, and those of related university curricula. The goal is to do so at both
the undergraduate and graduate levels, and globally. The new series will supplement today’s
literature with modern and innovative telecommunication engineering textbooks and will make
inroads in areas of network science and engineering where textbooks have been largely missing.
The series aims at producing high-quality volumes featuring interactive content; innovative pre-
sentation media; classroom materials for students and professors; and dedicated websites. Book
proposals are solicited in all topics of telecommunication engineering including, but not limited
to: network architecture and protocols; traffic engineering; telecommunication signaling and
control; network availability, reliability, protection, and restoration; network management; net-
work security; network design, measurements, and modeling; broadband access; MSO/cable
networks; VoIP and IPTV; transmission media and systems; switching and routing (from
legacy to next-generation paradigms); telecommunication software; wireless communication
systems; wireless, cellular and personal networks; satellite and space communications and
networks; optical communications and networks; free-space optical communications; cognitive
communications and networks; green communications and networks; heterogeneous networks;
dynamic networks; storage networks; ad hoc and sensor networks; social networks; software
defined networks; interactive and multimedia communications and networks; network appli-
cations and services; e-health; e-business; big data; Internet of things; telecom economics and
business; telecom regulation and standardization; and telecommunication labs of all kinds.
Proposals of interest should suggest textbooks that can be used to design university courses,
either in full or in part. They should focus on recent advances in the field while capturing
legacy principles that are necessary for students to understand the bases of the discipline and
appreciate its evolution trends. Books in this series will provide high-quality illustrations,
examples, problems and case studies. For further information, please contact: Dr. Tarek S.
El-Bawab, Series Editor, Professor and Dean, School of Engineering, American University of
Nigeria, [email protected]; or Mary James, Senior Editor, Springer, mary.james@springer.
com.
Fundamentals of IoT
Communication Technologies
Rolando Herrero
Northeastern University
Boston, MA, USA
The solutions and slides for this book can be found at https://www.springer.com/us/book/9783030700805
ISSN 2524-4345 ISSN 2524-4353 (electronic)
Textbooks in Telecommunication Engineering
ISBN 978-3-030-70079-9 ISBN 978-3-030-70080-5 (eBook)
https://doi.org/10.1007/978-3-030-70080-5
© The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature Switzerland AG 2022
This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether the whole
or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and
retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter
developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not
imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and
regulations and therefore free for general use.
The publisher, the authors, and the editors are safe to assume that the advice and information in this book are believed
to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty,
expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been
made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface
The motivation for this book is the need of finding a single book that addresses state-of-the-art
IoT networking and communication technologies. Specifically, while teaching “Fundamentals
of IoT” at Northeastern University in Boston, I noticed the lack of “student-ready” material that
can be used to present the most relevant IoT communication technologies. Moreover, because
of the dynamic nature of these protocols, most of the material I use in the class comes from
industry standards. Unfortunately, these standards are not “student-friendly” as they are usually
intended for developers and architects. It is impossible to find a single book, or many for that
matter, that address all the topics relevant to the class. Yes, there are many IoT books out there;
however, there are very few books that focus on IoT communication and networking. Those
that do focus on these topics, however, typically miss the big picture, and their content is fairly
compartmentalized.
v
vi Preface
• provides exclusive focus on IoT communication and networking technologies from a layered
architecture perspective. IoT protocols are presented and classified based on physical, link,
network, transport, and application layer functionality.
• presents and discusses the main families of networking architectures that rely on the IoT
protocols (i.e. LWPAN vs. WPAN).
• introduces use cases and examples that focus on protocol interaction to build network stacks.
• analyzes the impact of the IoT mechanisms on network and device performance with special
emphasis on power consumption and computational complexity.
Of course, these goals comply with the information presented in the previous section.
Intended Audience
Book Organization
This book follows a progression that starts with a description of IoT and how IoT fits in
the context of conventional communication systems; it continues by presenting IoT protocols
from a perspective of the layered architecture and concludes by focusing on advanced topics
associated with IoT. This content is delivered in three parts:
• Part I—Understanding IoT Communications: It deals with the bases of IoT communications
that are the building blocks needed to understand architectures and topologies. It includes
two chapters. Chapter 1 provides an introduction that details the evolution of IoT, discussing
components and the main differences when compared to traditional networking. Chapter 2
focuses on the topologies and the interaction between the different players involved in IoT
networking.
• Part II—IoT Network Layers: It explores the different communication layers of standard
IoT solutions. It includes three chapters. Chapter 3 introduces the physical and link layers
of wireless and wireline IoT technologies. Chapter 4 explores the network and transport
layers including adaptation mechanisms to enable IoT physical and link layer protocols to
support IPv6. Chapter 5 deals with the application layers that support the establishment and
maintenance of IoT sessions.
• Part III—Advanced IoT Networking Topics: It reviews the advanced IoT networking topics
that complement the protocols presented in Part II. It includes four chapters. Chapter 6
explores the different mechanisms used for resource identification and management. Chap-
ter 7 focuses on the technologies that provide traffic routing and message forwarding.
Chapter 8 presents a wide range of full and hybrid IoT LPWAN industry standards. Chapter 9
introduces Thread, a popular home automation WPAN architecture.
It is recommended that these parts and chapters are read in sequential order as there are
many dependencies among them.
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 M2M and IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Layered Architectures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 System Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Use Case: IoT Applied to UAVs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.5 Why Now? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.6 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Homework Problems and Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2 Concepts of IoT Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.1 IoT Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2 Types of Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3 Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.3.1 Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.3.2 Actuators and Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.3.3 Gateways . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.4 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.5 Wireless Sensor Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Homework Problems and Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
vii
viii Contents
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Homework Problems and Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
4 Network and Transport Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
4.1 Why IP? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
4.2 IPv6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
4.3 6LoWPAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
4.3.1 Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4.3.2 Header Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
4.3.3 Routing and Forwarding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
4.3.4 Header Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
4.3.5 Fragmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
4.3.6 Security Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
4.3.7 TCP and 6LoWPAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
4.4 6Lo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
4.5 6TiSCH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Homework Problems and Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
5 Application Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5.1 Architectures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5.2 Request/Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5.2.1 REST Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
5.2.2 HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
5.2.3 XMPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
5.2.4 CoAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
5.2.5 SIP and RTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
5.2.6 OPC UA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
5.3 Publish/Subscribe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
5.3.1 MQTT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
5.3.2 AMQP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Homework Problems and Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Homework Problems and Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
7 Routing on Constrained Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
7.1 Routing Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
7.2 WSN Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
7.2.1 Flooding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
7.2.2 Gossiping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
7.2.3 SPIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
7.2.4 Directed Diffusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
7.2.5 LEACH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
7.2.6 PEGASIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
7.3 RPL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
7.3.1 DODAG Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
7.3.2 Storing and Non-storing Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
7.3.3 Loop Detection and Avoidance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
7.3.4 RPL, 6LoWPAN, and ND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
7.4 LOADng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
7.4.1 Minimal Core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
7.4.2 Smart Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Homework Problems and Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
8 LPWAN Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
8.1 LPWAN in IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
8.2 LoRa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
8.2.1 Physical Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
8.2.2 Link Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
8.3 SigFox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
8.3.1 Physical Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
8.3.2 Link Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
8.4 D7AP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
8.4.1 Physical Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
8.4.2 Link Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
8.4.3 Other Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
8.5 Weightless . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
8.5.1 Physical and Link Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
8.6 NB-IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
8.6.1 Physical Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
8.6.2 Link and Upper Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
8.7 More LPWAN Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
8.7.1 NB-Fi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
8.7.2 IQRF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
8.7.3 RPMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
8.7.4 Telensa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
8.7.5 SNOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
8.7.6 Nwave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
8.7.7 Qowisio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
8.7.8 IEEE 802.15.4k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
8.7.9 IEEE 802.15.4g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
8.7.10 LTE-M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
8.7.11 EC-GSM-IoT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
x Contents
xi
xii Acronyms
KS Key Source
L2CAP Logical Link Control and Adaptation Protocol
LAN Local Area Network
LBR Low Power PAN Border Router
LDPC Low Density Parity Check
LEACH Low Energy Adaptive Clustering Hierarchy
LECIM Low Energy, Critical Infrastructure Monitoring
LFU Least Frequently Used
LHIP Lightweight HIP
LIDR Light Detection And Ranging
LKM Link Margin
LLC Link Layer Control
LLCP Logical Link Control Protocol
LLLN Low Power, Low Rate and Lossy Network
LLN Low Power and Lossy Network
LOAD Lightweight On-demand Ad-hoc Distance Vector
LOADng LOAD Next Generation
LoRa Long Range
LPWAN Low Power Wide Area Network
LS Link State
LSB Least Significant Bit
LTE Long Term Evolution
LTN Low Throughput Networks
M2M Machine to Machine
M2P Multipoint to Point
MAC Media Access Control
Mbps Megabits per second
MCTA Management Channel Time Allocation
mDNS Multicast DNS
MED Minimal End Device
MEIP Media over IP
MEMS Micro Electro Mechanical Systems
MeshCoP Mesh Commissioning Protocol
MFR MAC Footer
MHR MAC Header
MIB Master Information Block
MIC Message Integrity Code
MIMO Multiple Input Multiple Output
MLE Mesh Link Establishment
MMC Modified Miller Code
MME Mobility Management Entity
MPDU MAC Protocol Data Unit
MPL Multicast Protocol for Low Power and Lossy Networks
MQTT Message Queue Telemetry Transport
MQTT-SN MQTT for Sensor Networks
MS/TP Master Slave/Token Passing
MSB Most Significant Bit
MSDU MAC Service Data Unit
MSF Minimal Scheduling Function
MSSIM Mean Structural Similarity
MTC Machine Type Communication
MTR Multi-Topology Routing
MTU Master Slave/Token Passing
xvi Acronyms
NA Neighbor Advertisement
NACK Negative Acknowledgment
NAS Non-Access Stratum
NAT Network Address Translation
NB Narrow Band
NB-Fi Narrowband Fidelity
NB-IoT Narrow Band IoT
ND Neighbor Discovery
NFC Near Field Communication
NHC Next Header Compression
NPBCH Narrowband Physical Broadcast Channel
NPCW Normal Priority Contention Window
NPDCCH Narrowband Physical Downlink Control Channel
NPDSCH Narrowband Physical Downlink Shared Channel
NPRACH Narrowband Physical Random Access Channel
NPSS Narrowband Primary Synchronization Signal
NPSSS Narrowband Secondary Synchronization Signal
NPUSCH Narrowband Physical Uplink Shared Channel
NR New Radio
NRS Narrowband Reference Signal
NS Neighbor Solicitation
NSEC Next Secure
NUD Neighbor Unreachability Detection
NZR Unipolar Nonreturn to Zero
OFDM Orthogonal Frequency Division Multiplexing
OOK On-Off Keying
OPC UA Open Platform Communications United Architecture
OPCODE Operation Code
OQPSK Offset QPSK
OS Operative System
OSI Open Systems Interconnection
P2P Point to Point
PAM Pulse Amplitude Modulation
PAN ID PAN Identifier
PAN Personal Area Network
PCA Priority Channel Access
PCF Point Coordination Function
PDR Packet Delivery Ratio
PDU Packet Data Unit
PEGASIS Power-Efficient Gathering in Sensor Information Systems
P-GW Packet Data Node Gateway
PID Proportional Integral Derivative
PINGREQ Ping Request
PINGRESP Ping Response
PKI Public Key Infrastructure
PLC Power Line Communication
PNC Piconet Coordinator
PRB Physical Resource Block
PS Packet Switching
PSK Phase Shift Keying
PSKc Pre-Shared Key for the Commissioner
PSM Power Saving Mode
PSNR Peak Signal to Noise Ratio
Acronyms xvii
This part of this book, that includes two chapters, deals with the bases of IoT communications
that are the building blocks needed to understand architectures and topologies. Chapter 1
provides an introduction that addresses the evolution of IoT, discussing components and the
main differences with traditional networking schemes. The chapter also introduces a use case
that explores some of the technologies and mechanisms that are presented later in this book.
Chapter 2 focuses on the topologies and the interaction between the different players involved
in IoT networking. It describes wireless sensor networks (WSNs) and their importance in the
context of modern IoT networks.
Introduction
1
CD DM M CE SE
PID CHANNEL
CE M DM CD SD
As it can be inferred from the example above, M2M usu- a communication channel to an application. The application,
ally involves proprietary mechanisms where source, chan- in turn, processes the readout and makes a decision that may
nel encoding, as well as modulation are not standardized. or may not involve actuation. If it does involve actuation, the
Moreover, many legacy M2M scenarios are not even nec- application transmits over the channel a command or some
essarily digital, and, in many cases, just plain modulation other relevant piece of information that is used by the actuator
and demodulation are good enough to provide some basic to perform a specific action against the environment.
functionality. Telemetry, which represents the quintessential Typical M2M applications just deal with one type of
M2M application, relies on the remote measurement of a pa- parameter (i.e. temperature, humidity, speed, inventory level)
rameter that is processed at some monitoring station. An early where a simple decision is made (i.e. open or close a valve).
example of analog telemetry includes the synchro which is Lack of standardization, which manifests by the lack of
a variable coupling transformer where the magnitude of the communication protocols, many times plays against M2M
magnetic coupling between the primary and secondary varies applications and devices attempting to interact with each
in accordance with the position of a rotable element. The other.
Panama Canal, completed in 1914, relied on the extensive Because single-device scenarios limit the level of automa-
use of synchros to monitor locks and water levels. This tion that a particular system can have, it is just natural to
and other telemetry mechanisms evolved for decades until try to expand them by incorporating multiple devices. A
1968 when the digital Supervisory Control And Data Ac- more complex solution with multiple heterogeneous devices
quisition (SCADA) system became that standard technology associated with multiple heterogeneous parameters implies a
for distributed measurement and control. Although initially horizontal approach to the machine communication problem.
SCADA systems were built from mainframe computers and A horizontal approach, in turn, requires a standard mecha-
required intensive human supervision to operate, they eventu- nism to enable communication between dissimilar devices.
ally became more automated and therefore more compatible Traditional M2M frameworks, unfortunately, do not usually
with the M2M paradigm [18]. provide such a mechanism [14]. Luckily, the Internet Pro-
Another example of well-known M2M systems are the tocol (IP) can be used as the fundamental building block to
programmable logic controllers that consist of an industrial enable this integration. Specifically, IP serves as the glue
computer with several digital input and output ports that can that connects different devices with different applications
be used for sensing and actuation [6]. These devices usually and leads to what it has been called the Internet of Things
include built-in wireline communication ports that rely on (IoT). IoT is consequently a superset of traditional M2M
physical and data link mechanisms ranging from low-rate schemes that is only possible due to standardization by means
RS-232 to high-rate Ethernet. of IP. Figure 1.2 illustrates the difference between M2M and
Because most M2M applications involve devices that are IoT deployments. Each scenario shows three cyber-physical
remotely monitored and controlled by other devices that systems (CPSs) where in every CPS a device (D1 , D2 , or
make decisions, these architectures tend to be vertical in D3 ) interacts with a single asset (i.e. temperature, humidity,
nature. Specifically, a sensor interacts with the environment speed, inventory level). The sensor data generated by each
by sampling and generating a readout that is transmitted over CPS reaches three separate applications (A1 , A2 , and A3 ).
1.2 Layered Architectures 5
Fig. 1.2 M2M vs IoT CPS CPS CPS CPS CPS CPS
VERTICAL
VERTICAL
IP
A1 A2 A1 A2 A3
A3
application application application application application application
M2M IoT
HORIZONTAL
Under traditional vertical M2M communication, applications power wireless personal area networks (6LoWPAN), that,
neither share data nor make global decisions that affect more among many things, compress fields and lift some of the
than one CPS. On the other hand, under horizontal IoT, a restrictions on the size of packets [20].
single super application that encompasses A1 , A2 , and A3
makes decisions that affect all three CPSs. Moreover, sensor
traffic from the different CPSs reaches the super application 1.2 Layered Architectures
by means of IP communication.
In the long run, IoT is intended to rely on the automated M2M and IoT communication systems represented by the
IP interaction of billions of devices all over the globe. How- functional blocks described in Sect. 1.1 are difficult to im-
ever, IoT relies on IP version 6 (IPv6) addresses that over- plement, take too long to develop, and are very expensive
come the well-known IP version 4 (IPv4) address shortage. to maintain. A more efficient approach consists in mapping
Specifically, IPv4 relies on 32-bit addresses that can only these functions into multiple layers that can be indepen-
support up to 232 ≈ 4300 × 106 addresses. On the other dently updated. For example, while modulation and source
hand, IPv6 relies on 128-bit addresses that account for up encoding are, respectively, mapped into physical and ap-
to 2128 ≈ 3000 × 1035 addresses. IPv4 network address plication layers, channel encoding is distributed over mul-
translation (NAT) mechanisms that have a goal to overcome tiple layers that provide great functional granularity and
the address shortage require network infrastructure changes enable additional mechanisms like security and networking
that make them impractical. Moreover, since NATting relies support.
on using transport layer ports to provide additional network Under a layered architecture, each layer is a black box
layer, addressing it constitutes a violation of the traditional with an input that processes the output of the layer under-
IP layered architecture described in Sect. 1.2. neath, and an output becomes the input of the layer above.
Using IPv6 “as is” on IoT applications is not usually pos- The exchange of data between layers is performed by means
sible because IPv6 exhibits some characteristics that make of standardized interfaces supported by the input and output
it incompatible with most IoT scenarios. Specifically, IoT is facilities [15]. Granularity and standardization ease imple-
typically associated with devices that produce and consume mentation and make system maintenance a lot simpler and
small chunks of data, so it is advantageous to keep the cheaper. Essentially, network software updates apply only to
network overhead as negligible as possible. Long 128-bit ad- those layers that oversee the specific functionality that needs
dresses and IPv6 limitations on the minimum size of packets to be upgraded.
put heavy restrictions on certain IoT wireless and wireline In a layered architecture, layers can be made “shorter” or
technologies. These problems are minimized by introducing “taller” by, respectively, removing and adding more func-
IoT-specific adaptation mechanisms, like IPv6 over low- tions. To an extreme, a flat architecture is one where all
6 1 Introduction
MODULATOR DEMODULATOR
FLAT ARCHITECTURE
one sensor – one application
MODULATOR DEMODULATOR
MODULATOR
DEMODULATOR
DEMODULATOR
MODULATOR
SWITCH
DEMODULATOR
functions are performed by a single layer. Too many layers OSI IETF
can also be a problem due to the extra overhead associated layer 7 application application layer 5
with handling them. To understand the advantages of a lay- layer 6 presentation
layer 5 session transport layer 4
ered architecture when compared to a flat one, consider the
layer 4 transport network layer 3
example in Fig. 1.3. The system consists of a temperature network
layer 3
sensor transmitting readouts to multiple applications. In a flat link control layer 2
layer 2 link control
architecture, the support of two applications requires two co- layer 1 physical physical layer 1
over the channel. Third, the network layer ensures that in- vices interact with assets, while applications interact with
formation packets are delivered to the destination. Fourth, enterprise processes. Devices are sensor, controllers, and
the transport layer provides support of multiplexing of traffic actuators typically running on small constrained embedded
from different applications. Fifth, the session layer oversees computers based on system-on-chip (SoC) and system-on-
managing multiple sessions between applications. Sixth, the module (SoM) hardware. A SoC is a chip that provides a
presentation layer provides formatting of information for central processing unit (CPU), memory, storage, input/output
further processing including security extensions for encryp- digital and analog interfaces, and radio-frequency (RF) signal
tion and decryption. Seventh, the application layer involves processing. A SoC may also include a graphical processing
application-specific services as well as the conversion of unit (GPU) and support for several peripherals. On the other
information between the digital and analog domain. Packets hand, a SoM is a circuit board that includes a SoC in addition
at each layer receive different names; they are called mes- to some other discrete chips that provide additional function-
sages at the application layer, they are called segments at ality.
the transport layer, they are called datagrams at the network The communication channel is the medium that enables
layer, and they are called frames at the link layer. The five- the propagation of signals between devices and applications.
layer IEFT model is similar to the OSI model with the main Because, in a traditional sensor-application scenario, signal
difference being that OSI layers 5 through 7 are mapped propagation is usually from multiple devices to a single ap-
into a single application layer. Since IoT is based on Internet plication, it is called multipoint-to-point (M2P). In a layered
technologies originally specified by IETF, this book follows architecture, simultaneous communication between multiple
the IETF layered architecture model as the main mechanism devices and an application is efficiently carried out by means
to build IoT protocols, frameworks, and solutions [17]. of network packet switching. Moreover, being an IoT sys-
tem a superset of several interacting M2M subsystems, the
channel is a critical component that integrates devices and
1.3 System Components application and where the standardization of communication
protocols is key.
Two additional and very important components are needed Embedded devices are resource constrained; they have
for IoT communication to work, a device and an applica- very little memory and exhibit very low computational capac-
tion. Summarizing, in its simplest format and as illustrated ity in order to minimize power consumption to extend battery
in Fig. 1.5, an IoT scenario typically involves three main life. Low power consumption also limits transmission rates
fundamental components: (1) devices, (2) a communica- and signal coverage. The communication between a device
tion channel, and (3) an application performing analytics. and an application may involve signals traversing different
These components interact with the “outside world”; de- channels that affect the very nature of the communication
protocol stacks and the network itself. Specifically, the con-
version between different protocols at each layer, as signals
assets traverse channels, is performed by IoT gateways. Gateways,
depending on the protocol complexity, range from simple
embedded devices to more complex specialized equipment
devices [19].
Although IoT is associated with several types of networks,
there are two main types: (1) wireless personal area networks
IoT/M2M Components
device
device GW IP application
WPAN gateway
device
LPWAN device
GW
IP application
device
ACCESS CORE
range
is called mesh connectivity and enables WPAN to operate domain by means of the modulator. This signal, which
over long distances at a cost of the additional latency intro- is transmitted over the channel, is characterized by
duced by the packet forwarding of the intermediate devices. its bandwidth. The bandwidth is measured in units of
WPANs support end-to-end IP connectivity by relying on Hertz (Hz). Through the modulation technique, a larger
gateways. These gateways are fairly simple components that analog bandwidth is usually associated with a higher
just convert lower layer traffic (physical and link layers). digital transmission rate. The demodulated analog
LPWANs do not typically support end-to-end IP connectivity, wave is converted back into digital information that
and their gateways are more complex as they convert full arrives at the receiver at a rate known as throughput.
stacks of protocols. Throughput, as the transmission rate, is measured in
Figure 1.6 shows the difference between a WPAN and units of bps. Because of network impairments like
an LPWAN. As it can be seen, the portion of the network network packet loss, throughput is usually lower than
between the devices and the gateway is called the access side, the transmission rate. The relationship between these
while everything else is called the core side or backbone. three parameters is shown below:
Note that the WPAN supports multiple devices connected
in mesh to increase access side coverage. Additionally, the
trans mission band width throughput
WPAN gateway is fully IP compliant, while the LPWAN ... CE
rate
M ... DM
gateway, on the other hand, only supports IP on one inter- transmitter
[bps] [Hz] [bps]
receiver
face [1].
In the context of IoT, applications typically perform
operational analytics to extract knowledge from the data Applications deal with knowledge, while devices deal
generated by devices. This knowledge is used, in turn, with data. An IoT communication system is partially respon-
to make automated actuation decisions and to provide sible for facilitating the conversion from data to knowledge.
visualization for human interaction. Knowledge extraction is Essentially devices collect data that is highly redundant.
a complex subject that is outside the scope of this book. Given that devices are constrained, and transmission rates
It relies on several techniques ranging from traditional are low, data is compressed by the devices before transmis-
statistical and predictive analysis to machine learning and sion. This compression is known as the data-information
data mining. conversion that attempts to lower throughput in order to
optimize channel utilization and lower power consumption to
Transmission Rate vs Bandwidth vs Throughput One extend battery life. Depending on topologies and scenarios,
important distinction in communication systems is more data-information conversions may be performed in
the difference among transmission rate, bandwidth, other network entities like gateways. When the information
and throughput. The transmission rate represents how arrives at the application, it is processed in what it is called
much digital information is being transmitted over the information-knowledge conversion [22, 16]. This is a sce-
communication path. It is measured in units of bits nario compatible with cloud computing, but this processing
per second (bps). It typically includes the redundancy can be partially performed in entities that are closer to the
added by the CE. Note that the transmission rate is device. Depending on how close they are, the situation can
sometimes referred to as network bandwidth. The be representative of mist computing and fog computing sce-
digital bits are converted into a signal in the analog narios.
1.4 Use Case: IoT Applied to UAVs 9
82°C
82°C
zooming and resolution changes that enable additional fine- only possible by means of multi-hop communications where
tuning required for analysis. Compression at the UAV is a UAV communicates with the planner through intermediate
performed by means of a hyperspectral image coder/decoder UAVs that forward packets. The drawback of this scheme is
(codec) that takes a raw image as input and produces a overhead and latency. Similarly, power limitations condition
lossy compressed image as output. Lossy compression is long-range LPWAN links to be low rate.
a term used to describe the compression mechanism that The idea behind a hybrid network architecture is to rely on
removes non-essential information in order to lower its size. the high-latency WPAN for the transmission of hyperspectral
Lossy compression leads to noise due to the distortion intro- images and rely on the low-latency LPWAN for transmission
duced by the removal of such information. In general, codec- of sensor and flight control information. In general, due to the
based compression is a lot less computationally complex than nature of each network, different technologies are typically
the image classification performed by the application and used. Traditionally, WPAN technologies range from IEEE
therefore a lot more suitable for an embedded device like a 802.11 (Wi-Fi) to IEEE 802.15.4. Similarly, LPWAN tech-
UAV. nologies include a myriad of mechanisms like narrowband
The autonomy of the UAVs is such that it covers an area IoT (NB-IoT) and LoRa. Note that within the family of
divided into multiple subareas known as cells of size Acell . WPAN protocols, some technologies like IEEE 802.15.4,
Cells are scanned by UAVs by taking hyperspectral pictures when compared to others like IEEE 802.11, exhibit certain
of the different parts of the cell. The size of the area covered LPWAN features like lower rate and larger coverage. This is
by a single image is given by Aimage . The application, in particularly important in the context of this use case where
the context of this scenario, is called mission planner. The IEEE 802.15.4 and IEEE 802.11n, respectively, provide low-
planner resides at a ground station and calculates flight paths rate LPWAN and high-rate WPAN communications.
of UAVs to efficiently coordinate the mission by considering The planner extracts knowledge by means of image
environmental parameters like wind and weather conditions processing- and machine learning-based classification. Note
as well as terrain information and other inputs from the that these tasks cannot be performed at a UAV since the
UAVs. Moreover, the mission planner controls the movement required computational complexity is too high. Moreover,
of the UAVs and receives in return location information, because computational complexity is related to power
such as Global Positioning System (GPS) positions, and other consumption, even if computation were possible, the extra
sensory information from the UAVs. processing could lead to battery drain that would render the
Communication between the planner and the UAVs is solution impractical. Therefore, UAVs are only in charge of
through a hybrid network, shown in Fig. 1.8, that com- less intensive hyperspectral image compression.
bines a high-rate WPAN and a low-rate LPWAN. UAVs Each cell is scanned by one UAV using a mounted camera
are powered by batteries such that energy consumption is with resolution of Rpx × Rpy (pixel). The resolution results
a limiting factor that conditions high-rate WPAN links to from a trade-off between processing capabilities associated
exhibit short-distance coverage. Long-distance coverage is with lossy compression and transmission rates. In fact, de-
pending on the codec and the compression algorithm under
consideration, the compressed image results in a stream of
Mimage bits. Each image covers an area Aimage that includes
distance
height
FOV k=
width Because an IEEE 802.11n radio supports multiple spectral
height bands in addition to those supported by the IEEE 802.15.4
radio, interference can be greatly minimized. More details of
width
these and other technologies are presented in Chap. 3.
Fig. 1.9 Aspect ratio k vs FOV The brain of the UAV is a SoM that interacts with the
autopilot and enables both IEEE 802.11n and IEEE 802.15.4
connectivity. This SoM runs Ubuntu Core, a well-known
Linux distribution intended for IoT systems, that supports the
upper layer protocol stacks, including drivers and applica-
tions, for interaction with the planner. By keeping the weight
of the UAVs low, many advantages can be accomplished: (1)
battery consumption is reduced, (2) UAVs can fly higher,
(3) UAVs can fly longer, (4) UAVs can fly faster, and (5) in
case of malfunctioning, liability due to physical and personal
damage can be greatly minimized. Unfortunately, low-weight
systems are also computationally less complex and support
slower communications because of smaller batteries. Addi-
tionally, low-weight systems support fewer add-on modules
and are more likely to have UAV flight instability issues
due to the presence of the hyperspectral camera and the
external antennas. The hyperspectral camera is a fast 60 g
80 mm×97 mm×159 mm camera that captures 25,650×990
spectral bands that can be used, among other things, for land
vegetation detection.
Leaving IP connectivity and routing issues aside, dis-
cussed in detail in Chap. 4, we can focus on the mechanisms
Fig. 1.10 UAV winglet to transmit low-rate sensor and flight control information as
well as high-rate hyperspectral images [9]. Low-rate traffic
transmitted over IEEE 802.15.4 relies on the Constrained
where n = AAimage
cell
is the number of images scanned in each Application Protocol (CoAP) [21]. CoAP is a lightweight
cell. and highly efficient protocol that enables the management
The UAV is a winglet, illustrated in Fig. 1.10, that has a of IoT sessions. More importantly, CoAP supports Repre-
wingspan of 0.8 m and a weight of 1/2 kg including a hyper- sentational State Transfer (REST) transactions that optimize
spectral camera. A single electrical motor drives a propeller the interaction of the entities involved in the communication.
that enables the UAV to fly. A lithium polymer battery gives Figure 1.11 illustrates the flow of the CoAP transactions
the UAV an autonomy of half an hour. The average linear used for the transmission of sensor and flight control in-
speed is about 10 m/s, and the maximum altitude is around formation [10]. First, the planner transmits a CoAP GET
400 m high. Each UAV has an autopilot that provides, among request to observe the sensor readouts originated at the UAV.
other things, a GPS unit and pressure as well as inertial Observation is a feature associated with REST and adopted
sensors. The autopilot also gives UAVs automated takeoff by certain protocols like CoAP that enables an observed
and landing capabilities as well as mechanisms to navigate device to transmit readouts whenever parameter changes are
through a set of waypoints dynamically programmed by detected. Observation removes the need of an application
the planner. In this solution, the low-rate communication to be constantly polling a device. In that figure, dash lines
between UAVs and planner is by means of a IEEE 802.15.4 identify both the original GET request and the UAV CoAP
radio that enables a 250 Kbps peak transmission and a 1 km 2.05 Content updates that carry readouts from sensors. These
coverage. Although this low rate is good enough for transmis- updates are real-time processed and used, in turn, by the
sion of actuation and sensor traffic that includes control mes- application to send CoAP POST requests with lists of way-
sages and status information, it is not high enough to support points that define the flightpath. Solid lines identify each
compressed hyperspectral images. To that end, the UAV also POST request and its corresponding acknowledgment carried
has a multi-antenna Multiple Input-Multiple Output (MIMO) in an empty 2.05 Content message. More details of CoAP are
IEEE 802.11n radio that provides high throughput with a presented in Chap. 5.
12 1 Introduction
x
x x
capture delay
coding delay
data
start band
end band
1.4 Use Case: IoT Applied to UAVs 15
high low
α loss rate loss rate
1-p
1-α
relies on two states such that the channel is either in a low-loss Table 1.1 Effects of FEC in transmission of hyperspectral images
state or in a high-loss state. While in low-loss state packets PSNR (dB) MSSIM
may be dropped, the loss probability is lower than when the α p No FEC FEC No FEC FEC
channel is in the high-loss state. Transitions are given by two 0.01 0.01 42.91 45.28 0.90 0.94
main parameters: (1) p, the transition probability from low- 0.01 0.05 39.11 43.83 0.86 0.92
to high-loss states, and (2) α, the probability that the channel 0.01 0.10 35.74 41.71 0.79 0.89
stays in a high-loss state. The assumption is that all packets 0.05 0.01 40.39 44.16 0.86 0.92
are dropped when the channel is in a high packet loss state, 0.05 0.05 36.09 41.49 0.81 0.89
while no packets are lost if the channel is in a low packet loss 0.05 0.10 32.75 40.10 0.77 0.86
state. From this model, it is clear that the nature of the channel 0.10 0.01 37.17 41.07 0.83 0.88
is such that bursty packet loss is likely to occur because when 0.10 0.05 31.66 39.49 0.74 0.86
the channel is in a high-loss state, several packets may be 0.10 0.10 27.48 37.63 0.68 0.83
dropped before the channel transitions back to the low-loss 0.15 0.01 32.71 39.85 0.76 0.86
state. 0.15 0.05 25.11 37.12 0.69 0.82
One way to assess the efficiency of the solution, evaluating 0.15 0.10 21.05 33.52 0.64 0.79
its resilience against fading and other performance problems,
is to check the quality of the transmitted hyperspectral im-
ages. Although there are many algorithms that can be used Table 1.1 shows PSNR values as well as MSSIM scores for
to assess image quality, there are only a few that are effective transmission of hyperspectral images with and without FEC-
when considering the effects of network impairments. To this assisted RTP transport. These values incorporate the effects
end, the evaluation of data cube quality can be performed of lossy compression due to the mblpc codec configured to
by means of different technologies including peak signal-to- provide a compression rate of around 1 bits per pixel band
noise ratio (PSNR) and structural similarity (SSIM). These (bppb). The measured transmission rates are 1.608 Mbps and
mechanisms provide quality scores that can be used to un- 2.575 Mbps for RTP and FEC-assisted RTP, respectively.
derstand the degradation introduced by the encoding and Note that, as expected, there is high correlation between
packetization in a lossy environment. PSNR provides the PSNR values and MSSIM scores and that the best results
ratio between the energy of the hyperspectral and the energy are obtained when FEC is enabled. In this latter case, the
of the error between the image and its reference. SSIM is maximum PSNR and MSSIM improvements are 12 dB and
used to measure the similarity between images by means of 20%, respectively. As the bursty packet loss intensifies, when
comparing local patterns of pixels and considering the strong both α and p go up, the overall improvement becomes
interdependency of sections that are spatially close [23]. more significant. This can be better seen with a graphical
SSIM scores range from −1 to 1 where 1 is only achievable example; Fig. 1.18 shows PSNR as a function of the network
when a received image is identical to its reference. The SSIM loss for both low and high loss burstiness. It is important
scores that result from all spectral bands in an image are to mention that although this scheme relies on basic XOR
averaged to obtain a mean structural similarity (MSSIM) FEC, other more efficient alternatives like Reed-Solomon
score that represents the quality of a data cube. (RS) codes, turbo codes (TC), and low-density parity-check
(LDPC) codes can be used instead.
16 1 Introduction
40
PSNR(dB)
35
30
ing industry involve micro payments, logistics, product life- that natively support IPv6 with Protocol Stack Virtualization
cycle information, and shopping assistance. The automobile (PSV) techniques that enable the deployment of massive IoT
industry is also being affected by IoT through autonomous solutions.
cars and multi-modal transport that enables the coordination
for end-to-end delivery of goods. Another sector to consider
is agriculture where IoT applications include forestry, farm-
ing, livestock monitoring, and urban agriculture that enables Summary
small-scale farming in cities and other highly populated
zones [14]. IoT is driven by several scientific and technological break-
The environmental industry initially by means of WSNs throughs and developments that provide an evolution that
and now with IoT has improved applications intended to starts with traditional M2M and WSN schemes. This chapter
sense pollution and monitor air, water, soil, and weather. explored this evolution by introducing an overview of the
The infrastructure industry, on the other hand, relies on main concepts needed to understand IoT. It detailed the
IoT advancements to provide home and building automation convenience of the layered architecture as a model for de-
including access control as well as monitoring of roads and sign, development, and deployment of IoT communication
railroads. Similarly, public utility companies are also starting technologies. The chapter presented a quick overview of
to take advantage of IoT and enhancing their services by the main IoT components and how they lead to the two
means of smart grids; water, gas, as well as oil management; most popular IoT network topology families: WPANs and
and heating and cooling control and monitoring. The health LPWANs. These topologies are put in the context of a use
industry is another sector that has been heavily disrupted case that supports IoT communication with UAVs. Other
by IoT; this includes remote monitoring of health, assisted relevant IoT applications ranging from home automation to
living, behavioral change, treatment compliance, and fitness IIoT are also discussed.
applications. A whole new industry that is based on the
smart city concept has resulted from IoT; some areas of
interest are integrated environments, sustainability, and in-
clusive living. IoT has also resulted in improved industrial Homework Problems and Questions
processes with applications ranging from simple automation
and remote operations to resource management and robotics 1.1 In an M2M scenario, an application performs image
including manufacturing and control of heavy machinery. processing of a video stream captured by a camera and
This has led to IIoT that is a key factor in the context of the unlocks a door when the right person is identified:
Fourth Industrial Revolution also known as Industry 4.0 [2].
Other critical elements of the IoT evolution include the (a) Describe the different elements of the communication
integration of newer and more efficient LPWAN technologies system
18 1 Introduction
camera
application
door lock
(b) Indicate what components transform data into informa- 3. Geng, H.: Internet of Things and Data Analytics in the Cloud with
tion Innovation and Sustainability, pp. 1–28 (2017)
4. Geng, H.: Internet of Things and Smart Grid Standardization, pp.
(c) Indicate what components transform information into 495–512 (2017)
knowledge 5. Geng, H.: MEMS, pp. 147–166 (2017)
6. Geng, H.: Scada Fundamentals and Applications in the IoT, pp.
1.2 Based on addressing capabilities alone and ignoring 283–293 (2017)
7. Hassan, Q.F.: A Tutorial Introduction to IoT Design and Prototyp-
other NAT limitations, when comparing IPv6 to IPv4 with
ing with Examples, pp. 153–190 (2018)
NAT support, which one provides the largest address space? 8. Haykin, S.: Communication Systems, 5th edn. Wiley, New York
How much larger is it? (2009)
9. Herrero, R.: Real time transmission of hyperspectral images on-
board UAVs. In: 4th AETOS International Workshop on “Research
1.3 In the transformation example of Fig. 1.7, each tempera-
Challenges for Future RPAS/UAV Systems”
ture readout is a 1-byte number, and the extracted knowledge 10. Herrero, R.: MQTT-SN, CoAP, and RTP in wireless IoT real-time
can be encoded as a 1-bit number. What are the compression communications. Multimed. Sys. (2020). https://doi.org/10.1007/
rates for each transformation? The compression rate is given s00530-020-00674-5
11. Herrero, R., Cadirola, M.: Effect of FEC mechanisms in the per-
by the ratio between the uncompressed and compressed
formance of low bit rate codecs in lossy mobile environments. In:
values. Proceedings of the Conference on Principles, Systems and Appli-
cations of IP Telecommunications, IPTComm ’14. Association for
1.4 In Fig. 1.6, why is the WPAN gateway inside the IP Computing Machinery, New York (2014). https://doi.org/10.1145/
2670386.2670387
cloud, while the LPWAN one is not?
12. Herrero, R., Cadirola, M., Ingle, V.K.: Preprocessing and com-
pression of Hyperspectral images captured onboard UAVs. In:
1.5 What are the implications of combining OSI session, Carapezza, E.M., Datskos, P.G., Tsamis, C., Laycock, L., White,
presentation, and application layers into a single IETF ap- H.J. (eds.) Unmanned/Unattended Sensors and Sensor Networks
XI; and Advanced Free-Space Optical Communication Techniques
plication layer?
and Applications, vol. 9647, pp. 8–16. International Society for
Optics and Photonics, SPIE (2015). https://doi.org/10.1117/12.
1.6 What components are responsible for the data- 2186169
information and information-knowledge conversion stages 13. Hohlfeld, O., Geib, R., Hasslinger, G.: Packet loss in real-time
services: Markovian models generating QoE impairments. In: 2008
in the use case in Sect. 1.4? What type of conversion does
16th International Workshop on Quality of Service, pp. 239–248
each stage involve? (2008). https://doi.org/10.1109/IWQOS.2008.33
14. Holler, J., Tsiatsis, V., Mulligan, C., Avesand, S., Karnouskos, S.,
1.7 In Figs. 1.13 and 1.11, respectively, consider an average Boyle, D.: From Machine-to-Machine to the Internet of Things:
Introduction to a New Age of Intelligence, 1st edn. Academic, New
RTP image packet size of 1000 bytes transmitted every
York (2014)
12 ms and an average 2.05 Content packet size of 10 bytes 15. Kurose, J.F., Ross, K.W.: Computer Networking: A Top-Down
transmitted every 1 ms. Ignoring any additional overhead due Approach, 6th edn. Pearson, London (2012)
to lower layers, what channel capacity is minimally expected 16. Lucero, S., et al.: IoT platforms: enabling the internet of things.
White paper (2016)
for WPAN and LPWAN networks?
17. Palattella, M.R., Accettura, N., Vilajosana, X., Watteyne, T.,
Grieco, L.A., Boggia, G., Dohler, M.: Standardized protocol stack
for the internet of (important) things. IEEE Commun. Surv.
Tutorials 15(3), 1389–1406 (2013)
18. Ravi Kumar, K.S., Gottapu, J., Mandarapu, C., Rohit, M.S.,
References Murthy, T.V.N., Mavuri, M.: Introduction to M2M communication
in smart grid. In: 2015 International Conference on Control,
1. Al-Sarawi, S., Anbar, M., Alieyan, K., Alzubaidi, M.: Internet Instrumentation, Communication and Computational Technologies
of things (IoT) communication protocols: review. In: 2017 8th (ICCICCT), pp. 250–254 (2015)
International Conference on Information Technology (ICIT), pp. 19. Sethi, P., Sarangi, S.R.: Internet of things: architectures, protocols,
685–690 (2017) and applications. J. Electr. Comput. Eng. 2017, 9324035 (2017).
2. Conway, J.: The industrial internet of things: an evolution to a smart https://doi.org/10.1155/2017/9324035
manufacturing enterprise. White paper (2015)
References 19
20. Shelby, Z., Bormann, C.: 6LoWPAN: The Wireless Embedded 22. Siow, E., Tiropanis, T., Hall, W.: Analytics for the internet of things:
Internet. Wiley, Chichester (2010) a survey. ACM Comput. Surv. 51(4) (2018). https://doi.org/10.
21. Shelby, Z., Hartke, K., Bormann, C.: The Constrained Application 1145/3204947
Protocol (CoAP). RFC 7252 (2014). https://doi.org/10.17487/ 23. Wang, Z., Bovik, A.C., Sheikh, H.R., Simoncelli, E.P.: Image
RFC7252. https://rfc-editor.org/rfc/rfc7252.txt quality assessment: from error visibility to structural similarity.
Trans. Img. Proc. 13(4), 600–612 (2004). https://doi.org/10.1109/
TIP.2003.819861
Concepts of IoT Networking
2
router
host
source sink
host
host
source sink
source sink
(continued)
2.2 Types of Networks 23
network
.....
....
application
devices
assets
sensor 1 sensor 1
sensor 2 sensor 2
sensor 3 sensor 3
sensor 4 sensor 4
application application
(continued) (continued)
take for a packet to reach the gateway over the three = 20 ms, dB = 200×8 bits/64000 bps =
200×8 bits/240000 bps
different paths (dA , dB , and dC )? 25 ms, and dC = 2 × 200×8 bits/152000 bps = 21.05 ms.
Note that although path A traffic is retransmitted by
two intermediate nodes, it exhibits lower delay when
compared to paths B and C because of its higher
transmission rate.
gateway
Networks have been traditionally classified based on the
area they cover; as shown in Fig. 2.5, the three main types
sensor are local area networks (LANs), metropolitan area networks
(MANs), and wide-area networks (WANs). A LAN involves
an office, a lab, and a building, and it does not rely on
third-party communication infrastructure to provide high-
Solution The delay is given by the number of hops speed service. A WAN, on the other hand, involves a very
per path multiplied by the delay over a single link. large geographical region and therefore relies on third-party
Specifically the corresponding delays are dA = 3 × infrastructure to function. The throughput of a WAN is typ-
(continued) ically much lower than that of a LAN. The size of a MAN
falls somewhere in between that of a LAN and WAN. As a
24 2 Concepts of IoT Networking
LAN
LAN
`
LAN
WAN
gateway
border router transmission rates in order to extend battery life. As indicated
clusterhead in Sect. 1.3, a very big family of IoT solutions are based on
wireless PANs and therefore called WPANs. WPANs are one
of the most common network types in the context of IoT. With
a smaller coverage than PANs, body area networks (BANs)
are made of wearables and implants as well as other small
access devices that support fitness and health-care applications. As
LLN it is also indicated in Sect. 1.3, the other big family of
IoT networks falls under the WAN umbrella due to their
large coverage. Because these technologies are low power in
Fig. 2.6 IoT access network
order to extend battery life, they are called low-power WANs
or LPWANs. Note that although LPWANs are inherently
WAN, a MAN also relies on third-party communications but wireless, they are called LPWAN and not LPWWAN [3].
operates at higher speeds typically linking LANs and WANs. Both WPANs and LPWANs, by virtue of being wireless,
Larger than WANs, an Internet area network (IAN) connects rely on batteries. Moreover, in order to extend battery life,
endpoints within a cloud environment. power consumption must be minimized. Low power, unfor-
Under IoT, networking typically refers to the access net- tunately, implies weak signals and therefore low SNR that is
work where the devices are located. Figure 2.6 illustrates a responsible for high packet loss and low transmission rates.
generic IoT access network. In general, the overall topology Most IoT technologies, as shown in Fig. 2.6, fall under what it
is such that devices interact with an IoT gateway, border is called low-power and lossy networks (LLNs) or sometimes
router, or clusterhead that acts as the boundary between ac- called low-power, low-rate, and lossy networks (LLLNs) [2].
cess and core sides. The core network is usually a mainstream There are several PAN physical and link layer mechanisms
IP network that provides global connectivity to applications. that can co-exist in an IoT environment. They range from
These applications, in turn, many times reside in the cloud wireless technologies like IEEE 802.15.4 and Bluetooth Low
infrastructure. Energy (BLE) to wireline schemes like PLC and Master-
Recent developments of virtualization have led to the Slave/Token-Passing (MS/TP). More complete description
integration of WANs and software-defined networks (SDNs) of these and other technologies are presented in Chap. 3.
into software-defined WAN (SD-WANs) that provide reliable Since IoT PANs and WPANs involve devices communicating
long-distance WAN access at a reduced cost by relying on IP with each other or against gateways, they can be laid out
tunnels transmitted over the public Internet. in different topologies including buses, rings, and master-
All these network types can be deployed as wireless or slave schemes. In most cases, these technologies are part of
wireline topologies. For example, WWAN and WLAN, re- proprietary network stacks that do not rely on the Internet
spectively, indicate the wireless versions of WAN and LAN. for communications. The IoT revolution has brought into
Essentially, a “W” prefix indicates that the network type is existence several network layer protocols that can be used
wireless. Similarly, if no prefix “W” is included, it is assumed with these heterogeneous mechanisms to provide broad IPv6
to be a plain wireline-based network type. communication. Specifically, 6LoWPAN and other similar
2.3 Devices 25
mechanisms provide IPv6 connectivity on top of physical regardless of their complexity, include several I/O interfaces
and layer protocols like IEEE 802.15.4 to uniformly support that are accessible to system designers by means of pins on
IoT applications. Details of the IoT network layers including SoCs and SoMs. These interfaces provide basic communica-
6LoWPAN support are presented in Chap. 4. There are also tion between peripherals within a device by supporting point-
several LPWAN stacks that co-exist in several full and hybrid to-point and bus infrastructures [8]. The Serial Peripheral
IoT environments. They are mostly wireless technologies that Interface (SPI) enables very simple, fast serial communi-
include LoRa, SigFox, NB-IoT, and many more presented in cation between a master embedded processor and multiple
Chap. 8. slaves. Similarly, the Inter-Integrated Circuit (I2 C) interface
provides a more complex, but a bit slower, bus architec-
ture that supports multiple co-existent bidirectional master
2.3 Devices and slave peripheral. A universal asynchronous receiver-
transmitter (UART) interface supports a generic and reliable
IoT involves, by definition, interaction with the physical mechanism for the transmission of data over serial link. Both,
environment that is performed by means of logical devices RS-232 and RS-485, are well-known examples of UART
that can be controllers, actuators, sensors, and gateways [17]. serial interfaces that despite being old and slow are widely
These logical devices are supported by hardware provided used in the industry. As opposed to SPI and I2 C, UART-
by physical devices running on constrained embedded com- based serial interfaces are sometimes used by some IoT
puters and systems, first introduced in Sect. 1.3. They are technologies. For example, wireline MS/TP relies on RS-485
embedded because they are typically part of a bigger CPS. for its physical layer.
They are constrained because they have limited memory and Another serial interface that is widely supported by most
computational complexity. In general, these computers are embedded processors is known as Joint Test Action Group
characterized by a power source, a networking stack, and a (JTAG). JTAG, standardized as IEEE 1149.1, is used to per-
processor. form a boundary scan of an integrated circuit to enable circuit
The power sources can be traditional alternating current testing in situations where using electrical probes is virtually
(AC) and direct current (DC) electric power lines, batteries, impossible. It also enables the examination and control of the
or hybrid schemes that support energy harvesting by means state of an embedded processor. A newer mechanism is Serial
of, for example, solar panels [6]. In regard to the networking Wire Debug (SWD) that provides similar functionality with
stacks, and depending on the hardware and software capa- fewer pins.
bilities, there are different protocols associated with layers In the context of IoT devices, some embedded processors
and technologies as diverse as IEEE 802.15.4 and CoAP. As also include ADC and DAC interfaces for conversion of
stated before, the main goal of this book is to explore these signals from the analog to the digital and from the digi-
IoT communication technologies. tal to the analog domains, respectively. Last but not least,
The processors are in most cases low-power constrained most embedded processors include general-purpose input
embedded computers with limited computational complexity and output (GPIO) ports that can be used to read and write
and small instruction set architectures (ISAs). Because of the two-level digital signals for interaction with sensors and
IoT interaction with the physical environment, these devices actuators [14].
are particularly reliable when it comes to control over timing. In order to run complex software, complex hardware
Therefore, in many cases, embedded processing is a syn- is needed. Constrained 8-bit embedded processors are a
onym of real-time processing. The simplest devices rely on lot weaker candidates than 64-bit ARM processors to run
microprocessors with basic central processing units (CPUs) complex operating systems (OSs). Based on levels of com-
that combine several peripheral devices like memories, I/O plexity, OSs can be classified as main-loop, event-based,
interfaces, and timers. They are usually 8-bit processors that embedded, or full-featured. A main-loop OS consists of a
consume extremely small amounts of energy and rely on simple bootloader that executes a single threaded process
power cycles as well as sleep modes to minimize energy that continuously polls sensors and performs actuation in
consumption and extend battery life. These small embedded response. An event-based OS is a bit more sophisticated
devices are well known to operate on small batteries for and relies on hardware interrupts to report events to an
several years. application. An embedded OS, usually called real-time OS
More advanced devices rely on 32-bit and 64-bit ARM (RTOS), is lightweight but includes all basic building blocks
processors that comparatively consume more power but pro- of traditional OSs including threading, sockets, and con-
vide a lot higher computational complexity including, some- tention mechanisms that provide concurrency and real-time
times, support of digital signal processing (DSP) capabil- functionality [5]. Full-feature OSs, on the other hand, include
ities. Many not-too-complex embedded processors rely on all the components and modules that belong to commercial-
co-processors that offload complex functionality like signal grade OSs distributed into kernel and user space elements.
and network processing. In general, embedded processors, In many scenarios, highly constrained devices run as bare-
26 2 Concepts of IoT Networking
metal devices that do not rely on any OS support, and their IoT devices, and more specifically sensors, controllers,
firmware provides all functionality. and actuators, can be self-configured and self-organized. The
Based on hardware and software capabilities, devices can idea is that they can be deployed in a network such that once
be simple or complex. A simple device relies on a main-loop they are powered up, they can be automatically provisioned
or event-based OS running on a battery-powered constrained and configured to become functional right away. Devices,
embedded processor. Examples of simple devices are basic at this point, have all the information that enables them
sensors or actuators. Simple device communication is low to communicate with gateways and applications. Moreover,
rate and may or may not rely on IP networking. When a sim- certain devices can also self-propel and support mobility that
ple device does not natively include an IP interface, Internet allows them to deploy themselves in unaccessible remote
connectivity is provided by means of an IoT gateway. Specif- areas while preserving connectivity. In general, a highly
ically, many simple devices talk to a gateway that converts desired property of IoT devices is reliability such that they
non-IP into IP traffic. LPWANs are quintessential examples can operate for years without any human interaction.
of this scenario. A complex device, on the other hand, relies
on an RTOS or on a full-featured OS with fully compliant
IP stacks. These stacks provide PAN, LAN, and WAN access 2.3.1 Sensors
that provide direct communication to the Internet. Complex
devices, such as gateways and stand-alone sensors, rely on Sensors are logical devices that sense or measure an asset
external power lines that enable higher transmission rates. of the physical environment. Examples of assets include
Keep in mind that the topic of software/hardware interac- not only physical parameters like temperature, humidity,
tion and capabilities of embedded devices in the context of and light intensity but also other measurable quantities like
IoT is quite complex and it falls outside the scope of this inventory and population sizes. The sensors in each case
book. retrieve temperature, relative humidity, and light intensity as
values measured in Centigrade degrees, percentage, and Lux,
RTOSs RTOSs give devices capabilities that are not respectively [24]. Sensors can be classified in accordance to
typically available in bare-metal environments. Specif- their size; they can be nanoscopic in the order of 1–100 nm,
ically, they provide very efficient task concurrency, mesoscopic between 100 and 10,000 nm, microscopic in
communication, and scheduling. RTOSs are typically the range between 10 and 1000 µm, and macroscopic when
as limited as the devices they run on. A list of some of above 1 mm. Moreover, depending on size and logistics, sen-
the most popular ones is shown below. sors are sometimes deployed as an array of devices specially
in the context of WSNs.
Depending on the complexity of the embedded proces-
Contiki BSD-licensed open-source, lightweight OS.
sor, a sensor may perform some local processing in order
Implemented in C and ported to Atmel AVR, MSP430,
and ARM M processors. to remove redundancy in a controlled way. An example
Very low memory requirements (order of kilobytes). of this removal is source encoding where sensor readouts
Open Open-source OS created by UC Berkeley. are digitized and compressed. Compression can be lossless
WSN Implemented in C. or lossy depending upon whether the original samples can
TinyOS BSD-licensed open-source OS. be recovered or not. Specifically, through source encoding,
It runs on devices with 16 KB of memory. data is converted into information that can be transmitted at
Applications are written in nesC a version of C that lower rates reducing the channel bandwidth requirements and
optimizes resources. improving power consumption. This data-information con-
RIOT LGPLv2-licensed open-source OS. version is part of the transformation shown in Fig. 1.7 [21].
Implemented in C and C++. If more complex computational capabilities are available,
Minimum memory requirement of 1.5 KB. more efficient processing can be done at the sensor. In spe-
Zephyr Apache 2.0-licensed open-source OS. cial cases, this additional processing is performed under the
Implemented in C and ported to ARM M, x86, and umbrella of an information-knowledge conversion executed
RISC-V 32 processors.
at the sensor. Examples of these more complex technologies
High-end support includes POSIX APIs.
include machine learning classification as well as numerical
FreeRTOS MIT-licensed open-source OS.
predictions by means of linear regression and other statistical
Implemented in C and ported to 35 microcontrollers and
processors. mechanisms.
Full kernel support. In general, a sensor is active if it is required to emit sounds
MBed Apache 2.0-licensed open-source OS. or generate electromagnetic waves that can be detected by
Implemented in C and C++. Ported to ARM M proces- means of external observation. A sensor that is not active is
sors. passive. For example, temperature and humidity sensors as
2.3 Devices 27
well as cameras are examples of passive sensors since it is 2.3.2 Actuators and Controllers
impossible to tell whether they are sensing by just looking
at them. On the other hand, radio detection and ranging Actuators are logical devices that perform some external
(radar), sound navigation and ranging (sonar), and light change of an asset of the physical environment. An example
detection and ranging (lidar) are examples of active sensors of actuation is the activation of a fan to lower the temperature
as they emit electromagnetic waves or they generate sounds of a room. In this case, the actuator is the fan, and the asset is
that can be easily detected by observing them. Because they the temperature. Another example of actuation is the servos
generate energy, active sensors consume a lot more power, that can be used to change the flight path of a UAV. Similarly,
and, therefore, they cannot rely on batteries to function. In the servos are the actuators, and the flight path is the asset.
opposition, passive sensors are more likely to rely on batteries Actuation is typically tied to sensing through feedback mech-
and perform external energy harvesting by means of, for anisms where decision-making takes sensor and actuation
example, solar panels. data as input and output parameters, respectively. Because
Battery life can be extended by means of power duty of this, if a given physical device has a logical actuator, it
cycles where devices sleep by dramatically reducing power is quite likely that a logical sensor is also present [21]. The
consumption at preprogrammed intervals. Specifically, while opposite, that is, the presence of an actuator given a sensor is
a device sleeps, it minimizes power consumption by only present, is a lot less common.
enabling basic functionality including a wake-up interrupt or Same way sensors are associated with source encoding
notification. In order to minimize network throughput and and DACs, actuators are associated with source decoding
preserve the power consumption of all devices to extend and ADCs. Actuators, however, are a lot simpler as they
the network lifetime, it is preferable that duty cycles are do not rely on data-information and information-knowledge
coordinated throughout the network [6]. This is particularly conversions. Usually the knowledge from the application
important when considering capillary networks that rely on results in a command being sent down to the actuator. As with
multi-hop communication where intermediate sensors act sensors, actuators are affected by loss and latency that results
as routers. If a sensor does not know whether transitional in different QoS levels.
devices are sleeping at any given time, it may waste energy to Controllers are logical devices that perform some internal
transmit data to an inactive router that is not able to propagate change in the physical device to assist sensing or actuation
packets to destination. [22]. This involves, for example, having a camera zoom in
From a networking perspective, depending on the use of and out, replacing optical filters, or having a transmitter turn
the sensor readouts, transmission reliability is important. If antennas around. For most cases, controllers are deployed
sensor readouts are to be used to make real-time decisions along with sensors and actuators as logical devices on the
like to change the flight path of a UAV, latency and packet same physical device. When assisting sensing, control is
loss must be as low as possible. On the other hand, if those affected by the same application QoS requirements that are
readouts are to be used to perform offline data visualization, needed by the sensor.
latency and packet loss requirements are a lot less restrictive.
In general, application-specific quality of service QoS goals
lead to different application latency and packet loss levels that 2.3.3 Gateways
tell how reliable sensor data transmission must be. The trade-
off, shown in Fig. 2.7, between QoS and reliability has power Gateways are logical devices that serve as an interface be-
consumption and, therefore, battery life implications. tween access side IoT devices and core side applications.
Access side IoT devices are the sensors, actuator, and con-
trollers, while the core side applications rely on analytics to
make real-time decisions. When compared to other devices,
QoS
L L1 L2
cations. Of course, this is contingent on device computational
complexity and battery life. Many times, gateways are critical P P1 P2
in providing communication between devices, as they route
all traffic up and down the network. This is especially true
when the gateway acts as clusterheads that forward back and
forth all packets in the access side. Solution The delay associated with gateway 1 is given
In most IoT scenarios, gateways are known to provide by dgw1 = 3 × 5 ms + 2 × 30 ms = 75 ms.
interfaces between WPANs and LPWANs on the access side Similarly, the delay associated with gateway 2 is given
and mainstream WANs on the core side. In a more generic by dgw1 = 5 × 30 ms = 150 ms. Clearly a hybrid IoT
definition, gateways translate messages at different levels of scenario where IP is only supported on the core side of
the layered architecture [18]. They can (1) convert physical the network requires gateways converting full stacks.
and link layer frames, for example, when forwarding them Of course, this introduces processing delays that are a
between wireline Ethernet and wireless IEEE 802.15.4; they lot larger than those of IoT scenarios that support end-
can (2) convert network layer datagrams, for example, when to-end IP connectivity.
forwarding them between IPv4 and 6LoWPAN/IPv6 layers;
they can (3) convert transport layer segments, for example,
when forwarding them between Transport Control Protocol
(TCP) and UDP layers; and they can (4) convert application 2.4 Security
layer messages, for example, when forwarding them between
Hypertext Transfer Protocol (HTTP) [1] and CoAP layers. The security challenges in IoT networks are multiple [12,19];
Table 2.1 compares gateways against the other devices re- (1) it is very important to minimize resource consumption,
garding computational complexity, networking capabilities, (2) it is critical to prevent link attacks ranging from passive
and hardware form factors. eavesdropping to active interfering, and (3) wireless com-
munication mechanisms associated with IoT networks render
Example 2.2 Consider the two gateways below: traditional security mechanisms many times unsuitable.
gateway 1 (associated with a IoT scenario) only Security requirements are also important; (1) confiden-
converts transport protocol 1 (T1) to transport tiality implies that information must be encrypted to make
protocol 2 (T2) and application protocol 1 (A1) sure that it is inaccessible to unauthorized users, (2) au-
to application protocol 2 (A2), while gateway 2 thentication dictates that only trusted sources can transmit
(associated with a hybrid IoT scenario), respectively, data, (3) integrity means that the received messages are not
converts physical protocol 1 (P1), link layer protocol 1 altered in transit, (4) freshness guarantees that traffic does not
(L1), network protocol 1 (N1), transport protocol (T1), include replayed datagrams, (5) availability ensures connec-
and application protocol 1 (A1) to physical protocol tivity even when subjected to hostile attacks, (6) resilience
2 (P2), link layer protocol 2 (L2), network protocol provides consistent security levels even when devices are
2 (N2), transport protocol 2 (T2), and application compromised, (7) resistance prevents intruders from getting
protocol 2 (A2). Assuming that basic processing delay full control of the network, and (8) energy efficiency implies
(i.e. address lookup) takes around 5 ms and more that the network security must minimize power consumption.
complex protocol conversion processing delay takes Attacks and threats against both user and data in IoT net-
around 30 ms, how long does it take for a protocol 1 works are typically very destructive as IoT access networks
packet to be processed by both gateways? are usually wireless and easily accessible. In this context,
there are several threats that can be analyzed from the layered
architecture perspective. The assumption is that an intruder is
(continued) fully capable of carrying out an attack at any time but during
2.5 Wireless Sensor Networks 29
deployment. IoT is special because it is highly susceptible datagram loss, (2) selective forwarding where an affected
to physical attacks where devices are destroyed or relocated. device only forwards certain datagrams in order to cause
Because of these attacks, one or multiple devices can be connectivity problems, (3) sinkhole attack where an affected
put out of commission causing irreversible losses. During a device attempts to become the destination of all traffic in a
physical attack, it is possible to extract keys and modify the certain location (this requires the device to broadcast low-
behavior of the device by uploading a new firmware. cost routes to neighbors beforehand), (4) Sybil attack where a
In IoT networks, denial-of-service (DoS) attacks are per- single device assumes multiple identities in order to become a
formed at different layers. Physical layer DoS attacks consist destination of many other nodes in the network, (5) wormhole
of an intruder generating interference that lowers the over- attack where the attacker captures datagrams in one location
all SNR of the modulated waves. Link layer DoS attacks and retransmits them in another leading to routing and con-
are associated with forcing devices to deplete their energy. nectivity problems, and (6) neighbor discovery attack where
Specifically, attackers induce device media collisions that neighbor discovery messages typically used in the context of
cause devices to retransmit frames that, in turn, reduce their WPANs are either dropped or corrupted in order to induce
battery life. In addition, frames with fake addresses in dif- reachability issues.
ferent WPANs can cause a device to transmit bogus replies
that also drain its battery. This is further aggravated when a
device relies on power duty cycles. In this case, the attacker 2.5 Wireless Sensor Networks
attempts to keep the device busy in a scenario known as sleep
deprivation torture. When the device that is being attacked WSNs have been briefly mentioned in previous sections, but
is an IoT gateway, the results can be devastating as routing because of their historical importance, it is very important to
throughout the network is usually affected. Network layer talk about them in the context of IoT [20]. WSN is an old
DoS attacks are associated with an intruder flooding the net- legacy term that designates a system of a very large number
work with many datagrams that fill queues and cause network of wireless sensors that interact with an application that mon-
performance degradation as well as throughput reduction. itors events and other phenomena occurring in the physical
Replay protection is a mechanism that many networks put in environment. Specifically, as indicated in Sect. 2.3.1, sensors
place to make sure that attackers do not resend old datagrams measure assets like temperature and humidity and transmit
in order to cause intentional congestion. To support this, these values to applications that perform data visualization
datagrams include incrementing sequence numbers that are and, in more advanced cases, knowledge extraction. Like IoT
used by devices to keep track of the age of the datagrams. networks, WSNs rely on control for sensors to work effi-
Devices drop stale datagrams that have sequence numbers ciently. For example, if a sensor is a camera taking pictures,
that are lower than those of previously received datagrams. control by means of the camera zooming in and out leads to
Unfortunately, this protection can be used to cause a type better sensing.
of DoS attack called replay protection attack. Essentially, an When, in addition to sensing and control, actuation is also
attacker sends bogus datagrams with high sequence numbers performed by the devices, the network becomes a wireless
in order to prevent valid datagrams from being processed by sensor and actuation network (WSAN). In many cases, the
a destination device [7]. term WS(A)N is used to designate a generic form of a
In certain IoT protocols, for the sake of simplicity, ac- WSN where actuation may or may not be also present. In
knowledgment messages associated with reliable transmis- general, WSANs are associated with decision-making, either
sions are not protected by security. Attackers can take advan- automated or manual by means of human intervention, that
tage of this situation by falsely acknowledging a transmitted rely on actuators to complete the feedback path. Note that, in
message while producing enough interference for the original most cases, sensing is always present regardless of whether
message to be dropped. The idea is to make the source believe actuation is in place or not. In general, if a network supports
that a message has been received even if it has not. In many actuation, it is almost certain that it also supports sensing; the
IoT scenarios, cryptographic keys are periodically negotiated opposite is not always true.
in order to make sure that confidentiality is preserved as time WS(A)Ns are predecessors of modern IoT networks
progresses. This is typically triggered by the IoT gateway in and, as such, incorporate all their basic components
response to an unencrypted device request. An attacker can shown in Fig. 2.8. Clearly there are (1) assets, (2)
take advantage of this situation by pretending to be a valid sensors/actuators/controllers, (3) a communication network,
device and forcing key renegotiation that leaves the device (4) gateway(s), and (5) a central processor that serves as
in-communicated. application [23]. There are differences in some of these
Other network layer attacks include (1) routing informa- components though. WS(A)Ns do not typically follow
tion spoofing where the intruder spoofs, alters, or replays standards, like IP-based protocols, so communications are
routing information in order to create loops that lead to based on proprietary legacy mechanisms that prevent data
30 2 Concepts of IoT Networking
sensor
sensor
sensor
gateway
sensor
clusterhead
sensor
assets sensor sensor
actuator actuator
gateway
gateway
actuator clusterhead
actuator clusterhead
controller
channel
sharing and use of information in a wide sense. Sensors and between transmitters and receivers, it is possible to improve
actuators are wireless and only interact with gateways that the overall network energy efficiency.
collect packets and aggregate, transform, and forward them In the context of WS(A)Ns, the central processor does
to the central processor. not necessarily make real-time decisions, and in many cases,
Moreover, WS(A)N architectures, as illustrated in especially in WSN scenarios, information is stored for offline
Fig. 2.8, are pyramidal with multiple devices communicating processing and visualization. This is particularly true for
to multiple gateways that talk to a single application. traditional WSNs that were built when analytics mechanisms
Communication is therefore M2P and relies on clusters like machine learning and data mining were not as developed
of devices that connect to other clusters by means of as they are today.
gateways that in turn communicate with other gateways Limited battery life at devices leads to a trade-off between
in order to access the central processor. In many cases, computational complexity and transmission power. If more
the gateway functionality is carried out by sensors and processing is performed at a sensor or actuator, more energy
actuators that behave as clusterheads. In fact, and in order to is needed to execute more complex algorithms. Similarly, if
preserve battery life, devices typically take turns in becoming more traffic is to be generated by a device, more energy is
clusterheads as gateway communication requirements needed for a higher transmission rate [11]. Fortunately, more
typically impose power consumption conditions that can lead processing results in fewer packets being transmitted and
to energy depletion. WS(A)Ns can also define mechanisms therefore lower transmission rate requirements. Figure 2.9
that reduce the overall battery consumption by allowing shows this trade-off; essentially, battery life is presented as
sensors to forward packets to other intermediate sensors a function of both processing and transmission rate. Specif-
that, in turn, retransmit these packets to reach the central ically, battery life decreases as both processing and trans-
processor. Since power consumption is exponentially mission rate increase, but more processing implies a lower
affected by signal coverage, by minimizing the distance transmission rate, and a higher transmission rate implies less
2.5 Wireless Sensor Networks 31
BATTERY LIFE
OPTIMAL OPERATIONAL POINT
HIGH
MEDIUM
LOW PROCESSING
LOW MEDIUM HIGH
TRANSMISSION RATE
HIGH MEDIUM LOW
processing. When considering their accumulated effect, the “sleep” in order to guarantee that sensor readouts are always
optimum operational point that maximizes battery life results transmitted uplink. Again, this depends on overall network
from a trade-off between transmission rate and processing. coordination including traffic routing protocols. Summariz-
In general, maximizing the battery life of a device leads to ing, in the context of WSNs, battery life preservation is usu-
finding an operational point that determines computational ally the result of several interrelated trade-off mechanisms:
requirements and protocol stacks. (1) low transmission rates at a cost of higher processing,
Most WSN applications produce traffic that is lightweight (2) power duty cycles to minimize device processing, (3)
in nature since it involves the transmission of packets con- multi-hop routing to lower transmission power, and (4) low
taining simple commands and events. This relates to both computational complexity at a cost of higher transmission
communication and processing requirements. On the other rates [20].
hand, some WSN applications rely on sensors that capture WSNs are classified depending on their size and more im-
video by means of cameras. Video, as opposed to traditional portantly on whether they support multi-hop communication.
sensor readouts, is highly demanding from transmission rate Specifically, category 1 WSNs are those that include a very
and computational complexity perspectives. Video codec se- large and highly dense deployment of devices. Transmission
lection at the device enables a WSN application to decide the is multi-hop with communication from devices to gateways
operational point that represents the best trade-off between relying on intermediate sensors and actuators forwarding and
those two parameters. For example, transmitting raw uncom- aggregating packets. Under category 1 structures, multiple
pressed video minimizes processing but maximizes through- devices talk to other devices that forward traffic to gateways
put, while video compression by means of the state-of-the-art that, in turn, talk to other gateways that end up communi-
International Telecommunication Union Telecommunication cating with a single gateway that provides communication to
Standardization Sector (ITU-T) H.265 codec maximizes pro- the central processor. On the other hand, category 2 WSNs
cessing but minimizes throughput. Other less efficient codecs are simpler, with fewer devices directly connected to a sin-
can be selected to find the best trade-off for a given WSN gle gateway that communicates with the central processor.
scenario. The penalty to pay for the extended coverage provided by
When comparing IoT networks to traditional WS(A)Ns, category 1 WSNs is lower transmission rates and higher
one major difference is that the latter consist of networks latency when compared to category 2 WSNs. Figure 2.10
with many sensors (and actuators) highly densely deployed. shows examples of both category 1 and 2 WSNs. In many
Specifically, because these devices are wireless and battery- solutions, category 1 and 2 WSNs overlap in order to provide
powered, duty cycles are used to preserve battery life. In fact, different functionalities. As such, each network type relies on
most sensors affected by power duty cycles are installed in different physical and link layer technologies. Leaving other
clusters where highly redundant sensors take turns to go to differences aside, the low- and high-throughput networks
32 2 Concepts of IoT Networking
sensor (clusterhead)
gateway
application
category 1 category 2
presented in the IoT UAV example in Sect. 1.4 can be thought of authentication, association, registration, and session
of as category 1 and 2 WSNs, respectively. establishment. Additionally, and depending on the WSN,
Because of the limitations associated with WSNs, devices asset tracking enables asset detection and classification.
may not have global identification and be only accessible Also, part of group management, dynamic device allocation
through gateways that act as proxies between sensors and presents procedures to provision, unprovision, and query
processors. Moreover, by virtue of being wireless, devices sensors.
can also move leading to dynamic topology changes trig- Some factors that are relevant to WSNs are (1) network
gered by internal and external position changes. Internal coverage that indicates the topological coverage of a given
mobility is caused by self-powered changes of the device WSN, (2) detectability that provides the probability that a
position by means of control. External mobility results from given WSN is able to detect a specific asset or physical
an application or an operator changing the position of the phenomenon, (3) node coverage that presents the level of
device. device redundancy available to capture data if a sensor failure
Mobile ad hoc networks (MANETs) are a well-known occurs, (4) node assessment that introduces provisioning
type of wireless networks that, from a traffic perspective, capabilities to add additional sensors and actuators to accom-
are similar in nature to WSNs. MANETs are representative plish redundancy goals whenever needed, and (5) control ca-
of Wi-Fi (standardized by IEEE 802.11 and described in pability that enables orientation and mobility sensor changes
Sect. 3.3.1) networks configured in ad hoc mode as presented that maximize coverage.
in Sect. 3.3.1. In MANETs, however, packets flow between Most WSN devices perform in-network processing that
a few endpoints point-to-point (P2P) as opposed to WSNs relies on several techniques: (1) data aggregation where
where transmission is mostly M2P from a large number of readouts from different sensors are collected by a sensor
devices to a central processor [25]. WSNs are wireless but closer to the gateway or clusterhead, (2) data fusion where
not always mobile, while MANETs are mobile. Moreover, redundancy from readouts of different sensors is removed
traffic of WSNs can be highly redundant as it originates from by another sensor, (3) data analysis where a single sensor
close-by sensors that describe the same physical phenomena. converts data into information though signal processing and
This redundancy, when coordinated, can be exploited to lightweight machine learning techniques, and (4) grid and
increase the device battery life through the introduction of hierarchical computing where data analysis is performed
power cycles. In addition, as opposed to WSNs, MANETS by those sensors that have the best context information to
are not deployed for long periods of time without human do it. Central processors complement in-network process-
intervention and almost always do not run on batteries. The ing by taking the pre-preprocessed information and con-
many differences between MANETs and WSNs make that verting it to useful knowledge as mentioned in previous
routing protocols that would normally work in one case do paragraphs.
not work in the other. Like IoT, under WSN, controller side data management
Due to the sheer size of WSNs, both network organization is critical. The main aspects of data management include
and device tracking are very important. Because traditional database management that can be used to set, query, and
WSNs do not rely on standardized mechanisms, technologies store device configuration and provisioning parameters
to accomplish these goals include proprietary group as well as sensor readouts and actuation information. In
management that provides device self-organization by means some scenarios, high availability is provided by distributing
References 33
databases over multiple entities including several controllers 2.2 For the use case in Sect. 1.4:
and devices supporting in-network processing. Data in
WSN is multidimensional for both storage and retrieval, (a) what mechanism plays the role of controller (if any)?
and therefore efficient spatial and temporal searching is (b) what mechanism plays the role of IoT gateway (if any)?
mandatory. (c) what element is the asset?
When designing WSNs, it is important to consider hard-
ware and power constraints that limit physical layer param- 2.3 In Fig. 2.9, the trade-off between embedded processing
eters like transmission rate. Moreover, deploying a WSN and transmission rate is shown. How can the figure be modi-
requires understanding of network topologies and how to deal fied to consider throughput instead of transmission rate?
with fault tolerance, mobility, and scalability. As previously
mentioned, WSNs are typically self-configuring systems that 2.4 From a power consumption perspective, what are the
must be able to deal with unpredictable states and situations. differences between passive and active sensors?
Other less flexible scenarios that rely on static or semi-
static topologies are pre-configured and do not support self- 2.5 The end-to-end delay of a communication system is
configuration. defined as (N − 1 + P ) RL where N and P are the number of
Desired characteristics of WSNs are low network and links and transmitted packets, respectively, L is the average
computational latency, power efficiency, and low transmis- packet size, and R is the transmission rate. What is the extra
sion rates that enable efficient use of the wireless channel. latency due to transforming a high-power single-hop access
The idea is to minimize the amount of traffic generated by IoT network into a low-power four-hop one? Assume that in
each device in order to create enough room for all sensors both scenarios the packet size and the transmission rate is the
to share the medium. In-network processing is a good mech- same.
anism to accomplish this goal at a cost of increased energy
consumption that results from the trade-off between compu- 2.6 What are some of the drawbacks of replay protection?
tational complexity and transmission power [20]. Traditional How do they relate to power consumption?
WSNs due to their proprietary nature have not been very
efficient at addressing these issues. Standardization by means 2.7 The efficiency of a communication system η is given by
of IoT protocols and technologies give WSNs a new way to η = CR where R is the transmission rate and C is the channel
overcome these limitations. capacity. In an IoT M2P scenario, the access interface of
a gateway has an 85% efficiency. What is the efficiency
of the core interface if the access and core side channel
Summary capacities are 250 Kbps and 1 Gbps, respectively? What are
the implications of these results?
Most IoT communication solutions are deployed as a combi-
nation of access and core networks where devices interact 2.8 In a WSN scenario, several sensors are to be used to
with applications that extract knowledge in order to make transmit readouts of an asset that is 20 km away. If the
smart decisions. This chapter started by delving into concepts coverage of each sensor is 500 m, what category of WSN is
associated with different IoT networking topologies to then the best deployment option? Why?
focus on the multiple elements of connectivity including
security aspects. This led to presenting the roles supported by
actuators, sensors, controllers, and gateways in the context References
of IoT networks. The chapter also investigated the main
1. Belshe, M., Peon, R., Thomson, M.: Hypertext Transfer Protocol
differences between modern IoT scenarios and traditional Version 2 (HTTP/2). RFC 7540 (2015). https://doi.org/10.17487/
WSNs. RFC7540. https://rfc-editor.org/rfc/rfc7540.txt
2. Bormann, C., Ersue, M., Keranen, A.: Terminology for
Constrained-Node Networks. RFC 7228 (2014). https://rfc-
editor.org/rfc/rfc7228.txt
Homework Problems and Questions 3. Chew, D.: Protocols of the Wireless Internet of Things, pp. 21–45
(2019)
4. Cover, T.M., Thomas, J.A.: Elements of Information Theory (Wiley
2.1 Draw the topology of a capillary network with four Series in Telecommunications and Signal Processing). Wiley-
sensors, three actuators, and a simple gateway that provides Interscience, New York (2006)
connectivity to the Internet. Assume that only one of the 5. Elk, K.: Embedded Software for the IoT: The Basics, Best Practices
sensors and two of the actuators support routing capabilities. and Technologies, 2nd edn. CreateSpace Independent Publishing
Platform, North Charleston, SC (2017)
34 2 Concepts of IoT Networking
6. Geng, H.: Internet of Things and Smart Grid Standardization, pp. 16. Robertazzi, T., Shi, L.: Networking and Computation: Technology,
495–512 (2017) Modeling and Performance (2020)
7. Geng, H.: Security of IoT Data, pp. 399–406 (2017) 17. Sehrawat, D., Gill, N.S.: Smart sensors: analysis of different types
8. Hassan, Q.F.: A Tutorial Introduction to IoT Design and Prototyp- of IoT sensors. In: 2019 3rd International Conference on Trends in
ing with Examples, pp. 153–190 (2018) Electronics and Informatics (ICOEI), pp. 523–528 (2019)
9. Haykin, S.: Communication Systems, 5th edn. Wiley, New York 18. Sethi, P., Sarangi, S.R.: Internet of things: architectures, protocols,
(2009) and applications. J. Electr. Comput. Eng. 2017, 9324035 (2017).
10. Holler, J., Tsiatsis, V., Mulligan, C., Avesand, S., Karnouskos, S., https://doi.org/10.1155/2017/9324035
Boyle, D.: From Machine-to-Machine to the Internet of Things: 19. Shrobe, H., Shrier, D.L., Pentland, A.: Data Security and Privacy
Introduction to a New Age of Intelligence, 1st edn. Academic, New in the Age of IoT, Chap 13, pp. 379–401 (2018)
York (2014) 20. Sohraby, K., Minoli, D., Znati, T.: Wireless Sensor Networks:
11. Huang, Y.M., Hsieh, M.Y., Sandnes, F.E.: Wireless Sensor Net- Technology, Protocols, and Applications. Wiley, New York (2007)
works and Applications, pp. 199–219. Springer, Berlin (2008) 21. Stanley, M., Lee, J., Spanias, A.: Sensor Analysis for the Internet
12. Jurcut, A.D., Ranaweera, P., Xu, L.: Introduction to IoT Security, of Things (2018)
pp. 27–64 (2020) 22. Xia, F., Kong, X., Xu, Z.: Cyber-physical control over wireless
13. Kurose, J.F., Ross, K.W.: Computer Networking: A Top-Down sensor and actuator networks with packet loss (2010)
Approach, 6th edn. Pearson, London (2012) 23. Yang, S.H.: Wireless Sensor Networks: Principles, Design and
14. Lee, E.A., Seshia, S.A.: Introduction to Embedded Systems: A Applications. Springer Publishing Company, Incorporated (2013)
Cyber-Physical Systems Approach, 2nd edn. The MIT Press, 24. Yasuura, H.: Introduction, pp. 1–6. Springer International Publish-
Cambridge (2016) ing, Cham (2017)
15. Popovski, P.: Information-Theoretic View on Wireless Channel 25. Zheng, J., Jamalipour, A.: Wireless Sensor Networks: A Net-
Capacity, pp. 201–234 (2020) working Perspective. Wiley/IEEE Press, Hoboken/Piscataway
(2009)
Part II
IoT Protocol Layers
This part of this book, that includes three chapters, explores the different communication
layers of standard IoT solutions. Chapter 3 introduces the physical and link layers of wireless
and wireline IoT technologies. The chapter analyzes them from a perspective of their most
important characteristics like transmission rate and power efficiency. Chapter 4 explores
the network and transport layers including adaptation mechanisms that enable IoT physical
and link layer protocols to support IPv6. Chapter 5 deals with the application layers by
describing the most relevant methods for session management and the transmission of device
and application-generated media and data.
Physical and Link Layers
3
LLC
FRAMING
adds controlled redundancy in the form of additional bits
in the frames sent from the transmitter to the receiver, the
RELIABLE DELIVERY transmission rate is slightly increased. On the receiver, the
MAC
channel decoder removes the controlled redundancy and
LINK ACCESS restores the error controlled source frame. To accommodate
the transmission rate increase, the modulation scheme is
Fig. 3.1 Link layer typically modified to increase either the bandwidth or the
number of bits per symbol. Because channel bandwidth is a
limiting factor and a modulated wave with higher bandwidth
transmission power at the transmitter. If transmission power cannot be always used, changing the modulation scheme is
increases, then transmission rate also increases, while BER usually the most common option. When block codes are
lowers as SNR gets larger. used for error control, a payload is partitioned into chunks
Unfortunately, in the context of a wireless scheme, in- of data called messages, and each message, when controlled
creasing transmission power leads to depleting batteries a redundancy is added, becomes a codeword. A block code is
lot faster. Essentially, in order to extend battery life, power identified by the tuple (n, k) that, as indicated in Fig. 3.3,
consumption must be minimized. This idea is illustrated in implies that out of n bits, k bits are message bits and n−k are
Fig. 3.2. For fixed channel bandwidth and noise, long battery controlled redundancy bits. Note that n is the block length,
life leads to low power consumption that translates into low while k is the message length [17]. For every k message
SNR at the receiver. Low SNR, in turn, implies both low bits entering the block channel encoder, n code bits are
channel capacity and high BER. Low channel capacity limits generated leading to a code rate r = nk with 0 ≤ r ≤ 1.
the transmission rate, and high BER causes high packet loss. An alternative to block codes are convolutional codes that
High packet loss and low transmission rates are represen- operate on continuous streams of bits instead of on blocks of
tative of LLNs discussed in Sect. 2.2. Note that packet loss bits.
can be minimized by means of reliable delivery and channel Transmission in wireline scenarios is performed by means
coding techniques that enable the retransmission of missing of line codes [16]. Line coding is used to modulate digital
and corrupted packets at a cost of a larger transmission bits of a link layer frame into an electrical signal that can
rate. Again, this is not always possible as channel capacity be transmitted over the channel. Different mechanisms exist
typically limits transmission rates. to fulfill this objective, but they all attempt to accomplish
Low transmission rates associated with LLNs greatly af- two goals that affect the transmitted signal; (1) minimize its
fect how MAC works. Since the MAC sublayer must guaran- DC component, and (2) maximize its transitions. Minimizing
tee fair access to the channel, a single user cannot transmit the DC component increases the propagation range of a
for too long as it prevents the other users from accessing signal and the distance between repeaters. On the other hand,
the media. In this case, transmitting traffic as short bursts maximizing signal transitions enables the receiver to better
at low transmission rates translates into limiting the frame synchronize with the transmitter.
size to a maximum allowable size known as the maximum Figure 3.4 shows the modulation of the codeword 101010
transmission unit (MTU) size. by means of Unipolar Nonreturn-to-Zero (NZR) where bit
The physical layer is responsible for processing the link 1 is modulated by transmitting a square pulse of positive
layer frame by subjecting it to both transmission and propa- amplitude for the duration of the bit Tb , while bit 0 is
gation. It is propagation that defines the characteristic of the modulated by not transmitting any signal during that period.
transmission, and it is the channel that defines the character- Because the DC component of any waveform modulated
istics of the propagation. As indicated in Chap. 1, depending by this mechanism is always positive, NZR is not a good
on the channel characteristics, the physical layer can support option for modulation over wireline channels. Also, if an all
guided propagation or free propagation. Guided propaga- ones or an all zeros sequence is transmitted, the resulting
tion occurs in man-made guiding channels like waveguides, modulated wave exhibits no transitions, and therefore no
coaxial cables, twisted pair cables, and optical fibers that synchronization information can be extracted.
are examples of traditional wireline communications. On the Figure 3.5 shows the modulation of the codeword 101010
other hand, free propagation occurs between corresponding by means of Polar NZR where bits 1’ and 0 are respectively
antennas in the Earth’s atmosphere and underwater. Free represented by transmitting a positive or negative square
propagation is, of course, the basis of wireless broadcasting. pulse for the duration of the bit Tb . Unless the incoming
sequence has an even distribution of zeros and ones, the
3.1 About Physical and Link Layers… 39
LOW SNR
... ...
1 0 1 0 1 0
Tb t
Tb t
1 0 1 0 1 0
t for half the duration of the bit Tb , and bit “0” is modulated
by not transmitting any signal during that period. Because
the DC component of any waveform modulated by this
mechanism is always positive, it is not a good alternative for
modulation over wireline channels. However, as opposed to
Fig. 3.5 Polar NRZ
unipolar NRZ, clock information can be extracted if an all-
one sequence is received.
Figure 3.7 shows the modulation of the codeword 101010
modulated wave exhibits a positive DC component, and no by means of Bipolar RZ, also known as Alternate Mark
synchronization information can be extracted deeming this Inversion (AMI). Under this scheme bit 1 is modulated by
modulation impractical in most wireline channels. transmitting a square pulse of alternate positive and negative
Figure 3.6 shows the modulation of the codeword 101010 amplitudes for half the duration of the bit Tb , while bit 0 is
by means of Unipolar Return-to-Zero (RZ). Bit “1” is mod- modulated by not transmitting any signal during that period.
ulated by transmitting a square pulse of positive amplitude The DC component of a bipolar RZ modulated wave is al-
40 3 Physical and Link Layers
data
1 0 1 0 1 0 1 0 1 0 1 0
1 1 0 0 1 1 0
Tb Tb t
10 01 11 01 11 00
1 0 0 0 1 0
0 after 0
Ts
0 after 1
t
t 1
Tb
digits QPSK
1 0 1 1 1
00
01
0 11
000 100
001 101
010 110
011 111
as rate-distortion, higher transmission rates correspond to to each of them. For example, in a simplified scenario with
higher distortion. two carriers (K = 2), one carrier can modulate QPSK and
another 64-QAM such that the overall transmission rate is
Example 3.1 If a wireless sensor relies on a 8-PSK given by the aggregate of the rates over each subchannel,
modulation scheme and the symbol duration is namely, R = 2+6 T
= T8 bps.
T = 25 µs, what are the symbol (Rs ) and transmission Another popular mechanism that enables the modulation
(Rb ) rates? of binary streams in wireless scenarios is spread spectrum
(SS) [26]. Let’s assume a 101 bit sequence is to be transmit-
ted, that sequence can be represented as a signal b(t) with
Solution Symbol rate is Rs = T1 = 40,000 symbols amplitudes 1 and −1 representing binary ones and zeros,
per second. Transmission rate is Rb = log2 (8) × Rs = respectively. If each bit is transmitted every Tb seconds, it
120 Kbps. is possible to find another signal c(t) with period Tb that
represents a pseudo-random sequence, known as code, that
includes a number of binary digits, known as chips, transmit-
All passband modulations presented so far rely on a single ted every Tc seconds.
carrier acting at any time. It is natural to think that this
scheme can be expanded to simultaneously rely on multiple
Example 3.2 An OFDM scheme consists of 16 QPSK
carriers each one using a particular modulation. The idea is to
subchannels with symbol duration T = 3.2 µs, what
divide the available channel bandwidth W into a number of
is the transmission rate (Rb ) ?
subchannels of equal bandwidth f such that, as illustrated
in Fig. 3.18, around K = W/f subchannels are avail-
able for modulation. When the carrier waves are orthogonal,
Solution Symbol rate is Rs = T1 = 312,500 symbols
that is T per second. Transmission rate is Rb = 16 × log2 (4) ×
Si (t)Sj (t)dt = 0 (1) Rs = 10 Mbps.
0
where Sn is one M of the symbols associated with the
modulation, T is the symbol length and i = j , and the Figure 3.19 shows both b(t) and c(t), where c(t) is rep-
scheme is called Orthogonal Frequency Division Multi- resented by the pseudo-random 15-chip 100011110101100
plexing (OFDM). Orthogonality improves resilience against code. Of course, in this case, the code length is therefore 15
packet loss caused by channel noise and multipath phe- chips.
nomenon. If T = 1/f , where f is the frequency differ- Under direct-sequence SS (DSSS), the sequence to be
ence between symbol sinusoidal waves, the carrier waves transmitted b(t) is multiplied by the code c(t) to produce
are orthogonal for any possible value of the carrier phase. the spread spectrum signal m(t) shown in Fig. 3.20. When
Because orthogonality restricts the period of each symbol, the destination endpoint receives m(t), it can recover b(t) by
it also imposes a new limitation of the transmission rate in multiplying it by code c(t) because m(t) × c(t) = b(t) ×
each subchannel. In general, depending on SNR subchannel c(t) × c(t) = b(t) since c(t)2 = 1. The requirement is for
characteristics, different modulation schemes can be applied both, transmitter and receiver, to use the same code signal
3.1 About Physical and Link Layers… 43
Δf
b(t)
+1
...
-1 TIME
Tb
c(t)
+1
...
-1 TIME
Tc N TC
b(t)
+1
...
-1 TIME
Tb
m(t)
+1
...
-1 TIME
Tc N TC
c(t). In general, the longer the code, the more the resilience tation of m(t) exhibits a bandwidth that is much larger than
against channel noise and interference. Because each code that of b(t), thus the name spread spectrum. Under DSSS the
identifies each communication path, multiple streams can ratio between the symbol width and the chip width is known
share the same wireless channel. By relying on pulses, m(t) as the spreading factor (or processing gain) SF = TTbc . In
is a line code that cannot be wirelessly transmitted. To general, the higher the spreading factor, the more resilience
provide wireless support, a DSSS signal is modulated by, for against channel noise and interference.
example, BPSK. Another type of spread spectrum is called Frequency
Figure 3.21 shows the m(t) and the corresponding Hopping SS (FHSS) that relies on sequentially spreading the
DSSS/BPSK modulated signal x(t). The spectrum represen- message signal spectrum. Based on the code generated from a
44 3 Physical and Link Layers
Tb = N T c
m(t)
+1
...
-1 TIME
x(t)
...
TIME
TS
BAND 111
BAND 110
BAND 101
BAND 100
WC
BAND 011
BAND 010
BAND 001
BAND 000
TIME
INPUT BINARY 01 10 00 11 01 10 10 00 11 00 10 01
pseudo-random or pseudo-noise (PN) sequence, FHSS relies indicates how fast a different subband is used. Depending
on translating the narrowband modulating wave across differ- on how fast frequency hopping is carried out, there are two
ent predefined subbands associated with carrier locations in possibilities; if in a specific subband multiple symbols are
the frequency domain. The binary stream is first modulated transmitted, that is, R > Rh , the modulation is called slow
by means of M-FSK and then transmitted through carrier FHSS, and, otherwise, if a single symbol is transmitted over
modulation in a specific frequency subband determined by multiple subbands, that is, R ≤ Rh , the modulation is called
the pseudo-random code. Because M-FSK is involved, this fast FHSS.
type of modulation is also known as FHSS/MFSK. Note Figure 3.22 shows tones generated when the binary se-
that under FHSS, the spreading factor is given by the ratio quence 0110001101101000 11001001 is modulated with
between spread signal and the narrowband transmitted wave slow FHSS. Specifically, k = 3 bits from a pseudo-random
(i.e. SF = W Ws
c
). code 000011110010001100 are taken to generate up to 2k =
It is possible to define to two rates, the symbol rate R = 8 possible carrier frequencies associated with eight subbands.
Rb
n
= nT1 b where n = log2 M and the hopping rate Rh that Within each subband, n = 2 bits of the input binary sequence
3.2 Wireline 45
FREQUENCY
modulation example
TH TS
BAND 111
BAND 110
BAND 101
BAND 100
WC
BAND 011
BAND 010
BAND 001
BAND 000
TIME
INPUT BINARY DATA 01 10 00 11
7 1 6 6 2 N1 N2 4
an upper layer IPv6 datagram. For IEEE 802.3 compatible by means of the Subnetwork Access Protocol (SNAP), also
frames that do not include an ethertype, upper layer generated shown in Fig. 3.25, that supports the identification of upper
payloads are signaled through an additional LLC layer that is layer datagrams by means of an organization identifier and
placed as Ethernet data. For all cases, the frames must be long an ethertype field.
enough to comply with collision detection requirements. If Ethernet as other wireline physical layer technologies
frames are not long enough, padding bits are typically added. relies on full duplex communications where devices and ap-
The very last field of an Ethernet frame is the frame checksum plications can simultaneously transmit and listen for frames.
(FCS) that through a 32-bit cyclical redundancy checking This fact leads to Carrier Sense Multiple Access with Colli-
(CRC) block code provides basic channel encoding. sion Detection (CSMA/CD) that is a generic mechanism for
IEEE 802.2, the LLC protocol that is transported on MAC under Ethernet.
top of standard IEEE 802.3, provides both unreliable The medium is shared so a device transmits frames if the
connectionless and reliable connection-oriented delivery channel is idle. If it is busy, a device continues to listen until
of frames. Connectionless delivery, in addition, supports the channel is idle, at this point it transmits immediately. If a
optional acknowledgments. Figure 3.25 shows the Service collision is detected during transmission, the device transmits
Access Point (SAP) header that includes a Destination a brief jamming signal to assure that all stations know that
Service Access Point (DSAP), a Source Service Access there has been a collision, so they can cease transmitting. The
Point (SSAP), and a control field. Both DSAP and jamming signal is a 32-bit to a 48-bit pattern of alternating
SSAP identify the source and destination addresses of ones and zeros. After transmitting the jamming signal, the
the upper layer protocols multiplexed under IEEE 802.2. device waits for a random amount of time, known as expo-
The control field signals mode selection as well as the nential backoff, and then it attempts to transmit the frame
messaging mechanism to provide connection-oriented and again. Essentially retransmissions are delayed by an amount
connectionless communications. IEEE 802.2 can be extended of time derived from a fixed interval of time that depends
3.2 Wireline 47
end of last
CFS HPCW NPCW
transmission NO RESPONSE
CIFS CIFS contention state
bands are available. As for any PLC technology, and because in Sect. 3.3.3, they rely on 6LoWPAN adaptation to support
of the inherently low EMI, devices can transmit in frequency IPv6.
bands that relying on relatively small guardbands exhibit
little disturbance. Depending on the transmission rate and
3.2.4 MS/TP
reliability, the number of subchannels varies.
In a typical example, the 500 KHz band provides
The Master-Slave/Token-Passing (MS/TP) protocol relies on
an OFDM scheme over 72 subchannels. Supported per
a RS-485 physical layer that enables devices to relay and
subchannel modulations are DPSK, DQPSK, D8-PSK,
exchange information. In addition, MS/TP and RS-485 are,
BPSK, QPSK, 8-PSK, and 16-QAM. Typical transmission
respectively, the link and physical layers of the BACNet
rates are around 500 Kbps. IEEE 1901.2 relies on adaptive
protocol stack [23]. MS/TP is a peer-to-peer, master/slave
tone mapping (ATM) that dynamically selects the usable
protocol that supports multiple masters. The mechanism is
tones and the optimum modulation and coding schemes that
based on a token passing scheme.
ensure reliable communication over the wireline channel.
3.2.4.1 Physical Layer
3.2.3.2 Link Layer
RS-485 enables communications in inexpensive LANs with
Two types of frames are supported: (1) data frames and (2)
multidrop links relying on differential signaling over twisted
ACK/NACK frames. Figure 3.31 shows the frame structure
pairs. Differential signaling consists of transmitting data by
where each frame starts with a (1) preamble used for syn-
means of two complementary electrical signals that, when
chronization and detection as well as to signal automatic
subtracted at the receiver, minimize noise. Figure 3.32 illus-
gain control (AGC). The preamble is followed by a FCH that
trates an example of differential signaling when one bit is
specifies the number of symbols depending on the number of
transmitted over two separate lines. The transmitter generates
carriers used by the OFDM scheme. This header also contains
two pulses of different polarity that are affected by the
information regarding modulation and the length of the cur-
same channel noise. On the receiver, the noisy pulses are
rent frame in symbols. The FCH also includes a FCS field that
subtracted, and the noise is canceled out resulting in a single
is used for error detection. The size of the FCS depends on the
large output pulse.
frequency band being utilized. From a topology perspective,
As shown in Fig. 3.33, MS/TP follows a bus topology
IEEE 1901.2 networks are typically deployed following a
with devices deployed in a daisy chain configuration where
full mesh structure. Because IEEE 1901.2 frames follow a
each device is connected point-to-point to one or two peers
similar structure to that of IEEE 802.15.4 frames presented
depending on its location in the network. Connectivity is
1 TX - detector 1
50 3 Physical and Link Layers
3.3 Wireless
FT frame type
DA destination address
SA source address
HCS header checksum
DCS data checksum
P padding
3.3 Wireless 51
Table 3.1 Radio-frequency spectrum the power limitations that result from the need of extended
Transmission type Frequency Wavelenth battery life. Similarly, media access contention is aggravated
Very low frequency (VLF) 9–30 kHz 33–10 km by the fact that collisions can be avoided but not detected
Low frequency (LF) 30–300 kHz 10–1 km because devices either transmit or receive frames at any given
Medium frequency (MF) 300–3000 kHz 1000–100 m time but cannot do both things at the same time.
High frequency (HF) 3–30 MHz 100–10 m Media access is also affected by two situations indicated
Very high frequency (VHF) 30–300 MHz 10–1 m in Fig. 3.35: (1) the hidden station problem that results from
Ultra high frequency (UHF) 300–3000 MHz 1000–100 mm stations A and C transmitting simultaneously to station B
Super high frequency (SHF) 3–30 GHz 100–10 mm and not detecting each other since they are out of range and
Extremely high frequency (EHF) 30–300 GHz 10–1 mm (2) the exposed station problem that results from station C
transmitting to station D and preventing station B to transmit
Table 3.2 Radio-frequency spectrum to station A. In general terms, the hidden station problem
RF band Wireless network specifica-
leads to excessive bit errors and therefore packet loss. The
tion exposed station problem leads to excessive latency that, in
915/868 MHz ISM IEEE 802.15.11ah, IEEE turn, becomes packet loss from an application perspective.
802.15.4, ITU-T G.9959, Essentially, packets that arrive too late are not useful and can,
BLE, LoRa, SigFox therefore, be considered lost by the application. Again, this
2.4 GHz ISM IEEE 802.11ax, IEEE depends on the nature of the application and QoS goals.
802.15.4, BLE, LoRa
This section introduces several wireless physical and link
5.8 GHz IEEE 802.11ac, IEEE
802.11ax layer technologies that are selected based on their native
support of IPv6. This support is either direct or by means of
an adaptation mechanism. This means that some well-known
do not impose power duty cycle limits that lower transmis- stacks like ANT+ are not included in this section because they
sion rates. do not have standard support of IPv6 adaptation.
Table 3.2 shows the some wireless IoT technologies as-
sociated with the ISM bands. The table shows both WPAN
and LPWAN technologies discussed in this chapter and in 3.3.1 IEEE 802.11
Chap. 8. In general, regulatory authorities in countries and
regions control the use of the spectrum by means of frequency Wireless Fidelity (Wi-Fi), also known as IEEE 802.11, is
band allocation for both licensed and unlicensed services an umbrella term for a number of technologies that are the
including the maximum allowable transmission power levels. wireless equivalent of Ethernet in the IoT world [8]. It
These legislation differences make very difficult the full includes many standard protocols that support a wide range
standardization of frequency band allocation and maximum of transmission rates and exhibit different levels of power
power levels by ITU and other standardization bodies. More- consumption. A few of these protocols are optimized for
over, they introduce hardware and software design interoper- IoT scenarios and have power efficiency as main goal. The
ability issues that affect deployment and maintenance costs. IEEE 802.11 standard provides a physical and link layer
The use of unlicensed bands under ISM implies that anyone mechanism for transmission in WLANs and, especially when
can freely use them if transmission power is low enough to considering IoT, WPANs.
minimize interference. However, if too many devices use the IEEE 802.11 networks rely on three main elements: (1)
same unlicensed band, it can eventually become unusable. stations that play the role of IoT access devices, (2) access
This is the case of the 2.4 GHz ISM band that is overcrowded points (APs) that play the role of IoT gateways interfacing
with device communications ranging from cordless phones between access and core networks, and the (3) distribution
to IoT sensors. system that provides the backbone for connectivity to appli-
Wireless, when compared to wireline communication, is cations performing analytics. Stations are grouped in what is
affected by three well-known problems: (1) data link reliabil- known as the Basic Service Set (BSS). APs, as most IoT gate-
ity issues due to the fading caused by multipath phenomena ways, include multiple communication stacks; IEEE 802.11
that results on bit errors that lead, in turn, to packet loss, to interact with the access side and some other technology,
(2) media access issues due to the contention of multiple like Ethernet, to interact with the core side. When considering
devices attempting to simultaneously transmit data over the both access and core networks, the whole infrastructure is
same wireless channel, and (3) security due to the fact that known as the Extended Service Set (ESS).
wireless transmissions by virtue of being open are more With IEEE 802.11, a BSS responds to a WLANs or
likely to be intercepted than those in a wireline scenario. WPANs that is under the control of a single AP. The AP, in
In the case of IoT, reliability is further degraded because of turn, enables communications by devices that use a common
52 3 Physical and Link Layers
STATION BRANGE
STATION C RANGE
STATION D RANGE
STATION A RANGE
STATION B RANGE
STATION CRANGE
STATION A STATION B STATION C STATION D
X EXPOSED STATION
access core
IP
3.3.1.1 Physical Layer that results from aggregating all the code bits from the
The initial standardization of IEEE 802.11 presented two al- individual subchannels. The table also presents the FEC
ternative physical layer mechanisms: FHSS and DSSS oper- code rate that leads to the number of data bits per symbol.
ating in the ISM 2.4 GHz band. The standard also introduced The number of data bits per symbol, in turn, is used to obtain
an infrared (IR) communication mechanism that was never the actual transmission rate. For example, the fifth row in
fully implemented. Depending on negotiated parameters the the table is 16-QAM which includes 4 bits per subchannel
nominal transmission rate for this basic IEEE 802.11 support and, at 48 subchannels per symbol, leads to 192 code bits per
is either 1 or 2 Mbps. Later amendments to the standard led by symbol. With a 1/2 code rate, this translates to 192×1
2
= 96
power and modulation scheme changes improve transmission data bits per symbol that sent every 4 µs corresponds to a
rates, energy consumption, and signal range. Chronologically 96
4×10−6
= 24 Mbps transmission rate.
speaking, these amendments are IEEE 802.11a and IEEE IEEE 802.11b was released around the same time as IEEE
802.11b in 1999, IEEE 802.11g in 2003, IEEE 802.11n in 802.11a, but it was designed to operate on the mainstream
2009, IEEE 802.11ac in 2013, and IEEE 802.11ax in 2016. and more crowded ISM 2.4 GHz band. This improves signal
IEEE 802.11ad released in 2012 and IEEE 802.11aj released penetration at a cost of increased interference. For the same
in 2018 introduce support of unlicensed bands in the 45– power consumption and due to its lower penetration, IEEE
70 GHz spectral range available in certain countries. These 802.11a typically requires a larger number of APs to support
two standards enable very high transmission rates in the the same area coverage. IEEE 802.11b divides the ISM
Gbps range. From the IoT perspective (1) IEEE 802.11p was 2.4 GHz band into several overlapping 22 MHz channels.
introduced in 2010 to support Wireless Access in Vehicular Depending on the world region, the total number of channels
Environment (WAVE), (2) IEEE 802.11af in 2014 to provide is anywhere between 11 and 14. IEEE 802.11b supports up
low transmission rates by sending data over digital television to 31 20-µs timeslots.
guardbands, (3) IEEE 802.11ah for generic IoT support in IEEE 802.11b extends traditional IEEE 802.11 by intro-
2016, and (4) IEEE 802.11ba for power efficient, by means ducing additional DSSS based transmission rates. Table 3.4
of an aggressive Wake-up Radio (WUR) duty cycle, narrow illustrates the different modulation schemes that are used
band (NB) IoT access in 2020. under IEEE 802.11b. Note that the first two rows of the table
Many of the amendments to IEEE 802.11 evolve from present the two original IEEE 802.11 modulation schemes.
the original IEEE 802.11a standard. IEEE 802.11a relies on Through 11-chip codes that are used to generate symbols
OFDM operating in the ISM 5 GHz band and providing non- at a rate of 106 symbols per second and relying on BPSK
overlapping 20 MHz channels for modulation. Depending on and QPSK modulations, the maximum nominal transmission
different country regulations the number of channels and rates are 1 and 2 Mbps, respectively. Higher transmission
the maximum EIRP requirements may change. In many rates are obtained by changing the modulation method to a
scenarios upper channels are reserved for outdoor use and differential scheme that relies on D-QPSK and D8-PSK to
therefore increase the EIRP limit. Each of these 20 MHz accomplish 5.5 and 11 Mbps rates, respectively. Note that
channels support 52 OFDM subchannels with carriers sep- in this case, the code length is shorter at 8 chips, while the
arated every 312.5 KHz. Out of the 52 OFDM subchannels, symbol rate is slightly higher at 1.375 × 106 symbols per
48 are used for data transmission, while the remaining four second.
provide frequency and phase signal reference. IEEE 802.11a IEEE 802.11a and IEEE 802.11b rates are dynamically
allows a maximum of 15 9-µs backoff timeslots. selected by means of dynamic rate shifting (DRS). This
Table 3.3 shows the OFDM subchannel modulation mechanism allows the transmission rate to be selected in
schemes used under IEEE 802.11a to support maximum order to compensate for multipath fading and other types of
nominal transmission rates between 6 and 54 Mbps. The interference. If a link is not reliable, devices select lower
table includes the total number of code bits per symbol transmission rates until the communication path is stable.
54 3 Physical and Link Layers
Whenever possible if interference reduction is detected, a physical device over multiple non-overlapping subchannels.
higher transmission rate is selected. This reduction is done Packet bursting improves throughput but introduces addi-
automatically at the physical layer and is transparent to tional network latency as frames are buffered before being
higher layers. transmitted. It also prevents other devices from transmitting
IEEE 802.11g uses the same OFDM modulation scheme as a source station accesses the channel for a compara-
as IEEE 802.11a but operates on the ISM 2.4 GHz band and tively longer amount of time. Similarly, channel bonding
supports transmissions rates between 6 and 54 Mbps. In addi- also improves throughput by increasing the transmission rate
tion, and to provide backward compatibility since they both without affecting latency. The drawback of channel bond-
operate on this band, IEEE 802.11g radios also support IEEE ing, however, is more expensive and complex hardware. In
802.11b transmission modes at a cost of lower throughput. opposition, packet bursting can be purely implemented in
Specifically, IEEE 802.11b devices can associate with IEEE software.
802.11g APs through a number of protection mechanisms MIMO is a technique that consists of using multiple
that enable interoperation; a device sends a Request to Send outgoing and incoming antennas that, exploiting spatial di-
(RTS) control frame to the AP and, in turn, the AP issues versity, lead to extra gain that can be used to defeat chan-
a Clear to Send (CTS) response to grant transmission. This nel noise. MIMO mechanisms increase transmission rates.
interaction minimizes the collisions between IEEE 802.11b With spatial diversity the same signal travels over different
and IEEE 802.11g transmission attempts but increases la- paths and thus is more likely to overcome wireless channel
tency thus lowering throughput. IEEE 802.11b devices can fading. MIMO is not the same as channel bonding, since
also transmit without the RTS/CTS frame exchange and just unlike channel bonding, MIMO achieves higher data rates
relying on the channel state to guarantee that it is clear before without increasing the number of subchannels used. IEEE
transmission. This is particularly useful in BSSs with very 802.11n introduces maximum nominal transmission rates
few devices since it can lead to lower latency and higher of 600 Mbps by combining OFDM with MIMO. Moreover,
throughput. IEEE 802.11g backoff slot parameters follow IEEE 802.11n extends channel bandwidths by combining
those of IEEE 802.11a unless when it is operating under up to two 20 MHz channels in the ISM 2.4 GHz and ISM
mixed mode where an IEEE 802.11g AP interacts with IEEE 5 GHz bands. IEEE 802.11n uses complex synchronization
802.11b devices. In this latter case, IEEE 802.11g backoff mechanisms that attempt to guarantee the highest throughput
slot parameters are those of IEEE 802.11b, and the overall by dynamically adapting channel selection, antenna configu-
network throughput is lowered. ration, modulation schemes, and code rates.
IEEE 802.11g introduces two mechanisms to improve Table 3.5 indicates the modulation schemes used by IEEE
throughput: (1) packet bursting that consists in buffering a 802.11n to accomplish the highest transmission rates. For
number frames before transmitting them all together in order example, the last row in the table is 64-QAM which includes
to lower average channel contention delay and (2) channel 6 bits per subchannel and, at 432 subchannels per symbol,
bonding that consists of transmitting frames of the same leads to 2592 code bits per symbol. With a 5/6 code rate,
this translates to 2592×5
6
= 2160 data bits per symbol that
3.3 Wireless 55
Table 3.8 shows the modulation schemes used by IEEE Table 3.9 shows the modulation schemes used by IEEE
802.11af to accomplish the highest transmission rates. For 802.11ah to accomplish the lowest transmission rates. For
example, the last row in the table is 256-QAM which includes example, the last row in the table is 256-QAM which includes
8 bits per subchannel and, at 2128 subchannels per symbol, 8 bits per subchannel and, at 24 subchannels per symbol,
leads to 17,024 code bits per symbol. With a 5/6 code rate, this leads to 192 code bits per symbol. With a 5/6 code rate, this
translates to 17,024×5
6
= 14,168 data bits per symbol that sent translates to 192×5
6
= 160 data bits per symbol that sent every
every 24.75 µs corresponds to a 24.75×1014,168
−6 = 569.6 Mbps
40 µs corresponds to a 40×10
160
−6 = 4 Mbps transmission rate.
transmission rate.
IEEE 802.11ah, also known as Wi-Fi HaLow, is a Wi- 3.3.1.2 Link Layer
Fi standard intended exclusively for IoT use. As most other IEEE 802.11 devices cannot detect collisions between their
IEEE 802.11 deployments, IEEE 802.11ah networks are own transmissions and those of other devices because under
deployed as stars with the AP acting as IoT gateway. As wireless communications it is not possible to simultaneously
opposed to conventional IEEE 802.11 standards, however, transmit and receive frames. This results in a scenario where
IEEE 802.11ah operates on the ISM 915/868 MHz band collisions can only be avoided. Because avoiding collisions
with 1, 2, 4, 8, and 16 MHz channels. As IEEE 802.11af, takes longer than detecting them, latency is inherently higher
IEEE 802.11ah reuses the MIMO OFDM modulation scheme in wireless systems than in wireline ones.
introduced by IEEE 802.11ac by changing symbol interspace
and length to accomplish a wide range of transmission rates Example 3.4 Consider a sensor that transmits 200-
depending on power consumption. Also, as opposed to con- byte packets every 20 ms. What is the communication
ventional IEEE 802.11 standards, IEEE 802.11ah supports system efficiency for both non-IoT IEEE 802.11ax
a comparatively large number of devices in a single BSS in and IoT IEEE 802.11ah scenarios? Assume the lowest
order to enable LPWAN support. IEEE 802.11ah provides a possible transmission rates for both technologies.
typical range of 100 m–1 km for direct connectivity that is
supported by means of very low energy consumption that
relies on power saving strategies. (continued)
3.3 Wireless 57
SIFS
mapped to three access priorities: high that supports a spacing
device A busy time
like that of DIFS, medium, and low. Figure 3.40 shows the
different AIFSs as well as SIFS and DIFS spacings.
Figure 3.41 shows a regular IEEE 802.11 frame that
device B busy PIFS time encapsulates a network layer datagram. Each frame consists
of a MAC header, payload data, and a frame checksum. The
backoff frame control is a 2-byte field that indicates whether it is a
DIFS
control, a data, or a management frame. Control frames, like
device C busy time
the CTS and RTS frames, are used to facilitate the exchange
high priority access of data frames between devices. Management frames are
backoff used for maintenance of the communication between devices
device D busy AIFS[2] time and APs. Data frames are used to carry real application and
medium priority access session traffic. The frame control field also indicates the
backoff encryption mechanism; Wired Equivalent Privacy (WEP),
busy AIFS[3] Wi-Fi Protected Access (WPA), or Wi-Fi Protected Access
device E time
II (WPA2). This field, in addition, provides fragmentation
high priority access as well as retransmission information. The duration id field
Fig. 3.40 SIFS
has multiple uses; when included in data frames, it indicates
the amount of air time the sending radio is reserving for
the pending acknowledgment frame, while when included in
default, there are no other MAC priorities and no way to management frames, it is used to indicate the AP association
guarantee a specific QoS level. In general, given the nominal id. The addresses 1 and 2 are the receiver and sender MAC
transmission rate of each of the standards that fall under addresses, respectively. The addresses 3 and 4 are used for
the IEEE 802.11 umbrella, the actual transmission rates are mesh routing and to provide connectivity between APs in an
much lower due to the latency introduced by CSMA/CA ESS. The sequence control field identifies the frame where
contention. The less severe the contention is, the closer to the first 4 bits specify the fragmentation number, while the
the nominal transmission rate the actual transmission rate last 12 bits indicate the sequence number itself. Data frames
becomes. are typically encapsulated following the IEEE 802.2 standard
Devices that need predictability and guaranteed QoS can described in Sect. 3.2.1.
rely on PCF. The device that serves as point coordinator Once a device activates its IEEE 802.11 interface, it scans
accesses the medium through an interframe spacing known for other devices that are within range and ready for associ-
as PCF IFS (PIFS) that lies somewhere in between the SIFS ation. Scanning can be either passive or active. Under pas-
and DIFS spacings. Once the coordinator has control, it tells sive scanning, devices sequentially listen for beacon frames
all other devices the duration of the contention free period. transmitted by other devices over IEEE 802.11 channels.
This enables these devices to access the medium, avoiding These beacon frames provide relevant information related
collisions, in a controlled fashion. Specifically, the point to synchronization and modulation as well as other physical
coordinator sequentially polls stations to check and verify layer parameters. Under active scanning, a device can send
whether they have frames to transmit. The PCF functionality, a probe frame indicating the SSID of the BSS it wants to be
although part of the original IEEE 802.11 specifications, is associated with. When the AP receives the probe, it replies
typically implemented as part of enhancements introduced with a probe response. Alternatively, active scanning can also
by IEEE 802.11e. IEEE 802.11e provides an extension to the involve a device sending a broadcast probe to all available
basic DCF called Enhanced DCF (EDCF) that relies on an devices. APs reply with response probes that are used by the
Arbitrary Interframe Spacing (AIFS). Essentially, AIFSs are devices to construct lists.
3.3 Wireless 59
MAC header
FC frame control field
DID duraon id
SC sequence control field
FCS frame checksum
CTAP
4 5
3 4
P2P star
Fig. 3.47 Cluster networks CLUSTER 2
CLUSTER HEAD
CLUSTER 1
DEVICE
CLUSTER 3
low transmission power. CSS is a particular type of spread extended into a mesh topology that supports up to 64,000
spectrum that does not rely, as opposed to traditional DSSS devices. In this situation efficient routing is many times
and FHSS, on a pseudo-random sequence derived from a accomplished by means of reactive mechanisms that, relying
code to spread the spectrum. It spreads the spectrum, instead, on requests and responses, outperform proactive table-driven
by linearly varying the frequency of the sinusoidal carrier routing.
based on a spreading factor that results from the transmission
of chirps. In either case, these changes in modulation attempt Example 3.5 Consider a sensor that transmits 5-byte
to improve the trade-off between power density and signal readouts every 20 ms and assume that the overhead
bandwidth in order to improve the SNR at the receiver. due to network, transport, and session layer headers
Like the link layer of other technologies, the one of IEEE is 32 bytes. What is the efficiency of the communi-
802.15.4 provides many functions including the transmis- cation system if the physical and link layers are IEEE
sion of beacon frames, frame validation, node association, 802.15.4? Assume that the IEEE 802.15.4 header size
and security. IEEE 802.15.4 defines two device classes: (1) is minimum.
Full Function Devices (FFD) that can serve both as PAN
coordinators and as regular devices in any topology and (2) Solution The transmission rate R is given by R = TL =
Reduced Function Devices (RFD) that only provide node 18,800 bps where L = 8 × (5 + 32 + H ), T = 20 ms
functionality in simple topologies like star and P2P. Fig- and H = 10 is the minimum IEEE 802.15.4 header
ure 3.46 illustrates these two topologies supported by RFDs size as per information shown in Fig. 3.50. Note that the
communicating with one or more FFDs. Summarizing, an IEEE 802.15.4 header size in this case is 10 bytes long
FFD can coordinate a network of devices, while an RFD is because it includes a minimum size 4-byte address field
only able to communicate with other devices. FFDs, besides with no security. The efficiency is given by η = CR =
supporting all topologies associated with RFDs, also support 0.0752 where C = 250,000 bps, and it is therefore
the cluster network topology shown in Fig. 3.47. around 7.52%.
Figure 3.48 shows a scenario where multiple FFD and
RFD topologies are combined. In fact, basic P2P can be
3.3 Wireless 63
STAR LINKS
STAR LINKS
PAN COORDINATOR
MESH LINKS
MESH LINKS
ROUTER
3.3.3.2 Link Layer free timeslots provide devices with a way to predict
Under IEEE 802.15.4 media access is carried out by a com- channel access and estimate duty cycles that are essential
bination of contention and contention free periods accessible to minimize power consumption. During contention-based
via timeslots supported by both CSMA/CA and TDMA. access, the CSMS/CA mechanism is like that of IEEE 802.11
Figure 3.49 shows the structure of an IEEE 802.15.4 described in Sect. 3.3.1.1. Devices sense the channel before
superframe that consists of a beacon transmission followed transmission and backoff for a random time period before
by 16 timeslots. The PAN coordinator transmits beacons that transmitting. Backoff is exponential as it doubles whenever a
are used for device synchronization, to transmit configuration collision is detected. IEEE 802.15.4 supports basic reliability
information and for identification. Beacons are sent at a fixed allowing devices to request acknowledgments of transmitted
predefined interval between 15 ms and 252 s. Because beacon frames. If the far end device fails to send the acknowledgment
transmissions are quite infrequent and are not likely to suffer due to network loss, the transmitter resends the frame. Only
from collisions, they do not rely on CSMA/CA for media a fixed number of retransmissions are allowed before the
access. Contention-based access, that occurs right after bea- frame is declared lost. An IEEE 802.15.4 network can also be
con transmission, takes a section of the available 16 timeslots configured in non-beacon mode when device transmissions
for devices to transmit relying on CSMA/CA. The remaining are infrequent enough that contention-based access results
section of timeslots provides contention-free access where in a lack of collisions. This scenario comparatively lowers
the PAN coordinator assigns, by means of TDMA, guar- topology and device complexity requirements.
anteed access timeslots to certain devices. This is typically Support of single channel communication, as enabled by
associated with scenarios where the application has prede- the original IEEE 802.15.4 specification, results in unpre-
fined bandwidth requirements that require them to reserve dictable reliability especially in the context of multi-hop
exclusive timeslots for transmissions. The beacon carries a deployments where applications are time restricted. This is
permit joining flag that is used to indicate devices that they particularly true for certain IIoT applications that rely on
can join the network. Under standard IEEE 802.15.4, network media transmission. IEEE 802.15.4e addresses this prob-
joining is initiated at the device, for example, by pushing a lem by introducing the Time Synchronized Mesh Protocol
physical button. This contrasts with the Thread architecture (TMSP). TMSP provides a Time Slotted Channel Hopping
presented in Chap. 9 that also relies on IEEE 802.15.4 but (TSCH) MAC layer that relies on time synchronized channel
uses a different mechanism for devices to join a network. hopping in order to overcome multipath fading and inter-
The use of predefined intervals for the transmission ference. Essentially, devices link themselves to groups of
of beacons combined with the presence of contention- slots repeating over time where each slot is associated with
64 3 Physical and Link Layers
B 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 inactive B
beacon beacon
respectively, 32, 64, or 128 bits long. The MIC is then ap- of a frame to look for the security parameters needed to
pended to the unencrypted payload. For scenarios where both process encryption and message authentication. This infor-
confidentiality and message authentication are needed, CTR mation is stored as entries in an access control list (ACL). Up
and CBC modes are combined into a counter combined mode to 255 entries can be stored with a default entry that specifies
that leads to security modes AES-CCM-32, AES-CCM-64, security for those frames that are not associated with any
and AES-CCM-128 for MIC sizes of 32, 64, and 128 bits, entry. Figure 3.54 shows the format of a single ACL entry.
respectively. In this case, encryption is applied after message Each entry includes the addresses, a security suite identifier,
authentication is performed. Note that the frame counter and the cryptographic key, and, for scenarios with encryption, the
the KC fields are set by the sender whenever encryption is in last available IV. If replay protection is in place, then the
place. The frame counter is typically incremented each time latest frame counter is stored too.
a frame is hardware encrypted, while the KC is set by the
application and contains the KI that identifies the key in use. 3.3.3.3 TSCH
The original datagram is chunked into several 16-byte TSCH, introduced in IEEE 802.15.4e, is the MAC layer of the
blocks that are identified through a block counter. Each block TMSP. It provides a way to map timeslots to user channels
is encrypted using a different initialization vector (IV) that is based on a preassigned hopping sequence. The main goal
computed on-the-fly for each frame as illustrated in Fig. 3.53. is to make sure that no frames collide on the network and,
Essentially the IV consists of a 1-byte flag, the 64-bit long therefore, frames are scheduled and synchronized for energy
source address, the 32-bit frame counter, the 8-bit frame efficiency with no need for an extra preamble or guardbands.
control, and the 16-bit block counter. Note that the block Collision-free communication is accomplished by means of
counter is not sent so the receiver typically estimates its value the aforementioned schedule that allows multiple devices to
based on the order of block within the frame. communicate at the same time over different frequencies. As
IEEE 802.15.4 introduces support of access control by a collision-free mechanism, synchronization is critical under
allowing devices to use the source and destination addresses TSCH. Specifically, synchronization is carried out by means
of frames exchanged between neighbors. If devices do not
receive any traffic for a predefined time period, they can
AES-CTR FC KC ENCRYPTED PAYLOAD transmit dummy frames to trigger synchronization.
Under TSCH all devices are fully synchronized with
timeslots that are long enough to fit a full size frame and its
acknowledgment. Timeslot durations of 10 ms are typical,
AES-CBC-MAC-X PAYLOAD MIC
providing enough time for transmission, propagation, and
processing delays. Timeslots are grouped into slotframes that
are periodically transmitted. Depending on the application,
AES-CCM-X FC KC ENCRYPTED PAYLOAD EMIC a single slotframe can hold anywhere between tens and
thousands of timeslots. Shorter slotframes are associated
with higher transmission rates but also higher energy
FC frame counter consumption. TSCH allows a single schedule to rely on
KC key control
MIC message integrity code
multiple simultaneous slotframes. At some point in time, a
EMIC encrypted message integrity code device can perform two simultaneous tasks on two different
slotframes like receiving frames from device 2 in slotframe 1
Fig. 3.52 Payload data formats with IEEE 802.15.4 security and transmitting frames to device 3 in slotframe 2. Two rules
specify how devices behave in a multi-slotframe scenario: (1)
1 8 4 1 2
transmissions have higher priority than receptions, and (2)
FLAGS SOURCE ADDRESS FRAME COUNTER KC BC
lower slotframes have higher priority than higher slotframes.
The TSCH schedule specifies what a given device does
KC key control
BC block counter in a timeslot. Specifically, it indicates the channel offset
associated with hopping and the address of the neighbor
Fig. 3.53 Format of the IV with which to communicate. Possible actions in the schedule
include receiving or transmitting data as well as sleeping. For
ADDRESSES SECURITY SUITE KEY LIV RC each transmitting timeslot, the device checks whether there
are pending frames in the outgoing queue for the destination.
LIV last IV
RC replay counter If there are no frames, the device keeps its radio turned off in
order to save energy; otherwise it transmits the pending frame
Fig. 3.54 IEEE 802.15.4 ACL entry requesting an acknowledgment whenever needed. Similarly,
3.3 Wireless 67
for each receiving timeslot, the device listens for incoming of the frame counter field and to (2) indicate whether the
frames; if no frames are received for a certain amount time, frame counter field is 32 or 40 bits long. When ASN-based
the device shuts off its radio; otherwise if it receives a frame, encryption is in use, the 40-bit frame counter is followed by
the device can send an acknowledgment if needed. the key control field as indicated by Fig. 3.52.
The combination of the timeslot and channel is called a
cell. A cell represents an atomic unit of scheduling. A single 3.3.3.4 Limitations
device can communicate with another one through one or IEEE 802.15.4 exhibits some limitations that affect its reli-
more cells. If multiple cells carry traffic between two devices, ability in the context of LLNs. Specifically, one of the most
then the scheme is called a bundle. The larger the bundle important limitations affecting not only IEEE 802.15.4 but
is, the higher the transmission rate from one device to the also many other IoT technologies is due to the interference
other. TSCH also provides a mechanism that enables multiple associated with other transmissions over the ISM bands. This
devices to simultaneously transmit over the same cell. In this is particularly critical when considering the overcrowded
case of shared cells, contention is prevented by means of a 2.4 GHz band used by different versions of IEEE 802.11 and
backoff algorithm. BLE as well as other devices ranging from remote control
Each cell is determined by both parameters: the channel toys to cordless phones. Additionally, radio propagation is
offset and the timeslot offset that indicate the spectral and mainly by the way of scattering over surfaces and diffraction
temporal position of the cell. TSCH introduces a global over and around them in a situation typical of a multipath
timeslot counter called Absolute Slot Number (ASN) that environment. Essentially, in this scenario, multipath fading
specifies the number of timeslots that have been scheduled results from signals taking different paths and arriving at the
since the start of the network. In general, ASN = k × S + t receiver with different phases. If all signals interact positively
where k and S are the slotframe cycle and size, respectively, (i.e. they have same phase), then there is constructive interfer-
and t is the timeslot offset. The ASN value is broadcasted ence or upfading, while if, on the other hand, signals interact
throughout the network for devices to synchronize when they negatively (i.e. they have opposite phase), then there is de-
join the network. The ASN is 40 bits long in order to support structive interference or simply fading. As opposed to IEEE
hundreds of years without overflowing. 802.15.4 that is greatly affected by fading, IEEE 802.15.4e
Although the channel offset is constant for any given attempts to address some of these problems through TMSP.
transmission from one device to another, this does not mean IEEE 802.15.4 also limits the communication range.
the transmission frequency is constant. In fact, channel hop- Specifically, the coverage is around 200 m in outdoor
ping is supported by a transmission frequency calculated environments. Longer coverage is possible; however, it
as frequency = F ((ASN + c) mod N) where c is the requires the use of multi-hop transmissions in the context
channel offset, N is the maximum number of frequencies, of mesh forwarding. Devices that provide message relaying
and F (. . .) is a mapping to one of the possible N frequencies. introduce three problems: (1) additional deployment costs,
Because ASN is an incrementing counter, for any fixed cell, (2) increased latency, and (3) reduction of communication
the transmission frequency changes in each slotframe. This reliability. This latter point is associated with the fact that
enables channel hopping even when keeping the schedule multi-hop communication relies on systems that are “in
simple by relying on fixed cells associated with fixed channel series” and as such they have multiple points of failure when
and timeslot offset. Channel hopping is essential in order to compared to one-hop communication schemes. One way
prevent multipath fading and interference as these impair- to improve reliability is by increasing transmission power;
ments are frequency dependent. however, the nature of IoT solutions typically prevents this.
The TSCH network schedule is linked to the application
needs; a sparse schedule implies a solution where devices
consume very little energy, but throughput is very low too, 3.3.4 Bluetooth Low Energy
while a dense schedule implies a solution where devices
generate a lot of traffic and consume a lot of energy. TSCH Bluetooth is a full protocol stack that supports small coverage
introduces several IEs that can be used for communication in while providing low to medium transmission rates under
the context of this mechanism. wireless communications [13]. Initially released in 1998 as
IEEE 802.15.4e [4] adapts security to support TMSP; it Bluetooth 1.0 and 1.0B by the Bluetooth Special Interest
defines the possibility of using optional 40-bit frame counters Group, it has been updated several times since then. In 2002
that are set to the ASN of the network. The use of the ASN it was amended as Bluetooth 1.1, also released as IEEE
provides time-dependent security as well as replay protec- 802.15.1-2002, to address several deficiencies of the orig-
tion. In order to support the use of the 40-bit frame counter, inal specification and to support Received Signal Strength
IEEE 802.15.4e modifies the security control field to use Indicator (RSSI) as a mechanism for power control. This
two of the originally reserved bits to (1) enable suppression standard led to Bluetooth 1.2, also released as IEEE 802.15.1-
68 3 Physical and Link Layers
master
slave
slave master
slave
SCATTERNET
slave slave
STAR-BUS
BLE ADVERTISING
PHY CHANNEL
slave
master
slave
2005, to improve modulation and transmissions rates among Under classic Bluetooth, a master device controls up to
other things. Enhanced Data Rate (EDR), introduced in 2004 seven slaves on a single piconet. In the context of Bluetooth,
as Bluetooth 2.0, further improves transmission rates and a piconet is an ad hoc network that links a wireless user
energy consumption by incorporating power duty cycles. group of devices. Slaves communicate with the master, but
Bluetooth 2.1 was released in 2007 to simplify the device they do not communicate with each other. A slave can also
pairing process. In 2009, Bluetooth 3.0 introduced High belong to more than one piconet. An example of a classic
Speed (HS) support by means of co-located IEEE 802.11 Bluetooth topology is shown in Fig. 3.55 with multiple pi-
links. BLE, also known as Bluetooth Smart and standardized conets deployed in a scatternet configuration. Under BLE,
as Bluetooth 4.0, was released in 2010 as a brand new however, slaves talk to the master on a separate channel. As
mechanism to support low power consumption [18]. As such opposed to classic Bluetooth piconets, where slaves listen
it has been an excellent candidate for many M2M, CPS, for incoming connections from the master, a BLE slave
and hybrid IoT solutions. BLE is not backwards compatible, initiates connections, and it is therefore in control of power
so classic Bluetooth devices cannot directly interact with consumption. A BLE master, which is assumed not to be as
pure BLE-based topologies. Bluetooth 4.0 relies on devices power constrained as a slave, listens for advertisements and
supporting both mechanisms independently. Bluetooth 4.1 initiates connections as a result of received advertisement
and Bluetooth 4.2 were, respectively, released in 2013 and frames. An example BLE topology is also shown in Fig. 3.55
2014 to address certain requirements in order to enhance deployed in a star-bus configuration.
accessibility of connected devices. Bluetooth 5.0, released
in 2016, boosted BLE modulation and transmission rates. In
2019 Bluetooth 5.1 added angle of arrival (AoA) and Angle 3.3.4.1 Physical Layer
of Departure (AoD) to improve asset tracking complement- Classic Bluetooth relies on FHSS at a rate of 1600 hops
ing the use RSSI [14]. per second with each code spanning over 79 channels in
It is important to emphasize that IEEE 802.15.1 [1] is the 2.4 GHz ISM band. The code that controls the hopping
the standardization of Bluetooth 1.1 and Bluetooth 1.2 and pattern is derived from the 48-bit MAC address of the master
it does not refer to any other version of Bluetooth including device. BLE, on the other hand, uses a different FHSS scheme
BLE. The physical and link layers of BLE, in a similar way as it relies on 40 2 MHz channels that enable higher reliability
to ZigBee, are mechanisms that by means of adaptation can over long-range coverage. Classic Bluetooth nominal trans-
be used to transport IPv6 traffic that is essential to IoT. mission rates are 1, 2, and 3 Mbps, while the BLE nominal
3.3 Wireless 69
input sequence
ADVERSING
SLAVE
feedback shift register +
to modulator
CONNECTION STANDBY SCAN
Fig. 3.56 Scrambler
master, and reduce power consumption. Advertising frames The data access address is a random 32-bit number that
are used to set up connections between devices, while data identifies a connection between two devices. The 8-bit
frames are used for communication traffic between devices. packet header field is encoded as indicated in Fig. 3.59
Advertising frames are sent over three advertising channels, depending on whether it applies to advertising or data frames.
while data frames are sent over 37 different data channels. For advertising frames, the header includes an advertising
The upper sublayer of the BLE link layer is called the Logical frame type and two bits to indicate whether transmission
Link Control and Adaptation Protocol (L2CAP) that enables and reception addresses are public or random. The possible
the multiplexing of data with higher layer protocols and advertising frame types are (1) advertising indication, (2)
supports segmentations among other things. connection indication, (3) non-connectable indication, (4)
Figure 3.58 shows a generic BLE frame. It starts with a scannable indication, (5) active scanning indication, (6)
preamble that is followed by an access address field that is active scanning response, and (7) connection request. For
used by the receiver to filter out this frame from channel data frames, the header includes a logical link identifier that
noise. This field is in turn followed by a packet header indicates whether the frame is a segment of higher layer
field that is used to indicate the nature of the frame. The datagram or whether it is used for connection management.
length field signals the size of the data payload. The last This header also includes a sequence number that identifies
field of the frame is a FCS that by means of a CRC block this data frame within the transmission stream and a next
code provides basic channel encoding. The preamble is sequence number that tells the peer device what the expected
an 8-bit sequence of alternating ones and zeros that are receiving sequence number is. Finally, the more data field in
used by the receiver to detect the modulation frequencies this header tells the receiver that there are more frames to
and perform gain control. The access address is a 32-bit be sent and therefore the connection should stay active and
field that can be an advertising access address or a data power management in effect.
access address. The advertising access address is always Figure 3.60 shows how first a device, an advertiser, sends
10001110100010011011111011010110 and is used for data an advertising frame that triggers another device, an initiator,
broadcasting as well as advertising and scanning frames. to transmit a connection request. Once the connection is
established, the initiator becomes master and the advertiser
becomes slave. From this point on, data frames are sent by
1 4 1 1 variable (0-37) 3
both devices. Whenever a data frame is sent, the sending de-
P ACCESS ADDRESS H L DATA PAYLOAD FCS
vice specifies the sequence number of the transmitted frame
P Preamble (S) and expected sequence number of next incoming frame
H Header (N) as well as whether more frames are to follow (M). If a
L Length
FCS Frame Checksum
APT RESERVED T R
LLI N S M RESERVED
Fig. 3.59 Packet header Fig. 3.60 Connection creation and data transfer
3.3 Wireless 71
frame is lost and, therefore, it does not arrive at the endpoint, Figure 3.61 shows the building blocks of the physical
the transmitter knows it has to retransmit it when it analyzes layer. The data stream is first modulated by FSK or GFSK
the expected sequence number of the incoming frame. In followed by Manchester or Polar NRZ line coding depending
the exchange of frames, each frame is further identified by on the rate as shown in Table 3.15. Line coding is introduced
device addresses that follow the length field as part of the data to minimize the DC component of the transmitted signal and
payload. Specifically, 48-bit initiator and advertising MAC improve range as well as penetration.
addresses are used to identify the transmitting devices. Each
MAC address can be a public device address that is assigned 3.3.5.2 Link Layer
by the manufacturer or a random device address that can ITU-T G.9959 relies on a traditional CSMA/CA MAC as
be either static if it is reset on power cycle or private if it most wireless technologies discussed in this section. Col-
periodically changed to prevent device tracking. lision avoidance is active for all devices in the network if
their radios are active. It is completely independent of the
transmission rate mode R1, R2, or R3. ITU-T G.9959 also
3.3.5 ITU-T G.9959 introduces both power efficiency by means of predictable
duty cycles and reliability by means of retransmissions.
ITU-T G.9959 provides physical and link layer wireless ITU-T G.9959 supports three channel configurations.
mechanisms for low-rate data transmission that are derived Configuration one supports one channel named channel A.
from the well-known consumer-oriented Z-Wave technology Configuration two supports two channels named channel A
[20]. Z-Wave focuses mainly on sensing and actuation func- and channel B. Configuration three supports three channels
tions in home and small business facilities. Some common named channel A, channel B, and channel C. Figures 3.62
examples of Z-Wave use include physical security, lighting and 3.63, respectively, show IEEE G.9959 unicast and
and climate control, smoke detectors, appliances, remote multicast MAC frames for channel configuration one and
controls, as well as smart meters. In a similar way to ZigBee two. The frame format for channel configuration three is
and IEEE 802.15.4, Z-Wave and ITU-T G.9959 support identical, but it also includes a sequence number field.
wireless mesh topologies that enable devices to communicate Each frame starts with a preamble that is used for device
with other devices even if they are not within range. This synchronization, follows with a Start of Frame (SoF) field
is done by means of traffic transmission over intermediate and a MAC Protocol Data Unit (MPDU), and ends with
nodes. The architecture also supports master controllers that an End of Frame (EoF) field. From a topology perspective,
provide wider access to devices. An individual ITU-T G.9959 ITU-T G.9959 networks are typically deployed in mesh
WPAN can integrate up to 232 devices, and multiple master configurations.
controllers can be used to partition the network based on The MPDU includes a MAC Header (MHR), a MAC
different functions. Service Data Unit (MSDU), and a MAC Footer (MFR). The
MHR starts with a 4-byte HomeID field that indicates the
3.3.5.1 Physical Layer ITU-T G.9959 network the device is associated with. All
ITU-T G.9959 operates on the 915/868 MHz ISM band but devices in the network share the same HomeID. The MHR
relies on other bands in many other countries based on follows with a 1-byte source node ID that together with
licensing and regulations. Modulation is based on plain FSK
and GFSK in a similar way to BLE but without FHSS.
Three different transmission rates are supported by this tech- Table 3.15 Z-wave modulation
nology through physical layer configuration changes: R1 at Data rate Modulation Line coding Rate (Kbps)
9.6 Kbps, R2 at 40 Kbps, and R3 at 100 Kbps. The signal R1 FSK Manchester 9.6
coverage is up to 30 m depending on power and obstruction R2 FSK NRZ 40
conditions. The electrical transmission power is 1 mW. R3 GFSK NRZ 100
DATA RATE
(R1=9.6 Kbps, R2=40 Kbps, R3=100 Kbps)
PREAMBLE
4 1 2 1 1 m 1 or 2
4 1 2 1 1 29 m 1 or 2
Table 3.16 Destination NodeID presented in Sect. 3.3.3, they can support IPv6 with the right
Value Meaning adaptation mechanism.
00000000 Uninitialized
00000001 − 11101000 NodeID
11101001 − 11111110 Reserved 3.3.6 DECT ULE
11111111 Broadcast NodeID
Digital enhanced cordless telecommunications (DECT) is
a cordless telephone technology that has been extended, as
the HomeID identify the device that generated the frame. DECT Ultra Low Energy (DECT ULE), for use in wireless
The MHR continues with a 2-byte frame control field that sensor and actuator networks in the context of smart home
defines the frame type as well as other control flags. Pos- applications [9]. The protocol is managed by the ULE Al-
sible frame types, among others, are unicast, multicast, and liance and intends to provide long-range and middle-rate
acknowledgment frames. The following fields are the 1-byte transmission rates with very little power consumption and
MPDU length and a 1-byte destination node ID that identifies low latency. Low power consumption combined with low
the device destination. Possible values of the destination duty cycles leads to batteries lasting over 5 years. Typical
NodeID are shown in Table 3.16. Multicast frames, shown in coverage is up to 60 and 500 m for indoor and outdoor
Fig. 3.63, include instead a 1-byte multicast control field and scenarios, respectively. The DECT ULE topology is a star
29-byte multicast bitmask that identify the destinations of with one-hop links between devices and the base station
the frame. For frames associated with channel configuration that plays the role of IoT gateway. Up to 400 devices are
three, the sequence number is a 1-byte value. The MSDU supported in a single DECT ULE network.
field includes the actual upper layer datagram. Acknowl-
edgment frames that are used when retransmissions are in 3.3.6.1 Physical Layer
place do not include the MSDU field. In general devices DECT ULE operates on the unlicensed cordless phone fre-
can only receive frames with MSDU fields that are short quency bands of 1.8 GHz in Europe and 1.9 GHz in US
enough to comply with configured transmission rates. The with channel spacing of 1.728 MHz supporting a maximum
MFR includes a 1-byte FCS. Because ITU-T G.9959 frames nominal transmission rate of 1 Mbps. The modulation relies
follow a similar structure to that of IEEE 802.15.4 frames on a GFSK scheme.
3.3 Wireless 73
FRAME
4 1 5 2 n ½ 7½
HDR Network Data Header
CS Network Data Checksum
Q Quality
3.1 In Fig. 3.2, how does signal coverage relate to LLNs? 3.8 A sensor generates a single readout once every second.
Each readout can take one out of 16384 possible values that
3.2 The readouts generated by an IoT sensor become the are subjected to a block code with rate r = 78 . Assuming the
following codewords when encoded by a block code: 0000, overhead due to network, transport, and session layer headers
0011, 0101, 0110, 1001, 1010, 1100 and 1111. What is the is 48 bytes, what is the protocol efficiency and the nominal
code rate? transmission rate of the following mechanism?
3.4 What do you think is the problem of a scheme where 3.10 How long does it take to transmit a full size IEEE
the sensor of Problem 3.2 generates a continuous sequence 802.15.4 frame? How does it compare to a full size Ethernet
of 0000 codewords encoded with AMI in a wireline environ- frame? What are the implications?
ment?
3.11 If an IEEE 802.15.4 layer receives a 130-byte datagram
3.5 If a wireless sensor uses a 64-QAM modulation scheme from its upper layer, what does the IEEE 802.15.4 layer do?
and the symbol duration is T = 100 µs, what are the symbol
Rs and transmission Rb rates? 3.12 Under IEEE 802.15.4, if the address field is 8 bytes
long. What are the values of the SAM, DAM, and C fields?
3.6 An OFDM scheme consists of 16 16-QAM subchannels
and 16 64-QAM subchannels with symbol duration T = 3.13 An IEEE 802.15.4 frame has the following fields S=0,
6.4 µs, what is the transmission Rb rate? C=0, SAM=11, DAM=10 and a 40-byte payload. How long
does it take to be transmitted?
3.7 Consider two IoT sensors A and B that transmit readouts
to sensor C that, in turn, forwards the aggregated traffic to 3.14 Consider the BLE communication flow below. What
the network core. The signal coverage of A and B is such are the missing transactions?
that they cannot directly communicate with each other. How
is this scenario affected by the hidden and exposed station
phenomena?
76 3 Physical and Link Layers
this issue, IPv6 adaptation is an intermediate mechanism address has a prefix that is used for network identification.
that sits between the link layer and the network layer to Specifically, the prefix indicates how many leading bits de-
address this fragmentation issue as well as other related termine the network identity. For example, if the address is
problems. The most popular IPv6 adaptation technology is 2001::10:21:10/64, it means the first 64 bits, that is 2001::,
6LoWPAN [26, 19, 15] that interfaces with IEEE 802.15.4 identify the network.
and has been widely extended to other link layer technologies The first few bits of an IPv6 address always indicate its
like BLE as 6LoBTLE [22]. format. Figure 4.1 shows the format of unicast addresses.
Regardless of limitations like frame size, using IPv6 and They start with the 001 binary sequence leading to prefixes
upper layer protocols directly without adaptation can be 2000::/3 and 3000::/3. It follows 45-bit and 16-bit fields
demanding for embedded IoT devices due to several reasons: known as global routing prefix and subnet identification,
(1) traditional security mechanisms that provide authentica- respectively. The global routing prefix is assigned to a site,
tion and encryption like IP Security (IPSec) [6] and Transport and the subnet identification is assigned to a subnet within
Layer Security (TLS) [24, 23] are too complex, (2) the a site. The 64-bit Interface Identification (IID) that follows
most popular session management application layer protocol identifies the specific device in the subnet. Because de-
transmitted over TCP, HTTP, is also too complex, (3) many vices supporting unicast IPv6 addresses can participate in
IPv6 session and application layer protocols require contin- the global IPv6 infrastructure, unicast addresses are known
uous connectivity (this is a limitation that is not compatible as global unicast addresses (GUAs). Some unicast addresses
with power duty cycles of many embedded IoT devices), (4) are known as Unique Local Unicast Addresses (ULAs) when
IPv6 multicast transmissions are not always supported by link they are routable inside a limited area like a site, but they are
layers of constrained technologies like IEEE 802.15.4, and not expected to be routable in the global Internet.
(5) IPv6 routing technologies are not prepared to deal with Figure 4.2 shows the format of multicast addresses. They
capillary networks that rely on mesh topologies to improve identify a group of devices such that a single device can
energy consumption. belong to multiple groups. The first 8 bits of a multicast
In order to understand IPv6 adaptation technologies like address are all ones that are followed by a flag and a scope
6LoWPAN, it is first necessary to understand IPv6 and its field. The address ends with a 112-bit group identification
benefits. field. Figure 4.3 shows the 4-bit flags field with three relevant
bits: (1) T that indicates that the address is temporary, (2)
P that indicates that the address is a unicast-prefix based
4.2 IPv6 IPv6 multicast address, and (3) R that indicates that the ren-
dezvous point address is embedded in the multicast address.
The most important and relevant change introduced by IPv6 Table 4.2 shows the 4-bit scope field that specifies the scope
[5, 8] is the support of 128-bit addresses that exponentially of the multicast group. As in the IPv4 case, some multicast
increase the potential number of accessible devices. IPv6 addresses are used to assign specific groups; FF02::1 and
address notation is based on eight 16-bit values separated FF02::2 identify all devices and all routers, respectively. As
by colons. Each 16-bit value is represented, in turn, by a the scope is link-local, datagrams are not forwarded by a
hexadecimal number with all its leading zeros removed. An border router.
IPv6 address can be represented in a short form by replacing Figure 4.4 shows the format of link-local addresses. They
any sequence of all-zero 16-bit values with a double colon. are used for bootstrapping and connectivity within a single
For example, the long form 2001:0:0:0:0:10:21:10 can be link. They start with the 10-bit binary sequence 1111111010
represented as the short form 2001::10:21:10. followed by 54 zeros and the 64-bit IID. The prefix of a link-
Table 4.1 shows this and other relevant IPv6 address local address is, therefore, always FE80::/10.
types including their IPv4 example counterparts. Each IPv6 Besides the address size change, IPv6 introduces a dif-
ferent header format that is shown in Fig. 4.5. It includes
several fields: (1) a 4-bit version field used to identify the
Table 4.1 IPv6 addresses
IP version number that always carries a value of 6; (2) an
IPv4
8-bit traffic class field that provides QoS information; (3) a
equivalent
Long form Short form Type example 20-bit flow label that identifies the datagram as part of a flow
2001:0:0:0:0:10:21:10 2001::10:21 Unicast 192.168.21.5 of datagrams; (4) a 16-bit payload length that indicates the
FF01:0:0:0:0:0:0:2105 FF01::2105 Multicast 224.0.0.24 number of payload bytes that follow this header; (5) an 8-
FE80:0:0:0:983D:3F44: same Link-local 169.254.1.10 bit next header field that specifies the protocol under which
2819:CFCC the payload is encoded; (6) an 8-bit hop limit field, also
0:0:0:0:0:0:0:1 ::1 Loopback 127.0.0.1 known as IP Time to Live (IP TTL), that provides a counter
0:0:0:0:0:0:0:0 :: Unspecified 0.0.0.0 that is decremented as the datagram is forwarded throughout
4.2 IPv6 79
R rendezvous point
P unicast-prefix based IPv6 mulcast address
T temporary address
SOURCE ADDRESS
DESTINATION ADDRESS
PAYLOAD
80 4 Network and Transport Layers
0 8 16 0 8 16
TYPE CODE CHECKSUM TYPE CODE CHECKSUM
REACHABLE TIMER
Fig. 4.6 ICMPv6 RETRANSMISSION TIMER
0 8 16 OPTIONS…
TYPE LENGTH … M managed
… O other
H home agent
PRF preference
Fig. 4.7 ND message options
Fig. 4.8 Router advertisement ND message
mechanisms can be used to adapt and translate IPv6 datagram More details of application and session layer mechanisms are
into a format that is suitable for transmission over LLNs. introduced in Chap. 5.
Essentially 6LoWPAN gives constrained and low-power de- Figure 4.12 shows both a plain IPv6 stack and 6LoWPAN-
vices native IPv6 support at a cost of minimal overhead. based stack. There are several differences; (1) each stack has,
This IPv6 support, of course, enables connectivity to other as expected, different physical and link layer protocols, (2)
Internet-based hosts and routers. Although 6LoWPAN was IPv6 cannot run directly over IEEE 802.15.4 as 6LoWPAN
originally designed to provide full IPv6 support under IEEE adaptation is needed, (3) TCP cannot be used over 6LoWPAN
802.15.4, many of its features have been adopted by other due to performance issues, and (4) CoAP over UDP, as
physical and link layer technologies like BLE and ITU-T opposed to HTTP over TCP, is used on the 6LoWPAN-
G.9959. In fact, the term 6LoWPAN network typically refers based stack. Note that the 6LoWPAN-based stack has the
to an LLN that relies on 6LoWPAN principles. 6LoWPAN adaptation layer placed in between the IPv6 and
The 6LoWPAN architecture, shown in Fig. 4.11, is in- the IEEE 802.15.4 link layers. Also note that in many im-
tegrated by several WPANs that are characterized by being plementations, UDP and IPv6 layers are integrated directly
access stub networks with traffic that is never transmitted to into 6LoWPAN with APIs that interface with network and
other networks. All devices in a WPAN have IPv6 addresses transport parameters. Because of this, 6LoWPAN adaptation
that share the same prefix usually retrieved through RA is typically shown as part of the IPv6 layer.
ND messages. There are three types of WPANs: (1) simple Figure 4.13 shows a basic translation between an Ethernet
WPANs that have connectivity to the IP core by means of wireline core and an IoT IEEE 802.15.4 wireless access
edge routers, (2) ad hoc WPANs that locally connect devices that usually occurs at an WPAN edge router. Incoming IPv6
and have no access to the IP core, and (3) extended WPANs traffic from the core, on the Ethernet interface, is encoded
that have connectivity to the IP code by means of several edge as 6LoWPAN datagrams before being transmitted over the
routers along a backbone link. IEEE 802.15.4 interface. Similarly, incoming 6LoWPAN
An edge router resides in between the access and core traffic on the IEEE 802.15.4 interface is decoded as IPv6
networks and plays the role of a traditional IoT gateway. datagrams before transmitted over the Ethernet interface.
It handles traffic in and out of the WPAN by performing Note that this bidirectional translation is quite efficient, and
6LoWPAN adaptation, ND for interaction with devices on depending on the 6LoWPAN compression scheme, it can be
the same link, and other types of operations like IPv4-to- either stateless or stateful. More details of the 6LoWPAN
IPv6 translations for communication with other entities in compression mechanisms are discussed later in this chapter.
the IP core. Devices in a WPAN can behave like either hosts Although 6LoWPAN is intended to work over IEEE
or routers depending on source and destination addresses of 802.15.4, it can work over other link layer technologies with
the datagrams. A sensor can act as a host when it generates some small modifications. Specifically, 6LoWPAN requires
readouts, and it can act as a router when it forwards traffic that link layer protocols support framing, presented in Sect. 3,
from other devices in a mesh scenario. Most devices only unicast transmission, and unique addresses that can be used,
have a single interface (i.e. wireless) that is used to receive in turn, to derive unique IPv6 addresses by means of SAA.
and transmit datagrams. This is even true when the devices In addition, because IPv6 fragments cannot be smaller than
play the role of routers and forward datagrams on the same 1280 bytes, 6LoWPAN performs its own fragmentation to
interface in which they were received as a mechanism to adapt datagram transmission to link layer mechanisms with
extend coverage. Note that this is quite different to what small MTUs.
traditional Internet routers do, where traffic received on one It is therefore desirable for link layer frames to be as large
interface is forwarded to a different one. as possible with payloads of at least 60 bytes to minimize
Access to core communication in the context of WPANs the number of fragments that 6LoWPAN needs to track.
follows the standard rules of any other IP communication. Moreover, for fixed network packet loss, it is always good
Each WPAN device is identified by its unique IPv6 address, to minimize the number of fragments per datagram since the
and it can send and receive datagrams. As processing capabil- more fragments the higher the probability that a datagram
ities are limited in constrained devices, the type of transport will get dropped by the network. Note that 6LoWPAN com-
and application traffic is also limited. While protocols like pression can be used to efficiently compress IPv6 and UDP
UDP are suitable in this situation, TCP and HTTP [1] fail headers in order to maximize link layer payload size and
due to computational complexity and excessive resource con- therefore minimize the number of fragments per datagram. In
sumption; TCP relies on sophisticated state machines, while the context of other link layers, it is also important, although
HTTP imposes high memory requirements due to the size not required, that the adaptation layer provides reliability by
of its messages. This means that although TCP and HTTP means of error detection and correction. Additionally, the
can be used in WPANs, this is not typically recommended. adaptation layer must support security through encryption
and authentication.
4.3 6LoWPAN 83
internet core
router
local application
router
backhaul link backbone link
H H H
H H H
H
H
extended WPAN
simple WPAN
H
R router
R
R R H host
H H
H
ad-hoc WPAN
IPv6
6LoWPAN
CORE ACCESS
4.3.1 Addresses
remote server
2001:10::2105
6LoWPAN relies on IPv6 addresses that consist of a prefix
and an IID that are derived via SAA from link layer addresses
and edge router parameters received in 6LoWPAN ND RA
messages. 6LoWPAN ND messages are ICMPv6 ND mes- IPv6 CORE
sages that are exchanged in the context of 6LoWPAN and 2001:10::/64
have been optimized to work in WPANs as per IETF RFC
6775. As opposed to traditional ND, 6LoWPAN ND supports edge router
power duty cycles, and it can handle sleeping devices and
to minimize the use of multicast addressing. The mapping ::1
is essential in enabling 6LoWPAN IPv6 header compression
as most of the 128-bit source and destination addresses can
::2
be obtained from well-known information that does not need ::3
to be transmitted in every single datagram. Note that most
link layer IoT technologies like IEEE 802.15.4 support 64- ::6
::4 ::5
bit MAC addresses and configurable, 8-bit or 16-bit short
addresses typically assigned by the PAN coordinator. In the
context of 6LoWPAN, either one of these types of addresses 6LoWPAN ACCESS
can be used to form the 64-bit IIDs. 2001:11::/64
As mentioned in Sect. 2.3, IoT devices are intended to be
deployed, provisioned, and configured with minimal (and if Fig. 4.14 6LoWPAN example
possible, without) human intervention. This has to do with
the volume of sensors and actuators as well as the remote prefix 2001:11::/64. The access network is composed of five
nature of many of the locations where they are deployed. devices that interface with an edge router. These devices
Initial bootstrapping is performed by the link layer that can behave like routers or hosts depending on their location
besides assigning a link local address, attempts to obtain a and their traffic processing capabilities. This is because end
unicast globally routable address by means of SAA. In this devices do not have direct connectivity to the edge router and
scenario, the 6LoWPAN edge router exchanges 6LoWPAN rely on mesh routing to reach it. The edge router, in turn,
ND messages that not only support SAA but also enable connects to the core network and can access a server running
it to keep track of all devices in the link. Specifically, the on 2001:10::2105.
edge router creates a registry of devices and assigns simpler Bootstrapping starts when the edge router begins to ad-
IPv6 addresses that have the overall effect of simplifying the vertise the 2001:11::/64 prefix to the devices by means of
network operation. 6LoWPAN ND RA messages. The devices use this prefix and
Figure 4.14 shows an end-to-end IP network that com- their own IID derived from the 64-bit IEEE 802.15.4 MAC
bines a traditional IPv6 core with an 6LoWPAN access. The address to generate IPv6 addresses. This is further simplified
IPv6 core network is associated with the prefix 2001:10::/64, when devices, also relying on 6LoWPAN ND, register with
while the 6LoWPAN access network is associated with the
4.3 6LoWPAN 85
the edge router and receive a 16-bit IID that is combined As already stated, if a 128-bit destination address is from a
with the prefix to generate a less complex IPv6 address. device in the same WPAN, it can be compressed as a 16-bit
The edge router assigns its own access interface to ad- address. This would be a case of stateless compression since
dress 2001:11::1 and randomly assigns addresses 2001:11::2 each address is mapped based on the 128-bit address con-
through 2001:11::6 to the devices. This opens the door for tained in that datagram. If stateful compression were in place,
6LoWPAN compression since it is a lot more efficient to then the 128-bit address that is common to all datagrams
encode a 16-bit address than a 64-bit IID. Moreover, for would be associated with a context identifier, and it would not
traffic within the WPAN, datagrams only need to specify the need to be transmitted. This, of course, requires coordination
16-bit source and destination addresses since the network between transmitter and receiver. Usually, 6LoWPAN ND
prefix is well-known to all devices (i.e. traffic from ::4 to provides some mechanisms for context information dissemi-
::6). For datagrams going from one device to its closest nation.
neighbor, there is no need to include any IPv6 address since Both IPv4 and IPv6 work well with fast link layer pro-
their IEEE 802.15.4 MAC addresses provide all the routing tocols like Ethernet and IEEE 802.3 that natively support
information needed (i.e. traffic from ::5 to ::3). In other many of the regular IP requirements including the support of
words, if an 6LoWPAN stack finds a header that has neither large MTU sizes and multicast addresses. In those scenarios,
source nor destination address, it assumes that the traffic is there is no need for any adaptation mechanism. Other more
within neighbors. When datagrams flow from one device constrained link layer standards like IEEE 802.15.4 support
to the external server, the datagram includes a source 16- very small MTU sizes and do not allow multicast addressing
bit address (i.e. ::4) and the destination 128-bit address (i.e. due to restrictions linked to low transmission rates and low-
2001:10::2105). The edge router looks at its registry and power consumption. As many times mentioned, 6LoWPAN
converts the 16-bit address into the corresponding global provides an adaptation mechanism that overcomes these and
128-bit unicast address of the device before forwarding the other problems.
datagram to destination. In general, the edge router performs One of these problems is because link layer power limita-
any type of header compression and decompression in the tions also prevent devices from directly communicating with
process of translating network and transport layers back and other devices on the same link. In many cases, a device relies
forth. on intermediate devices to transmit frames to the destination.
This mesh topology requires additional information like orig-
inal and final MAC addresses that can be inserted by means of
4.3.2 Header Format 6LoWPAN adaptation. Another problem is that because link
layer protocols like IEEE 802.15.4 were designed to work
The 6LoWPAN layer maps fields of IPv6 and upper within proprietary stacks, they do not include a type field
layer headers into their compressed versions that become that can be used to identify the upper layer datagram. This
the 6LoWPAN header. This compression can be either is, again, a big difference when compared to fast link layer
stateless or stateful depending on whether the compressed protocols like Ethernet. Specifically, Ethernet includes the
information embedded in the datagram is enough to recover ethertype field to indicate if the upper layer is, for example,
the original IPv6 and transport layer headers. To be IPv4, IPv6, or ARP. 6LoWPAN introduces a special scheme
specific, Fig. 4.15 shows the difference between stateless to solve this issue. This scheme together with fragmentation
and stateful compressions. Under stateless compression, and header compression provides the most important features
6LoWPAN compresses each datagram header based on of 6LoWPAN.
intra-datagram redundancy alone. On the other hand, under To address the lack of a link layer type field, 6LoWPAN
stateful compression, 6LoWPAN compresses each datagram starts every datagram with an 8-bit field named dispatch value
header based on both intra- and inter-datagram redundancy. that serves as the datagram type indicator [18]. Although
Stateless compression is simple, and, as opposed to stateful the dispatch value is 8 bits long, most of the time only a
compression, it does not require a mechanism to keep track few of the most significant bits are used to indicate the type,
of the state of inter-datagram redundancy. Unfortunately, while the remaining bits are used to signal additional header
simplicity comes to a price of lower compression rates. information. Table 4.3 shows the dispatch values that are
Stateful compression relies on associating redundant used to assign the different types of 6LoWPAN headers;
information in uncompressed IPv6 headers with a context for example, a dispatch value starting with 10 indicates a
identifier that is transmitted in the datagrams instead. mesh header, while one starting with 01000001 specifies
Consequently, stateful compression requires coordination to an uncompressed IPv6 header. Note that a dispatch value
make sure that contexts are always correctly synchronized. 01000000 is used to indicate that the dispatch value extends
In most cases IPv6 addresses are not included in 6LoW- beyond one byte. All other dispatch values not shown in the
PAN headers because they can be derived one way or another. table are reserved values.
86 4 Network and Transport Layers
6LoWPAN
6LoWPAN
OUTPUT OUTPUT
HOP LIMIT
SOURCE ADDRESS
DESTINATION ADDRESS
4.3 6LoWPAN 87
Figure 4.16 shows an IPv6 header that is transmitted a total of 48 bytes that can be found on every single datagram
uncompressed by means of 6LoWPAN by pre-appending regardless of the values of the fields. Figure 4.18, on the
a 01000001 dispatch value. Note that most IPv6 header other hand, shows the maximum compression that can be
fields are placed within a 32-bit boundary that makes them achieved when adapting the same headers with 6LoWPAN.
accessible by means of a single clock transition in 32-bit The 6-byte 6LoWPAN header starts with a 2-byte stateful IP
and 64-bit processors. The extra 8-bit dispatch value disrupts Header Compression (IPHC) dispatch value and associated
the 32-bit boundary of some fields like the flow label and compressed fields. It follows a 1-byte Next Header Compres-
forces an extra clock transition that lowers processing speed. sion (NHC) UDP compressed header that includes a 1-byte
Fortunately, many embedded IoT devices rely on 8-bit and field to identify both source and destination UDP ports. Note
16-bit processors that are less affected by this displacement. that uncompressed UDP ports are always 2 bytes long. The
Note that the 6LoWPAN uncompressed header can be also 6LoWPAN header ends with the 2-byte UDP checksum field
used to transmit IPv4 datagrams and other types of packets. that is transmitted in-line and therefore uncompressed. The
In this case, 6LoWPAN provides fragmentation that enables overall compression rate is 6–48 or 1–6.
the end-to-end transmission of full IPv4 stacks over IEEE
802.15.4. Essentially, the gateway only transforms physical
and link layers and preserves all the upper layers. Of course, 4.3.3 Routing and Forwarding
the drawback is the fact that because IPv4 datagrams are not
compressed, they are inefficiently transmitted. One of the roles of a network layer is to move datagrams
Note that multiple dispatch values and headers can be from a sending to a receiving device. Two main functions are
encoded in a single datagram based on the order given in identified: (1) forwarding that involves moving a datagram
Table 4.3. For example, if a datagram is compressed and then from an incoming to an outgoing link in a device or router
fragmented, the fragmentation dispatch value and header and (2) routing* that involves determining a route or path that
must go before the compression dispatch value and header datagrams must follow from source to destination. Routing is
since a given fragment cannot be decompressed until it is a network wide decision that results from executing a routing
properly reassembled. Essentially, the order of the different algorithm that defines a forwarding information base (FIB).
6LoWPAN headers enables synchronization between the en- Forwarding, in turn, is a device decision derived from the
coder and decoder when many of them are included in a FIB.
single datagram. The first header must be, if present, the mesh Figure 4.19 shows how encapsulation works under tra-
header that carries the original and final MAC addresses ditional IPv6 routing. A router device with a FIB has two
along with a hop count. It follows, if present, the broadcasting interfaces on two different links associated with two different
header that contains hop-by-hop link layer information. The subnets, 2001:10::/64 and 2001:11::/64. A frame received on
third header is, if present, the fragmentation header in order interface 0 is processed and, based on the destination IPv6
to support transmission of datagrams larger than the link address found in the FIB, is forwarded to the outgoing inter-
layer MTU size. The packet ends with the uncompressed or face 1. Figure 4.20 shows a datagram being sent from device
compressed network/transport layer header if present. Note 1 at address 2001:10::10 to device 2 at address 2001:11::10.
that this order is consistent with the order of plain headers in First, device 1 looks at its FIB table to determine that in
regular IPv6 datagrams. order to reach 2001:11::10, it must first send the datagram
6LoWPAN relies on the dispatch value to specify the to the router on interface 0 at address 2001:10::1. Then
different headers, while IPv6 relies on the next header field device 1 looks in its ND table to find out the MAC address
to do the same. Moreover, after the dispatch value, the corresponding to IPv6 address 2001:10::1. The resulting
6LoWPAN protocol adds the compressed fields associated 11:22:33:44:55:66 MAC address is used as a destination
with the header and then continues with the uncompressed link layer address for the datagram sent by device 1. The
fields that are directly copied from the IPv6 header. These router receives the datagram, and it looks at its FIB table
uncompressed fields are known as in-line because they are to determine that the datagram must be sent directly over
sent in-line after the compressed fields. Examples of in- interface 1 to reach destination IPv6 address 2001:11::10.
line fields include IPv6 addresses associated with external The router looks at its ND table to obtain the MAC address
hosts that cannot be easily compressed based on context and corresponding to IPv6 address 2001:11::10. The resulting
implied information. 11:12:13:14:15:16 MAC address is used as a destination link
To understand how compression works under 6LoWPAN, layer address for the datagram sent by the router.
it is interesting to look at a simple example. Figure 4.17 When 6LoWPAN is in place, communication between
shows the headers that are used when application traffic is devices is by means of capillary networking where devices
encapsulated by means of UDP over IPv6. The UDP and IPv6 acting as routers have only one interface. Datagrams enter
headers are 8 and 40 bytes long, respectively, accounting for the router and leave the router on the same interface. In this
88 4 Network and Transport Layers
SOURCE ADDRESS
DESTINATION ADDRESS
IPv6
UDP CHECKSUM
FIB
application application
UDP UDP
interface 0 interface 1
2001:10::/64 2001:11::/64
4.3 6LoWPAN 89
router
dev 1 dev 2
L3: 2001:10::10 L3: 2001:10::1 L3: 2001:11::1 L3: 2001:11::10
L2: 01:02:03:04:05:06 L2: 11:22:33:44:55:66 L2: 11:21:31:41:51:61 L2: 11:12:13:14:15:16
L3 L2
2001:10::10 01:02:03:04:05:06
L3 L2 2001:10::1 11:22:33:44:55:66
2001:10::10 01:02:03:04:05:06 2001:11::1 11:21:31:41:51:61
2001:10::1 11:22:33:44:55:66 2001:11:10 11:12:13:14:15:16
ND ND
s: 2001:10::10 s: 2001:10::10
network
d: 2001:11::10 d: 2001:11::10
s: 01:02:03:04:05:06 s: 11:21:31:41:51:61
link
d: 11:22:33:44:55:66 d: 11:12:13:14:15:16
FIB
application application
UDP UDP
interface 0
2001:10::/64
90 4 Network and Transport Layers
router
dev 1 dev 2
L3: 2001:10::10 L3: 2001:10::1 L3: 2001:10::20
L2: 01:02:03:04:05:06:07:08 L2: 11:22:33:44:55:66:77:88 L2: 11:12:13:14:15:16:17:18
Interface 0 Interface 0
L3 L2
L3 L2 2001:10::10 01:02:03:04:05:06:07:08
2001:10::10 01:02:03:04:05:06:07:08 2001:10::1 11:22:33:44:55:66:77:88
2001:10::1 11:22:33:44:55:66:77:88 2001:10::20 11:12:13:14:15:16:17:18
ND ND
ND
s: 2001:10::10 s: 2001:10::10
network
d: 2001:10::20 d: 2001:10::20
s: 01:02:03:04:05:06:07:08 s: 11:22:33:44:55:66:77:88
link
d: 11:22:33:44:55:66:77:88 d: 11:12:13:14:15:16:17:18
scenario, not all devices on a single link can talk to each end-to-end support. In the context of IEEE 802.15.4, mesh
due to the power limitations that prevent long-distance radio forwarding is introduced as part of IEEE 802.15.5. Link layer
transmissions. Figure 4.21 illustrates how IPv6 routing can be mesh forwarding is invisible to both 6LoWPAN and IPv6.
implemented in this case. Essentially, the 6LoWPAN layer Figure 4.24 shows how to bring mesh forwarding to the
just decompresses IPv6 addresses that are used for routing. 6LoWPAN adaptation layer. This approach is also called
Since routing occurs above 6LoWPAN, it is called route- mesh-under. In this case, 6LoWPAN must keep track of origi-
over. Figure 4.22 shows a datagram being sent from device 1 nal source and destination MAC addresses since the link layer
at address 2001:10::10 to device 2 at address 2001:10::20. keeps tracks of source and destination MAC addresses for
First, device 1 looks at its FIB table to determine that in immediate hop communication. Essentially at every single-
order to reach address 2001:10::20, it must first send the hop source and destination, MAC addresses are overwritten
datagram to the router on interface 0 at address 2001:10::1. at the link layer by means of the original source and des-
The resulting 11:22:33:44:55:66:77:88 MAC address is used tination addresses carried in the 6LoWPAN mesh header.
as destination link layer address for the datagram sent by Knowing source, destination, and original and final MAC
device 1. The router receives the datagram, and it looks at addresses is not only needed for mesh forwarding but also
its FIB table to determine that to reach destination IPv6 for other services provided by 6LoWPAN like fragmentation
address 2001:10::20, the datagram must be directly sent over and reassembly.
interface 0. The router looks at its NB table to obtain the Figure 4.25 shows an example of 6LoWPAN mesh for-
MAC address corresponding to IPv6 address 2001:10::20. warding; frames go from device 1 to device 4 through devices
The resulting 11:12:13:14:15:16:17:18 address is used as a 2 and 3. Each hop shows the frame source, destination, and
destination link layer address for the datagram sent by the original and final MAC addresses.
router. Figure 4.26 shows a 6LoWPAN mesh header. The header
The alternative to route-over routing is to rely on the defines two 1-bit fields, O and F that, respectively, indicate
link layer to perform multi-hop frame mesh forwarding and whether the original and final MAC address is 16-bit PAN co-
enable local link connectivity. This is shown in Fig. 4.23 ordinator assigned or 64-bit based. The header also includes
where the link layer not only keeps track of source and des- a hops left field that indicates how many times the packet
tination MAC addresses for immediate hop communication can be forwarded before it is dropped by the network. As the
but also original source and destination MAC addresses for datagram traverses a network, and it is forwarded by different
4.3 6LoWPAN 91
application application
UDP UDP
interface 0
2001:10::/64
application application
UDP UDP
interface 0
2001:10::/64
1 2 3 4
DISPATCH
DISPATCH
92 4 Network and Transport Layers
devices acting as routers, this counter is decremented. In one fore forwarding datagrams. Consequently, 6LoWPAN header
version of the header, if the number of hops left is 14 or less, compression is usually performed on a hop-by-hop basis.
then it is encoded as a 4-bit field, while in another version, if Using traditional lossless data compression algorithms
the number of hops is larger than 15, then it is encoded as a like Lempel-Ziv for header compression is highly inefficient
4-bit 15 field followed by the actually 8-bit hop count. Note as those mechanisms rely on the formation and use of dic-
that these two different versions of the header can be used tionaries. Keeping track of dictionaries at both sender and
together in order to improve compression by maximizing the receiver is very complex and that does not scale well to
available header space. compress small amounts of data. Using traditional header
Since the mesh header carries all information needed for compression frameworks like Robust Header Compression
forwarding, it is the very first header included in a 6LoWPAN (ROHC), standardized by IETF through several RFCs, is
datagram. One of the requirements to support IPv6 is to not convenient either not only because of its computational
provide a single broadcast domain where all transmissions complexity that is not feasible in constrained devices but
are transitive throughout the network such that if device 1 also because of the additional traffic overhead that would
can send datagrams to 2 and device 2 can send datagrams overwhelm any LLN.
to 3, then device 1 can send datagrams to 3. Essentially any As already stated, 6LoWPAN introduces a simple stateless
interface can reach any other interface in the network by header compression scheme that relies on removing and
sending a single datagram. compressing all information that can be inferred from the
6LoWPAN enables the emulation of a single domain datagram. This implies the removal of irrelevant fields as well
within an 6LoWPAN network by relying on mesh-under. as the compression of addresses that can be derived from
Essentially the multi-hop topology is abstracted from IPv6 link layer MAC addresses. Alternatively, 6LoWPAN sup-
to make devices appear as fully connected and only one-hop ports context-based stateful header compression that relies
away. The mesh-under architecture defines the extent of an on information that can be inferred from a context related to
IPv6 link as all devices inside the same mesh, while the route- a flow of datagrams between two devices. This addresses the
over architecture puts routing and forwarding at the network compression of global unicast IPv6 addresses that by being
layer and defines the extent of an IPv6 link as immediate associated with a context, they do not need to be included in
devices that can be reached within a single hop. The mesh- every single IPv6 header.
under approach relies on routing functions at the link layer to
emulate a single broadcast domain where all devices appear 4.3.4.1 Stateless Compression
directly connected to each other at the network layer. In 6LoWPAN stateless compression is supported by means of
opposition, the route-over approach puts all routing functions the Header Compression 1 (HC1) header that is used to
at the network layer. compress IPv6 headers [18]. Together with the HC1 header
it is possible to include an additional Header Compression
2 (HC2) header that is used to compress some transport
4.3.4 Header Compression layer headers like UDP. The dispatch value LOWPAN_HC1
(01000010) is used to signal the presence of the HC1 header,
Constrained devices are subjected to channel access con- and within this header an additional flag is used to indicate
tention that limits for how long they can transmit. This to- that the HC2 header follows the HC1 header. Note that HC1
gether with power constraints that lower maximum transmis- and HC2 stateless compression headers have been super-
sion rates put restrictions on payload size of link layer frames. seded by the stateful compression mechanisms presented in
Because for efficiency the ratio between the sizes of headers Sect. 4.3.4.2 that support both stateful and stateless com-
and payloads must be kept low, header compression is critical pression. Having said this, however, it is still important to
in the context of 6LoWPAN. Although fragmentation can be understand how the original stateless compression scheme of
used to accommodate big payloads into multiple frames, it 6LoWPAN works.
is always preferable to minimize its use due to the negative Figures 4.27 and 4.28 show, respectively, the header for-
effect of network packet loss in fragmented datagrams. mat when HC1 is used alone and when HC1 is used in
6LoWPAN header compression can therefore take advan- combination with HC2. The difference resides in the use of
tage of the high degree of redundancy that exists in IPv6 the next header bit to indicate the presence of the HC2 header.
header fields including 128-bit addresses. Moreover, since After the dispatch value, the HC1 header includes two 2-bit
compression affects all layers above the link layer, each fields that specify the Source Address Encoding (SAE) and
device performing routing between original and final devices the Destination Address Encoding (DAE). Because encoding
must be able to do both (1) decompress IPv6 headers before is stateless, IPv6 addresses must be derived from information
making routing decisions and (2) compress IPv6 headers be- present in the frame. Moreover, whatever information cannot
4.3 6LoWPAN 93
dispatch HC1
SAE source address encoding
DAE destination address encoding
C traffic class and flow label encoding
NH next header type (if N= 1)
N=0 next header doesn’t follow
Table 4.4 HC1 address encoding transmitted in-line. Note that non-compressed in-line fields
SAE/DAE value 64-bit prefix 64-bit IID are transmitted in the order in which they appear in the
00 In-line In-line original IPv6 header.
01 In-line Derived HC2 that compresses the UDP header starts with two 1-bit
10 Link-local In-line fields that indicate, when set, that source and destination ports
11 Link-local Derived are compressed. If not set, the corresponding ports are sent in-
line. When compressed, ports are encoded by the four least
Table 4.5 HC1 next header significant bits of the port range between 61616 and 61631.
Value Meaning The following field specifies if the UDP payload length is
00 In-line removed from the header and inferred from the frame or
01 UDP transmitted in-line. The UDP checksum is transmitted in-
10 ICMP line. Figure 4.29 shows an example of a combination of HC1
11 TCP and HC2 headers when encoding UDP over IPv6 relying on
link-local addresses. Note that the resulting headers are about
56 bits long.
be derived from the frame, it must be sent in-line after the
compressed headers. 6LoWPAN Implementations There are many commer-
Table 4.4 illustrates the different possible values for DAE cial and open source 6LoWPAN implementations with
and SAE. The network prefix is either transmitted in-line support ranging from common constrained RTOS to
or assumed to be link-local as FE80::/64. Similarly, the IID general purpose Linux distributions. The list below
is either transmitted in-line or derived from the link layer shows the most popular open platforms that support
addresses. The 6LoWPAN header then includes a bit that is IEEE 802.15.4.
used to flag whether the traffic class and flow label fields are
transmitted or not. Specifically, the IPv6 8-byte traffic control
and 20-byte flow label are rarely used, so they can be re- Contiki Supported by means of the well-known open
moved from the header when this bit is set. If this bit is not set, source LwIP protocol stack.
TinyOS Supported by means of the Berkeley Low
then the traffic control and flow label are transmitted in-line.
Power IP (BLIP) protocol stack.
The IPv6 next header field is compressed right after as
OpenWSN Natively supported by the OS.
a 2-bit value in accordance with Table 4.5. As previously
Zephyr Natively supported by the OS.
stated, the last bit of the HC1 header specifies whether an Mbed Natively supported by the OS.
HC2 header follows. Note that IPv6 fields like version and Linux Kernel modules available for specific hard-
payload length are not transmitted since they can be inferred ware.
from the packet itself. The IPv6 8-bit hop limit is always
94 4 Network and Transport Layers
0 8 10 12 13 15 16 17 18 19 24 28 32 40
01111101 PAYLOAD
dispatch IPHC
0 1 2 3 5 6 8 9 10 12 13 14 16 20 24
00 ECN DSCP R FL
01 ECN R FL
10 ECN DSCP
11 NO BITS
00 source destination
01 source destination
10 source destination
11 source destination
0 1 2 3 5 6 8 9 10 12 13 14 16 21 22 23 24 28 32 48
48 56 61 62 64 68 72
NHC in-line
1.2
1 0.15
0.1
P 0.8 0.05
0.03
0.6
p
0.4
0.2
0
20 40 60 80 100
n
where n and p are the total number of fragments and the Figure 4.39 shows an example of 6LoWPAN fragmen-
network packet loss, respectively. tation. A 310-byte chunk of application data is first en-
The datagram loss probability (P ) as a function of the capsulated via UDP and becomes a 318-byte message. The
number of fragments (n) for different levels of network message is then encapsulated via IPv6 and becomes a 358-
packet loss (p) is plotted in Fig. 4.36. Clearly, for a fixed byte datagram. 6LoWPAN compresses both IP and UDP
network packet loss (p), the overall datagram loss probability headers by means of stateful IPHC and NHC headers that
(P ) increases as the number of fragments per datagram end up reducing the overall datagram size to 337 bytes.
increase (n). This implies that the best decision is to avoid Since the maximum IEEE 802.15.4 payload size is 127 bytes
fragmentation whenever possible and, if this is unavoidable, and fragmentation headers are either 4 or 5 bytes long, the
to minimize the total number of fragments per datagram. datagram is fragmented into two 120-byte fragments and one
This is particularly important in the context of IoT where 77-byte fragment. Note that 120-byte fragments are that size
network packet loss is usually a lot higher than in mainstream to preserve the 8-byte offset boundary limitations. With the 4-
networks. byte initial fragment header, the first fragment becomes 124
6LoWPAN fragmentation is carried out by means of two bytes long. With the 5-byte non-initial fragment header, the
headers that identify whether a given fragment is the initial second and third fragments become 125 and 82 bytes long,
one in a datagram. Specifically, the first five bits of the respectively.
dispatch value are either 11100 or 11000 to identify initial
(Fig. 4.37) and non-initial (Fig. 4.38) fragments, respectively.
Both headers include a 11-bit datagram size field that sup- 4.3.6 Security Considerations
ports a length of up to 2048 bytes. The length is followed
by a 16-bit tag that is unique for all fragments of any given Security is paramount in IoT networks, and this is particularly
datagram. For the worst-case scenario, it takes around 4 min true for 6LoWPAN since 6LoWPAN is one of the main
for the tag counter to roll over when transmitting frames at technologies that enables IPv6 communications in LLNs.
IEEE 802.15.4 rates. For non-initial fragments, it follows an Moreover, since 6LoWPAN compresses information in net-
8-bit offset field that indicates the fragment offset in units of work and transmission layers, it is in a key position to provide
eight bytes. The restriction of making the offset a multiple of encryption and authentication. As stated in Sect. 3.3.3.2,
eight has the advantage of decreasing the field size by three the end-to-end principle states that providing security at
bits. Note that as opposed to IPv4, the datagram size is in- higher layers is always more efficient than doing so at lower
cluded in every single fragment so that embedded devices can layers. In the context of 6LoWPAN, this means that placing
allocate a buffer to store the datagram as soon as one fragment encryption and authentication at the UDP layer is probably
is received. The alternative of storing all fragments in maps the best option. In all, the security challenges, requirements,
and queues until the fragment that includes the datagram and threats over 6LoWPAN can be summarized as those
size is received is too resource intensive and computationally presented in Sect. 4.3.6.
complex for constrained devices.
4.3 6LoWPAN 99
0 318
U application data
0 358
I U application data
0 317
IPHC
NHC application data
0 124
FRAG IPHC
1 NHC data
0 125
FRAG
2
data
0 82
U UDP
FRAG
3
data
I IPv6
100 4 Network and Transport Layers
IPH data
Example 4.2 Given the following 53-byte IPv6
datagram: original IP datagram
IPH AH data
I U P
authentication
I IPv6 header (40 bytes)
U UDP header (8 bytes) IPH EH data ET EA
P Payload ( 5 bytes) encryption
Assuming best-case scenario stateful 6LoWPAN
IPH AH EH data ET EA
compression (i.e. smallest possible IPHC and NHC
header sizes), how long does it take to transmit encryption and authentication
the IEEE 802.15.4 frame? Also assume that IEEE IPH IP header
802.15.4 frame headers are a small as possible. How AH Authentication Header
EH Encapsulating Security Payload Header
does it compare to a scenario where uncompressed ET Encapsulating Security Payload Trailer
6LoWPAN is used instead? EA Encapsulating Security Payload Authentication
Derive KDH, KM
under TLS, these features are handled by stream-based TCP
transport.
DTLS is made of two layers; (1) the low layer called DTLS
Record Protocol that ensures that connections are private by
means of symmetric encryption and message authentication
codes and (2) the high layer that supports the DTLS Hand-
shake Protocol, the DTLS Change Cipher Spec Protocol,
Fig. 4.41 HIP handshake the DTLS Alert Protocol, and the DTLS Application Data
Protocol. The DTLS Handshake Protocol enables the ne-
gotiation of security parameters. The DTLS Change Cipher
identify is disassociated from IP addresses. HIP also provides
Spec Protocol is used to signal the transitions in ciphering
end-to-end encryption.
strategies and to indicate what records are protected by the
HIP starts with a secure handshake called HIP Base Ex-
negotiated parameters. The DTLS Alert Protocol is used to
change (HIP BEX) that is used to establish the security
terminate a session by indicating an error condition. Finally,
context between an initiator and a responder (Fig. 4.41). As
the DTLS Application Data Protocol ensures that messages
IPSec, HIP information is transmitted directly over the IP
are fragmented and transmitted by the DTLS Record Proto-
layer. As part of HIP-BEX, the initiator starts by transmit-
col.
ting a message I1 that contains the initiator identity HITI
Figure 4.42 shows a DTLS handshake. Each transmission
and the responder identity HITR. The responder replies by
from the client to the server or from the server to the client
transmitting a message R1 that includes a puzzle, its Diffie-
is called a flight. There are two entities: a client that initiates
Hellman public value (DHR ), its host identity (public key
the session and a server that accepts the session establishment
PKR ), and a signature. With the R1 information, the initiator
request. Note that these roles are inherited from TLS and
can derive the Diffie-Hellman public key (KDH ) and the
TCP where a client and servers are essential to establishing
master key (KM ). The initiator then transmits message I2
secure connections. The client starts by sending a Client
that has the puzzle solution, its Diffie-Hellman public value
Hello message that is replied by the server with a Client Hello
(DHI ), its host identity (public key PKI ), and a signature.
Verify that includes a random cookie. These two optional
With the I2 information, the responder can derive the Diffie-
messages are used to protect the server against DoS attacks.
Hellman public key (KDH ) and the master key (KM ). The
The client then resends the Client Hello message but includes
responder then replies by transmitting a message R2 that has
the cookie in order to indicate that it can process messages
a message authentication code computed using the Diffie-
from the server. The Client Hello message signals the pro-
Hellman public key and a signature.
tocol version and cipher suites supported by the client. The
There have been several proposals to reduce the complex-
server then replies by sending a Server Hello message that
ity of HIP in order to make it more suitable for 6LoWPAN
indicates the selected cipher suite from the client’s list and
scenarios. Some approaches like Lightweight HIP (LHIP)
its own ITU-T X.509 certificate. If the server is configured to
reduce complexity by compromising security. Another ap-
support mutual authentication the Server Hello message also
proach known as HIP Diet Exchange (HIP DEX) removes
includes a certificate request. The server ends the transaction
the need of signatures. In all cases, however, HIP overhead is
by transmitting a Server Hello Done message. The client then
too high to consider the protocol as a viable security solution
sends the certificate if requested by the client and the Client
in the context of 6LoWPAN.
Key Exchange message encrypting a master secret using the
102 4 Network and Transport Layers
optional
encrypted
server’s public key obtained from its certificate. The master networks, with a 127-byte MTU, this is a limiting factor
secret is used by both endpoints to derive encryption and that leads to fragmentation, and, therefore, it increases the
authentication session keys. The client verifies the server’s chances of datagram loss. Essentially a 127-byte MTU yields
certificate against a known Certificate Authority (CA), and, about 70 bytes of payload after authentication and headers
under mutual authentication, the server verifies the client’s are put in place. Fortunately, DTLS addresses this issue by
certificate against a known CA. The client then transmits introducing a new mechanism by which instead of transmit-
a Change Cipher Spec message to indicate all subsequent ting the whole ITU-T X.509 certificate chain, public keys
messages are encrypted. The client transmits a Finished mes- are sent. Once received, the public keys are then validated
sage to indicate the client is done with the DTLS handshake. by endpoints by means of an out-of-band mechanism. DTLS
Similarly, the server transmits its own Change Cipher Spec also introduces handshake level fragmentation that can be
and Finished messages. used to prevent IP fragmentation of handshake messages.
DTLS breaks the data stream into DTLS records, appends Handshake level fragmentation, as opposed to the IP one, has
a MIC to each record for integrity checking, and then en- the advantage of being controlled by the DTLS Application
crypts both the record and the MIC. Figure 4.43 shows a Data Protocol and supports retransmissions at the fragment
DTLS record that consists of type, version, epoch, sequence level. Of course, there is a network overhead associated with
number, and data length fields as well as a data section and the this due to the extra datagrams being transmitted. Regardless,
MIC. Note that the first five fields are not encrypted. The type and as stated before, memory requirements in all scenarios
field indicates whether the record is a handshake message are large, as fragments associated with certificates need to be
or a message that contains application data. The epoch field stored for later reassembly at the receiver.
is a counter value that is incremented on every cipher state Although DTLS provides handshake level fragmentation,
change. The sequence number field is a counter value that is it does not support application data fragmentation. This
incremented with each record. means that for applications to prevent fragmentation, they
In the context of 6LoWPAN networking, DTLS is not must attempt to fit each message and all headers in a single
fully optimal as neither DTLS nor TLS were designed to datagram. There have been several proposals to minimize the
work with constrained networks and devices. One of these DTLS header length in order to increase the space available
issues is the fact that many of the messages exchanged during for message transmission including removing the version
handshaking are very large in nature as they carry certificates field in DTLS record carrying application data since it has
and other security parameters. This requires endpoints to already been negotiated during handshake and removing the
have large buffers to store messages in case they need to be re- length field of the last record in a given datagram since it can
transmitted. Moreover, certificates are typically represented be derived from its length.
by a chain of trust that includes intermediate certificates One way to prevent any type of fragmentation is by
that need to be transmitted along the way. In 6LoWPAN reducing the number of bytes to be transferred so that fewer
4.3 6LoWPAN 103
T V E SN L DATA M
T type
V version
E epoch
SN sequence number
L length
M message integrity code
fragments can be potentially lost. One approach to accom- Although a DTLS handshake stage consumes a lot of
plish this is by exchanging, out of band, large chunks of memory due to the buffers required for retransmissions,
data. To this end, the TLS Cached Information Extension is a once a session is established, memory requirements are a
mechanism that enables an endpoint to omit the transmission lot less stringent. In general, a single session must have
of information, such as a certificate, that is already known enough memory to store session keys and sequence num-
to its peer. Another way to reduce the number of trans- bers. This is, in general, used to dimension the number of
mitted bytes is by introducing header compression. There supported DTLS sessions in 6LoWPAN scenarios. With most
have been multiples proposal for DTLS header compression embedded devices and real-time operating systems (RTOSs),
under 6LoWPAN including the use of IETF RFC 7400 that DTLS connections are allocated statically as part of pools
introduces 6LoWPAN-GHC a generic header compression of predefined size. Because of the memory implications of
mechanism under 6LoWPAN [3]. Other proposals include DTLS, determining when a DTLS connection terminates is
transmitting only the least significant bits of the sequence important. DTLS connection closure consists of a closure
number, using self-delimiting fields instead of fixed sized alert that is not retransmitted even if packet loss occurs.
fields as with Huffman coding and using single bit fields This, again, can lead to memory exhaustion due to stale
instead of multiple type fields to encode handshake mes- connections that result from lost alerts in the context of
sages. IETF RFC 7925 that addresses the security profiles lossy 6LoWPAN networks. One way to guarantee that DTLS
under TLS and DTLS for IoT states that compression at the connections are terminated is by keeping track of them such
TLS/DTLS layer is not needed since application-layer proto- that when a device starts running out of resources, the least
cols are highly optimized, and the compression algorithms at frequently used (LFU) connections are removed first. IETF
the DTLS layer increases code size and complexity [29]. RFC 7925 recommends using a mechanism introduced in
Another critical element are timers; DTLS recommends IETF RFC 6520 that introduces a heartbeat mechanism to
that protocol implementations include an initial timer of 1 s verify whether a given DTLS connection is still active [31].
and double the value each time a message is retransmitted Since a single flight is associated with one or more mes-
up to a maximum value of 60 s. In the context of DTLS, sages like Server Hello and Certificate Request in Fig. 4.42,
an initial timer of 1 s may lead to bogus retransmissions several fragments may end up being transmitted. This is
as it may not give enough time for embedded IoT devices aggravated by the fact that many messages are independent
to perform message transmissions. In 6LoWPAN networks, and can be transmitted in parallel. In this case, multiple
therefore, the initial retransmission timer value may need to fragments may simultaneously arrive at the receiver causing
be adjusted depending on hardware requirements. IETF RFC input buffer overflows that could lead to datagram loss. One
7925 recommends an initial timer value of 9 s. way to prevent this is by making sure that the DTLS protocol
The number of handshake messages and their complex- implementation transmits independent messages in a flight
ity have memory implications that can be challenging in sequentially. Another problem with fragmentation is the fact
6LoWPAN networks. When compared to TLS, DTLS is that message integrity check requires the whole record to be
even more complex because it incorporates the initial cookie processed even if it has been corrupted. Additionally, if a
exchange intended to prevent DoS attacks. There have been message is to be retransmitted, the cleartext or unencrypted
several proposals addressing this issue including introducing version of the message must be stored in order to be re-
client puzzles to prevent DoS attacks in a similar way to encrypted with every single retransmission. The idea behind
HIP DEX. Another possibility is for the client to create preserving a cleartext message is to make sure that every
DTLS connections before they are really needed in order to retransmission is different since sequence numbers are dif-
minimize the time it takes to send secure datagrams once they ferent, thus providing replay protection. This also increases
become available. This approach, however, requires servers memory requirements and prevents the implementation from
to be powerful enough to support and maintain multiple implementing in-place encryption. This mechanism consists
simultaneous DTLS sessions.
104 4 Network and Transport Layers
(continued)
4.4 6Lo 105
IEEE 1901.2
N IPv6
BLE A 6LoPLC
N IPv6
L IEEE 1901.2
A 6LoBTLE
P IEEE 1901.2
L BLE
P BLE
IPv6
gateway
device
P physical layer
L link layer
A adaptation layer
N IPv6 N IPv6
N network layer
A 6LoWPAN A NFC 6LoWPAN
L IEEE 802.15.4 L NFC
N IPv6
P IEEE 802.15.4 P NFC
A 6Lo IEEE 802.11ah
IEEE 802.11ah
Table 4.10 6Lo Technologies hops are IP hops. The only 6Lo technologies that support
Technology Adaptation layer Topology a mesh topology are IEEE 1901.2 and ITU-T G.9959 that
ITU-T G.9959 ITU-T G.9959 6LoWPAN M reuse 6LoWPAN functionality. ITU-T G.9959 supports both
MS/TP LoBAC M modes of operation, while IEEE 1901.2, under 6LoWPLC,
DECT ULE DECT ULE 6LoWPAN S only supports mesh-under forwarding.
IEEE 1901.2 6LoPLC M Address compression is also key to both 6LoWPAN and
NFC NFC 6LoWPAN S 6Lo. Specifically, the IID, obtained from link layer address-
IEEE 802.11ah 6Lo IEEE 802.11ah S ing, is not only used to derive IPv6 addresses by means of
IEEE 802.15.4 6LoWPAN M SAA but also to provide their compression. All adaptation
mechanisms standardized and proposed for the 6Lo technolo-
gies described in this section rely on address compression.
technologies are compared in Table 4.10 where the topology One drawback of this compression, however, is the fact that
column indicates whether they support multi-hop (M) or the universal and static nature of IIDs can lead to security
single-hop (S) communication. attacks. In this context, different proposals that target this
Many of these technologies are not just physical and link issue under 6Lo have been proposed.
layer technologies. Like ZigBee with IEEE 802.15.4, BLE, Header compression, as provided by 6LoWPAN, can be
NFC, and DECT ULE prescribe full stacks that include their stateless or stateful to take advantage of the inter- and intra-
own network, transport, and application layers. In these sce- flow information correlation. The difference between one
narios, 6Lo replaces these upper layers with IETF IP-based approach and the other is extra computational complexity in
protocols. In all cases, however, the different physical and favor of stateful compression. All 6Lo technologies, other
link layers face different challenges associated with issues than IEEE 1901.2 under 6LoWPLC which is based on IEEE
ranging from low transmission rates to small MTU sizes 802.15.4, modify 6LoWPAN header compression to adapt
including lack of link layer fragmentation and asymmetries to specific needs of the link layer. ITU-T G.9959, MS/TP
between uplink and downlink mechanisms. LoBAC, IEEE 802.11ah, and NFC introduce minor changes
As previously indicated in Sect. 4.3.3, 6LoWPAN pro- associated with the address length of the link layer addresses.
vides two main modes of operation to support a multi-hop Single-hop star topologies like BLE and DECT ULE are
topology: mesh-under where the multi-hop path appears as a slightly less complex from a header compression point of
single link to the network layer and route-over where physical view since the gateway, when receiving a datagram, can
106 4 Network and Transport Layers
safely assume that the source address is that of the originator. to understand what threats can affect 6Lo technologies and
Moreover, when a device receives a datagram from the gate- how they can be prevented. Neighbor discovery is usually
way, it can also safely assume that the destination address affected by DoS attacks where an intruder pretends to be a
is that of itself. In either case, this leads to IPv6 source or legitimate device by sending fake ND messages. One way to
destination address suppression. prevent this is by relying on router priorities while limiting
Fragmentation is another important issue associated with ND transmission rates. Fragmentation is another issue that
6LoWPAN. Specifically, 6LoWPAN introduces fragmenta- can lead to security attacks. Specifically, an attacker can send
tion because IEEE 802.15.4 does not include any mech- incomplete datagrams with pending fragments that cause
anism to truncate upper layer datagrams. Since the other devices to waste memory resources for long periods of time.
6Lo technologies do support link layer fragmentation, this The intruder can also send fake and duplicate fragments that
is not typically a requirement for their IPv6 adaptation lay- cause corruption of incoming datagrams.
ers. Moreover, under IPv6, MS/TP and IEEE 802.11ah do
not even need to support fragmentation because with 2032-
byte and 7951-byte MTU sizes, respectively, they can easily 4.5 6TiSCH
transport any minimum size 1280-byte IPv6 fragment. Also
related to fragmentation is the encapsulation overhead due to IPv6 over TSCH [30] is an umbrella term for a group of
the physical and link layers headers. In general, the larger the protocols intended to provide IPv6 support over the IEEE
headers, the smaller the payload available and the greater the 802.15.4e TSCH media access mechanism presented in
need for fragmentation. For example, BLE and DECT ULE Sect. 3.3.3.3. Because traditional 6LoWPAN and associated
that support very small payload size are heavily affected by routing mechanisms are not designed to handle the
fragmentation. The overhead of MS/TP and IEEE 802.11ah synchronous nature of the TSCH link layer, 6TiSCH provides
is comparatively low as they both can carry most IPv6 additional functionality that compensates for this missing
datagrams without fragmentation. The other technologies, functionality. 6TiSCH introduces a thin layer above the MAC
ITU-T G.9959, IEEE 1901.2, NFC, and IEEE 802.15.4 suffer functionality of TSCH called 6TiSCH Operational Sublayer
some fragmentation for large datagrams. In all scenarios, the (6top) that binds asynchronous 6LoWPAN to synchronous
fragmentation overhead at either layer, link, or adaptation is TSCH.
very low. Specifically, 6LoWPAN provides IPv6 adaptation for tra-
All 6Lo adaptation methods, other than that of IEEE ditional CSMA/CA-based IEEE 802.15.4, but it is not pre-
1901.2, rely on either 6LoWPAN ND or traditional IPv6 ND pared to deal with TSCH-based IEEE 802.15.4e. 6TiSCH sits
for neighbor discovery. Specifically, IEEE 1901.2 relies on in between 6LoWPAN and IEEE 802.15.4e. Figure 4.45 il-
DHCPv6 for address autoconfiguration. IPv6 multicasting lustrates the layer differences between traditional CSMA/CA
is particularly important in IoT as it enables applications to and TSCH stacks.
reach multiple devices through the transmission of a single 6TiSCH supports dynamic scheduling by means of two
datagram. Of all 6Lo technologies, only IEEE 802.11ah na- separate entities; (1) the 6top Protocol (6P) that can be used
tively supports multicast and broadcast transmissions. More- by neighbors to negotiate the addition and removal of cells
over, BLE and DECT ULE only support unicast transmis- from the schedule and (2) a Scheduling Function (SF) that
sions. Regardless, for IPv6 multicast to work properly, it is triggers 6P negotiations. The 6P, which is standardized under
critical that the adaptation layer is able to present to the upper IETF RFC 8480, provides several commands that neighbors
layer multicast support. This implies that 6Lo adaptation can execute to support schedule cell management including
follows 6LoWPAN in the fact that each multicast datagram adding, removing, and relocating cells from a schedule as
is transmitted by the adaptation layer to each device in the well as listing cells and signaling SFs.
multicast group as individual unicast datagrams. This has to 6P negotiation is carried out by means of 2-step or 3-step
be done very efficiently as it can lead to depleted batteries. transactions. 2-step transactions consist of one device trans-
Security is also a key factor with 6Lo but fortunately mitting a request to its neighbor that replies by transmitting
most adaptation mechanisms like 6LoWPAN rely heavily on a response. This is usually used when a device wants to add,
link layer security. Since all these technologies, including remove, or relocate a given cell. Three-step transactions add
IEEE 802.15.4, provide some sort of security at the link an extra confirmation that is transmitted by device that initi-
layer this is not usually a problem. Also, most applications ated the transaction. This is used when one device requests
support end-to-end security that, as explained in Sect. 4.3.6, adding one or more cells to the schedule and expects the
is always more efficient than security placed at lower layers. receiving neighbor to offer a list of available cells for the
Due to the limited resources, the biggest challenge is to originator to select from. This is illustrated in Fig. 4.46 where
make sure that upper and lower layer security mechanisms device 1 sends a request to add two cells and the receiving
do not inefficiently overlap. In this context, it is important neighbor device 2 offers four cells (2,3), (3,5), (1,2), (5,1)
Homework Problems and Questions 107
(a) SAA based unicast Consider best and worst stateful compression scenarios. In-
(b) Link-local dicate all assumptions.
4.2 Why is DAD needed, if SAA relies on using MAC 4.11 What is the main difference between the 6LoWPAN
addresses that are typically unique? S/SAM and SAE fields?
4.3 What is the point of using fewer of the eight available 4.12 If an IEEE 802.15.4 IoT sensor generates N-byte read-
bits for dispatch encoding? outs at a rate of R readouts per second. Assuming each read-
out is transmitted over UDP/IPv6 and compressed by means
4.4 Why does not the initial 6LoWPAN fragment include the of 6LoWPAN. For the maximum nominal transmission rate
offset field? and best stateful compression, what is the relationship be-
tween R and N? Assume a minimum size IEEE 802.15.4
4.5 Given the following 88-byte IPv6 datagram… header.
What are the best compression rates for the scenarios listed
A B
below? Indicate all assumptions. Note that the compression
IPv6 address 2001::21:05 2001::21:10
rate is defined as the ratio between the size of the compressed MAC address 11:22:33:44:55:66:77:88 11:22:33:44:55:66:77:99
frame and that of the original datagram. Assume minimum
6LoWPAN compressed network and transport headers.
4.14 In an IoT scenario where real time readouts are trans-
(a) Stateless 6LoWPAN compression mitted over TCP by a sensor, what is a drawback of disabling
(b) Stateful 6LoWPAN compression Nagle’s algorithm?
4.6 Why is the 6LoWPAN fragment offset field a multiple 4.15 What does a 6LoWPAN stack that supports DTLS
of eight? security look like?
4.7 Repeat Problem 4.5 but considering the following 68- 4.16 Given the following scenario, if sensor A sends a data-
byte IPv4 datagram… gram to the application, what does the IEEE 802.15.4 frame
generated by the sensor look like? What does the Ethernet
frame generated by the edge router look like? Include all
I U P
headers and associated fields. Assume a 20-byte payload.
I IPv4 header (20 bytes) Indicate all assumptions including source and destination
U UDP header (8 bytes) UDP ports.
P Payload (40 bytes)
4.17 For the same conditions, what does typically result in 14. Khssibi, S., Idoudi, H., Van Den Bossche, A., Val, T., Saidane,
lower latency 6LoWPAN over IEEE 802.15.4 or over IEEE L.A.: Presentation and analysis of a new technology for low-power
wireless sensor network (2013)
802.15.4e? Why?
15. Kim, E., Kaspar, D., Gomez, C., Bormann, C.: Problem Statement
and Requirements for IPv6 over Low-Power Wireless Personal
4.18 How is a 20-byte payload transported over TCP state- Area Network (6LoWPAN) Routing. RFC 6606 (2012). https://
fully compressed by 6LoWPAN and transmitted over IEEE doi.org/10.17487/RFC6606. https://rfc-editor.org/rfc/rfc6606.txt
16. Lynn, K., Martocci, J., Neilson, C., Donaldson, S.: Transmission
802.15.4? What headers and fields do the IEEE 802.15.4
of IPv6 over Master-Slave/Token-Passing (MS/TP) Networks. RFC
frame include? 8163 (2017). https://doi.org/10.17487/RFC8163. https://rfc-editor.
org/rfc/rfc8163.txt
4.19 A sensor generates 500-byte readouts, if the network 17. Mariager, P.B., Petersen, J.T., Shelby, Z., van de Logt, M., Barthel,
D.: Transmission of IPv6 Packets over Digital Enhanced Cordless
frame loss is 5%, what is the datagram loss for the following
Telecommunications (DECT) Ultra Low Energy (ULE). RFC 8105
two scenarios? (2017). https://doi.org/10.17487/RFC8105. https://rfc-editor.org/
rfc/rfc8105.txt
(a) IEEE 802.15.4 18. Montenegro, G., Hui, J., Culler, D., Kushalnagar, N.: Transmis-
sion of IPv6 Packets over IEEE 802.15.4 Networks. RFC 4944
(b) Ethernet
(2007). https://doi.org/10.17487/RFC4944. https://rfc-editor.org/
rfc/rfc4944.txt
19. Montenegro, G., Schumacher, C., Kushalnagar, N.: IPv6 over
References Low-Power Wireless Personal Area Networks (6LoWPANs):
Overview, Assumptions, Problem Statement, and Goals. RFC 4919
1. Belshe, M., Peon, R., Thomson, M.: Hypertext Transfer Protocol (2007). https://doi.org/10.17487/RFC4919. https://rfc-editor.org/
Version 2 (HTTP/2). RFC 7540 (2015). https://doi.org/10.17487/ rfc/rfc4919.txt
RFC7540. https://rfc-editor.org/rfc/rfc7540.txt 20. Moskowitz, R., Heer, T., Jokela, P., Henderson, T.R.: Host Identity
2. Bluetooth, S.: Bluetooth 5.2 core specification, p. 3256 (2019) Protocol Version 2 (HIPv2). RFC 7401 (2015). https://doi.org/10.
3. Bormann, C.: 6LoWPAN-GHC: Generic Header Compression for 17487/RFC7401. https://rfc-editor.org/rfc/rfc7401.txt
IPv6 over Low-Power Wireless Personal Area Networks (6LoW- 21. Narten, D.T., Thomson, D.S.: IPv6 Stateless Address Autoconfig-
PANs). RFC 7400 (2014). https://doi.org/10.17487/RFC7400. uration. RFC 2462 (1998). https://doi.org/10.17487/RFC2462.
https://rfc-editor.org/rfc/rfc7400.txt https://rfc-editor.org/rfc/rfc2462.txt
4. Brandt, A., Buron, J.: Transmission of IPv6 Packets over ITU-T 22. Nieminen, J., Savolainen, T., Isomaki, M., Patil, B., Shelby, Z.,
G.9959 Networks. RFC 7428 (2015). https://doi.org/10.17487/ Gomez, C.: IPv6 over BLUETOOTH(R) Low Energy. RFC 7668
RFC7428. https://rfc-editor.org/rfc/rfc7428.txt (2015). https://doi.org/10.17487/RFC7668. https://rfc-editor.org/
5. Deering, D.S.E., Hinden, B.: Internet Protocol, Version 6 (IPv6) rfc/rfc7668.txt
Specification. RFC 8200 (2017). https://doi.org/10.17487/ 23. Oppliger, R.: SSL and Tls: Theory and Practice, 2nd edn. Artech
RFC8200. https://rfc-editor.org/rfc/rfc8200.txt House, Norwood (2016)
6. Frankel, S., Krishnan, S.: IP Security (IPsec) and Internet Key 24. Rescorla, E.: The Transport Layer Security (TLS) Protocol Version
Exchange (IKE) Document Roadmap. RFC 6071 (2011). https:// 1.3. RFC 8446 (2018). https://doi.org/10.17487/RFC8446. https://
doi.org/10.17487/RFC6071. https://rfc-editor.org/rfc/rfc6071.txt rfc-editor.org/rfc/rfc8446.txt
7. Gomez, C., Paradells, J., Bormann, C., Crowcroft, J.: From 6low- 25. Rescorla, E., Modadugu, N.: Datagram Transport Layer Security
pan to 6lo: Expanding the universe of ipv6-supported technologies Version 1.2. RFC 6347 (2012). https://doi.org/10.17487/RFC6347.
for the internet of things. IEEE Commun. Mag. 55 (2017). https:// https://rfc-editor.org/rfc/rfc6347.txt
doi.org/10.1109/MCOM.2017.1600534 26. Shelby, Z., Bormann, C.: 6LoWPAN: The Wireless Embedded
8. Graziani, R.: IPv6 fundamentals: a straightforward approach to Internet. Wiley, New York (2010)
understanding IPv6. Pearson Education (2012) 27. Simpson, W.A., Narten, D.T., Nordmark, E., Soliman, H.: Neighbor
9. Gupta, M., Conta, A.: Internet Control Message Protocol (ICMPv6) Discovery for IP version 6 (IPv6). RFC 4861 (2007). https://doi.
for the Internet Protocol Version 6 (IPv6) Specification. RFC 4443 org/10.17487/RFC4861. https://rfc-editor.org/rfc/rfc4861.txt
(2006). https://doi.org/10.17487/RFC4443. https://rfc-editor.org/ 28. Thubert, P., Hui, J.: Compression Format for IPv6 Datagrams over
rfc/rfc4443.txt IEEE 802.15.4-Based Networks. RFC 6282 (2011). https://doi.
10. Ikpehai, A., Adebisi, B.: 6loplc for smart grid applications. In: 2015 org/10.17487/RFC6282. https://rfc-editor.org/rfc/rfc6282.txt
IEEE International Symposium on Power Line Communications 29. Tschofenig, H., Fossati, T.: Transport Layer Security (TLS) / Data-
and Its Applications (ISPLC), pp. 211–215 (2015) gram Transport Layer Security (DTLS) Profiles for the Internet of
11. ISO/IEC 18000-3: Parameters for air interface communications at Things. RFC 7925 (2016). https://doi.org/10.17487/RFC7925.
13,56 MHz. Standard, International Organization for Standardiza- https://rfc-editor.org/rfc/rfc7925.txt
tion, Switzerland (2010) 30. Vilajosana, X., Watteyne, T., Chang, T., Vučinić, M., Duquennoy,
12. ITU, T.S.S.: Itu-t g.9959 : Short range narrow-band digital radio- S., Thubert, P.: Ietf 6tisch: a tutorial. IEEE Commun. Surv.
communication transceivers - phy, mac, sar and llc layer specifica- Tutorials 22(1), 595–615 (2020)
tions. Tech. rep., International Telecommunication Union (2015) 31. Williams, M., Tüxen, M., Seggelmann, R.: Transport Layer Se-
13. Kaufman, C., Hoffman, P.E., Nir, Y., Eronen, P., Kivinen, T.: curity (TLS) and Datagram Transport Layer Security (DTLS)
Internet Key Exchange Protocol Version 2 (IKEv2). RFC 7296 Heartbeat Extension. RFC 6520 (2012). https://doi.org/10.17487/
(2014). https://doi.org/10.17487/RFC7296. https://rfc-editor.org/ RFC6520. https://rfc-editor.org/rfc/rfc6520.txt
rfc/rfc7296.txt 32. ZigBee Specification. Standard, The ZigBee Alliance, USA (2015)
Application Layer
5
The IETF layered architecture indicates that the application 5.2.1 REST Architecture
layer also performs session and presentation functions that
enable the management of different sessions as well as en- IoT connectivity at the session level can take advantage of
cryption and authentication mechanisms. Most so-called IoT the existing request/response architecture that is an integral
application layer protocols provide session management such part of the web. Moreover, not only session layer mechanisms
that application layer-specific functionality is typically car- like HTTP but other technologies like HTML, JavaScript,
ried out by some other mechanism that encodes both sensor Node JS, Ajax, and PHP can be leveraged to provide con-
and actuation traffic. This is a similar situation to web traffic nectivity between devices and applications. This approach
transmission that relies on HTTP for session management has led to what it is called the Web of Things (WoT) that
and relies on Hypertext Markup Language (HTML) for ap- relies on embedding a simple web server on devices to take
plication data encoding. When considering session manage- advantage of the web infrastructure. There is no need for
ment, there are two well-known topologies request/response topology or client changes since all updates are pushed to the
and publish/subscribe that are shown in Figs. 5.1 and 5.2, devices. In general, request/response mechanisms associated
respectively [3, 15]. with web technologies like HTTP comply quite well with the
The request/response model, also known as client/server REST distributed architecture. REST architectures formalize
model, bases its interaction between application and device a series of requirements and interfaces that are necessary
by means of requests and responses. The device, sensor or for client/server interaction [8]. Not all REST schemes rely
actuator, acts as a server, while the application acts as a client. on the HTTP protocol, and not all HTTP scenarios support
The client typically requests sensor data or sends actuation REST architectures. Other protocols like CoAP, presented
commands, while the server responds by transmitting sensor later in this chapter, also support REST deployments.
readouts or actuation acknowledgments. The model is based For an architecture to be REST based, it must comply
on synchronous polling where for each request there is a with six requirements or principles. Freedom is given on
response. On the other hand, the publish/subscribe model the implementation of each component if it meets these
relies on a central broker that queues and delivers mes- requirements. The six requirements are the following:
sages between applications and devices. First, the application
subscribes to a specific topic supported by the device. The (1) The client/server requirement that states that a Uniform
device publishes device messages by sending them to the Interface separates clients and servers. This implies that
broker. The broker stores the messages and forwards them storage is associated with servers, while user interaction
via notifications to the application that is interested in them. is a function of the client. If the interface between a client
This model is based on asynchronous observation of devices and a server is preserved, they can evolve independently.
that do not rely on polling. The advantage of this mech- Moreover, clients and servers can be upgraded and down-
anism is that it improves latency and network utilization, graded without affecting each other.
but it requires the use of a broker that is a single point of (2) The stateless requirement that states that communication
failure. between client and servers is stateless and that each
© The Author(s), under exclusive license to Springer Nature Switzerland AG 2022 111
R. Herrero, Fundamentals of IoT Communication Technologies, Textbooks in Telecommunication
Engineering, https://doi.org/10.1007/978-3-030-70080-5_5
112 5 Application Layer
subscribe
publish
notify
application sensor, actuator
broker
request must contain all the information needed by the Table 5.1 shows an example of specific HTTP methods
server to process it and respond. No content stored on the and how they are used in the context of individual devices as
server can be used to process the request. Session state, well as collections of them. More details of the HTTP proto-
if any, is kept on the client side. col are presented in the following section. Note that REST
(3) The cacheable requirement that states that to minimize requests rely on resource identification by means of Uni-
overall network throughput and guarantee network versal Resource Identifiers (URIs) that follow the method.
efficiency, requests can be cached at the clients. Clients refer to resource identifiers but handle representations
Server responses indicate whether a given message of those resources and not the resources themselves. These
is cacheable or not depending on how likely it is to representations are data structures that can be formatted
change. via HTML, the more generic Extended Markup Language
(4) The Uniform Interface requirement that, besides separat- (XML), or JavaScript Object Notation (JSON). If a client
ing the client/server architectures, enables independent has enough permissions, it can use its own resource repre-
protocol evolution. sentation to update the resource on the server accordingly.
(5) The layered system requirement that states that the archi- Moreover, the client can also delete the resources from the
tecture must be composed of several hierarchical layers server.
with visible interfaces but without a formally specified One issue with traditional REST architectures is that the
implementation. CRUD mechanisms rely on the client always initializing the
(6) The code on demand requirement that allows client interaction with the server. In the context of IoT, this implies
code to be extended by dynamically downloading that the application must periodically send requests to obtain
and executing scripts from the server. This allows readouts from devices. For each readout, therefore, there is
the simplification of the client infrastructure by min- a full duplex transaction between client and server. There
imizing the preinstalled code and expediting software are two problems associated with this situation: (1) extra
updates. latency due to the time it takes for the client to poll the
sensor and (2) extra traffic due to the additional datagrams
REST APIs provide the basic functionality to access net- needed to poll the sensor. To address this issue, the reference
work resources by means of their representational states. architecture for IoT, introduced by the European Telecom-
REST APIs rely on the CRUD mechanism; C stands for munications Standards Institute (ETSI), extends REST by
create, R stands for read, U stands for update, and D stands means of two additional operations: (1) notify and (2) ex-
for delete. Essentially a client must be able to create, read, ecute. The notify operation, also known as observation, is
update, and delete an object representation. This is ideal triggered upon a change in the representation of a resource
for an IoT environment where objects are devices that are and results in a notification sent to the client in order to
(1) created as sensors or actuators, (2) read when they are monitor changes of the resource in question. The execute
sensors, (3) updated when they are actuators, or (4) deleted. operation enables a client to request the execution of a
In the context of the Internet, REST APIs rely on HTTP to specific task on the server. In the context of the CRUD set,
provide session management. As shown in Fig. 5.3, different notify is implemented by an UPDATE operation transmit-
HTTP methods are used; POST is used to create a new device ted from the server toward the requesting client. Similarly,
(sensor or actuator), GET is used to retrieve a sensor readout, execute is implemented by an EXECUTE operation from
PUT is used to update the state of an actuator, and DELETE the client to the server that includes task information and
is used to delete a device. parameters.
5.2 Request/Response 113
device AP
I
IP
AP
I
Table 5.1 REST API Methods HTTP method Entire collection, e.g. /devices/ Specific item, e.g. /devices/id/
GET 200 (OK)—list of devices 200 (OK)—single device
404 (Not Found) if ID is not found or invalid
PUT 404 (Not Found) 200 (OK) or 204 (No Content)—update device information
404 (Not Found) if ID is not found or invalid
POST 201 (Created)—Location header with 404 (Not Found)—Generally not used
link to /devices/id/ containing the new ID.
DELETE 404 (Not Found) 200 (OK)
404 (Not Found)—Generally not used
5.2.2 HTTP
connection.
3
e 2/ HTTP transported by means of persistent TCP connec-
ds hak
han tions has become more efficient with newer versions of
HTTP. This is shown in Fig. 5.7. The very first version 1.0
TIME
request
sensor
of HTTP, formally known as HTTP/1.0, only allowed clients
data hand to send requests in a stop-and-wait fashion. In other words,
shak
e 3/
3 if a client transmits a request, it must wait for the server
HT T
P re
ques response before it can transmit another request. The result of
t send this behavior is excessive latency. HTTP 1.1 (formally known
RTT
readout latency
readout latency
HTT
P re
que
st
nse nse
po
TIME
es es po
T Pr T Pr
HT HT
TIME
readout request readout request
HTT
P re
readout latency
que
st
nse
po
readout latency
es
T Pr
HT
HTT
P re
que
st
se
p on
res
TP
HT
Assume the following: (a) the IEEE 802.15.4 Solution The overall delay is given by T = T1 +
transmission rate is 250 KBps, (b) the Ethernet T2 + T3 + T4 where T1 is the delay associated
transmission rate is 1 Gbps, (c) the only delay with the transmission of the TCP SYN frame to es-
is the transmission delay, (d) the TCP header is tablish the connection (as part of the initial RTT),
T2 is the delay associated with transmission of the
(continued)
(continued)
116 5 Application Layer
1 1 1
2 2
3 3
TIME
TIME
TIME
2
3
1 1
2 1
2
3
PIPELINING MULTIPLEXING
2
3
HEADER LINES
ENTIRE BODY
SP ASCII space
CR ASCII carriage return
LF ASCII line feed
the client talks to the server through an intermediate proxy Table 5.2 HTTP response codecs
server. In this case, the header tells the proxy server who Range meaning
the final destination of the message is. The second header is 100–199 Informational
the Connection header that indicates whether the connection 200–299 Success
is persistent or not. The third and last header is the User- 300–399 Redirect
Agent header that identifies the application that is making 400–499 Client errors
the request to the sensor. This field lets the server make 500–599 Server errors
presentation decisions based on the type of application that
is originating the request. Other HTTP requests like POST
requests include a message body that follows the carriage line, in turns, includes a version field HTTP/1.1, a status
return and line feed after the last header in the message. The code 200, and a status message OK that maps the status
message body is used to include large amounts of information code. A response with a 200 OK status indicates that the
that can be transferred from the client to the server. This request was received and reply information is returned as
is particularly important in certain actuation scenarios. The part of the message. Other status codes are (1) 301 Moved
message body is also used in responses to HTTP GET re- Permanently to indicate that the object representation has
quests to carry object representations. The HEAD and GET been permanently moved and a new URL is specified in the
methods are similar with the difference that the former is used location, (2) 400 Bad Request that is a generic error code used
to signal that the client does not want to receive the message to indicate that the request was not understood by the server,
body if present. Essentially, the HEAD method enables the (3) 404 Not Found that indicates that the object does not
client to examine the object before requesting it in order to exist in the server, and (4) 505 HTTP Version Not Supported
minimize network utilization. On the other hand, the PUT that tells the client that the HTTP protocol version is not
method is usually used to create and upload objects, while supported by the server. Table 5.2 illustrates the numerical
the DELETE method enables a client to delete an object from range of possible response codes and their meaning. The first
the server. Figure 5.8 shows the format of a generic HTTP header is the Connection header that tells the client that the
request message. connection must be closed after the message is sent. The
The message below is an example of an HTTP response second header is the Date header that specifies when the
transmitted by a sensor including a temperature readout: HTTP response was created. The third header is the Server
HTTP/1.1 200 OK header that identifies the entity that created the response. The
Connection: close fourth header is the Last-Modified header that indicates when
Date: Tue, 23 July 2019 15:44:04 GMT the object representation was last changed. The fifth header
Server: www.l7tr.com is the Content-Length header that indicates the length of the
Last-Modified: Tue, 23 July 2019 15:44:04 GMT message body. Finally, the sixth header is the Content-Type
Content-Length: 5 header that identifies the encoding of the body. In this case,
Content-Type: text/plain the message body is a plain ASCII text that encodes in 5 bytes
the string 23.1C representing a temperature of 23.1◦ degrees.
23.1C Figure 5.9 shows the format of a generic HTTP response
In a similar way to a request, a response has three sections: message.
a status line, several headers, and a message body. The status
118 5 Application Layer
HEADER LINES
BLANK LINE CR LF
ENTIRE BODY
SP ASCII space
CR ASCII carriage return
LF ASCII line feed
5.2.2.2 Cookies the client has been powered down, the requests from the client
As presented in Sect. 5.2.1, one of the main characteristics include the 2105 cookie identifier that is used, in turn, by the
of REST architectures is that they are stateless. HTTP, fitting sensor to identify the application and respond in accordance
the REST model, is stateless, but for many applications, it is with pre-specified preferences and states.
convenient to have a mechanism to treat certain transactions
as stateful. For example, if an application user is interested in 5.2.2.3 Proxy Servers
temperature readouts presented as Centigrade degrees, it may A proxy server, also known as a web cache, is a device
be interesting for the device to be able to implicitly identify that sits between client applications and sensors as well
these requests by keeping track of a user state. Cookies are as devices acting as HTTP servers in order to respond to
an add-on mechanism that can be used to introduce a state client requests on behalf of these servers. Proxy servers
in the interaction between clients and servers. Cookies are can reply on behalf of HTTP servers by keeping copies
associated with users, and although they violate the REST of the information stored in them. Since proxy servers are
principle, they are useful under certain circumstances. Es- close to client applications, they are useful in lowering core
sentially cookies are short strings that enable IoT devices traffic throughput and thus accomplishing better channel
to identify multiple applications. The cookie infrastructure utilization, reducing data access latency, and providing re-
relies on two databases: one at the client and another at dundancy. Proxy servers attempt to keep in their own stor-
the server. It also relies on two cookie headers, Cookie and age the most recent copies of any server object that may
Set-Cookie, that are added to HTTP requests and responses, be requested by applications. Proxy server interaction with
respectively. clients is shown in the example of Fig. 5.11. The following
Figure 5.10 shows the interaction between a client applica- steps describe the flow of messages shown in that figure:
tion and a sensor server. The client has previously interacted (1) the client connects to its pre-configured proxy server to
with another server that has populated a cookie identified by request, via HTTP, a specific temperature readout; (2) the
1912 in its own database. The figure describes the process in proxy server checks whether it has the most recent readout
several steps: (1) the application sends a request to retrieve a of the temperature (if so, jump to step (6)); (3) if the proxy
readout of temperature in Centigrade degrees from the sensor. server does not have a recent copy, it connects to the sensor
This information is specified as part of the URL, but since and requests, via HTTP, the temperature readout; (4) the
this is the first time that this interaction occurs, the client sensor sends an HTTP response including an object repre-
does not include a Cookie header in the request; (2) the sentation of the temperature readout; (5) the proxy server
server then responds to the incoming request by transmitting stores the copy of the temperature object; and (6) the proxy
the temperature readout and associating cookie 2105 to the server sends the object representation of the temperature
client. The cookie is transmitted as a Set-Cookie header to readout to the client. These steps are summarized as a flow in
the application; (3) the client stores the cookie and associates Fig. 5.12.
it with the sensor; then it requests a new readout, but this time The main question is how a proxy server remains syn-
it does not specify a full URL but the 2105 cookie instead; (4) chronized with a web server; HTTP provides a mechanism
the device associates the request with the user by means of the known as conditional GET that allows the proxy server to
received 2105 cookie and responds with a new temperature verify that a specific object is up to date. The message below
readout in Centigrade degrees; (5) any later time, even after is an example of a conditional GET request:
5.2 Request/Response 119
application sensor C
sensor A: 1912
GET
tem
pe ratu
re in C°
unit
s
sensor creates
its entry 2105
° un
re in C 05
atu ie: 21
per k
tem et-Coo
S
sensor A: 1912
sensor B: 2105
GET
Coo sensor
kie:
2105
cookie-specific
its
° un acon
re in C 05
atu ie: 21
per k
tem et-Coo
S
LATER
sensor A: 1912
sensor B: 2105 GET
Coo sensor
kie:
2105
cookie-specific
nits acon
i n C° u
re 05
atu ie: 21
per k
tem et-Coo
S
GET /sensor102/temperature HTTP/1.1 On the other hand, if there have been more readouts since
Host: www.l7tr.com the last request, the sensor replies with a regular 200 OK
Connection: close response:
User-Agent: PXO Sensor HTTP/1.1 200 OK
If-modified-since: Tue, 23 July 2019 15:44:04 Connection: close
GMT Date: Tue, 23 July 2019 15:44:04 GMT
The request includes a If-Modified-Since header that is Server: www.l7tr.com
used by the proxy server to obtain a new object representation Last-Modified: Tue, 23 July 2019 16:04:04 GMT
only if it has changed since it was last requested on Tuesday, Content-Length: 5
July 23 2019 at 3:44:04 PM GMT. If there have been no Content-Type: text/plain
more new readouts since the last request, the sensor replies
by transmitting a 304 Not Modified response: 25.2C
HTTP/1.1 304 Not Modified In general, since the 304 Not Modified response is much
Date: Sat, 15 Oct 2011 15:39:29 smaller than the 200 OK response, this mechanism provides
Server: Apache/1.3.0 (Unix) a way to improve channel utilization efficiency.
120 5 Application Layer
A
te
A
or
m
GE re cryption and authentication to support end-to-end security,
ns
pe
Tt tu
se
ra
em ra
tu
application pe (2) presence to enable entities to share information about
re
pe A
em
B
ra t e their availability within the network, (3) contact lists that
tu
re ET tur
G ra provide a mechanism for servers to store lists of devices and
B pe
e m
t applications, (4) one-to-one messaging to support the infras-
eA tructure of communication that enables users to send XML
tur
ra messages, (4) multi-party messaging and notifications that
te
A
pe re proxy server
GE
m
tu
pe
m
Tt
te ra provide a mechanism to send a single message to multiple
ra
em
pe
tu
em subscribers in a similar way to that of the publish/subscribe
pe
re
t
ra
B
T
GE
tu
model, (5) service discovery to let entities (i.e. applications)
re
B
know the capabilities of other entities (i.e. devices), (6) struc-
rB
so
tured data forms that enable endpoints to exchange struc-
n
se
tured but flexible forms (i.e. IoT configuration information)
application with other endpoints, and (7) peer-to-peer media sessions to
support, negotiate, and manage media and other real-time
Fig. 5.11 HTTP caching sessions between devices and applications.
Fig. 5.12 HTTP caching flow
XMPP decentralization relies on messages being sent
client from one source device to its home server that, in turn,
request forwards the message directly to the server that serves the
destination endpoint. This scenario is illustrated in Fig. 5.13.
In XMPP networks, servers are directly connected to each
other to form a composite mesh network. This structure is the
proxy
server yes basic building block of the so-called XMPP federation. The
has copy?
XMPP federation additionally includes automated clients,
known as bots, that enable a wide range of services ranging
no
from assistance in chat rooms to interfaces to non-XMPP
services. As with any other IP based protocol, XMPP relies
proxy server on every device being identified by an address known as
request
Jabber Identifier (JID). JIDs follow the same format as e-
mail addresses that combine the username associated with an
sensor account with a domain as username@domain. The domain
response
5.2.3 XMPP
is a fully qualified domain name (FQDN) that can be mapped Stanzas are the messages generated and processed by
to one or more IP addresses in accordance with domain name the XMPP application layer. They are defined by (1) their
system (DNS) mechanisms. element name, that is, message, presence, or iq; (2) their type
When a client connects to an XMPP server, a resource attribute, for example, get, set, or result; and (3) their child
identifier is assigned to the connection. This identifier is elements known as payloads. The message stanza is used to
added to the end of the JID as username@domain/resource. push data from, for example, a device to a client. Since the
Since a device is typically mapped to a resource and there is a transport layer is reliable (TCP), these messages are trans-
single connection per device, this functionality enables other mitted through a fire-and-forget mechanism that does not
entities to query or exchange messages with specific devices rely on acknowledgments and retransmissions. In the context
associated with a given account. Each device is a specific of IoT, messages are used to propagate sensor readouts.
point of presence of a given user that includes different states Message types are diverse, and they range from normal to
and capabilities. Note that although the username@domain chat and groupchat to address unicast and multicast real-time
is not case sensitive, the resource identifier section /resource communications. Messages of type error are sent in response
is. Moreover, JIDs follow URI schemes with full representa- to incoming messages to indicate a problem processing them.
tion as xmpp:username@domain/resource?action with xmpp Other attributes included are from and to attributes that are
being the service identifier and action a particular command used to specify sender and receiver, respectively, and the id
that can be used, for example, to send a message. attribute that provides a mechanism to track messages. Note
that to prevent address spoofing, the from attribute is filled
5.2.3.1 XMPP Messages in by the home server of the sender. Message payloads vary
XMPP is in essence a mechanism to signal and stream XML depending on the type and nature of message ranging from
over TCP connections. Specifically, if a device wants to body and subject for basic chat to fields for IoT sensor traffic.
start an XMPP session, it must first create a persistent TCP Some message payloads are specified as part of extensions to
connection to the server, and, when security is also required, the core XMPP specification.
a TLS session must be negotiated over the connection. The The presence stanza is used to advertise the availability
XMPP stream consists of the sequential build-up interaction of XMPP clients and resources in order to know whether
between a client and its home server made of three main they are online and available for communication. Presence
possible XML stanzas: (1) <message>, (2) <presence>, is based on a subscriber/notification scheme where entities
and (3) <iq>. An XML stanza is a discrete semantic unit issue presence subscriptions in order to obtain presence in-
of structured information that is sent from one entity to formation about other entities. When these subscriptions are
another. approved, any change of the presence status, for example, on-
Figure 5.14 shows an XMPP XML session where an ap- line or offline, is transmitted to each subscriber. The iq stanza,
plication acting as client/resource ([email protected]/amr) also known as info/query stanza, enables request/response
requests a sensor data readout from a device (de- interaction between entities by providing CRUD support as
[email protected]) and, later, the same client/resource per- illustrated in Fig. 5.15. Each request is replied by transmitting
forms actuation on another device (digital.output@example. a response that relies on an id attribute for tracking. The
org). The client establishes a persistent TCP connection iq stanza, as the message stanza, also includes from and
to its local server, and all bidirectional traffic including to attributes that are used to specify sender and receiver,
XML stanzas between the client (shown prefaced as C) and respectively. The representational state of an object can be
the server (shown prefaced as S) are transmitted inside a read if the iq stanza type attribute is get, or, on the other hand,
stream/stream element. If encryption and authentication are it can be created, updated, or deleted, if it is set. The type
needed, a TLS session is established on top of TCP to encrypt attribute result is used in responses to specify a readout value
traffic [17]. Because under XMPP TCP connections are or to acknowledge a set request. The xmlns attribute, included
persistent, devices can push readouts down the client as soon in iq stanza payloads, specifies the particular namespace or
as they become available. This asynchronous behavior, which XMPP protocol extension associated with the requests and
minimizes latency and lowers throughput, is conceptually responses.
like that of the observation introduced for IoT by ETSI. As previously indicated, because TCP transport
Obviously, the price to pay for persistent connections is the guarantees delivery, there is no need for XMPP message,
use of additional computational and memory resources. A presence, and iq stanzas to be acknowledged. If for some
client can simultaneously send several requests to a device reason a stanza is delivered but an error occurs due to, for
via its home server. These requests, in turn, are responded example, lack of resources, a response with type attribute
by the device in the order in which they were transmitted. error including a payload of type error is transmitted to
Note that the client is never blocked as it can transmit new the original sender. Figure 5.16 shows an error response
requests while waiting for previous responses. that indicates that the end device failed to process an iq
122 5 Application Layer
GET GET
request request
GW IP
2.05 Content 200 OK
device proxy application
CoAP server HTTP client
CoAP HTTP
UDP TCP
IPv6 IPv4
6LoWPAN
in retransmission mechanism that might introduce additional both CoAP and HTTP are stateless protocols, the mapping
delays due to packet loss. This is in opposition to TCP trans- occurring at the gateway is also stateless.
port as described in Sect. 4.3.7. In addition, because UDP Besides providing a session layer mechanism like HTTP
is not a stream protocol like TCP, it provides a technology but relying on UDP to enable multicast transmissions and
for the delivery of independent messages, enabling CoAP low latency, CoAP uses binary encoding to lower its trans-
for asynchronous message exchanges that eliminate HOL mission rate. Since CoAP traffic is intended to be encap-
blocking exhibited by certain versions of HTTP. Note that sulated by technologies with small MTU sizes like IEEE
although it is not recommended, CoAP TCP transport has 802.15.4, ASCII encoding like that of HTTP and XMPP
been introduced by IETF RFC 8323 as an alternative for results in too much overhead that makes it impractical in
certain scenarios where the complex TCP congestion control LLNs. The inherent lack of reliability of UDP is compen-
mechanisms provide a viable solution in certain LLNs [7]. sated by an optional retransmission mechanism embedded in
To improve latency, CoAP has incorporated block data trans- CoAP known as confirmable mode. The alternative mode of
mission as part of IETF RFC 7959 Block-Wise Transfers operation, known as non-confirmable, is based on a fire-and-
in the Constrained Application Protocol (CoAP) [6]. This forget approach where messages are sent without expecting
mechanism enables the efficient transmission of streams and any acknowledgment. Note that under CoAP, transport layer
other structured data. functionality responsible for providing network reliability is
As a REST protocol, CoAP was designed to map some moved to the session/application layer whenever confirmable
of the functionality provided by HTTP such that in an IoT mode is enabled.
infrastructure, CoAP is used in the access side, while HTTP
is used in the core of the network with the gateway acting 5.2.4.1 CoAP Basic Flows
as a proxy that translates traffic from one protocol to another. CoAP relies on a two-sublayer structure, shown in
This situation is shown in Fig. 5.17. The application, typically Fig. 5.18, with the lower message sublayer providing the
performing analytics, issues an HTTP GET request to retrieve interface with UDP transport and enabling retransmissions
sensor readouts. This message is transmitted over both TCP when confirmable mode is configured and the higher
and IPv4 and encapsulated in IEEE 802.11. The gateway request/response sublayer that is responsible for building
maps the HTTP request into a CoAP GET message that is and parsing the binary messages. In addition to confirmable
transported over both UDP and IPv6. IPv6 is adapted by and non-confirmable messages, the message sublayer
means of 6LoWPAN for encapsulation under IEEE 802.15.4. also includes acknowledgment and reset messages. The
At the sensor, the request triggers the transmission of a acknowledgment messages are sent in response to incoming
readout as a CoAP 2.05 Content response that is translated confirmable requests or responses, while the reset messages
into an HTTP 200 OK response at the gateway. Because are used to indicate a far end failure in processing an
5.2 Request/Response 125
application
DEVICE DATA
CoAP
GET /tempe GET /tempera
rature ture
MESSAGES (token 0x21 (token 0x22)
)
]
x4d45
transport
]
UDP
ACK [0 tent x4d45
on ACK [0 ound
2.05 C x21) 4.04 N o t F
(token ”
0 0x22)
(token nd”
“20.1C “N o t F ou
Fig. 5.18 CoAP two-layer structure
application device
(NON) request identified by a 16-bit 0x8c57 message identi-
CON [0x8c56]
fier. In this case, the device does not acknowledge the request.
For both cases, confirmable and non-confirmable requests,
ACK [0x8c56] if the receiver fails to process the message, it replies by
transmitting a reset (RST) response.
Independent of reliability, the request/response sublayer
Fig. 5.19 Confirmable CoAP transaction
is responsible for generating and parsing requests and re-
sponses. Figure 5.21 shows an example of a client requesting
a temperature readout from a sensor acting as a server. Since
the request is a CON CoAP GET, an ACK is transmitted back
by the server. Assuming the sensor has access to the readout
application device value, it piggybacks this value to the acknowledgment as a
CoAP 2.05 Content response. On the other hand, if the sensor
NON [0x8c57] does not support temperature readouts or it does not have a
valid value, it responds back with a CoAP 4.04 Not Found.
Note that all CoAP responses include a numerical response
code in a similar fashion to the mapping of HTTP shown
Fig. 5.20 Unreliable CoAP in Fig. 5.2. Response codes follow a a.bb format where a is
associated with the class of message: a = 2 means success,
a = 3 means redirection, a = 4 means client errors, and
incoming request or response. In all scenarios, confirmable,
a = 5 means server errors. Besides a message identifier that
non-confirmable, acknowledgment, and reset messages are
identifies the transactions, Fig. 5.21 also shows the presence
signaled by means of CON, NON, ACK, and RST message
of a field called token that is common throughout the trans-
types, respectively.
actions associated with a single session. In other words, the
Reliable message transport, shown in Fig. 5.19, relies on
token uniquely identifies the session through its lifetime. A
the client transmitting a confirmable (CON) request iden-
session, in turn, is given by the interaction between the client
tified by a 16-bit 0x8c56 message identifier. The device
and the device to retrieve different readouts of sensor data as
responds to the request by transmitting an acknowledgment
time progresses.
(ACK) also identified by the same 16-bit message identifier.
Alternatively, if the sensor does not have a temperature
A single request/response interaction indicated by a common
readout value available by the time it transmits the ACK
message identifier is a CoAP transaction. If, for whatever rea-
message, it delays its transmission until a readout is obtained
son, the confirmable message or its acknowledgment is not
either by polling or by means of hardware interrupts. This
received, the sender attempts to retransmit the message three
is illustrated in Fig. 5.22. The session is identified by token
more times, exponentially incrementing the timeout each
0x21. First, the client initiates a transaction identified by mes-
time. Similarly, Fig. 5.20 shows unreliable message trans-
sage identifier 0x4d45 by issuing a CON CoAP GET request
port that relies on the client transmitting a non-confirmable
to retrieve a temperature readout. The sensor acknowledges
126 5 Application Layer
0 2 4 8 16
5]
CON [0x4d4
t
2.05 Conten 0x21 identifies the session. The sensor acting as server replies
(token 0x 21 )
“20.1C ”
by transmitting a NON 2.05 Content response as soon as a
temperature readout becomes available.
ACK [0x4d45]
5.2.4.2 Message Format
Figure 5.24 shows the encoding of a CoAP request or re-
sponse. The format consists of a variable sequence of extensi-
Fig. 5.22 Separate response model ble binary fields that are optimized to lower throughput while
providing some basic compatibility with HTTP. Moreover,
since CoAP relies on UDP transport (running on port 5683),
and because of its compact format, it is ideal for transmission
on top of 6LoWPAN and wireless IoT link and physical layer
application device mechanisms like IEEE 802.15.4. A CoAP message has a 32-
NON [0x4d45]
GET /tempera bit header followed, if present, by the variable length token
ture
(token 0x21) plus a sequence of options that provide functionality like that
of HTTP headers. The payload, also if present, follows the
options.
NON [0x4d45]
The fixed-length header starts with a 2-bit version field
2.05 Content that is always 1 with other values reserved for future versions;
(token 0x21) it follows a 2-bit type field that specifies whether the CoAP
“20.1C”
message is CON (0), NON (1), ACK (2), or RST (3) and
continues with a 4-bit token length that specifies the length in
bytes of the session identifier token (0 through 8 with lengths
larger than 9 being reserved). The next field includes an 8-
Fig. 5.23 Non-confirmable request/response model bit code that is encoded, as previously mentioned, as a.bb
where a is a 3-bit class digit between 0 and 7 and bb is a 5-bit
the request by sending an empty ACK response. When the detail number between 0 and 31. If a is 0, the message is a
temperature readout becomes available, the sensor transmits request, and otherwise it is a response encoded as specified
the response to the original request by transmitting a CON in the previous paragraph. If it is a request, the value of bb
2.05 Content message. Since this transmission is related to identifies its nature (GET if bb=01, POST if bb=02, PUT
the original CoAP request, it belongs to the same trans- if bb=03, and DELETE if bb=04). The fixed-length header
action and, therefore, shares the same message identifier. ends with a 16-bit message identifier used for transaction
Finally, the content message by being confirmable requires identification.
the client to acknowledge it by transmitting an empty ACK The options are encoded, as shown in Fig. 5.25, as a
response. sequence of TLVs used for both requests and responses. The
Figure 5.23 shows a non-confirmable request and re- original option types, as defined by IETF RFC 7252, are
sponse interaction. Since it is unreliable, there is no need shown in Table 5.3. The option type is differentially encoded
for acknowledgment. The client first sends a NON CoAP in order to use fewer bytes to represent it. The option length
GET request to retrieve a temperature readout. The message is encoded as an absolute value. Options are encoded in
identifier 0x4d45 identifies the transaction, while the token id ascending order of their type such that for a given option,
5.2 Request/Response 127
0 4 7
Example 5.2 Consider an end-to-end non-confirmable
OPTION TYPE DELTA OPTION LENGTH 1 byte CoAP scenario where an application requests a readout
from a sensor:
OPTION TYPE DELTA (EXTENDED) 0-2 bytes
GW application
… 3 2 0xe10 (3600)
application device
Header: GET (T = CON, Code = 0.01, MID = 0x7d34)
GET
Path: “temperature”
2.05 Header: 2.05 Content (T = ACK, Code = 2.05, MID = 0x7d34)
Payload: “22.3 C”
0 2 4 8 16
1 0 0 GET = 1 MID = 0x7d34
0 2 4 8 16
1 2 0 2.05 = 69 MID = 0x7d34
one or more representations of the target resource. The If- is set to a random duration between ACK_TIMEOUT
None-Match option is used to make a request conditional and ACK_TIMEOUT * ACK_RANDOM_FACTOR
on the nonexistence of the target resource. The Size option seconds, and the retransmission counter is set to zero.
provides size information about the resource representation When the timeout is triggered and the retransmission
in a request. counter is less than MAX_RETRANSMIT, the message is
Figure 5.27 shows a single transaction between a client retransmitted, the retransmission counter is incremented, and
and device acting as a server where the request is a CON the timeout is doubled. If the retransmission counter reaches
GET that includes a single Uri-Path temperature option. MAX_RETRANSMIT on a timeout, or if the endpoint
The response is an ACK that piggybacks a 2.05 Content receives a RST message, then the attempt to transmit the
that carries a 22.3C temperature payload. Figure 5.28 shows message is canceled and the application process informed of
another transaction for the same scenario that belongs to a failure.
larger session identified by the token number 0x20. An alternative scenario is shown in Fig. 5.30; in this case,
Figure 5.29 shows a client sending a CON GET request to the client issues a CON GET request. When the request
a device that responds back with an ACK that piggybacks a arrives at the destination, if the device does not have access
2.05 Content. The response never arrives to the client as it is to a recent readout, it just transmits a plain ACK. When,
dropped due to network packet loss. Since it is a confirmable later, the device, either by polling or by means of hardware
transaction, the request timeouts, and it is retransmitted a interrupts, obtains a valid readout, it transmits this value in a
few seconds later. When it arrives at destination, the sensor new CON 2.05 Content response. Of course, this response is
retransmits the ACK with the 2.05 Content response that is acknowledged after it is received.
then received by the client. This finalizes the transaction. The In Fig. 5.31, the client transmits a CON GET request, but
CoAP standard identifies three parameters that control trans- its application suffers an exception and crashes. The device
missions, MAX_RETRANSMIT, ACK_TIMEOUT, and replies with an ACK that arrives to the client by the time it has
ACK_RANDOM_FACTOR, with default values 4, 2, and already rebooted. The client ignores this acknowledgment as
1.5, respectively. For a new CON message, the initial timeout it cannot figure out what originated it. Moreover, since it is
5.2 Request/Response 129
application device
Header: GET (T = CON, Code = 0.01, MID = 0x7d35)
GET Token: 0x20
Path: “temperature”
2.05
Header: 2.05 Content (T = ACK, Code = 2.05, MID = 0x7d35)
Token: 0x20
Payload: “22.3 C”
0 2 4 8 16
1 0 0 GET = 1 MID = 0x7d35
0x20
0 2 4 8 16
1 2 0 2.05 = 69 MID = 0x7d35
0x20
application device
application device
TIMEOUT
ff02::1
UNKNOWN
18.5 C
18.5 C
19.2 C
19.2 C
5.2.4.4 CoAP and DTLS One of these issues, already introduced in Sect. 4.3.6.3, is
CoAP security is provided by means of the DTLS protocol the fact that the DTLS handshake exchanges large certifi-
presented in Sect. 4.3.6.3. The main motivation for using cates that lead to fragmentation and, thus, datagram loss in
DTLS is the fact that CoAP uses UDP transport and DTLS is LLNs. Moreover, alternatives like elliptic-curve cryptogra-
intended to work on top of UDP. IETF RFC 7925 addresses phy (ECC) that provides smaller keys and certificates, for
some of the requirements needed for DTLS to run in the comparatively same levels of security as traditional RSA and
context of CoAP [22]. Note that although DTLS is simpler DSA security, are too complex to be supported in embedded
than IPSec/IKE and HIP, some features of the protocol devices. Another important issue is that DTLS is not prepared
are too complex to be supported with lightweight CoAP. to work well with CoAP proxies. Moreover, CoAP relies
132 5 Application Layer
19.2 C
19.7C
19.7 C
CRASH
REBOOT
20.0 C
19.7 C (STALE)
20.0 C
19.7 C
19.7 C
heavily on multicast communications to enable applications chitecture perspective, it is an application layer protocol
to simultaneously talk to multiple devices. Unfortunately, that provides session layer functionality. Although sessions
DTLS does not natively support multicasting as security could be of any type, SIP has been mostly used in the
relies on end-to-end session establishment based on a hand- context of RTC with special focus on Media over IP (MoP)
shake. In this scenario, security is provided through a double- applications like bidirectional speech, audio, and video. IETF
stage mechanism where devices are first discovered through also recommends a specific protocol known as RTP for
multicasting and then secure associations are made with each media packetization. Note that RTP was briefly described in
device by means of unicast connectivity through DTLS. Sect. 1.4. Media packetization is the process that enables the
Both confirmable CoAP and DTLS introduce inefficient conversion of a stream of media into messages or packets that
retransmissions because each new CoAP retransmission re- are transmitted over IP. There have been several attempts to
sults in a new DTLS transmission. Moreover, CoAP and support SIP and RTP in the context of IoT for both media and
DTLS provide similar functionality at two different layers device data transmission.
unnecessarily increasing the code size. An alternative is, in
this situation, to rely on non-confirmable CoAP for transmis-
5.2.5.1 SIP
sions. Another issue with CoAP and DTLS is the fact that
SIP is a client/server protocol that is structurally like HTTP
the latter does not support fragmentation of application data.
as it includes ASCII encoded requests and responses with
It is therefore recommended for applications to attempt to
headers and methods [18]. SIP, as opposed to HTTP, however,
fit every single CoAP message and associated headers into a
was designed for UDP transport in order to lower the latency
single IP datagram to avoid any fragmentation.
usually associated with TCP connection setup and retrans-
missions. Later when security was introduced to SIP by
5.2.5 SIP and RTP means of TLS, TCP became an additional transport option.
Regardless of the transport, SIP is highly inefficient in IoT
SIP, briefly described in Sect. 1.4, provides a mechanism scenarios because it relies on plain text messages to establish
to create, manage, and finish sessions. From a layered ar- and manage sessions. Moreover, because SIP does not really
5.2 Request/Response 133
comply with the RESTful model either, it is not really useful being dropped. This field is used to prevent SIP routing loops.
for IoT device management. The From and To headers specify the source and destination
A SIP client is called User Agent Client (UAC), while a endpoints including tags that are random numbers assigned
SIP server is called User Agent Server (UAS). UACs gen- to the entities for identification. The Call-ID header value,
erate requests, while UASs generate responses for incoming in this case [email protected], combined
requests. A SIP transaction is a request/response interaction with the From and To header values is used to identify the
between a UAC and a USC. Similarly, a SIP dialog is several dialog. The CSeq header value, in this case 1021 INVITE,
transactions associated with a given session. A UAS can be contains an integer and the method. When a transaction
(1) a media server that generates audio, speech, and/or video starts, the first message is given a random CSeq value that
traffic to UACs; (2) a proxy server that, similar to HTTP is incremented upon transmission of new messages. Again,
proxies, acts on behalf of a client to interact with other UASs; this enables endpoints to detect out of order and lost mes-
(3) a redirect server that redirects UAC requests to other sages as UDP is the preferred SIP transport method. The
UAS; or (4) a registrar that keeps track of the location of Contact header specifies a direct route to the UAC used
UACs to support incoming sessions. by certain responses. The Content-Type header indicates the
By not being RESTful, SIP relies on different request type of content the request includes. In this example, the
types or methods that are transmitted by a UAC: INVITE to content is application/sdp that specifies session character-
start sessions, ACK to provide reliability since SIP is primary istics by means of the SDP protocol briefly described in
supported over unreliable UDP transport, BYE to terminate Sect. 1.4. The Content-Length indicates how big the body
sessions, CANCEL to cancel a pending request, OPTIONS is.
to request UAS capability information, REGISTER for a The SDP is a whole different protocol that is used to
UAC to register with a registrar, and INFO for out-of-band describe media sessions in a way that can be understood by
signaling of, for example, audio tones. all endpoints in a network [14]. As such, SDP provides a
SIP messages are ASCII encoded, and therefore they can mechanism for negotiation, where an endpoint can decide
be read by humans on the wire by means of network sniffers to accept an incoming session based on whether it supports
and analyzers. The message below is an example of a SIP specific media types. The SDP content is ASCII and, as SIP
request transmitted by a UAC attempting to start a new messages themselves, is not efficient in the context of IoT
session: communications. In either case, an SDP typically indicates
INVITE sip:[email protected] SIP/2.0 the list of specific media encoding technologies or codecs
Via: SIP/2.0/UDP server1.local;branch=z9hG4bK2105Gbc12 that are offered by a given endpoint, along with connectivity
Max-Forwards: 70 parameters like IP addresses and transport ports. Informa-
From: <sip:[email protected]>; tag=1921052105 tion is presented as lines formatted as parameter=value,
To: <sip:[email protected]> where the parameter is a single character. In the example
Call-ID: [email protected] above, for example, the v=0 line specifies the SDP version,
CSeq: 1021 INVITE c=IN IP6 2001::21:10 indicates the endpoint IP address, and
Contact: <sip:[email protected]> m=audio 5100 RTP/AVP 0 signals the type of media (audio),
Content-Type: application/sdp the media protocol (RTP), the UDP port (5100), and the
Content-Length: 112 codec code (0) that specifies ITU G.711 μ-Law coding. The
a=sendrecv indicates that media traffic is intended to be full
v=0 duplex.
o=session 5439349 2394349324 IN IP6 deviceA.local Like requests, the format of SIP responses follow that of
s=SDP exchange HTTP responses shown in Fig. 5.9. The message below is an
c=IN IP6 2001::21:10 example of a SIP response transmitted by a UAS as a reply
t=0 0 to an INVITE request:
m=audio 5100 RTP/AVP 0 SIP/2.0 200 OK
a=sendrecv Via: SIP/2.0/UDP server2.local;branch=z9hG4bK1chab10;
received=2001::21:20
The format of SIP requests follows that of HTTP requests From: <sip:[email protected]>; tag=1921052105
illustrated in Fig. 5.8. It includes a request line that specifies To: <sip:[email protected]>; tag= 42194562
the method, in this case INVITE, the request URI, and the Call-ID: [email protected]
SIP version that is typically 2.0. The Via header indicates CSeq: 1021 INVITE
the local address that is used to receive the response. The Contact: <sip:[email protected]>
Via header includes a Max-Forward field that specifies the Content-Type: application/sdp
maximum number of hops the request must support before Content-Length: 110
134 5 Application Layer
transaction 1
600–699 Global failure
v=0
o=session 2841303 91021765 IN IP6 deviceB.local
dialog
s=SDP exchange
c=IN IP6 2001::21:20
t=0 0 MEDIA SESSION
m=audio 5102 RTP/AVP 0
transaction 2
a=sendrecv
The first line of the response is the status line that in-
cludes the SIP version, the numerical status code, and the
corresponding status message or reason phrase. Although SIP
response codes follow the HTTP response codes, there are
Fig. 5.36 SIP call
some slight differences as shown in Table 5.4. Responses
between 100 and 199 are provisional, in the sense that they
indicate that a final response 200 or above will follow at not include any media information. Next, the UAS transmits
some point. For the example above, the SIP version is 2.0, a 200 OK that contains negotiated media. Because of the
the numerical status code is 200, and the reason phrase unreliable UDP transport, the client responds to the 200 OK
is OK. The Via header indicates the local address that is with an ACK on what it is called a three-way handshake.
used to receive the response including the specific IP ad- Once media endpoints have been identified, a bidirectional
dress of the interface that received the message. The From, RTP session starts. At this point, packetized media datagrams
To, Call-ID, and CSeq headers are copied over from the flow between endpoints. After a while, the client transmits
INVITE request. The UAS adds a tag to the To header. a BYE request to indicate it wants to terminate the media
As with the UAC, the UAS Call-ID header value, in this session. Upon reception, the server transmits another 200 OK
case [email protected], combined with the to confirm. This latter 200 OK does not carry a body as it does
From and To header values is used to identify the dialog. not need to specify media information.
The Contact header specifies a direct route to the UAS SIP, as HTTP, is a protocol that was not designed to be
used by subsequent requests. Because the response to an used in the context of LLNs. For example, SIP messages
INVITE has media negotiation information, the Content- are unnecessarily too big to fit in a single frame of link
Type and Content-Length header values indicate that the layer technologies like IEEE 802.15.4. This situation leads to
message body has an SDP content that signals the negotiated fragmentation, and, thus, it increases the chances of network
codec. loss. Although there have been several proposals intended
Figure 5.36 shows a dialog between a UAC and a media to adapt SIP to IoT networks, none of them have been
server UAS. This dialog is made of two transactions: one to really standardized. In this regard, it is important to mention
establish a media session and another one to tear it down. The constrained SIP (CoSIP). CoSIP attempts to compress SIP
session establishment transaction starts when the client trans- header information by relying on a message format identical
mits an INVITE request to the server. The INVITE carries an to that of CoAP shown in Fig. 5.24. Under CoSIP, message
SDP that provides the client side media offering. The UAS types do not encode REST methods like GET and POST but
transmits a provisional 100 Trying response to let the client encode session establishment, maintenance, and termination
know that the INVITE has been received and it is trying to messages like INVITE and BYE. CoSIP follows the same
respond. Right after, the UAS transmits another provisional convention of CoAP for the inclusion of headers in messages
180 Ringing response to tell the client to generate a ring by means of differentially encoded options. Also, in order
tone, while the INVITE request is being processed. Both to support the efficient transmission of messages in LLNs,
provisional responses do not carry a body and therefore do CoSIP relies on UDP and DTLS transport as opposed to the
5.2 Request/Response 135
TCP and TLS transport of traditional SIP. Fortunately, there is For the purpose of synchronization, a receiver relies on
standard mechanism to compress SIP headers that despite the SSRCs to identify streams and the sequence number to
fact that it was not developed with IoT in mind, it can be used determine what media packets to play next. Specifically,
in LLNs. Specifically, IETF RFC 5049 Applying Signaling since the sequence number is incremented every time a
Compression to the Session Initiation Protocol merges tra- packet is transmitted, the receiver can estimate packet loss
ditional SIP with signal compression (SigComp). SigComp and attempt to restore the packet sequence. Along with the
is a standard mechanism for the compression of signaling sequence number, the timestamp field provides another key
information associated with call establishment, termination, piece of information. This field tells the receiver when to play
and network registration. media packets and provides information about synchroniza-
tion. There are certain applications like video, where several
5.2.5.2 RTP and RTCP sequential RTP packets carry the same timestamp as they
RTP provides the end-to-end real-time delivery of audio, represent a single video frame. In most audio and speech
speech, and video sessions [19]. An RTP session is set scenario, however, timestamps change with the sequence
up through SIP negotiation by means of SDP information numbers.
exchange. RTP is transported over UDP to guarantee that RTP is a generic protocol that provides functionality that
latency is minimized, as in the context of media transmissions has different meanings depending on the codec under con-
any media packet that arrives too late can be considered sideration. For example, the extension bit is used to indicate
lost. In fact, most RTP applications rely on playout buffers that an extension header follows the RTP header. The ex-
that queue packets during a typically short interval of time tension header, in turn, may carry additional fields that are
before they are sequentially played. The idea behind this relevant to the codec. Similarly, the marker bit is typically
mechanism is to reduce the choppiness that results from used, depending on the codec, to specify when a stream
playing packets that arrive at an irregular pace. Additionally, starts. This is important when a codec supports discontinuous
since RTP relies on UDP for transport, it is ideal for multi- transmissions (DTX). Under DTX, voice activity detection
cast transmissions. Specifically, in multicast conferencing, a (VAD) may trigger a period of silence under which the codec
single transmitter can reach multiple receivers with a minimal does not produce any frames. Once speech is detected again,
amount of traffic. RTP supports multiple simultaneous media the media stream restarts, and this is signaled by setting the
types, so a single SIP dialog can set up multiple synchronized marker bit in the RTP header.
audio and video streams. Other applications of RTP include The RTP suite provides an additional protocol called
transcoding where a device re-encodes a media streaming Real Time Control Protocol (RTCP) that is used to provide
using a codec that is different to the one originally used. Note quality control over media streams. Essentially, for each RTP
that transcoding is performed by means of signal processing stream, there is an optional associated RTCP stream that
techniques that are computationally complex. enables receivers to provide feedback about the quality of
Media streams are packetized and encoded with an RTP the incoming media packets. The RTCP stream, as the RTP
header shown in Fig. 5.37. The header starts with a 2-bit stream, is transported over UDP typically using contiguous
version field that is always set to 2, and it continues with ports. As such RTCP is particularly important in the context
a padding bit to signal whether additional padding bytes, of conferencing multimedia applications. RTCP is associated
needed by certain codecs, follow the payload. The last byte with an RTP stream through its canonical name (CNAME)
of the padding indicates how long the padding is. The header and not through its SSRC, since the SSRC may change during
then includes an extension bit to signal that an extension a session. RTCP can include extra information for reference
header follows the RTP header; a 4-bit CSRC count field that like an e-mail address or a phone number. Figure 5.38 shows
specifies the number of contributing source (CSRC) fields, the format of a generic RTCP header. It starts with a 2-bit
described below, included in the header; a marker that is used version field that is always set to 2 and continues with a
for multiple purposes; a 7-bit payload type that identifies padding bit that indicates that additional bytes follow the for-
that codec that encodes the media packet payload; a 16-bit mat specific information payload. The header also includes
sequence number used by receivers for reordering and packet a 5-bit item count that indicates the list of items carried in
loss detection; and a 32-bit timestamp that specifies the sam- the payload, an 8-bit packet type that specifies the RTCP
pling instant of the first byte in the payload. The timestamp message type, and a 16-bit length that specifies the size of
is critical for synchronization and jitter estimations. The the payload that follows the RTCP header.
headers also include a 32-bit synchronization source (SSRC) There are many types of RTCP messages that are used
random number that identifies the stream and a list of 32- to indicate different types of information: (1) a sender re-
bit CSRCs for the payload contained in the packet. This is port (SR) for transmission and reception statistics from ac-
typically used in the context of mixers that are applications tive senders, (2) a receiver report (RR) for reception statis-
that combine multiple media streams into one. tics from passive senders, (3) a source description (SDES)
136 5 Application Layer
CSRC n
MEDIA PACKET
V version
P padding
X extension
CC CSRC count (n)
M marker
PT payload type
SSRC synchronization souce
CSRC contributing sources
0 2 3 8 16 31
V P IC PT LENGTH
PADDING (if P = 1)
V version
P padding
IC item count
PT packet type
for a description of a sender including the CNAME, (4) functionality provided by IoT-RTP and IoT-RTCP is slightly
a BYE message to indicate the end of participation in a larger packets due to the overhead.
session, and (5) an APP message for application-specific
functions.
One good thing about both, RTP and RTCP, is that they 5.2.6 OPC UA
exhibit a highly optimized structure with small headers that
are ideal for LLNs. Moreover, since RTP packets typically The Open Platform Communications United Architecture
carry codec compressed media frames, the RTP payload is (OPC UA) provides a protocol stack that supports the SOA
also optimal for IoT. In all cases, chances of fragmentation approach [20]. This protocol stack, shown in Fig. 5.39, com-
when transmitted over link layer technologies like IEEE plies with the request/response scheme of session protocols
802.15.4 are greatly reduced. When compared to SIP, HTTP, like CoAP and HTTP, but as a stack, it specifies additional
and other mainstream protocols, and because of its IoT functionality. Moreover, OPC UA not only addresses com-
readiness, there have not been that many attempts to further munication, security, and session management needs, but it
optimize the RTP protocol suite. Moreover, there have been also deals with data modeling that enables the interaction of
some proposals, but none of them have led to standards. One heterogeneous devices in the context of IIoT.
of these proposals introduces IoT-RTP and IoT-RTCP that, With constrained networks in mind, OPC UA introduces
respectively, optimize RTP and RTCP for support in LLN two different mechanisms for data encoding: (1) XML and
networks. IoT-RTP adds a few new fields to the standard RTP (2) binary. The generic UA XML encoding provides mes-
header to divide large media sessions into simpler sessions sages that are human readable, but it is expensive from a
that can adapt better to network changes while keeping networking and processing perspective. UA binary encoding,
track of energy consumption. On the other hand, IoT-RTCP on the other hand, is more efficient and designed to work in
is also upgraded to carry additional information about the constrained environments. Unfortunately, both mechanisms
transmitter including energy levels. The price to pay for the are transmitted over traditional TCP and subjected to all the
5.3 Publish/Subscribe 137
unsubscribe (t1)
advertise (t2)
brokers that cooperate to provide redundancy and enhance connections to go down. To prevent application traffic from
functionality and service levels. being lost when TCP fails, MQTT introduces an additional
level of reliability by means of the QoS levels. Unfortunately,
TCP transport, as indicated in Sect. 4.3.7, when subjected
5.3.1 MQTT to network packet loss results in retransmissions that in-
crease latency and prevent applications from successfully
MQTT is a lightweight broker-based publish/subscribe ap- transmitting real time events. In 2013 MQTT was extended
plication protocol that provides session layer functionality. as MQTT for Sensor Networks (MQTT-SN) [11] to deal
MQTT was developed and designed by IBM in 1999 for in IoT scenarios by introducing a new QoS level 3 (also
low transmission rate constrained devices [2]. Because of its known as -1) that provides simple event delivery over UDP.
simplicity and low overhead, MQTT is one of the preferred MQTT-SN requires an MQTT-SN gateway that translates the
mechanisms for communications in IoT networks. MQTT in- events into traditional MQTT messages for interaction with
corporates and improves some of the publish/subscribe func- a broker. The MQTT-SN gateway, as indicated in Fig. 5.41,
tionality described in Sect. 5.3, while some other features like can be configured as a (1) transparent gateway where each
the advertising of topics are assumed to be accomplished by MQTT-SN event is translated into individual MQTT events
means of other out-of-band mechanisms. In general, MQTT and as a (2) aggregating gateway where multiple MQTT-SN
targets scenarios that are characterized by LLNs where low events are aggregated into a single MQTT event. In 2018 the
transmission rates translate into high latency and devices newest version of MQTT, MQTT v5, was standardized [1]. It
with low computational complexity and limited memory includes several new features and improvements that include
resources. the support of request/response scenarios in compliance with
MQTT, like any other publish/subscribe protocol, enables the mechanisms discussed in Sect. 5.2.
the wide distribution of device events to multiple subscribers
and defines a generic session management mechanism that
5.3.1.1 Message Format
is agnostic of the payload content. MQTT was designed to
Figure 5.42 shows the MQTT message format; it consists of
rely on TCP transport (on port 1883), including TLS support
a 24-bit fixed size header followed by an optional variable
for security, with three QoS levels that provide additional
size header and then by the payload. The messages, by
reliability. These three levels are (1) QoS 0, at most once,
being very small, are ideal for processing and transmission
that provides a fire-and-forget delivery where the publisher
of constrained IoT devices. Figure 5.43 shows the format of
sends events relying on the best effort of the TCP transport;
the fixed header; it includes a 4-bit message type encoded
(2) QoS 1, at least once, where any event sent by a publisher
according to Table 5.5, a 1-bit duplicate flag that is set
is guaranteed to arrive at least once to the broker; and (3) QoS
on retransmissions for at least once and exactly once QoS
2, exactly once, that enables the publisher to transmit exactly
levels, a 2-bit QoS field that indicates the delivery level as
one event to the broker. Note that although TCP provides, by
indicated in Table 5.6, and a 1-bit retain flag used by a
design, reliable transmission of data, in the context of IoT,
publisher to instruct its broker to hold the published message
network packet loss and overall infrastructure stability cause
so it becomes available to future subscribers. Specifically,
5.3 Publish/Subscribe 139
BROKER BROKER
MQTT MQTT
MQTT-SN MQTT-SN
publisher broker
QoS = 1
DUP = 0
PUBLISH MessageID = x
ACTION:
. Store Message
. Publish Message
. Delete Message
PUBACK
ACTION:
Discard Message
a PUBCOMP message that triggers the publisher to discard scribers and publishers in order to support bidirectional com-
the message. The double transaction mechanism guarantees munication. The application acting as client subscribes to its
that messages are delivered only once. The price to pay is own private client topic. In general, all clients must subscribe
added latency and extra throughput. As before, the message to their own private topics. The sensor acting as a server,
identifier field is used to track the delivery of the different in turn, subscribes to its well-known public server topic.
messages involved in this scheme. The client transmits the request by publishing to the well-
known server topic. At the broker, the request is forwarded
MQTT Implementations There are many commercial to the server. The message includes a response topic field
and open-source MQTT implementations with support that specifies the client topic that is used by the server to
ranging from common constrained RTOSs to general- publish the response. Specifically, the server publishes the
purpose Linux distributions. The list below shows response to the client topic specified in the request. Again,
some of the most popular MQTT implementations. the response, as the request, is forwarded by the broker
to the application. From a performance perspective, MQTT
mosquitto BSD-licensed C implementation of client and broker. emulates request/response support and does not natively sup-
MQTT-C MIT-licensed C implementation of client. port it. When compared to HTTP, CoAP, and other REST
Paho MQTT BSD-licensed C/C++ implementation of client. protocols, the support of a request/response scheme under
wolfMQTT GNU-licensed C implementation of client. MQTT results in additional latency due to the messages being
eMQTT5 MIT-licensed C++ implementation of client. forwarded by the broker. Moreover, the broker is still a single
point of failure that can prevent end-to-end connectivity even
when both client and server are fully functional.
publisher broker
QoS = 2
DUP = 0
PUBLISH MessageID = x
ACTION:
Store Message
ACTION:
. Store Message
or
. Store Message Id
. Publish Message
MessageID = x
PUBREC
PUBREL
MessageID = x
ACTION:
. Publish Message
. Delete Message
or
. Delete Message Id
MessageID = x
PUBCOMP
ACTION:
. Discard Message
CoAP, HTTP, MQTT, and IoT Cloud Services There are UDP UDP
many commercial and non-commercial IoT services IPv6 IPv4
that enable devices to push sensor readouts to the
6LoWPAN IEEE 802.3
cloud for processing by means of analytics or for of-
fline visualization. Some of these technologies include IEEE 802.15.4 IEEE 802.3
application
802.15.4 into IPv4 datagrams over Ethernet. All
upper layers remain unchanged. The problem with this DEVICE DATA
approach is that the core network includes firewalls that
due to security and other performance considerations MESSAGING
AMQP
filter out UDP traffic. Because of this, most core
networks only support TCP-based protocols like TRANSPORT/FRAMING
MQTT and HTTP, and it is the task of the gateway
transport
to fully convert the stacks as shown below: TCP
SIZE
FRAME HEADER
DOFF TYPE CHANNEL
8
... EXTENDED HEADER
DOFF x 4
to exchange messages between each other. An AMQP link intermediate entities. The bare message includes a body and
is a unidirectional route attached to a node and responsible two properties: system properties that are defined by AMQP
for message status tracking. The relationship between con- and application properties that are defined by the application.
tainers, nodes, connections, sessions, and links is shown in Table 5.7 shows some of the possible system properties
Fig. 5.49. defined by AMQP. The annotated message is a superset of
Connections and sessions are terminated if the underlying the bare message that additionally contains a header and
TCP connection is lost due to, for example, heavy network annotations that are used by intermediate entities.
packet loss. Links, on the other hand, are recoverable, and The messaging sublayer introduces two message states:
even if the TCP connection goes down, they resume at the they can be terminal or non-terminal. Terminal messages can
same delivery status as it was before the connection loss. be accepted if they were received and successfully processed
Figure 5.50 shows an AMQP frame divided in three sec- by the receiver, rejected if they were rejected and cannot
tions: (1) an 8-byte frame header that is included in every be processed, released if they were not processed and to
single frame, (2) an optional variable length extended header be redelivered, and modified if they were modified but not
that depends on the frame type, and (3) the variable length processed. Non-terminal messages can only be received in-
frame body. The frame header includes several fields: a 32- dicating partial message data.
bit frame size that accounts for the frame header, extended
header and frame body, an 8-bit data offset that points to 5.3.2.3 Message Flows
the start of the payload, an 8-bit frame type that indicates When compared to MQTT, AMQP introduces message flows
the format and purpose of the frame (frame type 0 indicates that are a bit more complex. The message flow between
an AMQP frame), and a 16-bit channel field that identi- entities under AMQP relies on four steps: (1) opening/closing
fies the channel number. The frame body is defined as a an AMQP connection, (2) beginning/ending an AMQP ses-
performative followed by payload filled by the application sion, (3) attaching/detaching an AMQP link, and (4) send-
with data to send. The performative enables opening/closing ing/receiving messages. Figure 5.52 shows the message flow
an AMQP connection, starting/ending an AMQP session, between a client and its broker required to open an AMQP
attaching/detaching a link, transferring content, and handling connection. After the TCP connection is established, an
flow control. AMQP handshake is followed by an open performative that
defines the maximum frame size and the maximum number
5.3.2.2 Messaging of channels. The maximum frame size defines the maximum
Messaging capabilities are provided by the messaging sub- size of each frame that is exchanged. A session is then started
layer built on top of the framing sublayer. The sublayer by means of the begin performative that specifies the window
defines a well-known format that consists of two main com- size. Each endpoint has an incoming and an outgoing window
ponents: bare message and annotated message (Fig. 5.51). with a size defined as frame count that is decremented on each
The bare message contains the content that is transmitted transmission. The frame exchange stops when the sender
by the sender to the receiver and remains unchanged by does not have window space to transmit and the receiver
5.3 Publish/Subscribe 145
DA delivery annotations
MA message annotations
SP system properties
AP application properties
message sent
application broker
messages sent
open TCP connection
AMQP handshake
application broker
application broker
flow control
Fig. 5.57 AMQP at least once
receiving message
receiving messages
application broker
application broker
retransmissions guarantees that messages are received at least
once, and (3) exactly once that through double acknowledg-
deatach AMQP links ment reduces throughput while guaranteeing that messages
are received exactly once. In the context of AMQP, only
at most once and at least once mechanisms are used in
practice. Figure 5.56 shows a message being transmitted as
end session at most once QoS where the settled flag is set to true to
indicate that no acknowledgment is needed. On the other
hand, Fig. 5.57 shows a message being transmitted as at least
once QoS where the settled flag is set to false to indicate that
close connection an acknowledgment is needed. In this later case, the acknowl-
edgment is sent in the form of a disposition performative
with the settled flag set to true. If an acknowledgment is
Fig. 5.55 AMQP close not received, the sender retransmits the message. Similarly,
Fig. 5.58 shows a message being transmitted as exactly once
QoS where double acknowledgment is performed.
Summary
application broker
Interaction between devices and applications rely on
two main architectures that are common under IoT:
request/response and publish/subscribe. The chapter started
by describing the characteristics of these mechanisms with
initial focus on request/response architectures that have
Fig. 5.56 AMQP at most once REST as key component. REST, in turn, is extended by
Homework Problems and Questions 147
GW broker
Protocol Client/req or pub/subs Transport Overhead Security or QoS
HTTP Client/req TCP High Both sensor event
1 Gbps 0.5 second
XMPP Both TCP High Security 1 Gbps
REQUEST
REQUEST
CoAP Client/req UDP Low Both
SIP Client/req UDP/SIP High Security
RTP Client/req UDP Low Both
OPC UA Client/req TCP High Security
MQTT Pub/subs TCP Low Both
AMQP Pub/subs TCP Medium Both
application
latency
GW broker
sensor event
request/response or as a publish/subscribe mechanism. Can sensor on the sensor. Assume non-confirmable operations
you explain why? where ten server updates are received with a 10% packet loss.
5.8 What are the different layers of a secure XMPP stack 5.11 Under an observation scenario, 12.31 C temperature
that relies on a IEEE 802.15.4 physical layer? readouts are transmitted every half a second by a sensor to
an application as a payload of 2.05 Content CoAP messages.
The messages are transported over UDP and IPv6. Assuming
application XMPP
the shortest possible 6LoWPAN and IEEE 802.15.4 headers
security as well as a 1-byte token and no options as part of the CoAP
transport message, what is the overall transmission rate of the scheme?
network
5.12 Consider an application simultaneously polling eight
adaptation sensors to request readouts at a rate of twice a second in a
link lossless topology:
physical IEEE 802.15.4
request
5.9 The following flow shows a device transmitting three
sensor readouts to an application. The assumption is that
response
there has been a CoAP GET request from the application
to the device to enable CoAP observation. Add the missing
information: (1) type of message (examples: CON, NON,
ACK, RST), (2) message code (when needed) (examples:
2.05 Content, 4.04 Not Found), (3) message id, and (4) token
id to each message.
device application For maximum size IEEE 802.15.4 and 6LoWPAN headers
with no security, what is the application transmission rate and
throughput for the following scenarios?
maximum readout transmission rate of the scenario for each International Conference on Communication Systems Software
QoS level? and Middleware and Workshops (COMSWARE’08), pp. 791–798
(2008)
12. Nepomuceno, K., d. Oliveira, I.N., Aschoff, R.R., Bezerra, D., Ito,
5.15 Describe a scenario where MQTT is better suited than M.S., Melo, W., Sadok, D., Szabo, G.: Quic and tcp: a performance
CoAP for sensor data transmission. evaluation. In: 2018 IEEE Symposium on Computers and Commu-
nications (ISCC), pp. 00045–00051 (2018)
13. OASIS: advanced message queuing protocol (amqp) version 1.0
part 2 (2012). http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-
References core-transport-v1.0-os.html
14. Perkins, C., Handley, M.J., Jacobson, V.: SDP: session description
1. Banks, A., Gupta, R.: Mqtt version 5.0 oasis committee specifica- protocol. RFC 4566 (2006). https://doi.org/10.17487/RFC4566.
tion (2019). https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0. https://rfc-editor.org/rfc/rfc4566.txt
html 15. Rodríguez-Domínguez, C., Benghazi, K., Noguera, M., Gar-
2. Banks, A., Briggs, E., Gupta, R.: Mqtt version 3.1.1 oasis com- rido, J.L., Rodríguez, M.L., Ruiz-López, T.: A communication
mittee specification (2014). http://docs.oasis-open.org/mqtt/mqtt/ model to integrate the request-response and the publish-subscribe
v3.1.1/mqtt-v3.1.1.html paradigms into ubiquitous systems. Sensors 12(6), 7648–7668
3. Bellavista, P., Corradi, A., Reale, A.: Quality of service in wide (2012). https://doi.org/10.3390/s120607648. https://pubmed.ncbi.
scale publish-subscribe systems. IEEE Commun. Surv. Tuts. 16(3), nlm.nih.gov/22969366.22969366[pmid]
1591–1616 (2014) 16. Saint-Andre, P.: Extensible messaging and presence proto-
4. Belshe, M., Peon, R., Thomson, M.: Hypertext Transfer Protocol col (XMPP): core. RFC 6120 (2011). https://doi.org/10.17487/
Version 2 (HTTP/2). RFC 7540 (2015). https://doi.org/10.17487/ RFC6120. https://rfc-editor.org/rfc/rfc6120.txt
RFC7540. https://rfc-editor.org/rfc/rfc7540.txt 17. Saint-Andre, P., Alkemade, T.: Use of transport layer security
5. Bishop, M.: Hypertext Transfer Protocol Version 3 (HTTP/3). (TLS) in the extensible messaging and presence protocol (XMPP).
Internet-Draft draft-ietf-quic-http-29, Internet Engineering Task RFC 7590 (2015). https://doi.org/10.17487/RFC7590. https://rfc-
Force (2020). https://datatracker.ietf.org/doc/html/draft-ietf-quic- editor.org/rfc/rfc7590.txt
http-29. Work in Progress 18. Schooler, E., Rosenberg, J., Schulzrinne, H., Johnston, A., Ca-
6. Bormann, C., Shelby, Z.: Block-wise transfers in the constrained marillo, G., Peterson, J., Sparks, R., Handley, M.J.: SIP: session
application protocol (CoAP). RFC 7959 (2016). https://doi.org/10. initiation protocol. RFC 3261 (2002). https://doi.org/10.17487/
17487/RFC7959. https://rfc-editor.org/rfc/rfc7959.txt RFC3261. https://rfc-editor.org/rfc/rfc3261.txt
7. Bormann, C., Lemay, S., Tschofenig, H., Hartke, K., Silverajan, B., 19. Schulzrinne, H., Casner, S.L., Frederick, R., Jacobson, V.:
Raymor, B.: CoAP (Constrained application protocol) over TCP, RTP: a transport protocol for real-time applications. RFC 3550
TLS, and WebSockets. RFC 8323 (2018). https://doi.org/10.17487/ (2003). https://doi.org/10.17487/RFC3550. https://rfc-editor.org/
RFC8323. https://rfc-editor.org/rfc/rfc8323.txt rfc/rfc3550.txt
8. Fielding, R.T.: REST: architectural styles and the design of 20. Schwarz, M.H., Borcsok, J.: A survey on opc and opc-ua: about
network-based software architectures. Doctoral Dissertation, Uni- the standard, developments and investigations. In: 2013 XXIV
versity of California, Irvine (2000). http://www.ics.uci.edu/~ International Conference on Information, Communication and Au-
fielding/pubs/dissertation/top.htm tomation Technologies (ICAT), pp. 1–6 (2013)
9. Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, 21. Shelby, Z., Hartke, K., Bormann, C.: The constrained applica-
P., Berners-Lee, T.: Rfc 2616, hypertext transfer protocol – http/1.1 tion protocol (CoAP). RFC 7252 (2014). https://doi.org/10.17487/
(1999). http://www.rfc.net/rfc2616.html RFC7252. https://rfc-editor.org/rfc/rfc7252.txt
10. Hartke, K.: Observing resources in the constrained application 22. Tschofenig, H., Fossati, T.: Transport layer security
protocol (CoAP). RFC 7641 (2015). https://doi.org/10.17487/ (TLS)/datagram transport layer security (DTLS) profiles for
RFC7641. https://rfc-editor.org/rfc/rfc7641.txt the Internet of Things. RFC 7925 (2016). https://doi.org/10.17487/
11. Hunkeler, U., Truong, H.L., Stanford-Clark, A.: Mqtt-sn - a pub- RFC7925. https://rfc-editor.org/rfc/rfc7925.txt
lish/subscribe protocol for wireless sensor networks. In: 2008 3rd 23. XMPP: Xmpp extensions. https://xmpp.org/extensions/
Part III
Advanced IoT Networking Topics
This part of this book, that includes four chapters, reviews the advanced IoT networking topics
that complement the protocols presented in Part II. Chapter 6 explores the different mechanisms
used for resource identification and management. Chapter 7 focuses on the technologies that
provide traffic routing and message forwarding in the context of IoT. Chapter 8 presents a
wide range of full and hybrid IoT LPWAN industry standards. Chapter 9 introduces Thread,
a popular home automation WPAN architecture, that provides an alternative approach to
traditional IoT stacks.
Resource Identification and Management
6
© The Author(s), under exclusive license to Springer Nature Switzerland AG 2022 153
R. Herrero, Fundamentals of IoT Communication Technologies, Textbooks in Telecommunication
Engineering, https://doi.org/10.1007/978-3-030-70080-5_6
154 6 Resource Identification and Management
en.wikipedia.org
address D
en.wikipedia.org HTTP server to the client and terminating the global connectivity to DNS servers and (2) registering
the recursive query, (9) the client sends the HTTP GET RRs for a massive number of devices is too expensive to be
request to the en.wikipedia.org HTTP server, and (10) the practical in most deployments. mDNS provides an alterna-
en.wikipedia.org HTTP server replies by transmitting a 200 tive to traditional DNS by addressing these two problems.
OK. Specifically, mDNS (1) removes the need for DNS servers
DNS, however, is a lot more than that; it introduces a by moving the resolution capability to each device, and (2)
generic mechanism for querying information and retrieving it assigns a portion of the DNS namespace for free local
resource records (RRs) that can provide not only network use eliminating the need for global RR registrations and
and transport layer information but also configuration param- delegations [7]. When compared to DNS, mDNS requires
eters. Under IoT and, in order to support zero-configuration, very little or no configuration to function, and it works even
DNS is extended by means of two methodologies that enable when no infrastructure is present, or the current infrastructure
distributed service discovery: (1) multicast DNS (mDNS) and is faulty.
(2) Service Discovery DNS (SD-DNS) [16, 11]. From a functional perspective, mDNS relies on the exist-
ing DNS message structure and syntax, RR types, as well
as DNS operation and response codes. mDNS, however,
6.2 mDNS specifies how devices must coordinate themselves to send
and receive multicast requests and responses in a relevant
As it can be seen in Fig. 6.1, the DNS infrastructure consists way. DNS/mDNS messages are transmitted over UDP on
of a network of DNS servers that can be globally reached port 53. Figure 6.2 shows a DNS/mDNS message; it includes
by any client. In the context of IoT, the deployment of this a fixed size header and variable number of questions and
infrastructure is not always possible due to two main issues: RRs organized as answer records, authority records, and
(1) network impairments associated with LLNs may affect additional records. Questions include the requested record
6.2 mDNS 155
name, type, and class, while RRs include only the record
select random
name, type, and class but also the TTL and the corresponding RR name
data associated with the record. The name identifies the
resource within the device, while the type specified the nature
of the resource. Some resource types are A and AAAA
to respectively specify IPv4 and IPv6 addresses, PTR for
send multicast mDNS
reverse lookups, SRV for service information, and TXT for question for name
configuration information. The class is always set to IN for
IP resource types. The TTL field identifies the number of
seconds for which a resource record is valid. Note that this
TTL field is, therefore, a Resource Record TTL (RR TTL) in
contrast to the IP TTL field that specifies the hop count limit.
A and AAAA are probably the most relevant RR types reply ?
since they enable hosts and other entities to convert device
hostnames into respective valid IPv4 and IPv6 addresses.
For a device to be globally addressable, it must belong to timeout
an organization that has control over the DNS namespace
such that it can be assigned a name. For example, if the orga-
nization owns the DNS namespace l7tr.com, a given device use RR name
can have the subdomain sensor1.l7tr.com globally allocated
for applications and other hosts to access it. However, RR Fig. 6.3 RR name resolution state machine
registration on subdomain DNS servers increments topology
complexity and requires global connectivity to work. This
authority over the selected RR name. If the request timeouts,
is not always available in IoT LLNs where infrastructure
that is, no other device responds, then the sender can assign
limitations and network outages are common. mDNS assigns
the name to the RR, otherwise the device must select a new
RRs that are only valid within a given link-local segment of
random .local RR name and repeat the process. If a sensor
the network and that they are not typically accessible beyond
has authority of an RR name like temperature.local, it can
the link-local scope. These mDNS specific RR names take
continue using that name until a conflict occurs. In this case,
the form submain.local where, for example, a device could
the device must allocate a new name for the RR in accordance
assign the sensor.local name to itself for its own A/AAAA
with the procedure specified in Fig. 6.3.
records. It is critical the RR name selection is done in such
mDNS reserves the top-level domain to .local that, as a
a way that there are no collisions with names selected by
link-local allocation, implies that all subdomains are only
other devices. In this context, RRs are unique RRs. To this
meaningful in the link where they are defined. Requests and
end, a device must first verify that no other devices are using
responses associated with questions and answers belonging
the selected RR name. A device must, therefore, support
to the .local domain must be sent to the mDNS IPv6 multicast
both client and server DNS functionality by being able to
addresses FF02::FB. mDNS supports that other non .local
generate and process multicast requests and replies. Multicast
questions can be sent multicast to other devices in the link
requests and replies guarantee that they are visible to all
if no global DNS server is configured. This enables any non-
devices co-located on the same link. Figure 6.3 shows a state
authoritative entity to respond to these requests and provide
machine that defines how a device must assign an RR name.
RR name resolution even when connectivity to the traditional
Specifically, the device must first randomly select a .local RR
DNS infrastructure is not available. For example, if an IoT
name and acting as a client sends a multicast mDNS question
gateway, due to an outage, cannot access the network core,
asking all other devices on the same link whether they have
devices on the same link can still talk to each other using
156 6 Resource Identification and Management
locally resolved globally allocated DNS RR names. In gen- client issues a new AAAA query that results on a mapping
eral, due to its distributed nature, mDNS provides a general to 2001::7 with a TTL 100. At time 200, devices A and C
mechanism for devices to access each other RR names if at are sleeping, and device B is active. As the previous query
least a minimal infrastructure is present. expires, the client issues a new one that results on a mapping
In contrast to unique RRs, certain scenarios support shared to 2001::6 with TTL 100. Essentially, the client interacts with
RRs. This is shown in Fig. 6.4 where multiple devices interact the asset through the different devices in a transparent way
through either sensing or through actuation with an asset. All by means of the asset.local hostname. The client is unaware
three devices (A, B, and C) share the same AAAA RR name that application and session layer requests (i.e. CoAP, HTTP)
that maps to three different IPv6 addresses: 2001::5, 2001::6, are being processed by three different devices with three
and 2001:7. At initial time, device A is active (devices B and different power duty cycles. This mechanism that attempts
C sleep), at time 100 s device C is active (devices A and B to address the power limitations by abstracting the different
sleep), and at time 200 s device B is active (devices A and power cycles is known as load balancing.
C sleep). Each active device responds including a TTL field
of 100 s. In essence, the devices have nonoverlapping power
duty cycles that attempt to preserve the overall network life- 6.2.1 Queries
time. In other words, IoT networks exhibit power limitations
that enforce the need of power duty cycles that balance Figure 6.5 shows two devices, one acting as a client and
active with sleeping periods. Devices in sleep mode only keep another acting as a server. Both client and server consist of
some basic functionality that enables them to become active
at some point in time. While sleeping, devices sometimes
client server
harvest energy by means of, for example, solar panels. mDNS
provides shared RR names to overcome the limitations that applications applications
result from devices being unavailable for extended periods of
time. Specifically, multiple devices that observe an asset can mDNS client query
mDNS server
take turns responding to external requests. In the figure, at querier
responder
resolver response
time 0, device A is active, while B and C are sleeping, any answerer
quesoner
AAAA request querying for asset.local results in a mapping
to 2001::5 with a TTL of 100. By around time 100, devices
Fig. 6.5 Queries and responses
A and B are sleeping, while device C is now active. The
A A A
2001::5 B 2001::5 B 2001::5 B
ASSET 2001::6 ASSET 2001::6 ASSET 2001::6
C C C
2001::7 2001::7 2001::7
asset.local ?
asset.local ?
asset.local ?
TTL = 100
TTL = 100
TTL = 100
2001::5
2001::7
2001::6
AAAA
AAAA
AAAA
ACTIVE
SLEEPING
several client and server applications. The client applications where the interval between the first two queries is 1 s and
rely on an mDNS client, also known as querier, to perform any other successive queries are transmitted by multiply-
RR name resolution. The querier or resolver (also known ing this interval by two until reaching a maximum interval
as questioner) transmits a query that is answered by the length of 3600 s. Moreover, mDNS makes queriers support a
mDNS server, also known as responder (and also known mechanism known as known answer suppression. Figure 6.6
as answerer). mDNS queries can be (1) one-shot queries shows the interaction between three devices and a client:
that are typically associated with legacy DNS queriers and first at time 0, device A and B are active, but device C is
responders and (2) continuous queries that are made by sleeping. AAAA request querying for asset.local results on
fully compliant mDNS queriers and responders in order to a mapping to 2001::5 with a TTL of 200 and to 2001::6 with
support asynchronous operations like IoT load balancing. In a TTL of 100. At time 100, the client sends a new query
general, because devices advertising unique RRs must be for asset.local, but since it knows device A is still active, it
able to perform conflict resolution, they typically include populates the known answer section including the device A
both querier and responder functionality. For devices that AAAA RR with the updated TTL value of 100. This prevents
only advertise shared RRs, there is no need for them to act device A from replying with its own AAAA RR information,
as queriers as they are not exposed to conflict resolution. thus improving network efficiency by reducing throughput.
Under one-shot queries if a device is configured with a lo- Obviously, this is why the mechanism is called known answer
cal DNS server, it transmits all queries to the aforementioned suppression; known answers are suppressed by not being
server, while those falling under the .local domain are trans- transmitted. At this point, device B is no longer active, but
mitted multicast to the destination IPv6 address FF02::FB on device C becomes active and replies with its IPv6 address
UDP port 5353. These multicast queries are transmitted using 2001::7 with a TTL of 200. At time 200, the client issues a
a source port different from 5353 in order to indicate that they new query with a known answer section including the device
are one-shot queries. With one-shot queries the resolver will C AAAA RR with the updated TTL value of 100. Since at
use the first response it receives assuming the RR is unique, this point device C is the only one active and the known
and it will not attempt to request other answers. This behavior answer section information is correct, nobody replies to the
may work on certain simple scenarios, but it may not be query. Essentially, the known answer suppression mechanism
optimal when dealing with more complex situations where, tells mDNS servers what answers are already known to the
for example, shared RRs are involved. mDNS introduces querier.
continuous queries to address some of the performance issues If way too many answers are included in the known answer
introduced by one-time queries. section of a request, they may not fit in a single mDNS
With continuous queries, a single response is not an in- message due to fragmentation restrictions. In this case, the
dication that no more responses follow. For example, in a querier sends multiple requests with different sections of the
load balancing scenario where multiple devices sense a single list of known answers with all packets having the truncation
asset, they all may send separate answers to a question about (TC) bit set other than the last one transmitted. The responder,
an RR name mapping. Moreover, if one of the devices is upon receiving mDNS messages with the TC set, defers
sleeping, the one-shot approach would cause the client to transmitting any answer until either receiving the last mDNS
forget it. Under continuous queries, operations are asyn- message with the TC bit unset or timing out after 500 ms. This
chronous, and a transaction can be finalized when there is mechanism provides a trade-off between latency and wasted
clear indication that no other responses will be received. network bandwidth, such that when waiting for more known
If a client application is looking to send and receive answers, fewer answers are transmitted by the responder.
datagrams from a device, it must keep processing mDNS In continuous queries, the querier retransmits queries to
responses until there is clear indication that the applica- obtain new answers that may not have been available when
tion is interacting with the device. One common scenario the questions were first transmitted. To this end, successful
requires a client application to show the list of available implementation of known address suppression is critical to
services in real time. One naive (and inefficient) approach minimize throughput and limit network traffic. Since channel
is to rely on issuing several queries of interest and process capacity, especially for most low-power IoT technologies
them as answers are received. As time progresses the client like IEEE 802.15.4, is low, instant bursts of traffic result
application must resend the questions to prevent the use of in contention that ultimately leads to latency and packet
stale information. This can be done either through a timer loss. To prevent this, mDNS enforces that queriers delay the
or by means of the end user clicking on a refresh button. transmission of questions by choosing a random delay in the
Unfortunately, this compulsive device polling can lead to range of 20–120 ms.
inefficient network utilization by putting an unreasonable Based on the TTL fields of received replies, clients keep
burden on the communication infrastructure. Therefore, a a cache to verify the validity of the different RRs. When an
way to prevent this is by introducing a controlled schedule, RR expiration time is reached, if no client application has
158 6 Resource Identification and Management
A A A
2001::5 B B 2001::5 B
2001::5
ASSET 2001::6 ASSET 2001::6 ASSET 2001::6
C C C
2001::7 2001::7 2001::7
asset.local ?
asset.local ?
TTL = 100
TTL = 200
TTL = 200
2001::5
2001::6
2001::7
AAAA
AAAA
AAAA
X
ACTIVE
SLEEPING
an active interest in the records, they are removed from the multiple requests carrying a single question. The advantage
cache. In reality, way before an RR is about to expire, and of multiple queries on a single request is the transmission of
as long as there is an active interest, the client must transmit fewer lower layer headers that lead to less overhead and more
a query to make sure that the record is still valid and also network efficiency. If a device is about to send a question
to update the cache with a newer TTL value. These query and it notices that the multicast request generated by another
retransmissions must be performed starting after at least half device includes the same question and the known answer
of the RR lifetime has elapsed. Formally, mDNS indicates section does not include a valid answer, then it can avoid
that a retransmission must first be issued when the lifetime sending the query. Specifically, the assumption is that any
of the RR is at 80%. If no answer is received, the next other device with authority over the RR will answer the query
retransmission is performed when the lifetime of the RR is at by transmitting a multicast response.
85%. If still no answers are received, two additional attempts
are performed when the lifetime of the RR is at 90% and 95%,
respectively. In either case, whenever an answer is received, 6.2.2 Responses
the RR lifetime is updated according to the TTL field. If no
answer is received by the end of the RR lifetime, the record The transmission of multicast responses enables all link-local
is removed from the cache. As in the case of replies, queriers devices to benefit from the responses of the different re-
randomly delay the retransmission of questions to minimize sponders. This way devices can keep their caches up-to-date
the chances of traffic bursts that can lead to packet loss. They and minimize the transmission of additional queries that may
introduce a random TTL variation of 2% that implies that have been resolved by previously received answers. In some
retransmissions are performed first between 80 and 82% of situations, however, it is neither practical nor efficient for all
the lifetime, second between 85 and 87% of the lifetime, third devices on the link to receive responses, for example, if a pre-
between 90 and 92% of the lifetime, and finally between 95 viously inactive interface is activated through a configuration
and 97% of the lifetime. mDNS clients that comply with the change. In this case, the cache associated with the interface is
mechanisms of continuous queries must issue requests to the initially empty so the sequence of queries transmitted by its
IPv6 multicast address FF02::FB from UDP port 5353. device can cause a sudden flood of multicast responses that
A single mDNS request can carry multiple queries issued produce traffic bursts that can make the network unusable due
by a unique querier. From a protocol perspective, the effect to collisions and device contention. Since most other devices
of multiple questions in a single request is like that of on the network are likely to have the answers in their caches,
6.2 mDNS 159
the transmissions of these redundant multicast replies can be single response that includes both IPv4 and IPv6 addresses.
avoided. One way to do this is by explicitly indicating that The IPv4 address is transmitted as either an A or an NSEC
requests need to be replied using unicast responses. RR, and the IPv6 address is transmitted as either an AAAA
mDNS specifies that the class field of a DNS question or an NSEC RR. The point of including both answers in a
must include a unicast response bit that, when set, indicates single response is to make sure that the resolver receives all
that the querier wants to receive unicast replies in response the interface information at the same time and minimize the
to the question. mDNS calls questions that request unicast chances of incomplete information because of packet loss.
responses QU questions to distinguish them from the more The initial design of mDNS assumed that there was no need
common QM questions that request multicast responses. for negative answers and just a simple timeout would work
When an interface first initializes, the device transmits QU as a good indication of the nonexistence of a given RR.
questions only. Question retransmissions are sent as QM The problem with this later approach is that it induces the
questions because they are likely to include a large list of retransmission of questions that introduce additional latency
known answers derived from the initial QU question trans- as well as network packet loss.
mission. More known answers mean that fewer answers are mDNS responses are supposed to be true and accurate
transmitted by those devices answering questions, thus, re- answers regardless of what questions those answers are ad-
ducing the likelihood of traffic bursts. Sometimes, responders dressing. mDNS requests can include, besides questions,
send multicast answers to QU questions; this happens when answers in the form of the known answers. On the other hand,
the mDNS server detects that the time since the last multicast mDNS responses must only include answers. If an mDNS
answer transmission is more than quarter of the TTL time. response has questions in its question section, they must be
In general, QU responses follow the same timing and packet ignored by the resolver. As in the case of mDNS requests,
generation mechanisms than QM responses. the transmissions of mDNS responses are randomly delayed
In certain circumstances some client applications require minimizing traffic bursts that lead to channel contention
resolvers to send unicast requests to a specific mDNS server and network packet loss. If the responder advertises unique
even when the queries are associated with .local RR names. RRs, there is no need to impose any transmission delays
In these cases, the mDNS server sends answers as if the as it is guaranteed that only one device will respond to the
requests were carrying QU questions. The mDNS server incoming requests. On the other hand, if the question is
must make sure that the request is being initiated by an regarding shared RRs, then the responders must delay the
mDNS client on the same local link. Specifically, if a request transmission of the answers by a random amount of time
originates outside the local link, it must be dropped by the uniformly distributed in the 20–120 ms range. This is also
mDNS server. In some other circumstances, certain mDNS important if multiple devices are attempting to answer the
servers are designed to respond to queries initiated outside same question, since the random transmission delay enables
the local link. In this case, unicast requests associated with devices to observe whether the answer has been already
.local RR names are answered by responders transmitting transmitted. If so, the device does not need to send the query.
unicast responses. Since the requests/responses in this sce- This situation is compatible with the case in which mDNS
nario become traffic in the Internet backbone, it is convenient proxy servers respond to queries based on the information
to minimize their transmissions by making sure that only previously sent by other devices.
those RR for which the mDNS server is authoritative are sent. mDNS responses must be transmitted over UDP with
In general, an mDNS responder must only answer when source and destination ports 5353 to indicate full compliance
it has a non-null positive response to send or if it is author- with specifications. A resolver typically drops any mDNS
itative about the nonexistence of a given RR. For the case responses that do not have 5353 as source port. Responses are
of unique RRs, where the responder is the sole owner of transmitted multicast to the link-local IPv6 destination ad-
RRs, the mDNS server must transmit negative answers for dress FF02::FB, unless they are in response to QU questions.
queries related to RRs that do not exist. Negative answers are To minimize traffic bursts that lead to contention and loss, a
transmitted in terms of next secure (NSEC) RRs. As with any responder must wait for at least 1 s before it can resend an
records, NSEC RRs include a TTL field that indicates for how answer to a previously transmitted RR. Whenever possible,
long it is nonexistent. For example, IoT devices have IPv6 and in order to be efficient, responders tend to aggregate as
addresses but typically lack IPv4 addresses. Since addresses many answers as possible into a single request. By doing
are unique, devices are guaranteed to be authoritative about so, the overhead due to the DNS and lower level headers
A and AAAA RRs. If a client queries about A/AAAA RRs, is minimized. Moreover, a single multicast mDNS message
the IoT device will send a positive AAAA answer and a can include answers that address questions from multiple
negative A answer to indicate that the record does not exist. queriers. In general, a responder may delay the transmission
In general, questions that request information related to the of a response by up to 500 ms in order to collect enough
IP addresses of a given interface are answered by means of a questions to guarantee that many answers is included in the
160 6 Resource Identification and Management
packet. Of course, the price to pay for this aggregation is it indicates that the response carries answers owned by the
an additional 500 ms latency. In addition, in responding to sender; the TC bit that specifies that the request is truncated
requests that include known answers, the responder may and more messages are to be expected; the recursion desired
resend the answers with an updated TTL field if the lifetime (RD) bit that it is typically used by the querier to enable
of the corresponding RR is less than half the TTL value. If recursive queries; the recursion available (RA) bit used by
a device is about to send an answer and it notices that the the responder to specify support of recursive queries; and
multicast response generated by another device includes the the 4-bit response code (RCODE) that identifies the response
same answer, then it can avoid sending the response if the type and it is used to indicate format errors, server failures,
TTL field of the answer complies with the lifetime of its RR. RR errors, request refusal, or no errors. Then four 16-bit
counters end the message; the question count (QDCOUNT)
Example 6.1 Consider an IEEE 802.15.4 scenario that indicates the number of entries in the question section,
where a querier attempts to discover three sensors that the answer count (ANCOUNT) that specifies the number of
share an asset: RRs in the answer section, the authority count (NSCOUNT)
that indicates the number of RRs in the authority section,
and the Additional Count (ARCOUNT) that accounts for the
QUERIER
2001::2105 2001::2106 number of RRs in the additional records section.
ASSET
In the specific cast of mDNS, all responses including
those unsolicited responses coming from IoT devices must
2001::2107
be processed. This observation of all incoming responses is
multicast
typically performed regardless of the content in the message
unicast
identification field and the question section. In fact, under
mDNS, a device can cache the content of all responses even
if it does not have a client with an active interest in those RRs.
Of course, the mDNS client must respect RR lifetimes when
caching those responses.
If it takes 11.34 ms for all three unicast requests
In the context of mDNS, there are a few expectations on
to arrive at the sensors, what is the average MAC
how the fields are used. For example, for multicast mDNS
contention delay? Ignore any delays other than the
messages, the message identification field is always 0 re-
transmission delay. Assume average mDNS and CoAP
gardless of whether the message is a request or a response.
packet sizes of 30 and 40 bytes long, respectively.
Only in the case of legacy unicast responses triggered by
Solution: The contention delay is given by Tc =
T − Tt where T is T = 11.34 ms and Tt 0 1 5 6 7 8 9 10 11 12 15
is the transmission delay. Tt is given by Tt =
LmDNS request +3×LmDNS response +3×LCoAP MESSAGE ID
R
= 7.68 ms where R =
250000 Kbps, LmDNS request = LmDNS response = 8 × QR OPCODE AA TC RD RA reserved RCODE
30 bits and LCoAP = 8 × 40 bits. The contention delay QDCOUNT
is, therefore, Tc = 3.66 ms.
ANCOUNT
NSCOUNT
ARCOUNT
QU requests the message identification field is used to keep Because an instance is related to a service and a domain,
track of the transaction. Similarly, the OPCODE is always they are discovered by querying service.domain PTR RRs.
set to query on transmission, and any other value is ignored Once all instances are identified, then it is possible to retrieve
by the responder. The AA bit must be unset on transmission IP addresses, transport ports, and general configuration
and ignored when received. As previously indicated, if the information by querying instance.service.domain A/AAAA,
TC bit is set, the responder must wait for at least 500 ms SRV, and TXT RRs respectively. Figure 6.8 shows a client
to wait for more messages. This bit only applies to queries, transmitting a multicast service.domain PTR request that is
so responses do not set it and queriers ignore the value in answered by three devices (A, B, and C) that transmit their
incoming responses. Finally, queriers set the RCODE to no supported instances A.service.domain, B.service.domain, and
error on transmission, and it is ignored by responders upon C.service.domain. In Fig. 6.9 the client sends three queries
reception. Another difference between traditional DNS and derived from the list of instances: (1) an A.service.domain
mDNS is that the former relies not only on UDP but also A/AAAA request to obtain the IP addresses, (2) an
on TCP transport for unicast transmissions. Since TCP does A.service.domain SRV request to obtain the TCP/UDP
not support multicast operations, it cannot be used for mDNS ports, and (3) an A.service.domain TXT request to retrieve
transport. configuration information. Note that SD-DNS is defined to
work not only in the context of multicast mDNS transactions
but also relying on traditional unicast DNS servers. In this
6.3 SD-DNS later case a client can send all SD-DNS queries to a local DNS
server that through recursion can discover instances and their
mDNS provides the basic infrastructure for the exchange addresses, transport ports, and configuration parameters.
of RRs between devices on the same link [6]. By itself, The service component of the service.domain element
mDNS does not specify a procedure for the discovery of takes the form of the protocols associated with the instances
a newly deployed device in the network. To this end, SD- being queried. For example, if a client is interested in HTTP
DNS relies on the infrastructure to enable zero-configuration instances, the corresponding service name is _http._tcp since
support. Moreover, SD-DNS specifies how RRs must be HTTP is a session protocol that runs over TCP. Similarly,
named to provide service discovery, but, as mDNS, it makes if the client is interested in CoAP instances, the service
no changes to the structure of DNS messages, operation, and name is _coap._udp since CoAP is run over UDP. Services
response codes as well as most DNS protocol values. With can be more specific, for example, temperature._mqtt._tcp
SD-DNS a client can specify, by means of DNS queries, the addresses all instances of temperature sensors that support
type of service and the domain in which it is looking for that MQTT over TCP. Similarly, _coap._dlts._udp looks for all
service and obtain a list of the named instances that provide instances of secure CoAP. Note that protocol names are
the service. preceded by an _ symbol. Note that the original service
specification supports only two different transport types _tcp
and _udp. _tcp is used for TCP transport-based protocols,
and _udp is used for all other protocols regardless of whether
they support UDP or not. In other words, a popular transport
A/AAAA A. service.domain ?
IP addresses
B.service.domain
client B SRV A.service.domain ?
TCP/UDP ports
CLIENT A
TXT A.service.domain ?
configuration information
C
protocol known as Stream Control Transmission Protocol intended to be accessed more often, are specified by lower
(SCTP) that enables efficient transmission of data streams is priority numbers. Similarly, if several servers have ports with
encoded as _udp and not as it would be expected as _sctp. the same priority, the weight specifies what server should
Fortunately, most IoT protocols rely on UDP transport so this be accessed more often. When there is only one RR that
is never an issue. specifies the transport port, then the weight and priority fields
can be ignored.
Example 6.2 What is the transmission rate overhead TXT RRs provide a list of device configuration parameters
due to the transactions shown in Fig. 6.9? that are service and instance dependent. In other words,
how their parameters are interpreted depends on the type of
Assume that the TTL fields of the A/AAAA, SRV, service under consideration. For example, the unit configura-
and TXT RRs are 100 ms, 250 ms, and 500 ms, tion parameter on a temperature sensor is specified as either
respectively. Additionally assume that the size of the Celsius or centigrade degrees. Similarly, on a barometric
mDNS request packets is 30 bytes long and that the pressure sensor, it is specified as either Pascals or pounds per
sizes of the A/AAAA, SRV, and TXT mDNS responses square inch. What is standardized is the way in which TXT
are LA/AAAA = 20, LSRV = 10 and LTXT = 57 bytes, RRs are accessed; SD-DNS compliant devices must be able
respectively. to provide TXT RRs in addition to SRV RRs with the same
name even if they have no relevant configuration information.
In this later case, the TXT RR must provide a single 0 byte.
Solution Considering that in 1 s there are ten, four In all cases, the lifetime of the record is given based on the
and two A/AAAA, SRV, and TXT transactions, TTL field of the RR received.
respectively, Because the list of configuration parameters is typically
the rate overhead R is given by
R = 8 × 10 × LA/AAAA + 4 × LSRV + 2 × LTXT = large, it is important to mention the size restrictions that apply
2832 bps. to most RRs. As any other record, a TXT RR that includes
the list of parameters can be up to 65535 bytes long. This
length is part of the length field in the RR header. In the
The domain component of the service.domain RR
context of mDNS RR, when considering all protocol headers
name follows the usual subdomain.local format for
and networking conditioning, the practical upper limit of a
mDNS-based queries or follows the traditional unicast
TXT RR length is around 9000 bytes. It is always preferable
hostname format. Similarly, the instance components of the
to keep the TXT RR length below the MTU size of a single
instance.service.domain element is a user-friendly name that
datagram to prevent, whenever possible, fragmentation. Of
consists of a string composed of 16-bit unicode characters.
course, when relying on 6LoWPAN and low-rate IoT mech-
In most cases, the instance is a default name that enables
anisms like IEEE 802.15.4, fragmentation is, in many cases,
a client to access the device without any previous manual
unavoidable.
configuration. Moreover, to prevent collisions, in most cases
these defaults names are generated as a random combination
mDNS/SD-DNS Implementations mDNS/SD-DNS are
of keywords and numbers. Instance names, as opposed to
protocols that, predating IoT, were originally intended
hostnames, are not constrained by specific rules, and rich
for discovery, provisioning, and configuration of print-
text strings are allowed. Spaces and other special characters
ers and other network devices like routers and switches.
are possible, for example, Temperature Sensor 1 is a valid
Because of this, mDNS/SD-DNS implementations are
instance name. Some special characters like dots need to
pretty stable and widespread for many different plat-
be escaped to differentiate from the dots used to separate
forms and OSs. The list below presents some of the
instance, service, and domain components. Escaping a dot
most popular mDNS/SD-DNS implementations.
is done by representing it as a backslash followed by the
dot itself (i.e. \.. On the other hand, escaping a backslash is
performed by representing it as a double backlash (i.e. \\). Bonjour Apache licensed open source C implementation.
SRV RRs provide a list of the UDP and/or TCP ports Available for general purpose OSs like Linux.
associated with a given service instance. The list of ports Adapted to support RTOS like Contiki.
can be used to support load balancing by enabling clients lwIP BSD licensed open source C implementation.
to access servers in a sequential fashion. For example, if RTOS specific support.
TCP ports 1883, 1884, and 1885 are provided as response Avahi LGPL licensed open source C implementation.
to an SRV query, the client applications can then establish Available in most Linux distributions included in
new sessions by sequentially connecting to those ports. This embedded devices.
port selection, however, is ruled by two fields; priority and OpenMDNS BSD licensed open source C implementation.
weight associated with each port. Higher priority servers, Ultra lightweight support of mDNS/SD-DNS.
6.4 CoAP Service Discovery 163
The list of configuration parameters is made of a sequence RRs and the associated A/AAAA RRs. Finally, if a querier
of key and value pairs. The key represents the parameter transmits a TXT request, the responder sends back just the
name, while the value indicates its associated parameter TXT RR.
value. Each pair is encoded as a single string key=value Figure 6.11 shows a service discovery example; the
where key and value are separated by an equal sign =. For client just sends a multicast mDNS PTR RR query
example, a key could be location and its value the corre- for _temperature._coap._udp.local. Device sensor1
sponding GPS coordinates such that the encoding string is answers the query by sending a PTR RR that indicates
location=41.40338,2.17403. The key size is between one the sensor1._temperature._coap._udp.local session. The
and nine characters long, while the overall encoded string response also piggybacks an NSEC RR to indicate that
length size is never larger than 255 bytes. Obviously, the the device does not have an IPv4 address, an AAAA
key or parameter name has to be unique within the context RR that signals a 2001::21:10 IPv6 address, a SRV RR
of the service being considered. For the most part, the key that points to a single UDP port 5683, and a TXT RR
does not need to be human readable as it is intended to be that transmits a configuration parameter list units=C and
processed by client applications. Given a service and all its location=41.40338,2.17403.
associated parameters, there are four possible scenarios for
the parameters in the list included in the TXT RR: (1) if the
key is not present, it implies that the parameter takes the 6.4 CoAP Service Discovery
default value or that the parameter is unknown; (2) if the
key is present with no value, it implies that the parameter CoAP introduces both distributed and centralized approaches
represents a boolean condition that is false; (3) if the key is to service discovery. The distributed approach is based on
present with an empty value, it implies that the parameter simple CoAP resource discovery, while the centralized ap-
takes the default value; and (4) if the key and its value are proach is based on CoAP resource directory [15]. In all cases,
both present, it assigns the value to the parameter. as a result of the discovery, URIs that represent the resources
Key/value pairs, encoded as strings, are concatenated in and corresponding attributes are obtained. Distributed CoAP
a binary frame and pre-appended by a single byte that spec- service discovery relies on interaction, by means of queries,
ifies the length of the string. This is shown, as example, in between applications and devices. On the other hand, under
Fig. 6.10 where the following strings are encoded: key=value, centralized CoAP service discovery, applications and devices
active=1, and units=C. In general, it is up to the service do not query each other, and the interaction is by means of
specifications to purely rely on TXT RRs for configuration a directory. Note that although these mechanisms have not
or combine TXT RRs with inband protocol mechanisms. been fully standardized, they are supported by several CoAP
For example, under CoAP, configuration information like the implementations [17].
units associated with temperature sensing can be transmitted
as part of a TXT RR list or as part of a CoAP option.
For efficiency, under SD-DNS, whenever a PTR query 6.4.1 Distributed CoAP Resource Discovery
is transmitted, the responders transmit not only the list of
instances but also all associated A/AAAA, SRV, and TXT This method provides the simplest way for devices to sup-
RRs. This saves the querier the need of transmitting addi- port service discovery without the need of directories and
tional A/AAAA, SRV, and TXT RR queries. Similarly, if a other central entities. The scenario is illustrated in Fig. 6.12
client sends a SRV query, the responder transmits the SRV where a receiver application discovers the services offered
PTR sensor1._temperature._coap._udp.local
Fig. 6.12 Distributed CoAP resource discovery Fig. 6.13 Resource discovery registration
by a temperature sensor by transmitting a regular CoAP store the description of the CoAP services and resources
GET request to the well-known URI /.well-known/core. The available in the LLN and provide an interface for devices
querying application may or may not know the address of and applications to query them. Devices register with the
the device; for the first case, the application transmits the directories so that any entity can look up for resources by
request directly to the unicast address of the device, while for transmitting a single CoAP GET request. Since all queries
the second case, the application transmits a multicast request are submitted to the directory, devices and applications must
instead. Devices can also discover applications; in Fig. 6.12 be able to reach it. There are three possibilities: (1) the device
the temperature sensor sends a CoAP GET request to the knows what the address of the directory is, (2) the directory
/.well-known/core?rt=oic.d.receiver URI. Note that the URI address may be the same as that of the border router obtained
includes an attribute resource type (rt) that provides addi- by means of RAs, and (3) the directory address is discovered
tional filtering in order to only reach receiver applications. through a multicast transmission.
This is specified by means of the Internet Assigned Numbers Figure 6.13 shows the device registration process.
Authority (IANA) registered attribute value oic.d.receiver. First, a device sends a CoAP GET request to the /.well-
Other allowed attributes that can be included in URIs are (1) known/core?rt=core.rd* URI in order to determine the
the interface description (if) that is a string that indicates the specific URI of the directory. This is usually done in
name or URI used to access the resource, (2) the maximum all scenarios, including under multicast discovery. The rt
size (sz) that specifies the maximum size of the resource attribute points to core.rd* in association with the resource
representation returned by performing a GET of the target directory information. Once the directory location and
URI, and (3) the content type (ct) that indicates the format address are known, the temperature sensor can then transmit
of the content returned when accessing the resource. In the a CoAP POST to the /rd URI to add its resource identifier.
context of CoAP, the use of URIs with attributes is specified The directory responds with a 2.01 Created to indicate that
by IETF RFC 6690 Core Link Format as a mechanism for the entry has been inserted into the database and it has been
servers to describe hosted resources. assigned the /rd/2105 URI.
In most cases, however, the device address is not known CoAP introduces additional functionality to manage di-
beforehand, so discovery can only be performed by transmit- rectory entries. Figure 6.14 shows the device updating its
ting multicast CoAP GET requests. But multicast transmis- registration by transmitting a CoAP PUT request with a new
sions are unreliable since there is no way to know whether URI /temp. The request is replied with a 2.04 Changed. The
a request has made it to destination since the number of directory can also verify if the device resource information is
destinations is unknown to begin with. In this situation, it up-to-date. In this case, the directory transmits a CoAP GET
makes a lot more sense to rely on CoAP directories to keep request to the /.well-known/core URI with a ETag that speci-
track of resources. fies the version of the information it has. If the information is
up-to-date, the device replies with a 2.03 Valid; otherwise it
transmits the updated information by means of a 2.05 Content
6.4.2 Centralized CoAP Resource Discovery response. When the temperature sensor wants to delete its
directory entry, it transmits a CoAP DELETE request to the
As previously indicated, the centralized approach to resource URI /rd/2105. The directory replies with a 2.02 Deleted.
discovery relies on one or more directories. The directories
6.5 UPnP 165
If a device wants to look up for specific resource informa- ing from computers and printers to gateways and access
tion in the directory, as illustrated in Fig. 6.15, it can transmit points [12]. UPnP enabled zero-configuration networking
a GET CoAP request to the /rd/res?rt=oic.d.receiver by leveraging IP, TCP, UDP, HTTP, and XML. Each device
URI. The lookup type /rd/res indicates that the device is is associated with a particular XML schema that defines
querying the directory for those registered resources of the data structures that are used for interoperability and
type oic.d.receiver. The directory then replies with a 2.05 discovery. Note that most of these protocols and technologies
Content that includes the coap://[2001::21:5]:5683/app are not efficient in the context of LLN scenarios, so improve-
URI for direct access to the resource. Similarly, if the ments have been proposed to enable UPnP IoT support [13,
device just wants to find out what the domain of the 4].
receiver is, it can issue a GET CoAP request to the UPnP entities are classified as either controlled devices or
/rd/ep?rt=oic.d.receiver URI where the lookup type /rd/ep control points. Controlled devices are, from an IoT functional
specifies that endpoint information of type oic.d.receiver is perspective, sensors and actuators that act as UPnP servers,
being requested. while control points are user applications that run on smart-
phones and typically act as UPnP clients. UPnP networking is
made of five different steps: addressing, discovery, descrip-
6.5 UPnP tion, control, eventing, and presentation. Addressing is the
first step of UPnP networking and allows devices and control
The Universal Plug and Play (UPnP) architecture provides points to get network addresses. Once a control point has an
a framework for the discovery of network elements rang- address, through discovery, it can find controlled devices and
then obtain their capabilities by means of the description step.
Through eventing, control points listen for state changes of
the devices. The last step presentation enables control points
to display a user interface for the devices.
NOTIFY * HTTP/1.1 The start line HTTP/1.1 200 OK follows the convention
Host: [FF02::C]:1900 of the HTTP responses and specifies this is a response to
Cache-ControlL: max-age=3600 the request transmitted by the control point. The message
NT: uuid:2619d124-5400-2105-af21-90123ae100ff continues with a Cache-Control header that determines how
NTS: ssdp:alive long the message is valid. The message follows with an ST
Location: http://[2001::21:5]:8060/sensor/data.xml header that specifies the identity of the service responding to
USN: uuid:2619d124-5400-2105-af21-90123ae100ff the discovery request, and a USN header also identifies the
service. The Server header indicates the server information
The message is transmitted by a device as a multicast including OS, protocol, and application version. Finally, the
datagram to destination [FF02::C]:1900 and includes a start Location header indicates the URL that provides more infor-
line NOTIFY * HTTP/1.1 that indicates that the request is mation about the service provided by the device.
an advertisement. The message includes a Host header that
specifies the destination address and port included at the
application layer for recovering when NAT is in place; it 6.5.2 Description Step
continues with a Cache-Control header that determines how
long the message is valid, an NT header that indicates the The discovery step gives a control point some basic informa-
notification type as a service identifier, an NTS header that tion about the devices, but it does not provide any specific
specifies the notification subtype as ssdp:alive, a Location information about the data structures needed to interact with
header that indicates the URL that provides more information them. Specifically, to access a device, the control point must
about the service provided by the device, and a USN header be able to download the description of the device and its
that identifies the service. Note that in this message, the NTS capabilities that are indicated in the Location header of the
and USN headers carry the same information. 200 OK discovery response. The device description is carried
Discovery, as advertising, is carried out by the transmis- as XML formatted data that consists of two parts: (1) a device
sion of a multicast datagram request from a control point description indicating physical and logical containers and (2)
to destination [FF02::C]:1900. The message below is an a service description indicating the capabilities of the device.
example of an SSDP control point discovery message: The device description provides manufacturer information
M-SEARCH * HTTP/1.1
like serial number, vendor information, and model name,
Host: [FF02::C]:1900
while for each service in the device the service name, the
MAN: ssdp:discover
URL for service description, the URL for control and the
MX: 1
URL for eventing are provided. Note that a single physical
ST: ssdp:all
device, known as root device, may include multiple logical
The start line M-SEARCH * HTTP/1.1 indicates that the devices. The device description includes the description of
message is a discovery request. As for the advertising mes- the root device and all logical devices.
sage, the message includes a Host header that specifies the Figure 6.16 shows the description architecture, where the
destination address and port included at the application layer control point first retrieves the root device description that
for recovering when NAT is in place. The MAN header that includes the service URL that is used to obtain the service
follows specifies the type of message which for discovery description of the logical devices. The service description de-
requests it is always ssdp:discover. The MX header indicates fines the actions that the control point can perform including
how many seconds can devices wait before responding to the the arguments these actions can take. It also includes a list
request. The message ends with the ST header that specifies of the possible states a device can take with its associated
the scope of the search; in this case, ssdp:all indicates that all variables, data types, range, and event characteristics. Ac-
devices and services must be searched. tions have inputs and outputs, and their arguments are state
Devices reply by transmitting a unicast response to the variables.
device. The message below is an example of an SSDP device
discovery response message:
HTTP/1.1 200 OK 6.5.3 Control, Eventing, and Presentation
Cache-Control: max-age=3600 Steps
ST: uuid:2619d124-5400-2105-af21-90123ae100ff
USN: uuid:2619d124-5400-2105-af21-90123ae100ff Control enables control points to perform actions on devices
Server: Raspian/Buster UPnP/1.0 Temperature Sensor/2.4 and poll for results. This action/response interaction is syn-
Location: http://[2001::21:5]:8060/sensor/data.xml chronous, with the control point transmitting the action and
6.5 UPnP 167
description device
…
… service
…
waiting for the response from the device. When the device <?xml version="1.0"?>
receives the action, it processes it and replies with either a <s:Envelope
successful response or an error. The action is sent to the URL s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
associated with the service obtained from the service de- xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
scription. Control messages are encoded as SOAP payloads <s:Body>
transmitted over HTTP. As indicated in Sect. 5.2.6, SOAP <ns0:GetSensorTemperatureResponse xmlns:ns0="urn:
is an XML data structure that provides a mechanism for schemas-upnp-org:
exchange of messages. SOAP messages include a mandatory service:Temperature:1">20C
envelope, an optional header, and a mandatory body. </ns0:GetSensorTemperatureResponse>
The message below shows an example of an action trans- </s:Body>
mitted from the control point to the device: </s:Envelope>
POST http://[2001::21:5]:8102/upnp/control/Temperature HTTP/1.1
SOAPAction: urn:schemas-upnp-org:service:Temperature:1
The response is a regular HTTP 200 OK message with a
Host: [2001::21:5]:8102
SOAP body that has an Envelope that contains in the Body
Content-Type: text/xml;charset="utf-8"
the response GetSensorTemperatureResponse that carries a
Content-Length: 324
20C readout.
When a device like a temperature sensor generates a new
<?xml version="1.0" encoding="utf-8"?>
readout, it can trigger an event on the control point. Eventing
<s:Envelope
supports two ways of operation: unicast by relying on HTTP
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
over TCP and multicast by means of HTTPU, that is, HTTP
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
over UDP.
<s:Body>
<ns0:GetSensorTemperature xmlns:ns0="urn:schemas-upnp
-org:service:Temperature:1">
</ns0:GetSensorTemperature>
</s:Body> control point device
</s:Envelope>
Figure 6.17 shows the flow of messages for unicast event- 6.2 Describe a scenario where the mDNS responder is a
ing. The mechanism extends HTTP to include SUBSCRIBE sensor that only advertises shared RRs.
and UNSUBCRIBE methods used by the control points to
respectively start and stop receiving events. When a sensor 6.3 Under the SD-DNS the following transaction is carried
readout becomes available, the device transmits an HTTP out. What mDNS query type is likely to be sent by the
NOTIFY request carrying the readout itself. All these re- querier?
quests, SUBSCRIBE, UNSUBSCRIBE, and NOTIFY, are
replied with the usual HTTP response codes. Device readouts
in the NOTIFY messages are encoded as XML bodies to querier
encode the relevant device state variables. In the case of mul- sensor
ticast transmissions, control points do not need to subscribe
as the devices transmit the NOTIFY messages directly over
HTTPU, and they do not expect a response either.
Lastly, the presentation stage, when signaled through a
URL in the device description, provides a web interface for
users in control points to control the device and view its
status. As such, presentation stage is supported by the device
6.4 Under the SD-DNS the following transaction is carried
acting as a web server.
out. What mDNS query type is likely to be sent by the
querier?
Summary
6.1 Describe a scenario where the mDNS responder is a 6.6 Consider an SD-DNS client (running on an application)
sensor that only advertises unique RRs. that queries four sensors to discover service instances. If the
only delay is the transmission delay and the transmission rate
Table 6.1 Resource identification and management protocols on both directions is 135 Kbps, how long does it take for the
client to discover all instances? Assume a uniform packet size
Protocol Transport Overhead Generic?
of 120 bytes.
mDNS/DNS-SD UDP Low Yes
CoAP SD UDP Medium No, specific to
CoAP 6.7 Consider an SD-DNS client that queries the addresses
UPnP TCP High Yes of four sensors. If TTL fields of RRs are multiples of 100,
please fill the empty spaces in the figure below:
References 169
References
1. Al-Fuqaha, A., Guizani, M., Mohammadi, M., Aledhari, M.,
Ayyash, M.: Internet of things: A survey on enabling technologies,
protocols, and applications. IEEE Commun. Surv. Tuts. 17(4),
2347–2376 (2015)
2. Andrew Banks Ed Briggs, K.B., Gupta, R.: Mqtt version 3.1.1
oasis committee specification (2014). http://docs.oasis-open.org/
mqtt/mqtt/v3.1.1/mqtt-v3.1.1.html
3. Banks, A., Gupta, R.: Mqtt version 5.0 oasis committee specifica-
tion (2019). https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.
html
4. Bodlaender, M.P.: Upnp/spl trade/ 1.1 - designing for perfor-
6.8 Show an mDNS message flow example where a sensor mance compatibility. IEEE Trans. Consumer Electron. 51(1), 69–
responds by transmitting at least one NSEC RR. 75 (2005)
5. Carballido Villaverde, B., Alberola, R.D.P., Jara, A.J., Fedor, S.,
Das, S.K., Pesch, D.: Service discovery protocols for constrained
6.9 If the RTT is 200 ms, how long does it take for a client to machine-to-machine communications. IEEE Commun. Surv. Tuts.
fully discover and transmit a NON CoAP request to a sensor? 16(1), 41–60 (2014)
6. Cheshire, S., Krochmal, M.: DNS-based service discovery. RFC
6.10 How long does a transaction to delete a sensor entry 6763 (2013). https://doi.org/10.17487/RFC6763. https://rfc-editor.
org/rfc/rfc6763.txt
in the CoAP resource directory take? Assume a bidirectional 7. Cheshire, S., Krochmal, M.: Multicast DNS. RFC 6762 (2013).
130 Kbps transmission rate as well as minimum size IEEE https://doi.org/10.17487/RFC6762. https://rfc-editor.org/rfc/
802.15.4 and 6LoWPAN headers. Use Fig. 6.14 as reference. rfc6762.txt
8. Datta, S.K., Costa, R., Bonnet, C.: Resource discovery in internet of
things: current trends and future standardization aspects. In: IEEE
6.11 Consider the UPnP scenario shown in Fig. 6.17. As- World Forum on Internet of Things (WF-IoT), pp. 542–547 (2015).
suming a 120 ms RTT and nonpersistent HTTP connections, https://doi.org/10.1109/WF-IoT.2015.7389112
how long does it take for all transactions to be completed? 9. Domain names - concepts and facilities. RFC 1034 (1987). https://
doi.org/10.17487/RFC1034. https://rfc-editor.org/rfc/rfc1034.txt
A A A
2001::5 B B 2001::5 B
2001::5
ASSET 2001::6 ASSET 2001::6 ASSET 2001::6
D D D
C C C
2001::8 2001::8 2001::8
2001::7 2001::7 2001::7
TTL = ___ TTL = ___
2001::8 2001::6
asset.local ?
asset.local ?
asset.local ?
TTL = ___
TTL = ___
TTL = ___
K.A: ___
2001::5
2001::7
2001::5
AAAA
AAAA
AAAA
ACTIVE
SLEEPING
10. Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, 15. Shelby, Z., Koster, M., Bormann, C., der Stok, P.V., Amsuss, C.:
P., Berners-Lee, T.: Rfc 2616, hypertext transfer protocol – http/1.1 CoRE resource directory. Internet-Draft draft-ietf-core-resource-
(1999). http://www.rfc.net/rfc2616.html directory-25, Internet Engineering Task Force (2020). https://
11. Florea, I., Rughinis, R., Ruse, L., Dragomir, D.: Survey of standard- datatracker.ietf.org/doc/html/draft-ietf-core-resource-directory-
ized protocols for the internet of things. In: 2017 21st International 25. Work in Progress
Conference on Control Systems and Computer Science (CSCS), 16. Stolikj, M., Cuijpers, P.J.L., Lukkien, J.J., Buchina, N.: Context
pp. 190–196 (2017) based service discovery in unmanaged networks using mdns/dns-
12. Foundation, O.C.: Upnp device architecture 2.0 (2020). sd. In: 2016 IEEE International Conference on Consumer Electron-
https://openconnectivity.org/upnp-specs/UPnP-arch- ics (ICCE), pp. 163–165 (2016)
DeviceArchitecture-v2.0-20200417.pdf 17. Tanganelli, G., Vallati, C., Mingozzi, E.: Edge-centric distributed
13. Jeronimo, M., Weast, J.: UPnP Design by Example: A Software discovery and access in the internet of things. IEEE Internet Things
Developer’s Guide to Universal Plug and Play. Intel Press (2003) J. 5(1), 425–438 (2018)
14. Shelby, Z., Hartke, K., Bormann, C.: The Constrained Applica-
tion Protocol (CoAP). RFC 7252 (2014). https://doi.org/10.17487/
RFC7252. https://rfc-editor.org/rfc/rfc7252.txt
Routing on Constrained Devices
7
© The Author(s), under exclusive license to Springer Nature Switzerland AG 2022 171
R. Herrero, Fundamentals of IoT Communication Technologies, Textbooks in Telecommunication
Engineering, https://doi.org/10.1007/978-3-030-70080-5_7
172 7 Routing on Constrained Devices
CH
cluster 1
CH clusterhead
CH
cluster 2
temperature
readout sink humidity
readout sink
humidity
sensor
pressure
readout sink
pressure
sensor
temperature
temperature sensor
sensor
routing. Data naming relies on the use of relevant attributes location based routing; a client attempts to send a datagram
like data types and timestamps. In the context of a fully to a destination that is known by its geographical coordinates.
connected network, Fig. 7.3 shows a scenario with a remote First the client, that knows its own coordinates, forwards the
user residing at the edge of the IP cloud that transmits a query datagram to router 1 that is the closest one in the direction of
to reach a WSN sensor. The query is propagated beyond the the destination. Similarly, router 1, that also knows its own
gateway all the way to the sensor by means of intermediate coordinates, forwards the datagram to router 2 that, again,
nodes forwarding this request. The response, on the other is the closest one in the direction of the destination. Finally,
hand, makes it back all the way to the remote user. router 2, that has a direct link to the destination, just forwards
Location based routing is an alternative to both address the datagram. Location based routing can be combined with
and data-centric routing. It consists of a client or device hierarchical routing to exploit traffic aggregation.
transmitting datagrams to another client or device by for- One drawback of traffic aggregation, however, is that it
warding the traffic based on the geographical or physical results in increased throughput that limits channel capacity
location of the destination. To this end, the client and each and leads, in turn, to contention as well as additional latency.
router along the way estimate the direction of propagation of So, one desired property when performing aggregation is
datagrams to efficiently reach the destination with minimal making sure that readouts are processed and compressed
energy consumption. Figure 7.4 illustrates an example of at the device whenever possible. In other words, local pro-
7.1 Routing Concepts 173
IP
local user
qu
re er
sp
on
y WSN
se
gateway
sensor
router 1
dir
ec
ti
on
di
re
ct
io
n
dire
router 2 ctio
n
destination
cessing enables the conversion from data to information transmitted thus reducing the overall network bandwidth
presented in Sect. 1.3. The price to pay for the conversion is utilization. There is, therefore, a balance between respon-
the need for higher computational power that together with siveness and power consumption. Moreover, reducing power
the transmission of aggregated data increase battery drainage. consumption is typically accomplished by means of power
The overall idea of routing mechanisms in the context cycles that require full network coordination to minimize
of both WSNs and IoT is to maximize the network lifetime latency and other negative effects on the routing algorithms.
attempting to distribute routing traffic over as many devices Routing is classified in regard to three possible strategies
as possible. Aggregation and routing must be highly efficient that relate to the balance between responsiveness and power
due to the well known energy limitations and constraints of consumption: (1) proactive routing consists of building rout-
embedded devices like sensors and actuators. In general, the ing tables that ultimately define forwarding behavior by
lower the power consumption, the less responsive the routing means of the periodic transmission of routing information
mechanism is, as fewer routing control packets are typically across all nodes in the network, (2) reactive routing relies
174 7 Routing on Constrained Devices
7.2.1 Flooding
b
1
a c
a
b 4
1 2
e 3 c
d
2
3 6
f
Fig. 7.7 Flooding traffic overlapping
5 8
7.2.2 Gossiping
7.2.3 SPIN its data to other devices in the network even if they are not
directly connected. Essentially, device 1 starts by advertising
Sensor Protocols for Information via Negotiation (SPIN) metadata that its neighbor device 2 expresses interest in by
is a flat data-centric routing mechanism that through data transmitting back a request. This request triggers device 1 to
negotiation and resource adaptation enables devices to for- send the data to device 2. Device 2 forwards the associated
ward datagrams from a source to a sink in a much more advertising metadata to all its neighbors. From those, only
controlled and more energy efficient way than flooding and devices 3 and 6 are interested in requesting the data. Upon
gossiping [14]. Energy efficiency is accomplished by mak- receiving the requests, device 2 forwards the data to those
ing devices learn about the metadata associated with other devices.
devices before any datagrams can be forwarded. Metadata SPIN is further improved as SPIN Energy Conservation
are data that describe other data and, as such, are typically (SPIN-EC) by considering energy consumption. SPIN-EC
much smaller than the described data themselves. By being enables devices to minimize their participation in operations
smaller, lower transmission rates and less energy are needed if their energy levels fall below a certain threshold. For
for transmission. example, a device will only send an ADV message if it
SPIN relies on end and intermediate devices advertising considers that it has enough energy to process REQ and
metadata that they generate or forward so that other devices generate the corresponding DATA messages. Similarly, if a
interested in the associated data can request them [9]. Data device receives an ADV message, it will only transmit a REQ
are sent to the devices that are really interested in forwarding message if it considers it has enough energy to process the
or using them in order to minimize the waste of energy that incoming data.
results from sending datagrams to nodes that do not need to Although SPIN is a P2P mechanism it also introduces a
be involved in the process. Moreover, SPIN, when compared broadcast version, called SPIN Broadcast (SPIN-BC) that
to flooding, eliminates the transmission of redundant data relies on devices sharing a single channel. If a device sends
that causes traffic implosion and overlapping. an ADV, REQ, or DATA message, it is received by all other
Resource adaptation in SPIN means that devices, based on devices that are located within the transmission coverage area
the current energy levels, decide what resources to negotiate of the sender. The idea is to take advantage of the redundancy
and advertise before the real data are transmitted. In fact, as generated by the transmission of broadcast (or multicast)
energy levels become too low, a device can reduce and po- messages. Moreover, timing becomes critical under SPIN-
tentially eliminate the forwarding of metadata and real traffic BC since a device will delay the transmission of a REQ
data [8]. Device redundancy is, in these cases, important as an message to see if another co-located device is also attempting
energy depleted device can become a single point of failure. to request the same data. The length of the delay is estimated
Resource adaptation is, in the end, a way to control the overall based on the available device energy; the more energy, the
network lifetime. shorter a device will wait to transmit a REQ. The idea is
SPIN messages used for routing can be (1) advertising to extend overall network lifetime by giving those devices
(ADV), (2) request REQ, or (3) data DATA messages. The with the least amount of energy the greatest opportunity to
ADV message enables a device to advertise the metadata preserve it. Once the advertising device receives the REQ
that describe the type of data it supports. If any other device message, it broadcasts the DATA message to all interested
is interested in the advertised data, either to consume or devices including those that did not implicitly send the orig-
forward them, it sends a REQ message to obtain a copy inal REQ message.
of the real data. When received by the original metadata Figure 7.11 shows SPIN-BC operations; device 1 adver-
transmitter, the request triggers the transmission of a DATA tises its metadata to all listening devices 2, 3, 4, 5, and
message containing the actual data. These transactions are 6. If devices 2, 5, and 6 are interested in the data, device
illustrated in Fig. 7.9. Again, since the ADV message is much 2 broadcasts a request first, as it comparatively has more
smaller than the corresponding DATA message, the mecha- energy. Both devices 2 and 5 do not do anything and just wait
nism guarantees that energy is only spent on the transmission for the DATA message that is later broadcasted by device 1.
of datagrams that carry relevant information. One last SPIN mechanism, known as SPIN-RL, provides
Figure 7.10 shows a simple example of SPIN data nego- reliability when the underlying network is prone to packet
tiation and propagation; the idea is for device 1 to transmit loss and other impairments. Essentially, SPIN-RL introduces
two ways to accomplish additional reliability: (1) it relies on
retransmissions that are triggered whenever a DATA mes-
ADV sage fails to arrive after the transmission of a request and
REQ
(2) it transmits periodic ADV messages that are tracked
1 DATA 2
by the receiving devices to make sure that they are not
redundant.
Fig. 7.9 SPIN transactions
7.2 WSN Routing 177
1 1 1
3 3 3
2 2 2
4 4 4
7 7 7
5 5 5 6
6 6
1 1 1
3 3 3
2 2 2
4 4 4
7 7 7
5 5 5 6
6 6
1 1
6 4 6 4
5 5
2 3
1
6 4
One critical issue with any of the versions of SPIN is that if [17]. It provides multipath datagram propagation or diffusion
a single device, for whatever reason, fails to propagate ADV throughout a network by primarily focusing on the message
messages, the end-to-end network connectivity collapses. exchange of close-by devices. The message exchange is
Fortunately, other mechanisms overcome this problem. based on four main components: (1) interests that define the
nature of data to be requested or subscribed, (2) gradients
that specify the spatial direction of specific data types, (3)
7.2.4 Directed Diffusion data messages that provide the sensor readouts, and (4)
reinforcements that enable a device to give higher priority
Directed Diffusion is another flat data-centric rout- to certain paths in a multipath scenario. Directed diffusion
ing,10.5555/1203508 mechanism that relies on response provides routing through a publish/subscribe scheme like
aggregation to accomplish power consumption efficiency that of the application layer described in Sect. 5.3. In this
178 7 Routing on Constrained Devices
case, a device acting as a querier transmits a question that duration indicates the lifetime of the interest. Figure 7.12
represents a specific interest presented as an attribute-value shows an example of interest propagation and caching. The
pair [18]. device 1, acting as a sink, transmits its interests for tempera-
An example of a device interest is shown in Table 7.1. The ture data to its close neighboring devices 2 and 3. When these
device is interested in temperature readouts that are transmit- devices receive the interest, they add an additional cache
ted every second for an hour in the geographical location entry to tie the temperature type to the device 1 sink. The
determined by the square region with opposite corners lo- interest is forwarded by device 2 and 3 to their neighbors that
cated at geographical coordinates 41.40,2.17 and 41.41,2.19. now create new cache entries indicating these two devices
Note that by including geographical information, directed are sinks of the data. Interests are forwarded unaltered with
diffusion can be seen also as an example of location based modified sink fields as they are propagated. When a device
routing. receives an interest, it updates or adds to its cache a new
In general, an application device will periodically broad- entry that includes a gradient that points to the neighbor that
cast its interests in order to figure out if there exist other transmitted the interest. Essentially, the mechanism relies on
devices that can service them. As an interest traverses the the diffusion of interests across the network such that all
network, it is cached by devices such that whenever data devices with connectivity to the sink have an entry associated
are propagated down from servicing devices, they can be with the interest in their caches. If a device transmits sensor
forwarded to those with an active interest. A cache entry data that comply with an interest, this causes intermediate
includes a timestamp, a gradient for each neighboring device, devices to forward the data to the sink based on gradient and
and a duration field. The timestamp indicates when the desired rates.
interest was last received, the gradient specifies the direction The entries in the different caches can be used to reinforce
and the rate at which the readouts are transmitted, and the specific sensor data paths. For a given interest, if an entry
does not exist, it is added but, however, if it does exist, it is
updated. Since entries have timestamps and durations, they
Table 7.1 Interest example
expire and are removed from caches. Through different up-
Attribute/value pair Description dates a single interest may have different gradients associated
Type = temperature Temperature readouts with different data rates that may expire at different instances
Interval = 1 s Report events every second of time.
Duration = 3600 s Report for an hour In the scenario shown in Fig. 7.13 device 1 diffuses its
Field = [(41.40, 2.17) , (41.41, 2.19)] Report from sensors in this area
interests across the network for cache entries to be added
interest
Type Temperature
Interval 1s
Duration 3600 s
Field [(41.40, 2.17)(41.41, 2.19]
Sink 3 interest
4
Type Temperature
6 5 Interval 1s
Duration 3600 s
Field [(41.40, 2.17)(41.41, 2.19]
Sink 2
2
3 interest
clusterhead
clusterhead
clusterhead
one slot per node has not been selected in the last 1/P rounds [13]. LEACH is
extended by means of the eXtended LEACH (XLEACH) [10]
protocol to consider the device energy level when calculating
frame the T (n) threshold as
P
T (n) =
1−P rmod P1
En,current 1 En,current
round cluster setup
+ rn div 1− (7.2)
En,max P En,max
Fig. 7.16 LEACH rounds where rn is the number of consecutive rounds in which the
device has not been a clusterhead and En,current as well as
En,max are respectively the current and initial energy levels
Specifically, devices estimate the distance to the clusterheads
of the device. When the value of rn becomes equal to 1/P , the
based on the received signal power and select the closest
threshold becomes
one. Until this point, all clusterhead selection and cluster
formation are done offline. The devices then communicate P
with their selected clusterheads to initiate the association. T (n) = (7.3)
1 − P rmod P1
The clusterheads, in turn, set up and broadcast the TDMA
schedules to their associated devices. After the setup stage which is the original threshold that does not take into account
is finished, the steady state stage starts. Devices take turns energy in the computation of its value. When a device be-
transmitting sensor data to the clusterhead in accordance comes clusterhead the value rn,s is reset.
to the broadcasted schedule. As indicated in Fig. 7.16, each
device transmits only once per frame with multiple frames
being part of the stage. 7.2.6 PEGASIS
One issue with the clusterhead selection process is that it
does not have into consideration energy levels of the devices Power-Efficient Gathering in Sensor Information Systems
under consideration. Even if a device does not have enough (PEGASIS) is another hierarchical routing mechanism that
energy, it may still result in being selected as clusterhead if it relies on data aggregation [14, 15]. In a similar way to
7.2 WSN Routing 181
LEACH and XLEACH, PEGASIS attempts to lower power rounds. The clusterhead aggregates traffic from all other
consumption by distributing the role of clusterhead among all devices and forwards it to the sink application. The start
the devices in a section of the network. Moreover, PEGASIS of each round can be triggered by timing or by the sink
also lowers network latency by performing simultaneous data application itself that transmits a special beacon to indicate
aggregation on multiple devices. The overall result of these this. Note that depending on the distance to the sink, certain
mechanisms is to extend the overall network lifetime. devices may end up, on average, consuming more power per
Under PEGASIS, a device is aware of the geographical round than others.
location of its neighbors and can control its transmission But aggregation is not just performed by the clusterhead,
power in order to just reach the closest one. This latter prop- under PEGASIS half of the devices in the round perform
erty is usually enforced using CDMA modulation schemes. some type of data aggregation. Figure 7.18 shows an example
PEGASIS relies on a chain structure that results from direct of a PEGASIS round with 8 devices, A through H, in positions
communication of devices with their immediate neighbors. 0 through 7 within the chain respectively. In this case device
Figure 7.17 shows an example of such a scheme, device A D, initially in position 3, is the clusterhead. The first stage of
first selects its closest neighbor, device B, as the first link of the round have all the devices in even positions (i.e. 0, 2, 4,
the chain. Device B, in turn, selects its closest neighbor device 6) transmit their data to their next door neighbors in the odd
C as the second link. The process continues with all other positions (i.e. 1, 3, 5, 7). At this point, device B has device
devices selecting their closest neighbors in order to set up the A data, device D has device C data, device F has device E
different links of the chain. Note that the chain formation is data, and device H has device G data. Now devices B, D, F,
initiated by the farthest device and continuous by sequentially and H are at positions 0, 1, 2, and 3. The second stage of
adding devices to the chain. The selection is greedy based on the round consists, again, of all devices left in even positions
distance that can be inferred from the received signal power. (i.e. 0 and 2) transmit their data to their neighbors in the odd
As in the LEACH case, transmission is based on rounds positions (i.e. 1 and 3). After this stage, device D has device
where devices take turns in becoming clusterheads. The idea B data and device H has device F data. For the last stage, only
is that the energy consumption burden gets distributed among the clusterhead device D and the device H are left. Because
the different devices in the cluster. For any given round, a the clusterhead device always aggregates data regardless of
device in the chain is designated clusterhead. The clusterhead its position, the device H forwards all its data to it. Once the
selection is sequential so that if the chain is 8-device long, clusterhead has all the data from all other devices it transmits
a device will become, on average, clusterhead every eight them to the sink.
B
A C A B C D E F G H
D H
0 1 node position
B D F H
0 1 2 3 node position
A B C D E F G H
0 1 2 3 4 5 6 7 node position
182 7 Routing on Constrained Devices
0.9
0.8
0.7
0.6
PDR
0.5
0.4
0.3
0.2
Link1
0.1 Link2
Link3
0
0 5 10 15 20
time(h)
metrics like PDR very fast. Under IoT LLN routing, however, control traffic usually triggered by trickle timers described in
the assumption is that these metrics naturally change over Sect. 7.3.3.
time and it requires the routing algorithm to underreact
in order to prevent additional connectivity issues. Only if
routing problems are persistent it is expected that the routing 7.3.1 DODAG Creation
mechanism will redirect traffic through alternative routes
without triggering global reconvergence. RPL is a routing protocol that operates at the IPv6 network
The IETF Routing over Low Power and Lossy Networks layer and, as such, contrasts with other mechanisms that work
(ROLL) work group standardized a routing protocol that at lower layers like 6LoWPAN link layer mesh forwarding
follows these principles [16]. The routing protocol, known described in Sect. 4.3.3. Additionally, RPL is based on the
as Routing for Low Power (RPL) or Ripple, is a hierarchical adaptation of a hierarchical DV scheme applied to LLNs. The
IPv6 address centric [1] protocol. RPL was designed to procedure starts with the creation of a Destination Oriented
comply with three goals: scalability, reliability, and energy Directed Acyclic Graph (DODAG) that enables devices to
efficiency. RPL builds IPv6 networks with thousands of con- keep track of the routing topology. A DODAG is built based
strained devices over multiple low power wireless hops that on an objective function that operates on a combination of
combine reliable transmissions with several years of battery metrics and constraints in order to find the best path. In fact,
life. The idea behind RPL is that any device in a WPAN for the same network topology many different objective func-
can be router so the network can be easily deployed. This, tions associated with the different metrics and constraints
indirectly, limits the characteristics of the routing mechanism may lead to routing scenarios that would carry traffic based
to guarantee the support of low complexity devices. on QoS requirements. Metrics and constraints can be either
By being based on WSN routing, RPL makes two im- device or link based. For example, a device metric can be
portant assumptions: upward focused routing and reactive the device energy level while a link metric can be the latency
route update. Upward focused routing, by means of M2P associated with the link. Similarly, a device constraint can
traffic flow, implies that traffic moves mostly upward due to be that the device must support encryption while a link
sensors transmitting readouts. Although RPL supports traffic constraint can be that the link must be wireless. Metrics
in both directions, the focus is reliable upward routing. The can be applied individually or aggregated along a path. For
idea is for each device to select a parent as the next hop example, latency of a link can be the latency associated with
for its upward route based on DV from the gateway and set a single hop or the latency aggregated over multiple hops.
the downward route by reversing the upward route. Reactive Objective functions may result in DODAGs that attempt
route update implies that some routing decisions are made to find the best path that (1) minimizes ETXs (metric) over
by detecting physical connectivity changes that are reactive encrypted links (constraint) or (2) lowers latency (metric)
to data transmissions. This minimizes the use of proactive over unencrypted links (constraint) or (3) minimizes power
consumption (metric) or (4) uses wireless links (constraint).
184 7 Routing on Constrained Devices
The objective function, therefore, groups constraints and in joining the graph calculate their own rank and transmit
metrics as a way to specify rules for DODAG creation. Each DIOs in order to hierarchically extend the DODAG range.
graph represents a logical topology that exists on top of the Those devices joining a graph but without routing capabilities
physical network topology. At any given time, multiple logi- become leaves as they cannot transmit DIOs. Note that a
cal topologies overlap and depending on quality requirements single device may receive DIOs from multiple nodes and
only some of them are active. A device can then join one decide whether to join or not a DODAG based on the rules
or more graphs, known as RPL instances, and route traffic derived from its objective function. The route propagation
accordingly in order to accomplish the requirements. The starts at the root and ripples down to the leaves where the
datagrams are transmitted up and down along the edges of process finishes. The route enables all devices in the graph to
the corresponding DODAG. transmit datagrams to the LBR by means of the M2P upward
The DODAG creation is initiated by the Low Power PAN routing mechanism shown in Fig. 7.21. Note that the Figure
Border Router (LBR), also known as root, that plays the also shows DIS messages can be used by devices to proac-
role of IoT gateway. Multiple roots can serve an overlapping tively request upward routing information to its reachable
number of devices. There are three control routing messages, neighbors. Essentially, this provides an on-demand routing
transmitted over ICMPv6, that enable the graph creation: mechanism. Specifically, when a non-leaf device receives a
(1) DODAG Information Object (DIO), (2) DODAG Infor- DIS message it must respond by transmitting DIO messages
mation Solicitation (DIS), and (3) DODAG Advertisement that advertise the supported graph it is associated with.
Object (DAO). The ICMPv6 encoding, shown in Fig. 4.6, Upward routing is representative of traffic going from a
introduces a new ICMPv6 type field value known as RPL higher to a lower ranked node. Similarly, downward routing
and each message is indicated by different values of the results from datagrams propagating from lower to higher
ICMPv6 code field. DIS, DIO, and DAO messages carry ranked devices. Specifically, for a parent to be able to send
respectively ICMPv6 type field values 0, 1, and 2. The traffic to a child, it must know first how to reach it. RPL, as
LBR starts by periodically transmitting DIO messages that illustrated in Fig. 7.22, introduces DAO messages to accom-
advertise information about the DODAG to its neighbors. plish this task. They are transmitted by a device to its parent
Those devices that receive the DIO message and decide to as soon as the former joins a DODAG. Many times, DAO
join the graph become children of the LBR. For any child transmission can be induced by means of an indication in the
device, the LBR becomes its parent and assigns itself a rank incoming DIO message. In general, DAO messages carry and
that specifies its position in the graph hierarchy relative to the aggregate prefix information from a device and its children.
root and plays the role of DV path cost. In general, the smaller This information is used by lower rank nodes to add routing
the rank the closer the device is to the root. Conceptually table entries that enable downward routing. Essentially, pre-
the idea of the rank is to enable the routing algorithm to fix data eventually reach the LBR and a complete downward
determine the presence of loops. If the device is configured path becomes available.
with routing capabilities it can transmit, in turn, its own DIO Multi-Topology Routing (MTR) is supported by RPL to
to its neighbors in order to advertise the route to the LBR. overlap multiple routing instances over a single physical
The process is then repeated, and those neighbors interested topology. Figure 7.23 shows an example of two instances
LBR LBR
rank
rank
D E F D E F
rank 31 rank 32 rank 33 rank 31 rank 32 rank 33
leaf leaf leaf leaf leaf leaf
DODAGID
SUBOPTIONS
to these devices’ subgraphs [3]. Since memory require- for not storing routing information is both higher latency
ments and computational complexity can be critical issues and less channel utilization efficiency. Since source routing
in embedded IoT devices, RPL supports two modes of op- information is added to the datagrams by means of a specific
eration: if a device stores prefix information from all its routing header known as RH4, the ratio between the sizes
children is called a storing node, otherwise it is called a of payload and headers decreases leading to less efficient
non-storing node. Although both, storing and non-storing use of the channel. Note that all devices must be configured
devices, can route datagrams uplink, only the former can as either storing or non-storing nodes. Mixed scenarios with
route datagrams downlink as they keep routing entries for some devices configured as non-storing nodes and others as
each of their children subgraphs. In non-storing mode, only storing nodes are not allowed.
the LBR can route datagrams downstream and other devices
can forward datagrams downward if they include embedded
routing information populated by the root. 7.3.3 Loop Detection and Avoidance
Figure 7.26 shows the difference between storing and
non-storing nodes when device D transmits a datagram to Network loops typically result from both topology changes
device E. In storing mode, shown by the dashed lines, device and routing information synchronization problems between
D forwards the datagram to its parent device B that, in devices. As such they are a temporary phenomenon that per-
turns, by being a storing node routes the datagram down sists until the routing mechanism solves the inconsistencies
to device E. In non-storing mode, shown by the solid lines, associated with the loop. Their detection is critical because
device D forwards the datagram to its parent B, that by not datagrams in a loop cause not only additional congestion
having routing capabilities, it forwards the datagram to its but also network loss when the datagrams are dropped due
own parent device A. Device A, another non-storing node, to them reaching the maximum hop count. In traditional
finally forwards the datagram to the LBR. The LBR makes networking, high transmission rates magnify the effect of
routing decisions based on its routing table and embeds loops in the overall effect of the network performance. In
source routing information in the datagram to indicate the this scenario, routing algorithms tend to overreact in order
path the datagram must follow downward. The datagram to detect and remove loops, as fast as possible, in order to
is sent to device A that processes the routing information minimize the effects of congestion and loss. In IoT networks,
and forwards it to device B. Device B, in turn, looks at the lower transmission rates, however, limit the impact of loops
routing information and forwards it to the destination device to network routing where an under reactive approach is more
E. Clearly there is a trade-off between latency and memory appropriate as many of the loops are caused by transient
requirements as well as computational complexity; the price link reliability issues. In this situation, overacting may lead
to routing oscillations that end up generating unpredictable
latency and energy consumption.
RPL attempts to avoid loops by enforcing two basic rules:
LBR
a device (1) cannot select as parent another device that is
deeper in the graph and it (2) is not allowed to move deeper
3 4 in a graph in order to increase the number of parents. Besides
avoiding loops, RPL enables devices to detect them through
data path validation. Specifically, the mechanism relies on
non-storing nodes
information carried by a series of bits in the RH4 header that
storing nodes A are used to determine the whereabouts of a given datagrams.
These bits are set and read as datagrams move up and down
along the edges of the graph. Whenever a node sends a
datagram to its children, it sets the down bit in the header.
If a datagram is received from a child and its RH4 header
B
has the down bit set, it indicates the presence of a loop. This
causes, in turn, the device to drop the datagram.
Routing protocols rely on repairs to fix routing topologies
when failures are detected. RPL supports two complementary
mechanisms: (1) local repairs and (2) global repairs. If due to
D E
a node or link failure a device cannot forward datagrams in
leaf leaf the upward direction, it must initiate a local repair to find
an alternative parent or link. The effect of local repairs is
Fig. 7.26 Storing vs non-storing nodes cumulative, and they can cause a graph to diverge from its
7.3 RPL 187
root
storing
A B
1 1
2
4 2 5 4
3
5 7 3 6
6
time
1
1
2
4
5 4
3
5
6 2 7 3 6
7
188 7 Routing on Constrained Devices
progresses, the link between these two devices is perturbed timer as a mechanism for routing control traffic propagation
and connectivity is lost. This triggers a local repair that is simple enough that can be easily implemented on con-
results on device 2 now selecting device as parent. Note that strained devices without affecting computational complexity
many times there is no strong correlation between physical and other resources.
topology links and routing connectivity. Security in embedded IoT devices is computationally
Because embedded devices in IoT networks are energy expensive and resource demanding. Most RPL friendly link
constrained, limiting the transmission of routing DIO, DIS, layer technologies like IEEE 802.15.4 and BLE include their
and DAO control messages is critical to extending the net- own security mechanisms so RPL security is enabled by
work lifetime. Traditional routing protocols rely on keepalive means of optional extensions. Essentially, RPL supports three
messages transmitted periodically for devices to estimate modes of operations: (1) unsecured where routing control
throughput, latency, and loss of links associated with neigh- DIO, DAO, and DIS messages are transmitted without en-
bors in order to keep the routing tables updated. One of such abling any security measures and relying instead on the
mechanisms is called Bidirectional Forwarding Detection security provided by lower layers, (2) pre-installed where
(BFD). This approach to updating routing tables is not ap- devices have pre-shared keys that enable them to encrypt and
propriate for IoT networks as it is computationally complex, decrypt the messages, and (3) authenticated where devices
resource intensive, and energy inefficient. The RPL relies on receive the keys from an authentication authority. In pre-
an adaptive tickle timer that controls the rate at which DIO installed and authenticated modes, messages are secured by
messages are transmitted. Network inconsistencies like the encryption and message integrity at different security levels
presence of loops, or devices joining or moving within the supporting several algorithms like AES-128.
network, typically result in the reduction of the period of the When analyzing RPL from a performance perspective
trickle timer. On the other hand, as the network becomes there are a few observations that are worth mentioning: (1)
more stable the trickle timer period is increased and the control traffic associated with DIO, DIS, and DAO messages
DIO message transmission rate also decreases. The idea is negligible when compared to data traffic and decreases
of the trickle timer is to transmit network parameters and significantly as the graph becomes stable, (2) routing table
attributes while minimizing at the same time the load of the sizes are larger in those devices closer to the root of the
network. graph, (3) the routing paths that result from RPL are sub-
Figure 7.28 shows both data and control RPL traffic. optimal when compared to the ones that would obtained from
While the data traffic rate stays pretty constant, the control an ideal routing mechanism, and (4) by increasing the interval
traffic rate has peaks whenever the trickle timer triggers the between global repairs, local repairs become more prevalent
graph to be rebuilt. As the network becomes more stable, and control traffic throughout the network is reduced at a cost
the peaks are less common. The implementation of a trickle of longer lasting connectivity outages.
80
70
datagrams per second
60
50
40
30
20
10
0
0 20 40 60 80 100 120 140 160 180
time(s)
7.4 LOADng 189
RPL Implementations There are several implemen- 6LoWPAN device 6LoWPAN router
tations of the RPL routing suite. Most of them are
intended for RTOSs. The list below shows some of the
most popular RPL implementations.
Implementation Description
Tripple Apache licensed open source C implementation
Available for general purpose OSs like Linux.
unicast
Adapted to support RTOS through lwIP.
multicast
Contiki RPL BSD licensed open source C implementation. SAA
Implemented as part of the Contiki RTOS.
Very low memory requirements (order of
kilobytes).
add to neighbor cache
TinyOS RPL BSD licensed open source C implementation.
Implemented as part of WSN support of the
TinyOS RTOS.
RIOT RPL LGPLv2 licensed open source C implementation.
Implemented as part of the RIOT RTOS.
RS Router Solicitation
Unsprung BSD licensed open source C implementation. RA Router Advertisement
Implemented as lightweight implementation of NS Neighbor Solicitation
RPL for Linux. NA Neighbor Adverstiment
SAA Stateless Address Autoconfiguration
7.3.4 RPL, 6LoWPAN, and ND may also include 6LoWPAN compression context data as-
sociated with stateful compression. Since the RA message
RPL is typically used in the context of 6LoWPAN route-over is received by all devices on a link, all devices are syn-
routing. In general, any link layer technology that supports chronized with respect to the compression context in use.
6LoWPAN mechanisms can rely on RPL for routing [12]. This is important, since device synchronization is key to
Moreover, multiple different link layer technologies can be the proper behavior of 6LoWPAN stateful compression. In-
routed under a single RPL domain. Edge routers that connect teraction between devices and the router is progressive as
to traditional IP cores and access 6LoWPAN networks oper- they exchange ND messages. In turn, routers supporting
ate as RPL roots. Devices rely on RPL to build multiple rout- RPL, generate DAO messages that propagate the informa-
ing topologies to enable connectivity to their destinations. tion obtained from the registration by means of ND boot-
Host devices indicate their presence to neighboring devices strapping.
in two different ways: (1) by transmitting DAO messages
upwards and processing, but not forwarding, incoming DIO
messages or (2) by relying on ND to discover neighboring 7.4 LOADng
routers and notify them about the device existence. In this
later case, hosts devices attach to 6LoWPAN routers by The Lightweight On-demand Ad hoc Distance Vector
means of traditional ND bootstrapping without participating (LOAD) and its successor the LOAD Next Generation
in routing. (LOADng) protocols are technologies that provide reactive
Figure 7.29 shows the exchanged messages between a flat routing in LLNs [2]. Although neither LOAD nor
device and router as part of ND bootstrapping. The 6LoW- LOADng have been standardized, LOADng serves as
PAN device starts by transmitting an RS message as both valuable alternatives to proactive RPL routing. LOADng is
multicast and unicast transmissions. The router responds designed for simplicity supporting a minimal core that can be
back with a unicast RA message. The prefix information extended for additional functionality. This is possible due to
carried by the RA is used by the device to initiate SAA, a modular design that enables the addition of new messages
described in Sect. 4.2, and derive an IPv6 address. The de- and data types encoded by means of TLVs. LOADng is quite
vice then registers itself at the router by transmitting a uni- flexible, supporting addresses of variable length between 8
cast NS message that includes the address registration op- and 128 bits long as well as different metrics besides the
tion. The router responds back with a NA message. Note standard hop count.
that in addition to the prefix information, an RA message
190 7 Routing on Constrained Devices
7.4.1 Minimal Core Upon receiving RREQ and RREP messages, devices up-
date their routing tables to adjust the cost of the path to the
As a reactive routing protocol LOADng transmits Route message sender. The simplest cost metric is hops but more
Requests (RREQs) to discovery paths to a given destination. complex metrics like latency, throughput, and frame loss
A single RREQ is forwarded throughout the network until it are also possible. A routing scenario may support multiple
reaches the destination device which replies by transmitting metrics that are specified in the RREQ and RREP messages.
a Route Reply (RREP). If a path is broken a local repair is In all cases, all devices must support the basic hop metric that
typically performed, otherwise, a Route Error (RERR) is must be used if the other metrics are not available.
sent back to the sender of the RREQ. In general, an RREQ
message is generated by a LOADng device when it does
not have a valid route to destination. Similarly, an RREP 7.4.2 Smart Routing
message is generated by a LOADng device in response to
a received RREQ message with a destination address local One issue with flooding is that it leads to issues like over-
to that of the device. RREP messages are acknowledged lapping and traffic implosion, that in turn, cause a waste of
by the RREQ original sender by transmitting back a Route energy, network bandwidth, and channel capacity. LOADng
Reply Acknowledgment (RREP-ACK) to indicate that the introduces a mechanism called smart routing that takes ad-
route was successfully received. The encoding of these mes- vantage of known routes to the destination in intermediate
sages, transmitted over UDP to support broadcasting, is by devices to minimize the number of broadcast transmissions
means of IETF RFC 5444 Generalized Mobile Ad Hoc Net- that are generated during route discovery.
work (MANET) Packet/Message Format as a fixed number of The procedure starts by broadcasting a special RREQ
header fields followed by a block of message TLVs. These are message that includes a flag that converts it into a
then followed by a block of addresses with associated address RREQ_SMART message. When the message arrives to
TLVs. an intermediate device if this device has a valid path to
Route discovery, carried out in a similar way to WSN destination and the corresponding next hop if different
flooding presented in Sect. 7.2.1, consists of devices broad- from the previous hop associated with the message, then
casting RREQ messages along the way to reach the des- RREQ_SMART message is transmitted unicast to the
tination. This is shown in Fig. 7.30 where device 1 is the next hop otherwise the message is broadcasted. This
originator and device 4 is the destination. When the request procedure is shown in Fig. 7.32 where device 1 broadcasts
arrives at the destination, a unicast RREP, that contains the the RREQ_SMART message that is received by device 2
path information, is transmitted back to the originator as illus- that has a direct route to destination device 4. Device 2 then
trated in Fig. 7.31. From this point on, the originator will send forwards the RREQ_SMART message through a unicast
all datagrams to reach the destination through this path until transmission to device 3. Device 3 that is also a direct route
a failure is detected. This process, called path maintenance, to device 4 also forwards the message to the destination
makes sure that if a datagram cannot be forwarded for any device 4 through a unicast transmission. Although reactive
reason, a RERR message is sent back to the originator. At this flat LOADng smart routing improves performance, still it
point the RERR message retriggers a new route discovery. is not as efficient as proactive hierarchical mechanisms like
RPL.
ART
RREQ_SM
Fig. 7.31 LOADng route replies Fig. 7.32 LOADng smart route requests
Homework Problems and Questions 191
Table 7.3 RPL vs LOADng 7.2 What WSN routing protocols rely on endpoint negotia-
Energy tion to overcome implosion?
Protocol Hierarchical Proactive Transport Latency consumption
RPL Yes No ICMPv6 Low Low 7.3 A WSN has five sensors (A, B, C, D, E) with batteries
LOADng No Yes UDP MediumLow that are charged at PA = 94%, PB = 97%, PC = 99%,
PD = 91%, and PE = 4%, respectively. In the last 4 rounds
sensors A, B, C, D has been selected as clusterheads. For the
Summary following round, and assuming LEACH routing, which of the
sensors is most likely selected as clusterhead? Clusterhead
Routing is key to enable IoT devices to communicate with probability is P = 15 ?
applications. This chapter started by presenting the most
relevant concepts of IoT routing including their types and 7.4 Given the following RPL topology:
classifications. As an introductory approach to IoT routing,
well known WSN routing mechanisms were presented first.
This included flat flooding, gossiping, SPIN, and directed LBR
diffusion as well as hierarchical LEACH and PEGASIS. The
chapter then presented RPL and details of its hierarchical
approach including DODAG creation, maintenance, and sup- 11 12
port of storing and non-storing nodes. LOADng was then
presented as a valid reactive alternative to proactive RPL.
Table 7.3 compares some of the most important features of
21 22
RPL and LOADNg.
31 32
Homework Problems and Questions
hop takes 1 s:
A
7.7 Why are extra computational capabilities typically asso-
ciated with storing nodes under RPL?
How long does it take for a datagram to go from device A to 7.9 What type of nodes are more likely to cause application
device B if routing is WSN flooding? packet loss? Non-storing or storing nodes?
small packets only a few times per hour over long distances.
8.1 LPWAN in IoT Different LPWAN solutions are characterized by different
factors, namely, (1) network topology, (2) device coverage,
IoT technologies seen so far fall under the realm of PAN (3) battery lifetime, (4) resilience to interference, (5) node
scenarios, that because they are usually wireless, they are density, (6) security, (7) unidirectional vs bidirectional com-
representative of WPANs. Although these are low-power munication, and (7) nature of the applications. The following
technologies, they are still powerful enough to provide trans- section introduces several state-of-the-art LPWAN technolo-
mission rates that natively enable IPv6 support [5]. How- gies that are relevant to IoT.
ever, the direct hop-to-hop transmission range of WPANs
is typically quite short, rarely extending more than a few
hundred meters. LPWAN technologies, briefly introduced 8.2 LoRa
in Sect. 1.3, attempt to increase the device coverage, but
unfortunately, they are affected by a lower SNR that fur- Long range (LoRa) is the generic name for a full protocol
ther reduces transmission rates and MTU sizes [13]. These stack that provides LPWAN capabilities that enables devices
limitations prevent these devices from fully supporting IPv6 to run on a single battery for more than 10 years [18, 33, 28].
and derived protocols like CoAP and RPL. In other words, The LoRa stack is shown in Fig. 8.2. It is a small subset of
almost all LPWAN physical and link layers do not support the layered architecture that includes physical, link, and ap-
the upper layer protocols introduced in Chaps. 4 through 7. plication layers. This is fine since LoRa devices only interact
Most LPWAN mechanisms are therefore hybrid technologies with other LoRa devices. There is no need for a network or
with proprietary access networking stacks that rely on IoT transport layer since LoRa does not natively support IP to
gateways to enable application IP support. Moreover, most begin with. The figure also shows that each layer includes
LPWAN stacks only carry a subset of available layers of the multiple sublayers that provide different functionality [7].
layered architecture. Note that LoRa provides security at the link and applica-
Figure 8.1 shows the relationship between throughput and tion layers. Link layer security provides authentication and
coverage, of physical layers of different IoT technologies AES-128-based device encryption in the network by relying
when compared to LPWAN schemes. Best-case scenario on a 64-bit IEEE EUI-64 unique network key. On the other
is for traditional mobile cellular technologies like 5G that hand, application layer security provides AES-128 based
provide high throughput and coverage, but they are highly encryption of device data.
inefficient from a power perspective as they do not scale
well for support of IoT applications. With a similar level
of throughput, IEEE 802.11 derived technologies drain, in 8.2.1 Physical Layer
their majority, too much power to be effective in IoT en-
vironments. IoT WPAN schemes like IEEE 802.15.4 and The LoRa physical layer relies on transmission over different
BLE are power-efficient but they exhibit both low-throughput ISM bands, specifically, the 433 MHz and the 915/868 MHz
and very short coverage. LPWAN technologies complement ISM bands. LoRa modulation is based on CSS. In the context
WPAN by improving the distance range while keeping lower of the physical layer of LoRa, CSS, as an SS mechanism,
consumption to a minimal level in order to offer a multi- is not only power-efficient, but it also enables very long-
year battery lifetime. LPWAN devices typically transmit very range communications with a coverage that exceeds 10 km at
© The Author(s), under exclusive license to Springer Nature Switzerland AG 2022 193
R. Herrero, Fundamentals of IoT Communication Technologies, Textbooks in Telecommunication
Engineering, https://doi.org/10.1007/978-3-030-70080-5_8
194 8 LPWAN Technologies
throughput
range
high
IEEE 802.11n 5G
IEEE 802.11ac
4G
3G
IEEE 802.11ah
IEEE 802.11a
IEEE 802.11b
IEEE 802.11g
medium
BLE
IEEE 802.15.4
RFID/NFC
low LPWAN
range
LoRaWAN relies on devices talking to gateways directly simultaneous transmissions, payload lengths, and adaptive
without relying on intermediate nodes. To provide redun- data rates. This later mechanism consists of devices, with
dancy a single device is associated with multiple gateways. access links that have comparatively higher SNR that can
Therefore, for the same power restrictions and compared to transmit faster in order to lower channel access intervals and
WPAN technologies like IEEE 802.15.4, LoRaWAN trans- allow more devices to send traffic. The transmission rate
mits data at a much slower rate in order to reach farther is also affected by other issues like the spreading factor of
distances while attempting to defeat channel interference by the CSS modulation. In general, devices that are close to
means of highly available gateways. LoRa gateways have gateways, and therefore have good links, transmit faster than
two interfaces, (1) a LoRa interface and (2) an IP interface; those devices that are farther away. Moreover, by lowering
packets sent by LoRa devices arrive at the LoRa interface transmission rates, the battery lifetime of a device can be
and they are then forwarded via IP to a server. If one of the improved. One characteristic of LoRaWAN is that it is highly
copies of a packet arrives at the server, the packet is not lost. scalable, a network can be deployed with a single gateway
Therefore, a server not only verifies that a packet complies and, as more capacity is needed, more gateways can be added.
with security settings but also makes sure to drop redundant
copies. Since gateways are embedded devices themselves, Example 8.1 Consider a LoRa scenario with a device
LoRa pushes complexity and decision-making to the server. and a gateway transmitting 13-byte frames:
In mobile environments, the simple LoRa approach removes
the need for complex handover mechanisms that occur when sensor gateway
a device switches from one gateway to another.
LoRaWAN MAC is based on an ancestor of CSMA/CA
56 ms
known as ALOHA that enables devices to send datagrams
without having to wait for the channel to be free. If during 10 km
(continued) The SigFox protocol stack does not include any encryption
is DC = 2 × Dt + Dp where Dt = 8×L R
= 104 ms mechanism and relies on the applications to encrypt device
with L = 13 bytes and R = 1000 bps and Dp = data. SigFox messages, however, can be signed with a unique
10,000 m
c
= 33.34 µs with c = 300 106 m/s (speed device key.
of light). Because Dp Dt , DC ≈ 2 × Dt = 208 ms.
Under class A, the gateway only transmits a frame in
response to a frame sent by the device. In this scenario, 8.3.1 Physical Layer
this means that the delay DA is given by DA = DC +
56 ms = 264 ms. Class A, when compared to class SigFox, as LoRa, relies on transmission over the 915/868 MHz
C, provides better energy consumption but increases ISM bands. For uplink, each band is in turn divided into
latency. 333 Ultra Narrow Band (UNB) 100 Hz subchannels where
DBPSK modulation is performed. For the downlink traffic,
the subchannels are 600 Hz wide and GFSK modulation
Based on power consumption and level of interaction
is used instead. Because both modulations are binary, the
with gateways, device operation falls within the umbrella
nominal throughput is 100 and 600 bps for uplink and
of three different classes A, B, and C shown in Table 8.1.
downlink, respectively. Additionally, SigFox uses FHSS
Specifically, each class affects the trade-off between battery
across 3 out of the 333 uplink subchannels. This is done to
life, latency, and throughput. Class A is supported by all
increase channel diversity and improve fading protection.
devices and enables gateways to send packets 6LoWPAN as
Frequency hopping, based on a pseudo-random sequence,
soon as device traffic is received. As such class A devices
is combined with a random time delay, somewhere between
consume the least amount of energy and extend battery life.
500 and 525 ms, on what it is called random frequency and
Class B enables gateways to send packets downlink on a
time division multiple access (RFTDMA). The transmission
scheduled basis and therefore exhibit an intermediate level
power is specified to be 14 and 22 dBm for the 868 MHz
of power consumption and battery lifetime. Finally, class
and the 915 MHz bands respectively. Similarly, the receiver
C enables gateways to send packet downlink always unless
sensitivity is −120 and −142 dBm for the 868 MHz
traffic is being received. Class C is the least power-efficient
and the 915 MHz bands, respectively. SigFox estimates
mechanism and exhibits the shortest battery lifetime.
the allowable transmission rates based on the number
of devices connected to the network and duration of the
contract.
8.3 SigFox SigFox is designed for the transmission of infrequent
bursts of small sensor readouts. As such the payload size for
SigFox is another LPWAN protocol stack that, as opposed
uplink and downlink is 12 bytes and 8 bytes per message,
to LoRa, it relies on a unique commercial network called
respectively. Note that these payload sizes are good enough
SigFox [14, 22, 25]. SigFox hardware, however, is open
to represent sensor data with a pretty good resolution. Since
with several manufacturers making SigFox chips. Although
a single precision floating point number is typically stored
SigFox was originally designed as a unidirectional traffic
in 4 bytes, a SigFox message can carry uplink up to three
technology where sensors propagate readouts uplink, the
floating point numbers. Higher-precision floating point num-
stack was later updated to support downlink data transmis-
bers, stored in 8 and 12 bytes, reduce the message capacity to
sion. SigFox devices are characterized by very low power
transmit sensor readouts. In order to preserve battery life and
consumption that supports extended battery life and low
limit power consumption, the maximum number of messages
transmission rates.
that a device can transmit and receive daily is 140 and 4,
Figure 8.4 shows the SigFox protocol stack; it includes a
respectively. No device can transmit more than six messages
(1) physical layer, a (2) link layer that provide MAC, and a
per hour. In many cases, devices can minimize the amount
(3) network layer known as the frame layer that wraps the
of data sent by using events that are carried as messages
application data and adds a sequence number to the frames.
with no payload. Of course, this does not circumvent the
8.3 SigFox 197
daily transmission limit, but it reduces the overall power Devices carry a device identifier that is used for routing,
consumption. message signing, and authentication. Figures 8.6 and 8.7
show the SigFox frame format for both downlink and uplink
Example 8.2 What is the best-case scenario for communication between a device and a base station. Frames
uplink and downlink payload transmission rates under start with a preamble used for synchronization that is fol-
SigFox? lowed by a synchronization field that indicates the type of
frame being transmitted. Uplink frames include the device
identifier, the variable length payload, the authentication
Solution For uplink and downlink, the payload sizes field, and a FCS field used for error detection. Similarly,
are Luplink = 8 × 12 = 96 bits and Luplink = 8 × downlink frames include flags, the FCS, the authentication
8 = 64 bits, respectively. The uplink rate is given by field, the error code field, and the variable length payload.
N ×L Note that since communication is from multiple devices to a
Ruplink = uplink T uplink = 0.15 bps where Nuplink = 140
and T = 60 × 60 × 24 = 86,400 s. The downlink base station, no addressing mechanism is needed other than
rate is given by Rdownlink = Ndownlink T×Ldownlink = 0.003 bps the inclusion of the device identifier in uplink frames. For
where Ndownlink = 4. the worst-case scenario of a 200-bit frame, it takes around
200 bit uplink packet
≈ 100 bps
= 2 s to transmit it uplink. Since
three copies of each message are transmitted, the transmis-
sion time per individual message is typically 6 s. Because
8.3.2 Link Layer SigFox devices have a 1% duty cycle, they are active only
36 s every hour, and therefore they can only send up to six
As LoRa, SigFox MAC is based on ALOHA. Moreover, de- messages per hour.
vices are not synchronized with the network. SigFox supports Figure 8.8 shows the topology of a SigFox network. It con-
a transmission mechanism similar to that of LoRa class A; sists of base stations that play the role of gateways, providing
when a message from a device arrives at the base station an interface between devices in the access side and backend
acting as an IoT gateway, the base station has a 20-s window server in the core side. The communication with the devices
of opportunity to transmit a message down to the device. In is by means of the SigFox physical and link layer mechanisms
turn, the device waits for up to 25 s for an incoming 4-byte while the communication with the application is by means of
message from the base station to arrive. traditional IP networking. The overall scheme follows a star
Figure 8.5 illustrates RFTDMA, where three copies of topology where up to one million devices can interact with a
the payload are transmitted over three random carriers with single base station. In general, the number of supported de-
different random delays. The window for downlink transmis- vices is associated with the number of messages transmitted
sion only opens after the last frame is transmitted. Because throughout the network. As for the case with LoRa, SigFox
messages are transmitted in a fire-and-forget fashion, where devices transmit their messages simultaneously to multiple
no acknowledgment from the receiver is sent, three copies at- base stations, and it is up to the backend server to remove
tempt to provide enough redundancy to guarantee successful duplicates before storage. Applications rely on SigFox cloud
delivery. This redundancy acts as a FEC mechanism. service APIs to retrieve device data from backend servers that
frequency
f1 frame
2.08 s – 12 bytes
f2 frame
t1 t2 t3 time
device
base station
backend server
device
IP
device application
base station
device
store the device readouts themselves. In turn, backend servers Application WPAN LPWAN
transmit messages to devices by selecting the base stations BLE IEEE IEEE IEEE IEEE SigFox LoRa
with the best connectivity and in the best position to send 802.15.4 802.15.4e 802.11b 802.11ah
Media (64 Kbps) ≈ 0.25 ≈ 0.05 ≈ 0.06 ≈ 0.05 ≈ 0.015 N/A N/A
messages downlink.
Sensor (400 bps) 10.5 5 5.5 3 1 N/A N/A
Sensor (4 bps) 23.5 23 20.5 8 9 N/A 1
LPWAN vs. WPAN: Battery Life The following table
Sensor 24 24 20.5 8 10 21 27
shows battery life (in terms of years) for both LPWAN
(400 bits/day)
(long-distance coverage) and WPAN (short-distance
coverage) technologies as a function of different appli-
cations [21]. Note that the list includes 1% duty cycle
SigFox and LoRa. It assumes devices being powered 8.4 D7AP
by two AAA batteries.
The DASH7 Alliance Protocol (D7AP) is an open source
protocol stack that enables LPWAN communications [37]. Its
physical and link layers are derived from the ISO/IEC 18000-
8.4 D7AP 199
7 standard for active (as opposed to passive) RFID. The 7 ISM bands. Each band is subdivided in several channels: 69,
in DASH7 refers to the section -7 of the original standard. 280, and 1040, respectively, for the 433 MHZ, the 868 MHz,
D7AP was originally designed for military purposes with and the 915 MHz bands. The channels can be configured
batteries lasting for years and supporting low-latency long- under three different classes: (1) Lo-Rate, (2) Normal, and (3)
range wireless mobility [8, 9]. It was adopted by the US Hi-Rate that support transmission rates at 9.6 Kbps, 55 Kbps,
Department of Defense in 2009 to support asset tracking, and 166 Kbps, respectively. In all scenarios signal modula-
but in 2011 it was repurposed for location based services tion is by means of GFSK combined with FHSS that supports
associated with smartcards and device tracking and extended a transmission power of around 10 dBm. Most deployments
to support a huge number of WSN applications ranging from are characterized by a maximum 2-s latency for an adjustable
mobile advertising and billboards to cargo monitoring in transmission range between 10 m and 10 km. In asset tracking
transport vehicles. As an RFID mechanism, it compliments applications, the precision is within 4 m.
traditional short-range NFC technologies by providing mo- Before modulation, binary symbols are encoded by means
bile asset tracking and enabling devices to communicate with of several different coding schemes; the main mechanism
each other. relies on PN9 that produces a predictable pseudo-random
D7AP defines four device classes: (1) blinker that only sequence of values. PN9 is complemented by a FEC convo-
transmits traffic, (2) endpoint that transmits and receives data lutional encoder that provides a 1/2 code rate. The physical
and supports wake-up events, (3) subcontroller that is a full layer is also capable of performing RSSI measurement with
featured device and also supports wake-up events, and (4) 6 dBm accuracy.
gateway that is always active and provides the interface with
other networks as any IoT gateway.
D7AP, as shown in Fig. 8.9, supports two modes of op- 8.4.2 Link Layer
eration based on a star topology; the pull model where the
interaction between devices and gateways is bidirectional by The link layer of D7AP defines two types of frames: (1) fore-
means of requests as well as responses and the push model ground frame and (2) background frame. Foreground frames
where devices periodically transmit data to gateways unidi- are common messages used to carry data and data requests.
rectionally. When those messages are beacons, the mecha- On the other hand, the background frames are very small
nism is called beacon transmit series. messages used for advertising and for group synchronization.
Figure 8.10 shows a foreground frame; it includes a 32-
bit preamble and 16-bit synchronization word followed by an
8.4.1 Physical Layer 8-bit length field that specifies the size of the frame. The 8-
bit subnet field is used for filtering of incoming frames. The
D7AP specifies a full stack that, in certain scenarios, can rely 8-bit control parameter that is used to specify the target id
on other physical and link layer technologies like LoRa or identifier type is followed by a variable length target address.
SigFox for transmission. The native physical layer of D7AP Similarly, the variable length payload is followed by a 16-
relies on transmission over the 433 MHz and 915/868 MHz bit CRC field used for error detection. Figure 8.11 shows a
200 8 LPWAN Technologies
C control
H hopping control
HT hopping network layer timer value
SEC HDR security header
SEC FTR security footer
8.5 Weightless 201
1 1 1 0/1 0/1 0/1 ≤ 34 ≤ 239 bytes the best base station for message routing, (4) the broadcast
C DID TID AGC TL TE ACK PAYLOAD register keeps track of the groups the devices belong to in
order to support broadcast messages, (5) the Operation and
C control
Maintenance Center (OMC) provides the monitoring of the
DID dialog identifier
TID transaction identifier network to detect failures, (6) the billing entity keeps track of
AGC AGC control device activity to support billing information, and (7) white
TL listen timeout space database keeps track of the available channels based on
TE execution delay timeout the servicing location.
ACK acknowledgment template
As an open standard, multiple manufacturers produce
Fig. 8.14 D7ATP response segment Weightless hardware. The Weightless standard is the result of
the Weightless Special Interest Group (Weightless SIG) that
dictates the different layers of the protocol stack. Moreover,
Specifically, the white space spectrum refers to those fre- as any other standardization body, the Weightless SIG is
quencies that result from the allocation of separation guards responsible for specifying interop testing technologies as
between bands and channels in order to minimize interfer- well as mechanisms of certification for the industry. The
ence. Although these frequencies are typically reserved and Weightless SIG serves as an entity that interacts with gov-
not intended for transmission, in certain scenarios they can ernment regulators to free up the use of the white space
be used if power levels and modulation schemes are carefully spectrum.
selected to prevent any interference. The use of white space Figure 8.16 shows the Weightless stack where layers talk
frequencies enables Weightless to provide widespread signal to each other by means of channels. Moreover, the stack
coverage [24]. is partitioned into two different planes: a user plane and a
The standard is called Weightless because it relies on a control plane. The physical layer has three physical channels:
lightweight protocol stack that exhibits very little overhead the downlink channel that provides communication from the
in order to maximize the performance of small packet trans- base station to the device, conversely, the uplink channel
missions. Weightless applications include home and building that provides communication from the device to the base
automation, smart metering, health care, transportation, point station, and the uplink contended access channel that enables
of sale, inventory tracking, and physical security among multiple devices to simultaneously transmit traffic to the
others. base station. Within the physical layer, there are transport
Weightless, as many LPWAN technologies, is character- channels that provide the interface between the physical and
ized because it provides a low cost solution that is compatible link layers. The transport channels provide the framing of
with most large size IoT device deployments. In fact, Weight- the downlink and uplink channels as well as the contended
less is intended to support a very large number of devices access associated with the uplink contended access channels.
with a single cell supporting more than one million devices. In the link layer, the logical channels provide retransmission
A network could easily include around one billion devices. control as well as fragmentation and reassembly. Specifically,
In all cases, low costs imply that both device and service the logical channels enable the data and control traffic to
costs are low. Additionally, Weightless is ultralow power and be transmitted reliably or unreliably based on whether the
enables devices to run on a single battery for up to 10 years. individual frames are acknowledged or not. The connectivity
Moreover, Weightless provides reliable and secure delivery between base stations and devices is controlled by the radio
of unicast and broadcast messages. Messages are transmitted resource manager (RRM) that relies on control channels to
in bursts with the Weightless network prepared to support a send messages downlink. Alternatively, user channels pro-
typical message size of around 50 bytes. vide the connectivity between base stations and devices to
Weightless is an open standard that enables devices to enable the transmission of unicast, multicast, interrupted,
exchange data with a single base station that acts as an and acknowledgment frames. While unicast traffic is bidirec-
IoT gateway. As such, the base station provides connectivity tional, multicast traffic is unidirectional between device and
to a network manager and database through traditional IP base station.
mechanisms. Weightless relies on the star topology shown
in Fig. 8.15. Additionally there are several elements that
enable the operation of a Weightless network: (1) the base 8.5.1 Physical and Link Layers
station controller provides a point of contact for a group
of base stations, (2) the authentication database holds the As indicated above, Weightless relies on the transmission
authorization data associated with base stations and devices over the white space spectrum. Specifically, the UHF band,
as well as the encryption keys, (3) the location register keeps located between the 300 MHz and 3 GHz range and shown
track of the location of the devices in order to determine in Fig. 3.1, is an ideal candidate for white space frequency
202 8 LPWAN Technologies
weightless sensor
IP
base station
interface
network manager
user plane control plane Weightless. The modulation is adaptive, and the propagation
range is related to the negotiated transmission rate. Very high
application application layer
transmission rates are only possible at very short distances.
user channels control channels
link layer Note that each scheme is linked to a specific code rate
logical channels
and spreading factor. The code rate and spreading factor
transport channels
physical layer are, respectively, associated with FEC and resilience against
physical channels channel noise. Since the same frequency is used for both
uplink and downlink communications, TDD is used by device
Fig. 8.16 Weightless stack
and base station signals to share the channel.
Table 8.2 Weightless modulation summary Figure 8.17 shows the processes involved in the Weight-
Modulation summary
less signal generation. The binary data from the link layer
Scheme Code rate Spreading factor Rate (Mbps)
is first subjected to FEC that inserts control redundancy
16-QAM 1 1 16.0 and results in a specific code rate. The output data is then
16-QAM 3/4 1 12.0 processed by a whitening stage that by means of a scrambler
16-QAM 1/2 1 8.0 XORs the data against a pseudo-random sequence in order
QPSK 3/4 1 6.0 to randomize the signal and introduce transitions that are
QPSK 1/2 1 4.0 essential to signal synchronization. The output stream is then
BPSK 1/2 1 2.0 modulated by the schemes and spread by means of FHSS.
BPSK 1/2 4 0.5 Finally cyclic prefix insertion (CPI) is used to minimize,
BPSK 1/2 16 0.125 among other things, intersymbol interference (ISI) and mul-
BPSK 1/2 63 0.040 tipath fading, by inserting at the start of a frame a portion
BPSK 1/2 225 0.010 of the end of the frame. A preamble is then inserted to
DBPSK 1/2 1023 0.0025 provide synchronization between devices and base stations.
The resulting signal is passed through a root-raised cosine
(RRC) filter that provides pulse shaping to further minimize
modulation since it is characterized by very good propa- ISI due the sharp wave transitions it introduces.
gation. Moreover, Weightless modulation is typically per- Weightless include three main variations known as
formed over underutilized white space spectrum channels Weightless-W, Weightless-P, and Weightless-N. Weightless-
that exhibit very little interference and require small size W is based on the specifications presented so far in this
antennas. These channels are set up over unoccupied fre- section. Weightless-P is based on Weightless-W, but it
quency guardbands between TV channels. Again, since UHF is cheaper since it removes the need for a temperature-
TV signals are generated with high-power transmitters and compensated crystal oscillator (TCXO) by changing some
high gain antennas located at high altitude, they are unlikely of the modulation scheme parameters. Weightless-N is
to interfere with Weightless low-power transmitters and low also based on Weightless-W, but it relies on transmission
gain antennas at low altitude. over the 868/915 MHz ISM bands providing only uplink
Weightless relies on FHSS with the carrier being mod- communication. It exhibits lower power consumption that
ulated by means of DBPSK, BPSK, QPSK, or 16-QAM. extends battery life for up to 10 years but limits both the
Table 8.2 shows the different modulation schemes and their propagation range and the transmission rate.
corresponding nominal transmission rates associated with
8.6 NB-IoT 203
preamble
RRC pulse
shaping
DBPSK BPSK
FEC scrambler FHSS CPI
QPSK 16-QAM
frequency
physical random access channel (NPRACH) and (2) nar-
rowband physical uplink shared channel (NPUSCH), and it
also uses one signal demodulation reference signal (DMRS).
carrier 12 l The downlink uses three channels (1) narrowband physical
carrier 11 k downlink shared channel (NPDSCH), (2) narrowband phys-
carrier 10 j ical downlink control channel (NPDCCH), and (3) narrow-
carrier 9 i band physical broadcast channel (NPBCH), and it also uses
carrier 8 h three signals (1) narrowband reference signal (NRS), (2)
carrier 7 g narrowband primary synchronization signal (NPSS), and (3)
carrier 6 f narrowband secondary synchronization signal (NSSS).
carrier 5 e
carrier 4 d
carrier 3 c
Example 8.3 Consider an IPv6 adaptation mechanism
carrier 2 b
encapsulated as part of NB-IoT that results in the
carrier 1 a transmission of 20-byte packets. What is the worst-
time case scenario MAC latency that can be expected from
such mechanism?
Fig. 8.18 OFDMA
frequency
10485.76 s
10.24 s
10 ms
1 ms
slot 0 slot 1
500 μs
10485.76 s
10.24 s
10 ms
2 ms
subframes
frame
NPBCH Narrowband Physical Broadcast Channel
NPDCCH Narrowband Physical Downlink Control Channel
NPDSCH Narrowband Physical Downlink Shared Channel
NPSS Narrowband Primary Synchronization Signal
NSSS Narrowband Secondary Synchronization Signal
the cell identifier, subframe number, scheduling information, 8.6.2 Link and Upper Layers
and system bandwidth become available to the device. Addi-
tionally, each device acquires a UE identifier as part of the The NB-IoT network topology is based on legacy LTE in-
random access procedure (RAP) that is performed during frastructure. It includes (1) a network core called evolved
initial uplink synchronization and any time synchronization packet core (EPC) shown in Fig. 8.23, (2) an evolved UMTS
needs to be regained due to a long period of inactivity. terrestrial radio access Network (E-UTRAN), and (3) UE
206 8 LPWAN Technologies
that consists of IoT devices. The EPC includes a mobility plane CIoT EPS. Mandatory control plane CIoT EPS enables
management entity (MME) that handles the mobility of the the encapsulation of data packets by means of signaling mes-
devices but also performs several actions like tracking of sages in Non-Access Stratum (NAS). When device mobility
devices, session management, and serving gateway (S-GW) is under consideration, loss of signal can lead to a great
selection for devices initial attachment and authentication. QoS degradation. NB-IoT introduces radio resource control
The S-GW routes the data packets through the network and (RRC) that provides the transmission of data packets over the
serves as anchor for device handover when transitioning be- control plane and supports the reestablishment of connection
tween different eNode base stations (eNBs). The packet data upon loss of signal. Essentially, RRC hides the loss of the
node gateway (P-GW) provides the interface between the radio interface to the upper layers. Optional user plane CIoT
3GPP network and an external network like the IP network. EPS relies on RRC for the device to get Access Stratum (AS)
Finally, the home subscriber server (HSS) is a database that and provide connection suspend and resume procedures to
is used for mobility, session and user management, as well as keep the connection context during radio interface transi-
access authorization. tions. When a device wants to transmit data packets uplink, it
The MAC sublayer within the link layer is responsible, starts a service request procedure by sending a random access
among other things, of handling retransmissions by means of preamble that triggers the establishment of an RRC connec-
a hybrid automatic repeat request (HARQ) mechanism, tim- tion and the reservation of associated radio resources. The
ing advance, multiplexing, random access, priority manage- base station initiates the release procedure after an extended
ment, and scheduling. Resource allocation must ensure that period of inactivity. Similarly, for downlink transmissions,
the maximum number of devices is served in any given cell if the device is in eDRX mode, when it receives a paging
while accomplishing a specific throughput level, spectral effi- message, it starts a service request procedure as described
ciency, and coverage. To this end, several resources including for the uplink scenario.
tone allocations, power configurations, frames, subframes,
and slots must be adjusted in order to maximize performance.
NB-IoT, as with LTE, includes adaptive power consumption 8.7 More LPWAN Technologies
and symbol repetition in order to extend coverage and im-
prove link reliability. Adaptive power consumption is pro- There are several other LPWAN technologies; many of them
vided by means of the PSM and eDRX mechanisms. are commercial, and some others are experimental. They
In order to deal with IP and non-IP datagrams, NB-IoT provide mechanisms that range from proprietary protocols
introduces additional changes to the EPC by adding the to open standards. This section presents the most important
Service Capability Exposure Function (SCEF). Additionally, ones.
NB-IoT introduces a cellular IoT (CIoT) Evolved Packet
System (EPS) that provides new small data transmission
procedures over long-range distances. Typically, more than 8.7.1 NB-Fi
one data path is carried by the MME signaling messages. Two
main procedures are optimized to support small data transfer: Narrowband fidelity (NB-Fi) is an open full stack protocol
(1) mandatory control plane CIoT EPS and (2) optional user that is the base of a commercial LPWAN turn-key solution
UE eNB
UE S-GW P-GW
UE User Equipment
eNB eNode Base Station
MME
S-GW
Mobility Management Enty
Serving Gateway
IP
P-GW Packet Data Node Gateway
HSS Home Subscriber Server
8.7 More LPWAN Technologies 207
that includes devices and networks developed by WAVIoT available 2.4 GHz spectrum is divided into 1 MHz channels
[11, 16]. Its goal is to provide a robust and reliable interac- that can be grouped to support different deployments.
tion between devices and base stations acting as traditional RPMA is a type of a DSSS scheme used only for up-
IoT gateways. As most other LPWAN technologies, NB-Fi link communications and, as such, represents a variation of
provides long battery life combined with low hardware cost. traditional CDMA. One of the main differences between
Moreover, NB-FI attempts to lower both deployment costs DSSS and RPMA is that although both mechanisms allow
and deployment times by simplifying the network topology. transmitters to share a single timeslot, under RPMA the
The typical transmission ranges are around 10 and 30 km for duration of the timeslot is increased, and the starting trans-
urban and rural environments, respectively. NB-Fi applica- mission delay (or phase) is randomized in order to minimize
tions range from smart metering and smart cities to home and intertransmitter interference. Moreover, RPMA supports a
building automation. mechanism for transmission rate adaptation regulated by the
NB-Fi’s physical layer relies on transmission over the 433 spreading factor estimated from the received signal strength.
and 915/868 MHz ISM bands to accomplish transmission The base stations rely on multiple receivers tuned to de-
rates between 50 bps and 25.6 Kbps. Modulation is by means modulate the signals arriving at different starting times and
of DBPSK but optimized to improve spectral efficiency and exhibiting different spreading factors. Downlink communi-
performance through software-defined Radio (SDR). TDD is cation relies on CDMA. In all cases, the signal modulation
used by device and base station signals to share the channel. is by means of DBPSK. RPMA devices also adapt their
The NB-Fi link layer relies on both TDMA and FDMA for transmission power by communicating with the closest base
media access. This enables network scenarios that include station in order to minimize interference. Overall, all these
both star topology and mesh schemes where a single base features together with a higher bandwidth that most other
station can support up to two million devices. LPWAN technologies give RPMA higher transmission rates.
Specifically, nominal rates of 624 and 156 Kbps for uplink
and downlink, respectively, are common. RPMA encrypts all
8.7.2 IQRF traffic and introduces FEC through convolutional codes.
DSSS with OQPSK, and (3) OFDMA in scenarios affected LTE-M does to the LTE spectrum [11, 16, 3]. Specifically,
by multipath fading. Although nominal transmission rates, it increases coverage and lowers power consumption. As a
depending on the modulation scheme under consideration, CIoT technology, it operates on the GSM 850–900 and 1800–
can range from 6.25 to 800 Kbps, the standard defines FSK 1900 MHz bands providing a similar coverage and power
as the default mandatory mode of transmission supporting consumption to that of NB-IoT. The channel bandwidth
a transmission rate of 50 Kbps. As transmission rates are is 200 MHz, where like in most GSM networks, MAC is
higher than those of IEEE 802.15.4, the corresponding MTU performed by means of combining FDMA with TDMA and
size is also larger without affecting the transmission delay. FDD. Modulation is carried out by Gaussian Minimum Shift
Specifically, IEEE 802.15.4g supports a maximum frame Keying (GMSK) and 8PSK providing nominal transmission
size of 1500 bytes that enable the transmission of a complete rates between 70 Kbps and 240 Kbps, respectively. Latency
IPv6 datagram over a single frame without needing to apply is typically less than 2 s being lower than that of both LTE-M
any fragmentation. The link layer can be configured to and NB-IoT. As LTE-M, EC-GSM-IoT is enabled in existing
provide MAC based on IEEE 802.15.4 or on IEEE 802.15.4e GSM networks by means of a software upgrade. Because
introduced in Sect. 3.3.3 [1].Typical signal coverage of IEEE GSM networks are in the process of decommission, EC-
802.15.4g is around 10 km. GSM-IoT is a lot less popular than LTE-based technologies.
EC-GSM-IoT also exhibits comparatively high capacity sup-
porting around 50,000 devices in each cell. Moreover, EC-
8.7.10 LTE-M GSM-IoT is designed to provide coverage in locations where
radio conditions are challenging such as indoor basements
Standardized together with NB-IoT as part of the 3GPP where many sensors are usually installed. Battery life is
Release 13, LTE-M, also known as LTE Cat M1 or enhanced around 10 years, and security and privacy, as with LTE-M and
machine-type communication (eMTC), is a simplified ver- NB-IoT, are guaranteed by mutual authentication, confiden-
sion of 4G LTE that attempts to provide CIoT support by tiality, and encryption provided by legacy mechanisms [34].
reducing power consumption while extending signal cover-
age [11, 3]. Specifically, battery life is increased to over
10 years, while modem costs are reduced by 25%. When 8.7.12 5G and B5G Considerations
compared to LTE, LTE-M lowers nominal transmissions rates
to around 1 Mbps by reducing the available bandwidth from 4G LTE IoT solutions like NB-IoT and LTE-M intended
20 to 1.4 MHz (as opposed to 200 KHz of NB-IoT). Most for fixed/low-rate and mobile/high-rate applications, respec-
LTE functionality is available under LTE-M including Voice tively, have transitioned into 5G scenarios as part of the
over LTE (VoLTE). In order to increase battery life, LTE-M evolution of the 3GPP releases. This is further simplified by
supports optional half duplex transmissions. Some features of the fact that 5G is typically deployed as 5G non-standalone
NB-IoT like eDRX and PSM, introduced in Sect. 8.6, are also (5G NSA) where 5G is supported as a software upgrade
available under LTE-M. In most scenarios upgrading an LTE that updates protocols on legacy 4G LTE hardware. This
network to support LTE-M is as simple as a software upgrade. latter deployment is usually known as 5G LTE as opposed
LTE-M does not compete with NB-IoT, and the selection of to 5G standalone (5G SA) where additional hardware also
one technology versus the other depends on rate, coverage, known as new radio (NR) is needed to support frequency
and power consumption considerations. Device density is bands above 6 GHz [4, 32]. In this context, 3GPP Release
also increased by supporting over 100,000 devices in each 15 addresses the NR modifications needed to support both
cell. For deep coverage deployments associated with CIoT 5G NB-IoT and 5G LTE-M. As part of this evolution, one
scenarios, latency is within 10 s, while battery life is never of the main requirements for the future IoT applications
longer than 10 years, but for normal coverage, similar to that is massive access. Beyond 5G (B5G) including future 6G
of a smartphone, latency lowers to 0.1 s while the battery life networks will attempt to address this and other requirements
extends to 35 years [16]. in order to increase density to over a million devices per
square kilometer, increase battery life to 20 years, support
space-air-ground-sea coverage, reduce latency to less than a
8.7.11 EC-GSM-IoT second, and increase positioning precision to 1 m [19].
Table 8.3 LPWAN technologies Telensa, SNOW, NWave, Qowisio, IEEE 802.15.4k, IEEE
Technology Bands Max nominal rate Max coverage 802.15.4g, LTE-M, and EC-GSM-IoT including 5G, B5G,
LoRa ISM 1 GHz 50 Kbps 20 km and 6G considerations. The chapter ended by exploring IPv6
SigFox ISM 1 GHz 600 bps 40 km support of LPWAN mechanisms. Table 8.3 compares the
D7AP ISM 1 GHz 166 Kbps 10 km features of some of the most relevant LPWAN technologies.
Weightless TV guardbands 16 Mbps 5 km
NB-IoT LTE/5G 200 Kbps 10 km
NB-Fi ISM 1 GHz 25.6 Kbps 30 km Homework Problems and Questions
IQRF ISM 1 GHz 20 Kbps 500 m
RPMA ISM 1 GHz, 2.4 GHz 624 Kbps 25 km 8.1 If an application in the cloud is sending actuation com-
Telensa ISM 1 GHz 500 bps 16 km mands to a LoRa device, what LoRa media access class con-
SNOW TV guardbands 50 Kbps 1.5 km figuration is likely to minimize the delay of these commands
Nwave ISM 1 GHz 100 bps 10 km arriving at the device?
IEEE 802.15.4k ISM 1 GHz, 2 GHz 50 Kbps 3 km
IEEE 802.15.4g ISM 1 GHz, 2 GHz 50 Kbps 10 km 8.2 What LPWAN technologies do not rely on ISM bands
for transmission?
investment. The cost of this extended coverage, however, is 8.3 What LoRa MAC class enables the longest battery life?
very little energy left for computation, resource, and protocol
complexity. This leads to several challenges that prevent 8.4 If it were possible to transmit a CoAP message over
LPWAN from implementing IPv6 adaptation mechanisms LoRa and assuming:
like 6LoWPAN and 6Lo: (1) MTU and transmission rates
are several other of magnitude below those of WPAN tech- (a) LoRa configured with 50 devices transmitting over 8 km
nologies, (2) lack of link layer fragmentation support, and at a nominal maximum rate of 250 bps.
(3) uplink and downlink asymmetry. In this scenario, any (b) An 8-byte payload over an unencrypted NON CoAP mes-
adaptation that attempts to overcome the 6LoWPAN and sage transmitted over an adaptation mechanism that en-
6Lo limitations results in energy consumption levels that are codes IPv6 and UDP headers as a single 21-byte header.
unacceptable for LPWAN. Assume the LoRaWAN header is included in the adapta-
There have been, however, some attempts to provide IPv6 tion layer header.
support in LPWAN by adapting some of the lightweight (c) No network loss and no delays other than the transmis-
features of 6LoWPAN and 6Lo. Specifically, IETF RFC sion delay.
8724 SCHC: Generic Framework for Static Context Header
Compression and Fragmentation introduces Static Context How long does it take for a sensor to send a single readout?
Header Compression (SCHC) a mechanism that provides How does it compare to the best-case scenario of IEEE
both static header compression and fragmentation in the 802.15.4?
context of LPWANs [20]. Static header compression relies
on a common static context on both device and network in- 8.5 Many LPWAN technologies like SigFox support differ-
frastructure sides. SCHC is used to compress IPv6 and UDP ent transmission rates for uplink and downlink traffic. (a)
headers. There are, in addition, several proposals to specialize Why is this important? (b) How does this relate to IPv6
the use of SCHC under LoRa, NB-IoT, and SigFox. support?
8.6 What are the best and worst-case latency scenarios for a
Summary 45-byte long packet transmitted over NB-IoT?
LPWAN solutions provide long-range signal coverage be- 8.7 What are some differences between Weightless and
tween devices and gateways at a cost of comparatively low other LPWAN technologies?
transmission rates. As such most LPWAN schemes do not
fully support end-to-end IPv6 connectivity, and they rely on 8.8 Is there any LPWAN technology that provides IPv6
gateways and border routers to convert protocol stacks. The support?
chapter started by briefly describing IoT support of LPWAN
technologies and then switched to presenting LoRa, SigFox, 8.9 Many LPWAN technologies like Weighless-N only en-
D7AP, Weightless, and NB-IoT. The chapter then introduced able the transmission of uplink traffic. (a) How does this
other less common technologies like NB-Fi, IQRF, RPMA,
References 211
affect performance? (b) What are the implications for IoT 16. Foubert, B., Mitton, N.: Long-range wireless radio technologies:
applications? a survey. Future Internet 12, 13 (2020). https://doi.org/10.3390/
fi12010013
17. Harada, H., Mizutani, K., Fujiwara, J., Mochizuki, K., Obata, K.,
8.10 Assuming a symbol rate of 4×106 symbols per second, Okumura, R.: IEEE 802.15.4g based wi-sun communication sys-
how is the 500 Kbps transmission rate accomplished under tems. IEICE Trans. Commun. E100.B, 1032–1043 (2017). https://
Weightless? Assume a 4 MHz channel. doi.org/10.1587/transcom.2016SCI0002
18. Lavric, A., Popa, V.: Internet of things and lora low-power wide-
area networks: A survey. In: 2017 International Symposium on
Signals, Circuits and Systems (ISSCS), pp. 1–5 (2017)
References 19. Malik, H., Sarmiento, J.L.R., Alam, M.M., Imran, M.A.:
Narrowband-internet of things (NB-IoT ): Performance evaluation
1. IEEE standard for local and metropolitan area networks–part 15.4: in 5G heterogeneous wireless networks. In: 2019 IEEE 24th
Low-rate wireless personal area networks (LR-WPANS) amend- International Workshop on Computer Aided Modeling and Design
ment 3: Physical layer (PHY) specifications for low-data-rate, of Communication Links and Networks (CAMAD), pp. 1–6
wireless, smart metering utility networks. IEEE Std 802.15.4g- (2019)
2012 (Amendment to IEEE Std 802.15.4-2011) pp. 1–252 (2012) 20. Minaburo, A., Toutain, L., Gomez, C., Barthel, D., Zuniga, J.C.:
2. IEEE standard for local and metropolitan area networks—part SCHC: Generic Framework for Static Context Header Compres-
15.4: Low-rate wireless personal area networks (LR-WPANS)- sion and Fragmentation. RFC 8724 (2020). https://doi.org/10.
amendment 5: Physical layer specifications for low energy, criti- 17487/RFC8724. https://rfc-editor.org/rfc/rfc8724.txt
cal infrastructure monitoring networks. IEEE Std 802.15.4k-2013 21. Morin, E., Maman, M., Guizzetti, R., Duda, A.: Comparison of the
(Amendment to IEEE Std 802.15.4-2011 as amended by IEEE Std device lifetime in wireless networks for the internet of things. IEEE
802.15.4e-2012, IEEE Std 802.15.4f-2012, IEEE Std 802.15.4g- Access 5, 7097–7114 (2017). https://doi.org/10.1109/ACCESS.
2012, and IEEE Std 802.15.4j-2013) pp. 1–149 (2013) 2017.2688279.https://hal.archives-ouvertes.fr/hal-01649135
3. 3GPP: 3GPP release 13 (2015). https://www.3gpp.org/release-13 22. Mroue, H., Nasser, A., Hamrioui, S.: Mac layer-based evaluation of
4. Akpakwu, G.A., Silva, B.J., Hancke, G.P., Abu-Mahfouz, A.M.: A IoT technologies: Lora, sigfox and NB-IoT. In: IEEE Middle East
survey on 5G networks for the internet of things: communication and North Africa Communications Conference (MENACOMM)
technologies and challenges. IEEE Access 6, 3619–3647 (2018) (2018). https://doi.org/10.1109/MENACOMM.2018.8371016
5. Al-Sarawi, S., Anbar, M., Alieyan, K., Alzubaidi, M.: Internet 23. Naik, N.: LPWAN technologies for IoT systems: Choice between
of things (IoT) communication protocols: Review. In: 2017 8th ultra narrow band and spread spectrum. In: 2018 IEEE International
International Conference on Information Technology (ICIT), pp. Systems Engineering Symposium (ISSE), pp. 1–8 (2018)
685–690 (2017) 24. Oliveira, L., Rodrigues, J., Kozlov, S., Rabelo, R., Albuquerque, V.:
6. Alliance, L.: Lorawan 1.1 specification (2017). https://lora- Mac layer protocols for internet of things: a survey. Future Internet
alliance.org/sites/default/files/2018-04/lorawantm_specification_- 11, 16 (2019). https://doi.org/10.3390/fi11010016
v1.1.pdf 25. Raza, U., Kulkarni, P., Sooriyabandara, M.: Low power wide area
7. Augustin, A., Yi, J., Clausen, T., Townsley, W.M.: A study of networks: An overview. IEEE Commun. Surv. Tutor. 19, 855–873
lora: Long range & low power networks for the internet of things. (2016)
Sensors 16(9), 1466 (2016). https://doi.org/10.3390/s16091466. 26. Righetti, F., Vallati, C., Comola, D., Anastasi, G.: Performance
https://pubmed.ncbi.nlm.nih.gov/27618064. 27618064[pmid] measurements of IEEE 802.15.4g wireless networks. In: 2019
8. Ayoub, W., Nouvel, F., Samhat, A.E., Prévotet, J.C., Mroue, M.: IEEE 20th International Symposium on “A World of Wireless,
Overview and measurement of mobility in DASH7. In: 2018 25th Mobile and Multimedia Networks” (WoWMoM), pp. 1–6 (2019)
International Conference on Telecommunications (ICT), pp. 532– 27. Roth, Y., Dore, J.B., Ros, L., Berg, V.: A comparison of physical
536. IEEE, St. Malo (2018). https://doi.org/10.1109/ICT.2018. layers for low power wide area networks. In: Cognitive Radio Ori-
8464846. https://hal.archives-ouvertes.fr/hal-01991725 ented Wireless Networks. CrownCom 2016, pp. 261–272 (2016).
9. Ayoub, W., Samhat, A.E., Nouvel, F., Mroue, M., Prevotet, J.: In- https://doi.org/10.1007/978-3-319-40352-6_21
ternet of mobile things: overview of LoRaWAN, DASH7, and NB- 28. Saari, M., bin Baharudin, A.M., Sillberg, P., Hyrynsalmi, S., Yan,
IoT in LPWANs standards and supported mobility. IEEE Commun. W.: Lora-a survey of recent research trends. In: 2018 41st Interna-
Surv. Tutor. 21(2), 1561–1581 (2019) tional Convention on Information and Communication Technology,
10. Calvo, I., Gil-Garcia, J., Recio, I., Lopez, A., Quesada, J.: Building Electronics and Microelectronics (MIPRO), pp. 0872–0877 (2018)
IoT applications with raspberry Pi and low power IQRF communi- 29. Saifullah, A., Rahman, M., Ismail, D., Lu, C., Chandra, R., Liu,
cation modules. Electronics 5, 54 (2016). https://doi.org/10.3390/ J.: Snow: Sensor network over white spaces. In: SenSys ’16:
electronics5030054 Proceedings of the 14th ACM Conference on Embedded Network
11. Chaudhari, B., Zennaro, M., Borkar, S.: LPWAN technologies: Sensor Systems CD-ROM, pp. 272–285 (2016). https://doi.org/10.
emerging application characteristics, requirements, and design con- 1145/2994551.2994552
siderations. Future Internet 12, 46 (2020). https://doi.org/10.3390/ 30. Saifullah, A., Rahman, M., Ismail, D., Lu, C., Liu, J., Chandra, R.:
fi12030046 Enabling reliable, asynchronous, and bidirectional communication
12. Chen, M., Miao, Y., Hao, Y., Hwang, K.: Narrow band internet of in sensor networks over white spaces. In: Proceedings of the 15th
things. IEEE Access 5, 20557–20577 (2017) ACM Conference on Embedded Network Sensor Systems, SenSys
13. Farrell, S.: Low-Power Wide Area Network (LPWAN) Overview. ’17. Association for Computing Machinery, New York (2017).
RFC 8376 (2018). https://doi.org/10.17487/RFC8376. https://rfc- https://doi.org/10.1145/3131672.3131676
editor.org/rfc/rfc8376.txt 31. Saifullah, A., Rahman, M., Ismail, D., Lu, C., Liu, J., Chandra,
14. Ferré, G., Simon, E.P.: An introduction to Sigfox and LoRa R.: Low-power wide-area network over white spaces. IEEE/ACM
PHY and MAC layers (2018). https://hal.archives-ouvertes.fr/hal- Trans. Netw. 26(4), 1893–1906 (2018). https://doi.org/10.1109/
01774080. Working paper or preprint TNET.2018.2856197
15. Finnegan, J., Brown, S.: A Comparative Survey of LPWA Network- 32. Salva, P., Alcaraz-Calero, J., Wang, Q., Bernal Bernabe, J.,
ing. arXiv (2018), arXiv:1802.04222 Skarmeta, A.: 5g NB-IoT: Efficient network traffic filtering for
212 8 LPWAN Technologies
multitenant IoT cellular networks. Secur. Commun. Netw. 2018, MHz. In: 2011 IEEE International Symposium on Antennas and
1–21 (2018). https://doi.org/10.1155/2018/9291506 Propagation (APSURSI), pp. 3389–3392 (2011)
33. Shanmuga Sundaram, J.P., Du, W., Zhao, Z.: A survey on lora 36. Webb, W.: Weightless: the technology to finally realise the m2m
networking: research problems, current solutions, and open issues. vision. Int. J. Interdiscip. Telecommun. Netw. 4, 30–37 (2012).
IEEE Commun. Surv. Tutor. 22(1), 371–388 (2020) https://doi.org/10.4018/jitn.2012040102
34. Silva, P., Kaseva, V., Lohan, E.S.: Wireless positioning in IoT: a 37. Weyn, M., Ergeerts, G., Berkvens, R., Wojciechowski, B., Tabakov,
look at current and future trends. Sensors 18, 2470 (2018). https:// Y.: Dash7 alliance protocol 1.0: Low-power, mid-range sensor and
doi.org/10.3390/s18082470 actuator communication. In: 2015 IEEE Conference on Standards
35. Walden, M.C., Jackson, T., Gibson, W.H.: Development of an for Communications and Networking (CSCN) (2015)
empirical path-loss model for street-light telemetry at 868 and 915
Thread Architecture
9
© The Author(s), under exclusive license to Springer Nature Switzerland AG 2022 213
R. Herrero, Fundamentals of IoT Communication Technologies, Textbooks in Telecommunication
Engineering, https://doi.org/10.1007/978-3-030-70080-5_9
214 9 Thread Architecture
MED
FED
REED
THREAD ROUTER
LEADER
IP
BORDER ROUTER
thread network
it advertises global IPv6 prefixes and handles global unicast fails, a close-by REED can become Thread router so that all
address allocation of devices in the Thread network. Essen- MEDs and FEDs associated with the failing Thread router
tially, users typically connect from adjacent IP networks by become children of the transitioning REED. In most cases,
means of IEEE 802.11 (Wi-Fi) or IEEE 802.3 (Ethernet), all these topology changes are transparent to the end user.
and they access devices through the core interface of the There are certain conditions, however, under which a single
border router. In order to support redundancy and improve point of failure cannot be prevented. Border routers are
reliability, a Thread network typically has multiple border limited by hardware characteristics that force them to have
routers. The Thread Management Framework (TMF) proto- at least two interfaces: one to the access WPAN side and
col, which uses CoAP for transport, enables the notification another to the IP core side. This implies that if a border
of network data from border routers and DHCPv6 servers to router fails, communication to the IP core side will not be
Thread leaders [13]. possible unless another redundant border router exists in the
Thread routers provide routing capabilities to devices topology.
and coordination for devices to securely join the network. A Thread network is typically composed of a single par-
Because of their critical operation, Thread routers do not tition, but in certain cases, connectivity loss can lead to
typically run on constrained hardware and therefore do not disconnected sections of the network that end up grouped
perform power duty cycles that affect performance. Thread into separate partitions. The idea is that each partition is a
routers can become REEDs by downgrading their functional- Thread network with its own leader and network data. When
ity. REEDs are end devices, and as such they do not provide connectivity between partitions is back, they merge back, and
any routing or any services to other devices. Depending on the original Thread network topology is restored. Figure 9.5
topology changes and other network conditions, REEDs can illustrates how a single partition with one leader becomes two
become Thread routers or leaders without user interaction. partitions with two leaders when connectivity is lost between
REEDs cannot become border routers since they do not one side and the other of the Thread network.
usually include an interface to the core side that is needed One important concept in the context of Thread networks
to provide gateway capabilities. Leaders are routers that is commissioning. Commissioning is the process by which
keep track, through a registry, of other routers and their a user deploys a new device in a Thread network. Border
assignment. Consequently, leaders respond to requests from routers are essential in relaying messages between a man-
REEDs to become routers. For the most part, leaders rely agement application, known as commissioner, and network
on CoAP to assign and manage router addresses. The in- devices. Some of these network devices can be leader routers
formation stored in the leader registry is backed up in other that typically arbitrate the petitioning of multiple commis-
Thread routers such that if a leader becomes out of service, sioners [11].
any Thread router can automatically become the new leader.
End devices that are not REEDs can be either FEDs or MEDs.
Both FEDs and MEDs only communicate to Thread routers
and cannot serve as routers or become routers. MEDs do even 9.3 Routing
need to explicitly synchronize with their Thread routers to
transmit. Thread supports mesh forwarding that enables devices to
The Thread topology overcomes single points of failure talk to other devices by indirectly forwarding frames through
by relying on an automated and controlled mechanism in intermediate nodes. All routing entities (i.e. routers, border
which devices can take over functionality provided by failing routers and leaders) keep track and maintain routes to guar-
devices, or they can change their operation to become inde- antee that mesh forwarding is always available and fully
pendent of the failing devices. If a FED is communicating functional. Although up to 64 router addresses are supported
with a Thread router and the Thread router fails, then the in a single Thread network, not all these addresses can be
FED can select a new Thread router. If a Thread router used simultaneously in order to delay the reuse of addresses
216 9 Thread Architecture
partition 1
connectivity restored
of deleted devices. Since REEDs, FEDs, and MEDs do not intended to receive the messages. Similarly, under reactive
support routing, all traffic they generate is handled by their mod MPL data messages are multicast transmitted when it
parent Thread router. is discovered that nodes have not received the messages. In
In a single Thread network, there are up to 32 active the context of Thread, MPL is mostly supported in reactive
routers that rely on DV to compute routing tables. Specif- mode. The idea behind a trickle timer is to transmit network
ically, Thread routing relies on standard RIP Next Gener- parameters and attributes while minimizing, at the same time,
ation (RIPng) standardized under IETF RFC 2080. Note the load of the network.
that RIPng supports a maximum of 15 hops per end-to-end DV routing is different from other routing mechanisms
path and uses hop count as routing metric. As with any DV like RPL typically associated with on-demand routing. Al-
mechanism, each router is aware of the next hop routers though under IoT RPL is more stable and exhibits better
and the cost of transmitting traffic to each of them. This performance than DV mechanisms, DV routing has a much
enables routers to independently build routing tables that lower overhead. Specifically, RPL DIO, DAO, and DIS mes-
guarantee full network connectivity. Note that as opposed to sages are propagated throughout the network, while DV link
RPL, where routing is hierarchical, routing under Thread is costs are only propagated between neighboring routers. The
mostly flat. Moreover, by virtue of relying on DV routing, link costs represent all the information routers need to build
routing repairs tend to act fast, although temporary loops are comprehensive routing tables. Due to the dynamic nature
likely to occur. Routing information is exchanged by means of the link costs, routing tables are adjusted on-the-fly to
of mesh link establishment (MLE) messages. MLE messages compensate for connectivity issues in a comparatively faster
are compressed for efficiency, and they are used not only to way than RPL. Also, when compared to RPL, DV routing fast
propagate link costs between routers but also to establish, reactions can lead to loops and other routing instabilities that
identify, and maintain secure links and to detect neighbors. can affect short term performance.
MLE messages also enable the propagation of network con- Routing relies on a bitmap lookup where the address of a
figuration parameters like the PAN identifier. Note that link REED, FED, or MED parent is determined by looking at the
costs are typically asymmetrical as in most IoT networks, most significant bits (MSB) of the device address. In general,
because the traffic from a device to a router and from the same a sender determines the router associated with the receiver
router to the same device is affected by different impairments and forwards datagrams to the neighbor that provides the
and channel capacities. Since MLE messages operate at lowest-cost path. Again, the cost information between de-
link level, they are sent as link-local unicast and multicast vices and routers is propagated by means of single-hop MLE
frames. Multicasting of MLE messages is carried out by messages. The cost associated with a specific link between
simple flooding in accordance with the multicast protocol two entities is based on the power of the signals originated at
for low-power and lossy Networks (MPL). MPL enables the neighbors. Specifically, the incoming RSSI is mapped to
multicast forwarding in constrained networks while avoiding a link quality index between 0 and 3 where 0 indicates that
the need of maintaining any multicast forwarding topology. the cost is unknown.
MPL introduces two modes of execution. Under proactive If a device or a router receives an MLE message from
mode, MPL data messages are transmitted and triggered by a neighbor, it recomputes its routing table by updating or
a trickle timer without any prior indication that nodes are creating a new entry based on the information carried by the
9.4 Why Not RPL? 217
message. The MLE message contains the cost associated not and multicast addresses needed for them to work. Since
only to the close neighbor but also to all other routers that DHCPv6 is centralized with a server assigning addresses,
are reachable from the neighbor. Unfortunately, the IEEE there is no chance for overlapping and therefore no need
802.15.4 frame payload size limits to 32 the number of for any conflict resolution. SAA, on the other hand and
routers for which link cost information can be included. as indicated in Sect. 4.2, is fully distributed, and it enables
Routing tables are traditional IP routing tables with entries devices to independently configure their own address without
that specify network addresses and the corresponding next any human or nonhuman intervention based on their own
hop information. link layer addresses and the network prefix provided by the
router. By virtue of being distributed, SAA requires DAD for
Example 9.1 What is a valid addressing scheme for contention and conflict resolution.
the end devices of the following Thread network? Leaders keep track of the 16-bit addresses of the bor-
der routes, and they identify the REEDs that are upgraded
to become Thread routers and the Thread routers that are
downgraded to become REEDs. Additionally, leaders rely
on CoAP to assign and manage router addresses. As already
indicated, however, all information stored at the leader is
propagated to other routers so they can automatically become
new leaders if problems prevent the original leader from
working. Note that because devices rely on 6LoWPAN for
IPv6 adaptation, stateful header compression and decompres-
sion are widespread throughout the network.
cycles. To this end, it defines sleepy end devices that can sleep and other routers. Thus, it complements ND mechanisms. All
but are not allowed to forward messages from other devices. 32 router entries fit in a single control message with each
Regarding scalability, Thread supports up to 32 routers per entry being carried by a single byte. An entry, that includes
network partition. a 2-bit incoming link cost, a 2-bit outgoing link cost, and a
When compared to RPL, a Thread network reduces the 4-bit path cost, is positioned within the payload in a location
number of devices from thousands to a few hundred with that is associated with the address of the node in the network.
routers always powered on. Routers can therefore focus on End devices, by not supporting flat routing, do not broadcast
routing without being affected by energy efficiencies. The advertising messages.
assumption is a home automation scenario where there are Both RPL and Thread routing rely on trickle timers. RPL
enough power outlets to support several routers. More impor- uses the trickle timer for DIO transmissions that enable
tantly, Thread is not just a routing mechanism. It implements repairs and routing integrity. The period of this timer, in
a full stack that has under consideration information from steady state, is in the order of minutes to minimize power
multiple layers. Note that although IEEE 802.15.4, when consumption and extend the network lifetime. Thread routing
enabled with the right power configuration, provides a long- relies on trickle timers to trigger the transmission of ad-
range coverage, Thread coverage is limited to support con- vertising messages. In steady state the transmission interval
nectivity within homes and buildings. is in the order of seconds. This much shorter transmission
IEEE 802.15.4 and 6LoWPAN support mesh connectivity period is possible because Thread routers are not low-power.
by means of mesh-under and route-over approaches. RPL, The network can be fully refreshed by means of these con-
however, is a fully hierarchical routing mechanism where trol messages. Low-power Thread end devices periodically
parent nodes talk to multiple children, thus, not really sup- transmit keepalive messages to verify reachability with their
porting mesh connectivity. Thread routing is based on a full parents.
mesh topology where some nodes have a path cost not just to The link costs under RPL are mostly derived from ETX
the border router but to other nodes in the network. A node estimations obtained by inverting the PDR calculated from
can select the next hop by itself by looking at its routing table. the number of received datagrams. This is not always ac-
RPL routing paths are symmetric so datagrams from the curate, and it can lead to assigning low costs to unreliable
clusterhead to a device traverse the same path but in opposite links. Under RPL routing, the metrics are derived from the
directions that traffic from that device to the clusterhead. This link margin (LKM) that is defined as the difference between
is because downward routes are derived from upward routes the minimum expected power received at the receiver and
by reversing them. Moreover, this can be a problem since for the sensitivity of the receiver. A 20 dB LKM means that the
a given link, the cost in one direction may be different than the receiver can still detect the weakest signal the transmitter
cost in the opposite direction. Thread routing is asymmetric; generates even if it attenuated 20 dB. The higher the LKM
it relies on traditional flat DV techniques, and, therefore, a value, the more reliable the link communication is. Thread
route from the border router to a node may follow a path that routing maps the LKM to a link cost such that if LKM ≥
is different from that of the route from the node to the border 20 dB then the link cost is one, if 10 ≤ LKM < 20 dB, then
router. Thread also exhibits some hierarchical features, as the link cost is two; if 2 ≤ LKM < 10 dB, then the link cost
end devices only interact with a single parent router and all is four; and otherwise the link cost is infinity.
traffic generated or terminated at the device goes through this RPL supports two modes of operation: non-storing and
parent. This model minimizes the computational complexity storing that provide a trade-off between memory overhead
and the usage of memory resources improving the overall and network overhead. Thread routing, by supporting an
energy consumption. Therefore, under Thread there are two approach similar to that of traditional DV routing, uses tables
approaches to routing. Routers are complex devices that are for routers to find paths. This limits the memory use to
always powered on and rely on flat routing to support mesh 32 entries per table. In order to reach an end device, a
connectivity. End devices, on the other hand, are basic low- sender must first reach the device parent router such that
power devices that run on batteries and rely on hierarchical when the datagram arrives, it can be delivered to the device.
routing where any interaction is with a parent router. Specifically, the IEEE 802.15.4 short 16-bit address of each
Thread routers broadcast advertising messages that are end device, as described in Sect. 9.3, is assigned to have
used to update routing metrics in the context of the full mesh. two components: a 6-bit parent router identifier and a 10-bit
The maximum number of 32 routers is intended to limit the end device identifier. The parent router identifier is used to
amount of control traffic sent throughout the network. This determine the path from the source to the router. The device
contrasts with RPL routing where the DIO messages include identifier is used by the parent router to forward the datagram
the path cost to the clusterhead. Thread routing enables a to the right child.
router to determine the cost of paths and links to neighbors
9.5 Thread Stack 219
APS
APS ZCL
FCTL DE DC DP SE SEQ FCTL SEQ CMD
cluster binding
0x2 64 6 0xffff 65 0 0x48 0 1
client server
FCTL frame control
light switch light DE destination endpoint
DC destination cluster
Fig. 9.8 On/off cluster DP destination profile
SE source endpoint
SEQ sequence
quite common with many full-stack M2M and hybrid IoT CMD command
technologies like BLE and ANT+. But profiles force devices
to only interact with those of their own type. Essentially, BLE Fig. 9.9 ZCL message
devices and applications only interact with BLE devices and
applications, ANT+ devices and applications only interact
with ANT+ devices and applications, and, of course, ZigBee The idea with ZCL over IP is to map ZCL binary messages
devices and applications only interact with ZigBee devices as close as possible when encoded over CoAP. For example,
and applications. Fig. 9.9 shows a ZCL message, encapsulated over APS, that
Under ZCL, each cluster defines a communication inter- is transmitted from the light switch to the light of Fig. 9.8. The
face that specifies a collection of commands and attributes. message specifies that it is intended for destination endpoint,
Devices implement client and server sides of each cluster. destination cluster, and command 64, 6, and 1 respectively.
Cluster commands typically expose actions of devices, while As per ZCL specifications, cluster identifier 6 is associated
cluster attributes usually expose the state of devices. Clusters with the on/off cluster, while command 1 is associated with
are objects with attributes that follow flat structure that is the on command. Note that the message has no payload.
indexed by identifiers. ZCL defines clusters intended for Under ZCL over IP this message is translated as a CoAP
applications ranging from temperature sensing to dehumid- POST request to URI /zcl/e/64/s6/c/1 where /zcl specifies
ification control. ZCL is not RESTful by design as it relies ZCL protocol, /e/64 indicates the endpoint, s6 indicates the
on numerous different general commands and manufacturer- cluster identifier, and c/1 specifies the command. The POST
specific commands per cluster. Because of the ZigBee LLN request includes no body as the ZCL message has no payload.
origin, ZCL messages are quite small and optimized to fit ZCL service discovery is carried out by ZDP, while ZCL over
in a single IEEE 802.15.4 frame such that the unnecessary IP service discovery is carried out by IETF RFC 6690 Core
transmission of messages between devices is minimized. Link Format described in Sect. 6.4.1.
Figure 9.8 shows an example of the ZCL on/off cluster In general, ZCL commands are accessible through REST
with a light switch client transmitting an on command to a CoAP requests: GET, PUT, POST, and DELETE. ZCL re-
light server. sponses are returned as CoAP responses, typically as 2.05
The evolution of ZCL from ZigBee to generic IoT IP Content for success or as 4.05 Method Not Allowed to
network stacks defines the aforementioned dotdot application indicate errors. URIs specify a combination of resources
language for device communication. This is analogous to the that are indicated by /e for endpoints, /a for attributes, /c
situation of the link layer of ZigBee that was ported to other for commands, /b for bindings, /r for configurations, /n for
network stacks as IEEE 802.15.4. notifications, and /g for group notifications.
With Thread, dotdot requires access control by means Service discovery is invoked by means of the /.well-
of Authentication and Authorization for Constrained Envi- known/core URI. Figure 9.10 illustrates an example, where
ronments (ACE) that allows the provisioning application to an application attempts to discover endpoints implementing
specify the resources that are available each device. the on/off cluster by transmitting a multicast GET CoAP
Dotdot in the context of Thread is based on ZCL over IP request to /.well-known/core?rt=urn:zcl:c:6.c where the
that exploits CoAP for both session management, service dis- resource type attribute rt specifies ZCL for cluster identifier
covery, and RESTful access. It encodes ZCL payloads with 6. The unicast response is a 2.05 Content response that
Concise Binary Object Representation (CBOR) standardized carries the link format associated with the endpoint
as IETF RFC 7049. CBOR introduces a data format that coap://[2001::21:5]/zcl/e/64/c6>;rt=urn: zcl:c:6.c. Of
provides small message size and extensibility without the course, Thread does not rely on standardized mDNS and
need to version negotiation. DNS-SD for service discovery as CoAP is probably a better
fit to map ZCL interactions.
222 9 Thread Architecture
BR
BR border router
application light
IP
R R R2
BR border router BR border router
R router R router
R2 another router
BR
BR
IP
IP
R
BR border router Fig. 9.14 New router joins network
R router
R R2
BR
BR border router
R router (leader)
R2 another router
BR
IP
IP
router. Since the border router plays the role of Thread Fig. 9.15 Border router unavailable
leader, a commissioning session is established between the
commissioner and the border router.
The commissioner, then, enables another router R2 to route information. Now, router R advertises network data that
join the Thread network. This is illustrated in Fig. 9.14. A includes external routing information.
DTLS connection is established between this new router and Finally, a new border router BR2 joins the Thread network
the border router that, in turns, relays the handshake to the as illustrated in Fig. 9.17. This new border router communi-
commissioner. The border router then securely distributes cates with the leader by means of TMF traffic to inform it has
network parameters to R2 , which, in turns, uses DHCPv6 to taken over the role of DHCPv6 server.
get a globally scoped address.
If the border router is powered off, then another router in
the Thread network typically takes over the role of leader. 9.9 OpenThread
As shown in Fig. 9.15, router R becomes the new leader
and it starts advertising network data that no longer includes As opposed to many other IoT architectures, Thread is avail-
external routing information. able as a complete open-source implementation developed
Later, when the border router is back in service as shown by Google/Nest called OpenThread initially released in May
in Fig. 9.16, it acknowledges router R as Thread leader. 2016 [5]. The goal of OpenThread is to enable faster de-
The border router uses TMF traffic to forward its external ployments of Thread and to encourage chip manufacturers to
standardize devices as a mechanism to bring better, cheaper,
and more secure devices to end consumers [7].
224 9 Thread Architecture
Summary
IP Thread is a WPAN technology that provides a full stack
primarily intended for IoT home automation that can also
be used in the context of other industries ranging from asset
monitoring to IIoT. The chapter started by introducing the
main characteristics of Thread and how Thread compares to
IETF IoT stacks. Details of the Thread topologies and DV
Fig. 9.17 New border router joins network
routing were then explored. Specifically, DV routing was
compared against RPL in order to explain why it is the best
OpenThread RTOS Device Support There are several alternative for the Thread architecture. The chapter continued
implementations of OpenThread intended for RTOS- to explain the Thread stack, its application layer including
based devices. The list below details some of these resource discovery, and other security considerations. The
implementations. chapter ended by describing the network formation and de-
tails of OpenThread.
9.3 Why do you think ZCL messages are mapped as CoAP 6. Kim, H.S., Kumar, S., Culler, D.: Thread/openthread: A compro-
messages under Thread? mise in low-power wireless multihop network architecture for the
internet of things. IEEE Commun. Mag. 57, 55–61 (2019)
7. Marksteiner, S., Exposito Jimenez, V.J., Valiant, H., Zeiner, H.:
9.4 At least theoretically, how many end devices can a single An overview of wireless IoT protocol security in the smart home
Thread router support? domain. In: 2017 Internet of Things Business Models, Users, and
Networks, pp. 1–8 (2017)
8. Montenegro, G., Schumacher, C., Kushalnagar, N.: IPv6 over
Low-Power Wireless Personal Area Networks (6LoWPANs):
References Overview, Assumptions, Problem Statement, and Goals. RFC 4919
(2007). https://doi.org/10.17487/RFC4919. https://rfc-editor.org/
1. IEEE Standard for Local and Metropolitan Area Networks–Part rfc/rfc4919.txt
15.4: Low-Rate Wireless Personal Area Networks (lR-WPANS) 9. Rescorla, E., Modadugu, N.: Datagram Transport Layer Security
amendment 1: Mac sublayer. IEEE Std 802.15.4e-2012 (Amend- Version 1.2. RFC 6347 (2012). https://doi.org/10.17487/RFC6347.
ment to IEEE Std 802.15.4-2011) pp. 1–225 (2012) https://rfc-editor.org/rfc/rfc6347.txt
2. IEEE Standard for Low-Rate Wireless Networks. IEEE Std 10. ThreadGroup: Thread border routers (2015). https:https://
802.15.4-2020 (Revision of IEEE Std 802.15.4-2015) pp. 1–800 openthread.io/
(2020) 11. ThreadGroup: Thread commisioning (2015). https:https://
3. Alexander, R., Brandt, A., Vasseur, J., Hui, J., Pister, K., Thu- openthread.io/
bert, P., Levis, P., Struik, R., Kelsey, R., Winter, T.: RPL: IPv6 12. ThreadGroup: Thread 1.2 base features (2019). https://openthread.
Routing Protocol for Low-Power and Lossy Networks. RFC 6550 io/
(2012). https://doi.org/10.17487/RFC6550. https://rfc-editor.org/ 13. ThreadGroup: Thread network fundamentals (2020). https://
rfc/rfc6550.txt openthread.io/
4. Alliance, T.Z.: Zigbee cluster library specification (2019). https:// 14. Unwala, I., Taqvi, Z., Lu, J.: IoT protocols: Z-wave and thread. In:
zigbeealliance.org/wp-content/uploads/2019/12/07-5123-06- 2018 IEEE Green Technologies Conference (GreenTech). IEEE,
zigbee-cluster-library-specification.pdf Piscataway (2018)
5. Google/Nest: Openthread (2020). https://openthread.io/
Glossary
6Lo IPv6 over networks of resource-constrained nodes Authentication It dictates that only trusted sources can
refers to the native IPv6 support of constrained IoT transmit data.
devices. Autonomous cells Under 6TiSCH it provides proactive cell
6LoWPAN IPv6 over low-power wireless personal area net- scheduling without any type of negotiation.
works is a mechanism that enables IPv6 over several Backbone Same as core.
constrained IoT link layer technologies. Beamforming It is a signal processing technique to support
Access It is the portion of the network between the devices directional signal manipulation with the goal of minimiz-
and the gateway. ing interference.
Access point (AP) Under IEEE 802.11, it plays the role of BLE Bluetooth Low Energy is a physical and link layer
IoT gateway. technology for transmission of data over wireless chan-
ad hoc A mode of operation of a single BSS. nels. BLE is also known as Bluetooth Smart.
ACK Acknowledgment. Block code It is a mechanism where a payload is partitioned
Active scanning Under IEEE 802.11, a device sends a into chunks of data called messages, and each message,
probe frame indicating the SSID of the BSS it wants to be when controlled redundancy is added, becomes a code-
associated with. word that is used for error control.
Active sensor It is a sensor that emits sounds or generates Bundle Under TSCH, it is a scheme where multiple cells
electromagnetic waves that can be detected by means of carry traffic between two devices.
external observation. Bus A type of network topology.
Actuator It is a logical device that perform some external CBOR The Concise Binary Object Representation intro-
change of an asset of the physical environment. duces a data format that provides small message size and
ADC Analog-to-digital converter. extensibility.
Aggregation It implies that readouts from different sensors Cell Under TSCH, it is the combination of the timeslot and
are collected by a sensor closer to the gateway or cluster- channel.
head. Channel It is the medium that enables the propagation of
ALOHA It is a MAC mechanism that enables devices to signals between devices and applications.
send datagrams without having to wait for the channel to Channel bonding It consists of transmitting frames of the
be free. same physical device over multiple nonoverlapping sub-
AMQP The advanced message queuing protocol is a session channels.
layer protocol, similar to MQTT, that was initially de- Channel capacity theorem It states that the maximum
signed for enterprise applications like financial businesses achievable transmission rate of a communication system
but due to its simplicity and small footprint has become an is a direct function of SNR.
integral part of many IoT solutions. Channel coding It is an optional mechanism that embeds
Application layer Layer that involves application specific FEC information in headers.
services as well as the conversion of information between Channel decoder A communication system component
the digital and analog domain. that removes controlled redundancy to improve reliability
Asset An asset is an element of the environment that an IoT against channel impairments.
device interacts with. Channel encoder A communication system component
At least once One of the reliability modes supported by that adds controlled redundancy to improve reliability
AMQP and MQTT. against channel impairments.
At most once One of the reliability modes supported by Cloud computing Application processing performed at the
AMQP and MQTT. network cloud.
© The Author(s), under exclusive license to Springer Nature Switzerland AG 2022 227
R. Herrero, Fundamentals of IoT Communication Technologies, Textbooks in Telecommunication
Engineering, https://doi.org/10.1007/978-3-030-70080-5
228 Glossary
Cluster A group of devices that interact with a gateway for DECT ULE Digital Enhanced Cordless Telecommunica-
core side communication. tions Ultra Low Energy is a physical and link layer tech-
Clusterhead A gateway associated with a cluster. nology for transmission of data over wireless channels.
CoAP The Constrained Application Protocol is a lightweight Device A device is a sensor, a controller, or an actuator
and highly efficient protocol that enables the management running on small constrained embedded computer.
of IoT sessions. Demodulator A communication system component that re-
CoAP resource discovery It is a distributed mechanism for verses the signal transformation introduced by the modu-
CoAP service discovery. lator.
CoAP resource directory It is a centralized mechanism for Detectability It indicates the probability that a given net-
CoAP service discovery. work section is able to detect a specific asset or physical
Code rate It is defined as the ratio k/n where n is the total phenomenon.
number of transmitted packets (redundant and original) Differential signaling It consists of transmitting data by
and k is the number of original packets. means of two complementary electrical signals that, when
Cognitive radio It is used to dynamically select the portions subtracted at the receiver, minimize noise.
of the spectrum that minimize interference. Directed diffusion It is a flat data-centric routing mecha-
Complex device It is a usually a gateway. nism that relies on response aggregation to accomplish
Confidentiality It implies that information must be power consumption efficiency.
encrypted to make sure that it is inaccessible to Dispatch value Under 6LoWPAN, it is used as datagram
unauthorized users. type indicator.
Confirmable mode A CoAP transmission mode that com- Distribution services Under IEEE 802.11, they deal with
pensates the inherent lack of reliability of UDP transport. station services that span beyond communication between
Continuous A type of DNS query that is made by fully devices in a given BSS.
compliant mDNS queriers and responders in order to Distribution system Under IEEE 802.11, it provides the
support asynchronous operations like IoT load balancing. backbone for connectivity to applications performing an-
Controller It is a logical device that performs some internal alytics.
change in the physical device to assist sensing or actua- DNS Domain name system is a well-established IP suite
tion. protocol that is mainly used for address resolution.
Convolutional code It is similar to a block code, but it DODAG A destination-oriented directed acyclic graph is a
operates on continuous streams of bits instead of on blocks graph used under RPL that enables devices to keep track
of bits. of the routing topology.
Cookie It is an add-on mechanism that can be used to DTLS Datagram Transport Layer Security is the preferred
introduce a state in the interaction between clients and security mechanism in the context of 6LoWPAN and other
servers. IoT technologies.
Core It is the portion of the network between the gateway DV Distance vector routing consists of devices sending their
and the application. entire routing tables to their connected neighbors.
CPS A cyber-physical system represents the interaction be- Downlink Direction from application to device.
tween a device and an asset. Duty cycle It refers to devices that sleep in order to reduce
CSMA/CA Carrier sense multiple access with collision power consumption at preprogrammed intervals.
avoidance is a MAC mechanism. Endpoint It is a network component also known as host that
CSMA/CD Carrier sense multiple access with collision de- serves as the source or destination of messages.
tection is a MAC mechanism. End-to-end principle It states that, whenever possible, cer-
D7AP The DASH7 Alliance Protocol is an open source tain functions like security must be deployed on an end-
protocol stack that enables LPWAN communications. to-end basis typically at the application layer.
DAC Digital-to-analog converter. Ethernet It is a physical and link layer technology for
Data-centric routing It involves clients sending queries to transmission of data over wireline channels.
a specific network regions in order to retrieve a specific Exactly once One of the reliability modes supported by
readouts and data associated with specific capabilities. AMQP and MQTT.
Data mining Knowledge extraction mechanism. Exposed station It results from station C transmitting to
Data-information conversion Stage intended to lower station D and preventing station B to transmit to station
throughput in order to optimize channel utilization and A.
lower power consumption to extend battery life. FEC Forward error correction is a mechanism that helps
Datagram Name of a packet that is processed by a network detecting and correcting errors due to channel distortion.
layer.
Glossary 229
Flat architecture It is an architecture where all functions IEEE 802.15.4k It is a standard for low energy, critical
are performed by a single layer. infrastructure monitoring applications that relies on the
Flat routing It relies on devices interacting with each other 2.4 GHz, the 915/868 MHz, and the 433 MHz ISM bands
without a single device acting as parent that concentrates for transmission.
and aggregates traffic of children devices. IEEE 802.15.4g It is a new standard that targets smart me-
Flooding It is a routing mechanism that is based on devices tering applications like gas metering.
forwarding received datagrams through all possible neigh- IIoT Industrial Internet of Things is a term associated with
bors. IoT in the context of industrial applications.
Flow label IPv6 field that identifies the datagram as part of Industry 4.0 See IIoT.
a flow of datagrams. Information-knowledge conversion Stage where informa-
Fog computing Application processing performed at a tion is processed by the application to generate knowl-
gateway. edge.
Forwarding It involves moving a datagram from an incom- Infrastructure A mode of operation of a single BSS.
ing to an outgoing link in a device or router. Integrity It implies that the received messages are not al-
Frame Name of a packet that is processed by a link layer. tered in transit.
Framing It is a generic technique that consists of adding IoT Internet of Things is a term used to describe tech-
fields and special synchronization markers to data propa- nologies, protocols, and design principles associated with
gated down from upper layers. Internet-connected things that are based on the physical
G3-PLC PLC standard. environment.
Gateway It is a logical device that serves as an interface be- IP Internet Protocol. It is a network layer protocol and
tween access side IoT devices and core side applications. fundamental building block for IoT communication.
Gossiping It is an alternative to flooding that relies on IPSec/IKE IP security/Internet Key Exchange are IP-based
intermediate devices forwarding a received datagram to security mechanisms.
a single randomly selected neighbor. IQRF It is an open LPWAN framework that includes de-
Hidden station It results from stations A and C transmitting vices, gateways, and applications addressing scenarios
simultaneously to station B and not detecting each other ranging from telemetry and industrial control to home and
since they are out of range. building automation.
Hierarchical routing It groups devices in clusters with ISM Instrument, scientific, and medical bands are unli-
clusterheads that acting as parent devices concentrate and censed spectral bands used in many IoT wireless solutions.
aggregate traffic of children devices. ITU-T G.9903 PLC standard.
HIP Host Identity Protocol is an IP-based security mecha- ITU-T G.9959 It is a physical and link layer technology for
nism. transmission of data over wireless channels.
HOL Head-of-line blocking occurs when the processing of ITU-T H.265 Video codec.
a request prevents other responses from being transmitted. JTAG Joint Test Action Group standardized as IEEE
Hop limit IPv6 field that provides a counter that is decre- 1149.1. It is used to perform a boundary-scan of an
mented as the datagram is forwarded throughout the net- integrated circuit to enable circuit testing
work. Known answer suppression It is a mechanism by which
HTTP The HyperText Transfer Protocol is an application known answers are suppressed by not being transmitted.
protocol that enables the management of IoT sessions. Layered architecture A communication architecture that
Specifically, it provides session layer management of web segments functionality into different layers.
applications including client and server support. LDPC Low-density parity-check. Block code.
Hyperspectral image Images made of data cubes that in- LEACH Low-energy adaptive clustering hierarchy is a hier-
clude a few dozens of spectral bands. archical routing mechanism that by means of aggregation,
IEEE 1901.2 PLC standard. it transmits device data to an application that acts as a sink.
IEEE 802.2 LLC protocol that is transported on top of Line code It is used to modulate digital bits of a link layer
standard IEEE 802.3. frame into an electrical signal that can be transmitted over
IEEE 802.3 Ethernet standard. the channel.
IEEE 802.11 It is a physical and link layer technology for Linear regression Knowledge extraction mechanism.
transmission of data over wireless channels. Link Network component that connects endpoints and
IEEE 802.11ah An IEEE 802.11 developed for generic IoT routers.
support. Link layer Layer that provides error control mechanisms
IEEE 802.15.4 It is a physical and link layer technology for for reliable transmission of information over the channel.
transmission of data over wireless channels.
230 Glossary
LLN Low-power and lossy network typically associated Modulator A communication system component that trans-
with IoT. forms a signal for efficient transmission over the channel.
LOADng Lightweight On-demand Ad hoc Distance Vector MQTT Message Queue Telemetry Transport is a protocol
Next Generation is a technology that provides reactive flat that enables the management of IoT sessions.
routing in LLNs. MS/TP Master-Slave/Token-Passing is a physical and link
LoRa Long range is the generic name for a full protocol layer technology for transmission of data over wireline
stack that provides LPWAN capabilities that enables de- channels.
vices to run on a single battery for more than 10 years. Multipath It is a scenario that usually results in signal
LoRaWAN It is the LoRa networking mechanism that en- fading that causes network packet loss.
ables devices to access the channel. Nagle’s algorithm It is a mechanism by which TCP na-
Location-based routing It consists of a client or device tively buffers packet payloads until it has enough data to
transmitting datagrams to another client or device by for- make it efficient to send a datagram.
warding the traffic based on the geographical or physical NB-Fi Narrowband fidelity is an open full-stack protocol
location of the destination. that is the base of a commercial LPWAN turn-key solution
Logical devices Software-based devices than run on physi- that includes devices and networks.
cal devices. NB-IoT Narrowband IoT is an LPWAN technology based
LPWAN A low-power wide-area network is an IoT network on cellular communications and first introduced in the
associated with very low transmission rates (up to 50 3GPP Release 13.
Kbps) over long distances (in the order of kilometers) ND Neighbor discovery provides communication with hosts
LS Link state routing consists of devices sending the state and routers to enable connectivity beyond the local link.
of their links to all the devices in the network. Neighbor discovery attack It is an attack where neighbor
LTE-M Standardized together with NB-IoT as part of the discovery messages typically used in the context of
3GPP Release 13, LTE-M, also known as LTE Cat M1 is a WPANs are either dropped or corrupted in order to induce
simplified version of 4G LTE that attempts to provide IoT reachability issues.
support by reducing power consumption while extending Network layer Layer that ensures that information packets
signal coverage. are delivered to the destination.
M2M Machine-to-machine communication refers to mech- Next header IPv6 field that specifies the protocol under
anisms that enable simple interaction between devices and which the payload is encoded.
applications. In most cases, these mechanisms are neither NFC Near-Field Communications is a physical and link
standardized nor Internet-based. layer technology for transmission of data over wireless
MAC Media access control is a set of rules that determine channels.
how frames are received and transmitted over the physical Node coverage It presents the level of device redundancy
channel. available to capture data if a sensor failure occurs.
Machine learning Knowledge extraction mechanism. Non-beacon mode It is an IEEE 802.15.4 mode of trans-
MANET Mobile ad hoc network. mission when they are infrequent enough that contention
Master-slave A type of network topology. based access results in a lack of collisions.
mDNS Multicast DNS provides an alternative to traditional Non-confirmable mode A CoAP transmission mode that is
DNS by addressing some of the limitations of the latter in based on a fire-and-forget approach where messages are
the context of IoT. sent without expecting any acknowledgment.
Mesh-under It is forwarding that occurs in the 6LoWPAN Non persistent An HTTP session that relies on a single TCP
layer. connection for each transaction.
Media It refers to the transmission of the audio, speech, Non-storing node It is a node where a device does not store
video, and images. prefix information from all its children
Message Name of a packet that is processed by an applica- Nwave It is a commercial LPWAN solution intended mobile
tion layer. devices associated with smart parking.
MIMO multiple input-multiple output is a type of multi- Observation It is a feature associated with REST that en-
antenna. ables an observed device to transmit readouts whenever
Mission planner Application that resides at a ground sta- parameter changes are detected.
tion and calculates flight paths of UAVs. OFDM Orthogonal frequency division multiplexing is
Mist computing Application processing performed at a de- mechanism that enables the modulation of binary streams
vice. in communication channels.
Modulator A communication system component that trans- On-shot A type of query that is typically associated with
forms a signal for efficient transmission over the channel. legacy DNS queriers and responders.
Glossary 231
OPC UA The Open Platform Communications United Ar- Reactive routing It relies on dynamic on-demand building
chitecture provides a protocol stack that complies with the of routes from sources to specific destinations by relying
request/response paradigm. on route discovery queries that flood the network.
Packet A basic unit of data transmitted in packet switched Reliable delivery It is an optional mechanism that provides
networks. the infrastructure to signal and support retransmissions.
Packet bursting It consists in buffering a number frames Request/response This model bases its interaction between
before transmitting them all together in order to lower application and device by means of requests and
average channel contention delay. responses.
Packetization To chunk a media stream into several pack- Responder Also known as DNS server or answerer, it re-
ets. sponds to queries.
PAN coordinator In the context of IEEE 802.15.4 and other REST It is an architecture that formalizes a series of require-
technologies, it is the device that plays the role of gateway. ments and interfaces that are necessary for client/server
Passive scanning Under IEEE 802.11, it consists of devices interaction.
sequentially listening for beacon frames transmitted by Route-over It is routing that occurs above the 6LoWPAN
other devices over channels. layer.
Passive sensor It is a sensor that is not active. Router It is a network component that assists in the propa-
PEGASIS Power-Efficient Gathering in Sensor Informa- gation of messages throughout the network.
tion Systems is a hierarchical routing mechanism that Routing It involves determining a route or path that data-
relies on data aggregation. grams must follow from source to destination.
Persistent An HTTP session that relies on a single TCP Routing information spoofing It is an attack where the in-
connection for all transactions. truder spoofs, alters, or replays routing information in
Physical layer Layer that is dedicated to the transmission order to create loops that lead to datagram loss.
and reception of data over the channel including the con- RPL Routing for low power is a hierarchical and IPv6
version of information between the digital and the analog address centric routing protocol.
domains. RPMA is a media access scheme that serves as the base of
Physical devices Hardware-based devices. a robust LPWAN technology.
Piconet A type of network topology. RTCP Real-time control protocol is used to provide quality
PID A proportional integral derivative is a control loop control over media streams.
mechanism that relies on feedback. RTP Real-time protocol is the preferred standard for the
PLC Power line communication is a physical and link layer transmission of media. RTP sessions are typically estab-
technology for transmission of data over wireless chan- lished by means of SIP.
nels. SCADA Supervisory control and data acquisition is an in-
Presentation layer Layer that provides formatting of infor- dustrial control system architecture.
mation for further processing including security exten- Scatternet A type of network topology.
sions for encryption and decryption. Schedule Under TSCH, a schedule specifies what devices
Proactive routing It consists of building routing tables that communicate with each other.
ultimately define forwarding behavior by means of the SD-DNS It is a standard that it is used with mDNS to provide
periodic transmission of routing information across all service discovery.
nodes in the network. Scrambler A mechanism that randomizes in a controlled
Proxy server It is a device that sits between client applica- fashion the sequence of transmitted bits.
tions and sensors and devices acting as servers in order to Segment Name of a packet that is processed by a transport
respond to client requests on behalf of these servers. layer.
Publish/subscribe A model that relies on a broker that Sensor It is a logical device that interacts with the environ-
queues and delivers messages between an application and ment by sampling and generating readouts.
a device. Selective forwarding It is an attack where an affected de-
Qowisio It is a UNB turn-key commercial LPWAN solution vice only forwards certain datagrams in order to cause
supporting a wide range of applications ranging from connectivity problems.
asset tracking and management to lighting and power SigFox It is an LPWAN protocol stack that relies on an
monitoring. unique commercial network called SigFox.
Querier Also known as resolver or questioner transmits a Signaling It refers to the exchange of information between
query that is answered by the mDNS server. entities in order to establish a session.
Simple device It is a basic sensor, actuator, or controller.
232 Glossary
Sinkhole attack It is an attack where an affected device SNOW Sensor network over white spaces is an experimen-
attempts to become the destination of all traffic in a certain tal LPWAN technology that relies on transmission over
location. white space spectrum with modulation over unoccupied
SIP The Session Initiation Protocol provides a mechanism frequency guard bands between TV channels typically
to create, manage, and finish sessions. between 547 and 553 MHz.
Slotframes Under TSCH, timeslots are grouped into slot- Star A type of network topology.
frames that are periodically transmitted. Synchro It is a variable coupling transformer where the
Source decoder A communication system component that magnitude of the magnetic coupling between the primary
performs, among other things, digital to analog conver- and secondary varies in accordance to the position of a
sions. rotable element.
Source encoder A communication system component that Telensa It is a fully proprietary LPWAN technology that
performs, among other things, analog to digital conver- focuses mainly on smart city applications with emphasis
sions. on smart lighting and smart parking as it does not support
SPIN Sensor protocols for information via negotiation is indoor communications.
a flat data-centric routing mechanism that through data Thread It is a protocol stack, an architecture and a frame-
negotiation and resource adaptation enables devices to work that support IoT home automation.
forward datagrams from a source to a sink in a much more Traffic class IPv6 field that provides QoS information.
controlled and more energy efficient way than flooding Transmission rate Rate at which an application generates
and gossiping. rate. Measured in units of bps.
Spreading factor In SS, spreading factor or processing gain Transport layer Layer that provides support of multiplex-
is the ratio between the symbol width and the chip width. ing of traffic from different applications.
SS Spread spectrum is mechanism that enables the modula- Turbo code Block code.
tion of binary streams in communication channels. Uplink Direction from device to application.
Stateful compression It relies on associating redundant in- UPnP The Universal Plug and Play architecture provides a
formation in uncompressed IPv6 headers with a context framework for the discovery of network elements rang-
identifier that is transmitted in the datagrams instead. ing from computers and printers to gateways and access
Stateless compression It is a compression mechanism that points.
is simple, and, as opposed to stateful compression, it does Weightless It is an LPWAN protocol stack that relies on
not require to keep track of the state of inter-datagram transmissions over the white space spectrum.
redundancy. Wormhole attack It is an attack where the attacker captures
Station Under IEEE 802.11, it plays the role of IoT access datagrams in one location and retransmits them in another
device. leading to routing and connectivity problems.
Station services Under IEEE 802.11, they deal with authen- WPAN A wireless personal area network is an IoT network
tication and privacy between devices. that comparatively provides higher transmission rates (in
Storing node It is node where a device stores prefix infor- the order of Mbps) but supports shorter distances (in the
mation from all its children. order of hundreds of meters).
SWD Serial Wire Debug is used to perform a boundary-scan WSN Wireless sensor network a term that designates a
of an integrated circuit to enable circuit testing system of very large number of wireless sensors that
Sybil attack It is an attack where a single device assumes interact with an application that monitors events and other
multiple identities in order to become a destination of phenomena occurring in the physical environment.
many other nodes in the network. WSN category 1 A type of network topology that includes a
Reed-Solomon Block code. very large and highly dense deployment of devices. Trans-
REST Representational state transfer is an architecture mission is multi-hop with communication from devices
where transactions are destined to optimize the interaction to gateways relying on intermediate sensors and actuators
of the entities involved in the communication. forwarding and aggregating packets.
Ring A type of network topology. WSN category 2 A type of network topology that is very
RS-232 Recommended Standard 232 defines signals con- simple and includes fewer devices that directly connect to
necting terminals and other equipment. a single gateway.
RS-485 Recommended Standard 232 defines signals con- XMPP The eXtensible Messaging and Presence Protocol
necting terminals and other equipment. is an application layer protocol that loosely follows the
Session layer Layer that is in charge of managing multiple REST paradigm.
sessions between applications.
Glossary 233
Zero-configuration Mechanism where network deploy- ZDP The ZigBee Device Profile provides device discovery
ment and provisioning are carried out without human services through specific commands.
intervention. ZigBee Protocol stack with IEEE 802.15.4-based physical
ZCL The ZigBee Cluster Library is a standard mechanism and link layers.
for ZigBee devices to exchange data.
Index