You are on page 1of 423

CS578: Internet of Things

Introduction to IoT
Definitions, Characteristics, Applications

Dr. Manas Khatua


Assistant Professor, Dept. of CSE, IIT Guwahati
E-mail: manaskhatua@iitg.ac.in

“I have no special talent. I am only passionately curious.” – Albert Einstein


What is IoT?
 Internet of Things (IoT) is the network of physical objects — devices, vehicles,
buildings and other items – embedded with electronics, software, sensors, and
network connectivity that enables these objects to collect and exchange data.

 The basic premise and goal of IoT is to “connect the unconnected”


 “Things” or objects that were not supposed to be connected to the Internet

 IoT is a technology transition in computer network


 allow us to sense and control the physical world by making
objects smarter and connecting them through network
 Automation system and connected devices work together to
provide a world where data can be collected and analyzed

18-11-2020 Dr. Manas Khatua 2


Cont…
• Unifications of technologies:
• Embedded systems,
• Low power and low rate network,
• Internet,
• Big data,
• Data analytics,
• Cloud computing,
• Software defined networks,
• Etc.

• Alternate Definition:

“The Internet of Things (IoT) is the network of physical objects that contain
embedded technology to communicate and sense or interact with their internal
states or the external environment.” – Gartner Research*

* https://www.gartner.com/en/information-technology/glossary/internet-of-things

18-11-2020 Dr. Manas Khatua 3


Genesis of IoT
 The term "Internet of things" was likely coined by Kevin Ashton of Procter &
Gamble, later MIT's Auto-ID Center, in 1999.
 “In the twentieth century, computers were brains without senses — they only knew
what we told them.” IoT is changing this paradigm; in the twenty-first century,
computers are sensing things for themselves! – Kevin Ashton

Evolutionary Phases of the Internet


18-11-2020 Dr. Manas Khatua 4
Benefits of IoT
 To the End User

• Ease of Doing • Emergency • Security


Things Services Services

 To the Businesses

• Process • Asset • New Market • Workplace


Improvement Utilization Opportunities Security

18-11-2020 Dr. Manas Khatua 5


IoT vs. WSN
• Wireless Sensor Network (WSN):

– WSN refers to a group of specialized dedicated sensors with a communications


infrastructure.

– WSN is primarily used for monitoring and recording the physical environment
conditions like temperature, sound, pollution levels, humidity, wind, and so on.

– It is designed to acquire, process, transfer, and provide data/information extracted


from the physical world.

– In a WSN, there is no direct connection to the internet. Instead, the various sensors
connect to some kind of router or central node.

• WSN: Resource constraint sensor nodes + wireless network to connect the


nodes + gather some data by sensing the environment.

• IoT: WSN + Internet + App + Cloud computing + Data Analytics + etc…

18-11-2020 Dr. Manas Khatua 6


Growth of IoT Devices vs. Global Population

Cisco System’s prediction

• In 2017, Cisco Systems estimates that these new connections will lead to $19 trillion in
profits and cost savings
18-11-2020 Dr. Manas Khatua 7
Where is IoT?
Wearable
Tech Devices

Smart Appliances

It’s everywhere!

Industry Automation
and Monitoring
Healthcare
18-11-2020 Dr. Manas Khatua 8
Global IoT Market Share
14% Smart Homes Retail < 2%

3%
Wearables Smart Utilities
& Energy
4%

7%
Industrial IoT
Connected Cars
24%

20%* Healthcare 20%*


Personal Health
Smart Cities 26%
Source: https://growthenabler.com/flipbook/pdf/IOT%20Report.pdf

18-11-2020 Dr. Manas Khatua 9


Smart City

Source: https://depositphotos.com/126025652/stock-illustration-smart-city-concept-and-internet.html

18-11-2020 Dr. Manas Khatua 10


Smart Home

Source: https://medium.com/@globalindnews/north-america-accounted-for-major-share-in-the-global-smart-home-healthcare-market-in-2015-cc9cc1974ac5

18-11-2020 Dr. Manas Khatua 11


Smart Healthcare

Source: http://iot.fit-foxconn.com/

18-11-2020 Dr. Manas Khatua 12


Smart Manufacturing

Source: https://data-flair.training/blogs/industrial-iot-applications/

18-11-2020 Dr. Manas Khatua 13


Industrial IoT

Source: https://www.winmate.com/Solutions/Solutions_IoT.asp

18-11-2020 Dr. Manas Khatua 14


Connected Cars

Source: Vehicular K. Ziadi, M. Rajarajan, “Internet:


Security & Privacy Challenges and Opportunities”,
Future Internet 2015, 7(3), 257-275.

18-11-2020 Dr. Manas Khatua 15


Google’s Self-Driving Car

Source: https://www.google.com/

18-11-2020 Dr. Manas Khatua 16


Smart Agriculture

Source: https://in.pinterest.com/pin/515380751093603767/?lp=true

18-11-2020 Dr. Manas Khatua 17


Livestock Management

Source: https://data-flair.training/blogs/iot-applications-in-agriculture/

18-11-2020 Dr. Manas Khatua 18


Many More ….

Source: Rajiv Ranjan et. al., “Integrating the IoT


and Data Science” IEEE Cloud Computing, 2018

18-11-2020 Dr. Manas Khatua 19


How IoT works?

Source: Rajiv Ranjan et. al., “Integrating the IoT


and Data Science” IEEE Cloud Computing, 2018

18-11-2020 Dr. Manas Khatua 20


Main Challenges in IoT
Sensors Scale Privacy Security
• Limited resources • millions of devices • which personal • “things” becomes
• Limited types of are connected to data to share connected, so
sensors form IoT with whom security becomes
• how to control complex

Low Power Big data and


Network Data analytics
• Devices should remain connected to the • massive amount of sensor data
Internet for years • different sources and various forms
• High network latency • extract intelligence form the heaps of data

Interoperability
• various protocol, various architecture
• unavailability of standardized platform
• different technology leads to interoperability issue
• Recent IoT standards are minimizing this problem

18-11-2020 Dr. Manas Khatua 21


Lessons Learned

 Learned about what is IoT

 Learned the genesis of IoT

 Understand the benefits of IoT

 Learned about the market share of IoT

 Understand the real world applications of IoT

 Understand various challenges IoT implementation is facing

18-11-2020 Dr. Manas Khatua 22


Figures and slide materials are taken from the following Books:

1. David Hanes et al., “IoT Fundamentals: Networking Technologies, Protocols,


and Use Cases for the Internet of Things”, 1st Edition, 2018, Pearson India.

2. Mayur Ramgir, “Internet of Things: Architecture, Implementation and Security”,


1st Edition, 2020, Pearson India.

18-11-2020 Dr. Manas Khatua 23


CS578: Internet of Things
IoT Ecosystem
Different components of IoT

Dr. Manas Khatua


Assistant Professor, Dept. of CSE, IIT Guwahati
E-mail: manaskhatua@iitg.ac.in

“Strength is Life, Weakness is Death.” – Swami Vivekananda


IoT Ecosystem
IoT is not just a technology; it is an enormous ecosystem!

• Community components:
 IoT Frameworks
• Tools needed to design and implement IoT-based solutions and products

 IoT Architectures
• Graphical structure of the designed IoT-based solutions and products

 IoT Core
• Sensors & Actuators, microcontrollers, internet connectivity, service platform including security

 IoT Gateway
• It carries the responsibility to ensure bidirectional communication between IoT protocols and other networks

 Cloud
• Accepts, accumulates, maintains, stores, and process data in real time

 Analytics
• It indulges in conversion of data which results in meaningful suggestions and recommendations

 User Interface / Visualization


• Design sleek, visually appealing, interactive, and ease-of-use graphical user interface

13-09-2020 Dr. Manas Khatua 2


IoT Framework
• Framework provides a development environment.

– It provides appropriate infrastructure to design and implement the architecture

• IoT framework comprises of large number of components

– sensors, sensor systems, gateways, mobile app, embedded controller, data management
platform, analytical platform, and so on.

– support interoperability among all devices, provides secure connectivity, reliability in data
transfer, interface to 3rd party application to built on it, and so on.

Few IoT Framework Few IoT Framework


RTI (Real-Time Innovations) Connext DDS Cisco Ultra IoT
Salesforce IoT cloud Azure IoT
Eclipse IoT ThingWorx
GE (General Electronic) Predix AWS IoT
Watson IoT Kaa

13-09-2020 Dr. Manas Khatua 3


Salesforce IoT Cloud
• Salesforce IoT Framework
– Combines IoT and big data

• A new data is sent to Kafka,


where Spark is responsible
to transmit it to Cassandra
for further processing.
• Meanwhile, Storm analyses
the dataset to formulate
responses for current events

• The backbone of these


technologies:
– Salesforce’s Heroku PaaS
– AWS Cloud
– Apache Technologies and
Thunder event-processing
engine

13-09-2020 Dr. Manas Khatua 4


IoT Network Architecture
 At present, Network plays important role in business

 It should never be built without careful planning

Driving forces:
 Scale
Security
Constrained devices
Massive data
Data analysis
Support to legacy devices
• Architecture is how you design (i.e. graphical
structure) your application or solution.

13-09-2020 Dr. Manas Khatua 5


oneM2M IoT Architecture
• Proposed by Européen Telecommuinications Standards Institute (ETSI)

• Goal : to create a common services layer, which can be readily embedded in field
devices to allow communication with application servers.

13-09-2020 Dr. Manas Khatua 6


IoTWF Architecture
• IoTWF architectural committee (led by Cisco, IBM, Rockwell Automation, and others)

• Way of visualizing IoT from a technical / functional perspective

13-09-2020 Dr. Manas Khatua 7


IoT Gateway
• It is a physical device or software
program that serves as the connection
point between the two different types
of networks

• Provide bidirectional communication


 Between IoT protocols and other
networks
• e.g. Zigbee <--> Ethernet

• Sometimes programmed to execute


some processing operations
 Edge computing

• It is necessary to maintain security to a


certain extent
 Can shield the entire IoT systems from
any cyberattack

Source: B. Kang, D. Kim, H. Choo, “Internet of Everything: A Large-Scale Autonomic IoT Gateway”,
IEEE Transactions on Multi-scale Computing Systems, vol. 3, no. 3, 2017, pp. 206-214.

13-09-2020 Dr. Manas Khatua 8


Cloud
• IoT generates vast amount of Big Data;
• this in turn puts a huge strain on
Internet Infrastructure.

• Cloud can facilitate to


– Provide different services
– Store huge amount of data
– Process the data efficiently

• Benefits of Cloud Platform in IoT


– Network Scalability
– Data Mobility
– Time to market
– Security
– Cost-effectiveness

13-09-2020 Dr. Manas Khatua 9


Core Components of IoT

• Sensors - to gather data and events

• Actuators – responsible for moving and


controlling a mechanism or system
Sensors & Internet • Microcontrollers - automatically controls
Actuators Connectivity sensors and actuators; makes them smart

• Internet connectivity – responsible for


sharing gathered information and control
Micro Service command
controllers Platform
• Service Platform – ability to deploy and
manage the IoT devices and applications
including data management, data analytics
and all aspects of security

13-09-2020 Dr. Manas Khatua 10


“Things” in IoT – Sensors

MQ135 - Air Quality Sound Detection DHT11 - Temperature PIR Motion Detector
Gas Sensor Sensor and Humidity Sensor Sensor

Pulse Sensor Ultrasonic Distance IR Sensor


LDR Light Sensor
Sensor

13-09-2020 Dr. Manas Khatua 11


“Things” in IoT – Actuators

4 Channel 5V Relay Servo Motor DC Motor Solenoid valve

LED LCD
Linear Actuators

13-09-2020 Dr. Manas Khatua 12


Connecting Smart Objects
Communication Criteria IoT Access Technologies
 Range
 Frequency Bands
 Power Consumption
 Topology
 Constrained Devices
 Constrained-Node
Networks

13-09-2020 Dr. Manas Khatua 13


Comparison of Key Attributes
WiFi BLE Thread Sub-GHz: TI Sigfox Zigbee LoRa
Max. Data 72 Mbps 2 250 200 100 250 50
throughput Mbps Kbps Kbps bps Kbps Kbps
Range 100 m 750 m 100 m 4 km 25 km 130 m 10 km
Topology Star P2P/ Mesh/ Star Star Mesh/ Star of Star
Mesh Star Star
Frequency 2.4 GHz 2.4 GHz 2.4 GHz Sub-GHz Sub-GHz 2.4 GHz Sub-1GHz
Power 1 Year (AA Up to years on a coin-cell battery for limited range Few Years
consumption battery) (AA battery)
IP at the Yes No Yes No No No No
device node
Deployed AP smart No No No No No
Devices phones

Source: Nick Lethaby “Wireless Connectivity for the IoT: one size does not fit all”, Texas Instruments, 2017

13-09-2020 Dr. Manas Khatua 14


Utilizing IP for IoT
Key Advantages of IP
 Open and standard-based
 Versatile
 Ubiquitous
 Scalable
 Manageable
 Highly secure
Stable and resilient

• IPv6 packets require a minimum MTU/PDU size of 1280 bytes.


• The maximum size of a MAC layer frame in IEEE 802.15.4 is 127 bytes.
– It gives just 102 bytes for an IPv6 packet !!

Need of packet/frame size optimization due to


 Constrained Nodes
 Constrained Networks

13-09-2020 Dr. Manas Khatua 15


Modification in TCP/IP Stack

• WPAN: Wireless Personal Area Networks


• IEEE 802.15.4: Low-rate WPAN In 6TiSCH IoT Network

• LoWPAN: Low-Power WPAN


• 6LoWPAN: IPv6 over LoWPAN
• TSCH: Time Synchronized Channel Hopping
• 6TiSCH: IPv6 over the TSCH mode of IEEE 802.15.4e
• 6top: 6TiSCH Operation Sublayer
13-09-2020 Dr. Manas Khatua 16
Application Layer

13-09-2020 Dr. Manas Khatua 17


6TiSCH Protocol Stack

13-09-2020 Dr. Manas Khatua 18


AI for IoT
• AI focuses on putting human intelligence in machine
• It gives the ability to a machine/program to think and learn by itself

Use of AI in IoT:
• Smart Home
– Automated HVAC control

• Industrial IoT
– Predictive maintenance
– Optimized supply chain

• Farming
– Smart farming
– Interruption warning

• Self-driving Car
– Mimic human driving on road

• Health
– Auto-diagnosing any disease
– Assistive healthcare

13-09-2020 Dr. Manas Khatua 19


Data Analytics in IoT
“Data Analytics + IoT => Smart Business Solutions”

 The business value of IoT is not just in the ability to connect devices, but it
comes from understanding the data these devices create.
Challenges:
Huge Volume
Real-time data flow
Variety of data types
e.g. XML, video, SMS
 Unstructured data
 Variable data model and
meaning / value

 IoT analytics is the application of data analysis tools and procedures to realize
value from the huge volumes of data generated by connected IoT devices

13-09-2020 Dr. Manas Khatua 20


Securing IoT
• Both the IoT manufacturers and their customers didn’t care about the security !

Unauthorized access to IoT devices Unauthorized access to IoT network

Source:https://www.theguardian.com/technology/2016/oct/26/ddos-
attack-dyn-mirai-botnet Source:http://metropolitan.fi/entry/ddos-attack-halts-heating-in-
finland-amidst-winter

Major cyber attack disrupts internet DDoS attack halts heating in


service across Europe and US; Finland amidst winter;
October 26, 2016 November 7, 2016

13-09-2020 Dr. Manas Khatua 21


Cont…
• US Military’s Defense
Advanced Research Projects
Agency (DARPA) demonstrates
hacking smart “Things”

Source: https://www.youtube.com/watch?v=7E1WsdODxu0

Source: https://www.youtube.com/watch?v=4oONdV5RYp8

13-09-2020 Dr. Manas Khatua 22


User Interface
• Information made available to the end-users

• Users can actively check and act in for their IOT system

Important
Characteristics:

 Sleek design

 Visually appealing

 Interactive UI

 Ease-of-use

 Handy

Source: https://data-flair.training/blogs/how-iot-works/

13-09-2020 Dr. Manas Khatua 23


Lessons Learned

 What is IoT Ecosystem  IoT Gateway

 What are different components  Use of Cloud in IoT

 What is IoT Framework  Data Analytics in IoT

 Sensors & Actuators  AI for IoT

 IoT Architecture  Security in IoT

 IoT Access Technologies  User Interface for IoT

13-09-2020 Dr. Manas Khatua 24


Figures and slide materials are taken from the following Books:

1. David Hanes et al., “IoT Fundamentals: Networking Technologies, Protocols,


and Use Cases for the Internet of Things”, 1st Edition, 2018, Pearson India.

2. Mayur Ramgir, “Internet of Things: Architecture, Implementation and Security”,


1st Edition, 2020, Pearson India.

13-09-2020 Dr. Manas Khatua 25


CS578: Internet of Things

IoT Architecture

Dr. Manas Khatua


Assistant Professor, Dept. of CSE, IIT Guwahati
E-mail: manaskhatua@iitg.ac.in

“We must have life-building, man-making, character-making assimilation of ideas.” – Swami Vivekananda
Architectural Plan
Smart Home
 Networks run the modern
business

 It should never be built without


careful planning

 Architecture is how you design


(i.e. graphical structure) your
application or solution.

Driving forces:
 The key difference between the IT and IoT is  Scale
sensor & data  Security
 Constrained devices
 Massive data
 Essence of IoT architecture:
 Data analysis
 how the data is
 transported,  Support to legacy
 collected, devices
 analyzed, and
 ultimately acted upon.

26-09-2020 Dr. Manas Khatua 2


Traditional Data Flow in IoT

Image Source: Rajiv Ranjan et. al., “Integrating the IoT and Data Science” IEEE Cloud Computing, 2018

26-09-2020 Dr. Manas Khatua 3


IoT Architecture
• In the past several years, architectural standards and frameworks have emerged
• Two best-known architectures: oneM2M and IoT World Forum (IoTWF)

Goal of M2M architecture:


• to create a common architecture that would
help accelerate the adoption of M2M
applications and devices.

Goal of oneM2M architecture:


• to create a common services layer, which
can be readily embedded in field devices to
allow communication with application
servers.

• Applications: smart metering, smart grid,


smart city, e-health, etc.

26-09-2020 Dr. Manas Khatua 4


IoT Architecture
• In the past several years, architectural standards and frameworks have emerged
• Two best-known architectures: oneM2M and IoT World Forum (IoTWF)

Goal of M2M architecture: Challenges in IoT Architecture:


• to create a common architecture that would • heterogeneity of devices,
help accelerate the adoption of M2M • heterogeneity of software,
applications and devices. • Heterogeneity of access
methods
Goal of oneM2M architecture:
• to create a common services layer, which • Example: connecting two
can be readily embedded in field devices to systems - BACnet system that
allow communication with application the HVAC and BMS run; and
servers. LoRaWAN technology that the
sensor network uses
• Applications: smart metering, smart grid,
smart city, e-health, etc.

26-09-2020 Dr. Manas Khatua 5


oneM2M Architecture
• Proposed by European Telecommunications Standards Institute (ETSI)
• oneM2M architecture divides IoT functions into three major domains.
First

• Defines application-layer protocols

• Attempts to standardize northbound


API definitions for interaction with
business intelligence (BI) systems

• A northbound interface allows a


particular component of a network to
communicate with a higher-level
component.

• Applications have their own sets of


data models

26-09-2020 Dr. Manas Khatua 6


oneM2M Architecture
• Proposed by European Telecommunications Standards Institute (ETSI)
• oneM2M architecture divides IoT functions into three major domains.
First Second
• horizontal framework
across the vertical
industry applications.

• Include:
• the physical
network that the
IoT applications
run on. (e.g.
backhaul network)
• the underlying
management
protocols
• the hardware

26-09-2020 Dr. Manas Khatua 7


oneM2M Architecture
• Proposed by European Telecommunications Standards Institute (ETSI)
• oneM2M architecture divides IoT functions into three major domains.
First Second
• top is the common
services layer

• This layer adds APIs and


middleware supporting
third-party services and
applications.

• Service layer can be


readily embedded within
various hardware and
software nodes

• A RESTful API uses HTTP


requests to GET, PUT,
POST and DELETE data.
26-09-2020 Dr. Manas Khatua 8
oneM2M Architecture
• Proposed by European Telecommunications Standards Institute (ETSI)
• oneM2M architecture divides IoT functions into three major domains.
First Second Third

IoT devices,
communicat
ion network
(802.15.4,
LoRa, WiFi)

26-09-2020 Dr. Manas Khatua 9


IoTWF Architecture – 7 Layer Stack
• IoTWF architectural committee (led by Cisco, • Control flowing from the
IBM, Rockwell Automation, and others) center to the edge

• Decompose the IoT


problem into smaller parts

• Identify different
technologies at each layer

• Different parts of a system


can be provided by
different vendors

• Tiered security model


enforced at the transition
points between levels
• offers a clean, simplified perspective on IoT
• includes edge computing, data storage, and access • Define interfaces that
• succinct way of visualizing IoT from a technical perspective leads to interoperability

26-09-2020 Dr. Manas Khatua 10


Layers 1 & 2
Layer 1: Physical Devices Layer 2: Connectivity Layer
and Controllers Layer • focus is on connectivity

• home of the “things” in IoT

• “things” can be from a


microscopic sensors to giant
machines in a factory

• primary function is
generating data

• capable of being queried


and/or controlled over a
network.

26-09-2020 Dr. Manas Khatua 11


Layer 3 : Fog Layer
Basic principle:

Layer 3: Edge Computing Layer information processing is initiated as


early and as close to the edge of the
• often referred to as the “fog” layer network as possible.
• emphasis is on
– Data reduction by filtering and
cleaning up

– Reformatting and compressing data

– Initial processing of data (e.g. alert


generation, data validation, etc)

26-09-2020 Dr. Manas Khatua 12


Upper Layers: Layers 4–7

Layers Functions
Layer 4: Data Accumulation • Captures data and stores it for applications
• Convert event-based data to query-based processing
Layer 5: Data Abstraction • Reconciles multiple data formats
• Ensures consistent semantics for various data sources
• Confirmation about dataset completeness
Layer 6: Application • Interpret data using software applications
• Applications may monitor, control, and provide report
based on analysing the data
Layer 7: Collaboration and • Consumes and shares the application information
processes • Collaborating and communicating IoT information
26-09-2020 Dr. Manas Khatua 13
Simplified IoT Architecture
• It highlights the fundamental building blocks that are common to most IoT
systems and which is intended to help in designing an IoT network.

• IoT architectural framework is presented as two parallel stacks


• Core IoT Functional Stack
• IoT Data Management and Compute Stack

26-09-2020 Dr. Manas Khatua 14


Lessons Learned

 Why IoT architecture is needed?

 Different type of IoT Architectures

 About oneM2M architecture

 About IoT WF architecture

 About Simplified IoT Architecture

26-09-2020 Dr. Manas Khatua 15


Figures and slide materials are taken from the following sources:

1. David Hanes et al., “IoT Fundamentals: Networking Technologies, Protocols,


and Use Cases for the Internet of Things”, 1st Edition, 2018, Pearson India.

26-09-2020 Dr. Manas Khatua 16


CS578: Internet of Things

The “Things” in IoT

Dr. Manas Khatua


Assistant Professor, Dept. of CSE, IIT Guwahati
E-mail: manaskhatua@iitg.ac.in

“Arise! Awake! Stop not till the goal is reached.”‐ Swami Vivekananda.
The “Things”
 Sensors & Actuators are the fundamental building 
blocks of IoT
 Sensor senses Sensor
 Actuator acts

 Smart objects are any physical objects that contain
Actuator
 Embedded technology
 Sensors and/or actuators

 Smart objects are to sense and/or interact with 
their environment in a meaningful way
 by being interconnected, and
 enabling communication among themselves or an 
external agent. Smart Object

03‐10‐2020 Dr. Manas Khatua 2
Sensors
• It measures some physical quantity and converts that measurement into analog/digital form

• There are a number of ways to group and cluster sensors into different categories

– Based on external energy requirement
• Active / Passive

– Based on placement location
• Invasive / Non‐invasive

– Based on distance from the sensing object
• Contact / No‐contact

– Based on application industry
• Medical / Manufacturing / Agriculture / etc.

– Based on measuring scale
• Absolute / Relative

– Based on sensing mechanism
• Thermoelectric / Electromechanical / Piezo resistive / Optic / Electric / Fluid mechanics / Photoelastic / etc.

– Based on sensing parameter
• Position / Occupancy / Motion / Velocity / Force / Pressure / Flow / Humidity / Light / Temperature / Acoustic / 
Radiation / Chemical / Biosensors / etc.

03‐10‐2020 Dr. Manas Khatua 3
Sensor Types: What it measures
Sensor Type Description Example
Position • Measures the position of an object • Proximity sensor
• Position could be absolute/relative • Potentiometer
• Position sensor could be linear, angular,  • Inclinometer
or multi‐axis
Occupancy • Detects the presence of people and  • Radar Sensor
animals in a surveillance area
• Generates signal even when a person is 
stationary
Motion • Detects the movement of people and  • Passive Infrared (PIR) 
objects Sensor

Ultrasonic Proximity  Infrared Proximity  Microwave Radar  PIR Motion 


Sensor Sensor Sensor Sensor
03‐10‐2020 Dr. Manas Khatua 4
Cont…
Sensor Type Description Example
Velocity and  • Velocity sensor measures how fast an  • Gyroscope
Acceleration object moves • Accelerometer
• Acceleration sensor measures the 
changes in velocity
Force • Detects whether a physical force is  • Tactile sensor
applied and the magnitude of the force • Viscometer
Pressure • Measuring the force applied by liquids  • Barometer
or gases • Piezometer
• It is measured as force per unit area

Gyroscope Capacitive Touch Sensor Barometric Pressure Sensor


03‐10‐2020 Dr. Manas Khatua 5
Cont…
Sensor Type Description Example
Flow • Detects the rate of fluid flow through a  • Water meter
system in given period of time • Anemometer
Humidity • Detects amount of water vapour in the air • Hygrometer
• Can be measured in absolute/relative scale • Soil moisture sensor
Light • Detects the presence of light • LDR light sensor
• Photodetector
• Flame Sensor 

Soil moisture  LDR light  Flame 


Water meter
sensor sensor sensor

03‐10‐2020 Dr. Manas Khatua 6
Cont…
Sensor Type Description Example
Radiation • Detects the radiation in the environment • Neutron detector
• Geiger‐Muller counter
Temperature • Measures the amount of heat or cold  • Thermometer
present in the system • Temperature gauge
• Two type: contact / non‐contact • Calorimeter

Neutron detector Geiger‐Muller counter Temperature  Thermo‐


Sensor Hygrometer

03‐10‐2020 Dr. Manas Khatua 7
Cont…
Sensor Type Description Example
Acoustic • Measures sound level • Microphone
• Hydrophone
Chemical • Measures the concentration of a  • Smoke detector
chemical (e.g. CO2) in a system • Breathalyzer
Biosensor • Detects various biological elements, such  • Pulse oximeter
as organisms, tissues, cells, enzymes,  • Electrocardiograph (ECG)
antibodies, nucleic acid, etc. • Blood glucose biosensor

Hydrophone Breathalyzer Pulse oximeter


03‐10‐2020 Dr. Manas Khatua 8
Sensors in a Smart Car

03‐10‐2020 Dr. Manas Khatua 9
Sensors in a Smartphone

03‐10‐2020 Dr. Manas Khatua 10
Actuators
• Sensors are designed to sense and measure the surrounding environment

• Actuators receive some type of control signal (commonly an electrical 
signal or digital command) that triggers a physical effect, usually some 
type of motion, force, and so on.

Source: https://cdn2.hubspot.net/hubfs/1878050/Landingpages/Events/Schwabengipfel/Guido_Schmutz_IoT‐Cloud‐or‐OnPrem.pdf?t=1501051153000

03‐10‐2020 Dr. Manas Khatua 11
Cont…

Source: 
https://bridgera.com/iot‐
system‐sensors‐actuators/

Source: 
https://www.novatec‐
gmbh.de/blog/sensors‐
and‐actuators‐of‐the‐iot/

03‐10‐2020 Dr. Manas Khatua 12
Actuator Classification
• Common ways to classify actuators:

 Type of motion they produce
• e.g. linear, rotary, one/two/three axes

 Power output
• e.g. high power, low power, micro power

 Binary / Continuous output
• Based on number of stable‐state outputs

 Area of application
• Specific industry or vertical where they are used 

 Type of energy
• e.g. mechanical energy, electrical energy, hydraulic energy, etc.

03‐10‐2020 Dr. Manas Khatua 13
Actuators by Energy Type
Type Examples

Mechanical actuators Lever, Screw jack, Hand crank

Electrical actuators Thyristor, Bipolar transistor, Diode

Electromechanical actuators AC motor, DC motor, Step motor

Electromagnetic actuators Electromagnet, Linear solenoid

Hydraulic and Pneumatic  Hydraulic cylinder, Pneumatic cylinder, Piston, 
actuators Pressure control valve, Air motor

Smart material actuator (includes  Magnetorestrictive material, Bimetallic strip, 


thermal and magnetic actuators) Piezoelectric bimorph

03‐10‐2020 Dr. Manas Khatua 14
Smart Objects
• It is the building blocks of IoT

• Smart object has the following five characteristics:

– Sensor(s) and/or Actuator(s)

– Processing unit
• For acquiring sensed data from sensors,
• processing and analysing sensing data,
• coordinating control signals to any actuators, and
• controlling many functions (e.g. communication unit, power unit).

– Memory
• Mostly on‐chip flash memory
• user memory used for storing application related data
• program memory used for programming the device

– Communication unit
• Responsible for connecting a smart object with other smart 
objects and the outside world (via the network using 
wireless/wired communication)

– Power source
• To powered all components of the smart object
TelosB Mote

03‐10‐2020 Dr. Manas Khatua 15
Cont…

Source: Cisco
03‐10‐2020 Dr. Manas Khatua 16
Present Trends in Smart Objects

• Size is decreasing

• Power consumption is decreasing

• Processing power is increasing

• Communication capabilities are improving

• Communication is being increasingly standardized

03‐10‐2020 Dr. Manas Khatua 17
Lessons Learned

 What is “Things” in IoT

 Classification method of Sensors

 Different Sensors based on Sensing parameter

 Classification method of Actuators

 Different Actuators based on Energy type

 What is “Smart object” in IoT

03‐10‐2020 Dr. Manas Khatua 18
Figures and slide materials are taken from the following Books:

1. David Hanes et al., “IoT Fundamentals: Networking Technologies, Protocols, 
and Use Cases for the Internet of Things”, 1st Edition, 2018, Pearson India. 

03‐10‐2020 Dr. Manas Khatua 19
CS578: Internet of Things
UART
Serial Communication

Dr. Manas Khatua


Assistant Professor, Dept. of CSE, IIT Guwahati
E-mail: manaskhatua@iitg.ac.in

“We suffer as a result of our own actions; it is unfair to blame anybody for it.” – Ma Sarada Devi
UART
 UART stands for Universal Asynchronous Receiver Transmitter
• It is a physical circuit in a microcontroller, or a stand-alone IC

• It is used for asynchronous serial communication


• Serial communication stands for the process of sending data one bit at a
time sequentially
• Asynchronous means there is no clock signal to synchronize the output
of bits from the transmitting UART to the sampling of bits by the
receiving UART

• Instead of a clock signal, the


transmitting UART adds start
and stop bits to the data
packet being transferred.

05-10-2020 Dr. Manas Khatua 2


Cont…
 UART Communication
• Communication may be simplex, full duplex, or half duplex

• Simplex: One direction only, transmitter to receiver

• Half Duplex: Devices take turns transmitting and receiving

• Full Duplex: Devices can send and receive at the same time

• Data format and transmission speed are configurable

• Communication goes through the two independent lines/wires

• TX (transmission)

• RX (reception).

05-10-2020 Dr. Manas Khatua 3


UART Communication

• The transmitting UART


• converts parallel data from a controlling device like CPU, microcontroller, etc., into
serial form,
• transmits it in serial to the receiving UART,

• The receiving UART


• converts the serial data back into parallel data for the receiving device.

• Data flows from the TX pin of the transmitting UART to the RX pin of the receiving UART

• For communication between the devices, both of them have to have same baud rate
• Baud rate is a measure of the speed of data transfer, expressed in bits per second (bps).
• The baud rate between the transmitting and receiving UARTs can only differ by max 10%.
• Bit Rate = Baud rate x the number of bit per baud

05-10-2020 Dr. Manas Khatua 4


Data Framing

Start Bit:
• The UART transmission line is normally held at a high voltage level when it’s not
transmitting data
• It start bit is set to logic low as it is used to signal the receiver that a new framing is
coming.

Data Frame:
• Next 5-8 bits carry the “data bits” (information), if one parity bit is used.
• Otherwise, data bits can be 5-9 bits

05-10-2020 Dr. Manas Khatua 5


Cont…

Parity:
• It is an optional bit.
• It is used to detect the wrong data packets, i.e. error during transmission
• Two type of parity bit used: even parity, odd parity.
• Even parity:
• If the count of bits with value 1 is odd, the parity bit value is set to 1, making the total
count of occurrences of 1s in the whole set (including the parity bit) an even number.
• If the count of 1s in a given set of bits is already even, the parity bit's value is 0.
• Odd parity:
• In the case of odd parity, the coding is reversed.

Stop Bits:
• To signal the end of the data packet, the sending UART drives the data transmission line from a low
voltage to a high voltage for at least two bit durations.

05-10-2020 Dr. Manas Khatua 6


Steps of UART Communication
1. The transmitting UART receives data in parallel from the data bus:

2. The transmitting UART adds the start bit, (even) parity bit, and stop bit(s) to the data frame:
Cont…
3. The entire packet is sent serially from the transmitting UART to the receiving UART.

The receiving UART samples the data line at the pre-configured baud rate:

4. The receiving UART discards the start bit, parity bit, and stop bit from the data frame:
Cont…
5. The receiving UART converts the serial data back into parallel and transfers it to the data bus
on the receiving end:
Advantages and Disadvantages
Advantages:
1) Well documented and widely used method.

2) Only uses two wires

3) No clock, signal is necessary

4) Has a parity bit to allow for error checking

5) The structure of the data packet can be changed as long as both sides are set up
for it.

Disadvantages:
1) The size of the dataframe is limited to maximum of 9 bits.

2) Doesn’t support multiple slave or multiple master systems

3) The baud rate of each UART must be with 10% of each other.

05-10-2020 Dr. Manas Khatua 10


Applications and Standards
 UART is normally used in microcontrollers for exact requirements,

 Today, UART is being used in many applications like


 GPS Receivers,
 Bluetooth Modules,
 GSM and GPRS Modems,
 Wireless Communication Systems,
 RFID based applications
 etc.

 The first of the serial data transmission standards was RS232, or more correctly RS-232 or
COM-port. This was developed in 1962.

 There are more recent standards which allow high speed data transmission along with
multiple transmitters and receivers
 E.g. USB
Lessons Learned

 What is serial communication

 What is asynchronous communication

 UART communication mechanism

 Pros and Cons of UART communication

 Applications of UART communication


Thanks!

05-10-2020 Dr. Manas Khatua 13


CS578: Internet of Things

IoT Access Technologies

Dr. Manas Khatua


Assistant Professor, Dept. of CSE, IIT Guwahati
E-mail: manaskhatua@iitg.ac.in

“All Birds find shelter during a rain. But Eagle avoids rain by flying above the Clouds” – APJ Abdul Kalam
Communications Criteria
• A large number of wired and
wireless access technologies are
available

• Communication criteria describes


the characteristics and attributes
of access technologies

• Wireless communication is
prevalent for smart object
connectivity
– ease of deployment
– allows smart objects to be mobile
without losing connectivity

• Few basic criteria:


• Range • Topology
• Frequency bands • Constrained devices
• Power consumptions • Constrained-node networks

13-10-2020 Dr. Manas Khatua 2


Communication Range

• Short range:
– tens of meters of maximum distance between two devices • Long range
– often considered as an alternative to serial cable – greater than 1 mile (1.6 km)
between two devices
– IEEE 802.15.1 Bluetooth, IEEE 802.15.7 Visible Light
Communications (VLC) – Wireless : 2G, 3G, 4G, Outdoor
Wi-Fi (IEEE 802.11ah), Low-
Power Wide-Area (LPWA)
• Medium range communications
– tens to hundreds of meters between two devices – Wired : IEEE 802.3 ethernet
– Wireless : IEEE 802.11 WiFi, IEEE 802.15.4 Low Rate WPAN, over optical fiber, IEEE 1901.2
IEEE 802.15.4g Smart Utility Networks (SUN) Broadband PLC
– Wired : IEEE 802.3 Ethernet, IEEE 1901.2 Narrowband
Power Line Communications (PLC)

13-10-2020 Dr. Manas Khatua 3


Frequency Bands

• Radio spectrum is regulated by countries and/or organizations (e.g. International


Telecommunication Union (ITU), Federal Communications Commission (FCC))
• frequency bands leveraged by wireless communications are split between licensed
and unlicensed bands.
• Unlicensed
• Licensed – industrial, scientific, and medical (ISM)
– applicable to long-range access technologies portions of the radio bands
– users must subscribe to services – Unlicensed means that no guarantees or
interference protections are offered
– common licensed spectrum for IoT : Cellular
(900-2100 MHz), NB-IoT (700-900 MHz), – well-known ISM bands for IoT : 2.4 GHz,
WiMax 5 GHz, 915 MHz for WiFi, BLE, ZigBee;
868 MHz for LoRa
13-10-2020 Dr. Manas Khatua 4
Cont…
• Examples of circuit switching networks
– Public telephone network
– Private branch exchange (PBX) system
– Data switch system

• In circuit switching, the path is established before data transmission begins.


– Sometimes less efficient as channel capacity remains unused
– There is connection establishment delay prior to data transfer

13-10-2020 Dr. Manas Khatua 5


ISM Bands in India

• India also allow 865-867 MHz ISM band


13-10-2020 Dr. Manas Khatua 6
Power Consumption
• Powered node • Battery-powered nodes
– node has a direct connection to a power – bring more flexibility to IoT devices
source – batteries are small
– communications are usually not limited – batteries can be changed or recharged
by power consumption criteria
– IoT wireless access technologies must
– ease of deployment is limited by the address
availability of a power source • the needs of low power consumption
– makes mobility more complex • connectivity for battery-powered nodes

Bluetooth ZigBee WiFi LoRaWAN NB-IoT


Standard IEEE 802.15.1 IEEE 802.15.4 IEEE 802.11b LoRaWAN 3GPP NB-IoT
Sleeping 9 µA 12 µA 30 µA 0.1 µA 3 µA
Awake/Idle 35 mA 50 mA 245 mA 1.4 mA 6 mA
Transmitting 39 mA 52 mA 251 mA 44 mA 220 mA
Receiving 37 mA 54 mA 248 mA 12 mA 46 mA
Power Supply 3.3 V 3.3 V 5 V* 3.3 V 3.6 V
* The ESP8266 module powered by 3.3 V could be used as WiFi module.
13-10-2020 Dr. Manas Khatua 7
Topology
• Three main topology schemes are dominant:
– star, mesh, and peer-to-peer • IEEE 802.15.4, 802.15.4g,
and wired IEEE 1901.2a
• For long-range and short-range technologies: PLC are generally deployed
– star topology is prevalent as a mesh topology.

• Indoor Wi-Fi deployments


• For medium-range technologies: are mostly star topologies
– star, peer-to-peer, or mesh topology is common

FFD: A node that


implements the full
network functions

RFD: The device can


implement a subset of
protocol functions to
perform just a specialized
part (communication
with the coordinator).
13-10-2020 Dr. Manas Khatua 8
Constrained Devices
• Constrained nodes have limited resources that impact their
networking feature set and capabilities.

• RFC 7228 defines three classes for constrained nodes: Class 0, 1, 2

RAM Flash IP stack Security Example


Storage Scheme
Class 0 < 10 KB < 100 KB Not No Push
present button
Class 1 > 10 KB > 100 KB Optimized Light Sensors
IP stack
Class 2 > 50 KB > 250 KB Full IP Yes Smart
stack meter

13-10-2020 Dr. Manas Khatua 9


Constrained-Node Networks
• Constrained-node networks are often referred to as low-power and lossy networks (LLNs)

• Layer 1 and Layer 2 protocols must be evaluated in using the following characteristics:
– data rate and throughput
– latency and determinism
– overhead and payload.

• Data rate & throughput:


– data rates available from 100 bps to tens of Mbps
– actual throughput is less, sometimes much less, than the data rate
• Latency & determinism:
– When latency is a strong concern, emergent access technologies such as Time-Slotted Channel
Hopping (TSCH) mode of IEEE 802.15.4e should be considered.
• Overhead & Payload
– The minimum IPv6 MTU size is expected to be 1280 bytes.
– MTU size for IEEE 802.15.4 is 127 bytes; payload in LoRaWAN may be from 19 to 250 bytes
– So, the fragmentation of the IPv6 payload has to be taken into account by the link layer

13-10-2020 Dr. Manas Khatua 10


IoT Access Technologies
• there are many IoT technologies in the market today

13-10-2020 Dr. Manas Khatua 11


IEEE 802.15.4 PHY and MAC

IEEE 802.15.4 is the IEEE standards for Low Rate Wireless Networks (or Low Rare Wireless
Personal Area Networks). Latest version published in 2015.

For more details:


https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=7460875

13-10-2020 Dr. Manas Khatua 12


IEEE 802.15 Task Group 4
• TG4 was formed to define low-data-rate PHY and MAC layer specifications for
wireless personal area networks (WPAN)

• standard has evolved over time: • PAN


 IEEE 802.15.4-2003 ; IEEE 802.15.4-2006 – span a small area (e.g.,
 IEEE 802.15.4-2011; IEEE 802.15.4-2015 a private home or an
individual workspace)
– communicate over a
short distance
– low-powered
communication
– primarily uses ad-hoc
networking
– could be wireless or
wired (e.g. using USB)

13-10-2020 Dr. Manas Khatua 13


IEEE 802.15.4
• IEEE 802.15.4 is a wireless access technology for
 low-cost and low-data-rate devices
 devices powered by batteries

• It enables easy installation using a compact protocol stack

• Several network communication stacks leverage this technology for many IoT
use cases in both the consumer and business markets.

• Few applications:
 Home and building automation
 Automotive networks
 Industrial wireless sensor networks
 Interactive toys and remote controls

13-10-2020 Dr. Manas Khatua 14


Cont…
• Few well-known protocol stacks
which leverage the IEEE 802.15.4:
• ZigBee shows how 802.15.4 can
 ZigBee
be leveraged at the PHY and MAC
 ZigBee IP
layers, independent of the
 6LoWPAN
protocol layers above.
 WirelessHART
 Thread
 ISA100.11a
• Criticisms:
 MAC reliability
 unbounded latency
 susceptibility to interference
and multipath fading
 lacks a frequency-hopping
technique

13-10-2020 Dr. Manas Khatua 15


ZigBee
• ZigBee specification was ratified in 2004

• ZigBee Alliance is an industry group


 certify interoperability between vendors
 evolving ZigBee as an IoT solution

• ZigBee solutions are aimed at smart objects and sensors


that have low bandwidth and low power needs.

• Well-known application domains:

Industrial and Commercial Smart Home Smart Energy


Automation Applications smart meters, that can
measuring temperature control lighting, monitor and control the use
and humidity, and tracking thermostats, and and delivery of utilities, such
assets security functions as electricity and water

13-10-2020 Dr. Manas Khatua 16


ZigBee Protocol Stack
• ZigBee predefines many application
profiles for certain industries.
• Vendors can optionally create their
own custom ones.

• The application support layer


interfaces the lower portion of the
stack, dealing with the networking
of ZigBee devices, with the higher-
layer applications

• ZigBee uses AODV routing across a mesh • ZigBee network & security layer
network provides mechanisms for network
startup, configuration, routing, and
• ZigBee utilizes 128-bit AES encryption for securing communications.
security at the MAC layer
• ZigBee utilizes the IEEE 802.15.4
• It also provides security at the network and standard at the PHY and MAC layers
application layers.
13-10-2020 Dr. Manas Khatua 17
ZigBee IP
• ZigBee has not provided interoperability
with other IoT solutions or open standards

• ZigBee IP was created to embrace the open


standards at the network and transport
layers

• Open standards designed by IETF’s work on


LLNs, such as IPv6, 6LoWPAN, and RPL.

• ZigBee IP requires the support of


6LoWPAN’s fragmentation and header
compression schemes.

• ZigBee IP nodes support


– IPv6, • ZigBee IP is a compelling protocol stack
– ICMPv6, offering because it is based on current
– 6LoWPAN, IoT standards at every layer under the
– Neighbour Discovery (ND), and application layer.
– RPL for the routing of packets.

13-10-2020 Dr. Manas Khatua 18


IEEE 802.15.4 PHY layer
• Physical layer transmission options in IEEE 802.15.4-2015
– 2.4 GHz, 16 channels, with a data rate of 250 kbps
– 915 MHz, 10 channels, with a data rate of 250 kbps
– 868 MHz, 3 channel, with a data rate of 100 kbps

• Modulation schemes
– OQPSK PHY : Direct sequence spread spectrum (DSSS) PHY employing offset quadrature phase-shift
keying (OQPSK)
– BPSK PHY : DSSS PHY employing binary phase-shift keying (BPSK)
– ASK PHY : parallel sequence spread spectrum (PSSS) PHY employing amplitude shift keying (ASK)
and BPSK

Preamble (4 byte): identifies the start of the


frame; used to synchronize the data transmission

IEEE 802.15.4 PHY Frame Format SFD (1 byte): informs the receiver about the
starting point of frame content
13-10-2020 Dr. Manas Khatua 19
IEEE 802.15.4 MAC layer
• MAC layer manages access to the PHY channel
• defines how devices in the same area will share the frequencies allocated.
• Main tasks:
• Network beaconing for devices acting as coordinators
• PAN association and disassociation by a device
• Reliable link communications between two peer MAC entities
• Device security
16-bit short address
OR
64-bit extended address

• MAC frame types:


• Data frame
• Beacon frame
• ACK frame
• Command frame

13-10-2020 Dr. Manas Khatua 20


Cont…

Compress

13-10-2020 Dr. Manas Khatua 21


Topology
• Topology for 802.15.4:
• Star
• Peer-to-Peer
• Mesh

802.15.4 Sample Mesh Network Topology

• IEEE 802.15.4 does not define a path selection for a mesh topology
 Mesh-under: Path selection can be done at Layer 2
 Mesh-over: Path selection can occur at Layer 3 in routing protocol

13-10-2020 Dr. Manas Khatua 22


Security

• IEEE 802.15.4 specification uses Advanced Encryption Standard (AES) with a 128-bit
key length as the base encryption algorithm

• Message integrity code (MIC), which is calculated for the entire frame using the
same AES key, to validate the data that is sent

13-10-2020 Dr. Manas Khatua 23


IEEE 802.15.4g
IEEE 802.15.4e

IEEE 802.15.4g & IEEE 802.15.4e are the PHY and MAC layer amendments of wireless
personal area networks (IEEE 802.1.5.4) published in 2012.

For more details:


https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6185525
https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6471722

13-10-2020 Dr. Manas Khatua 24


IEEE 802.15.4e & 802.15.4g
• Disadvantages of IEEE 802.15.4
– MAC reliability
– unbounded latency
– multipath fading
• IEEE 802.15.4e amendment of • IEEE 802.15.4g amendment of
802.15.4-2011 expands the MAC 802.15.4-2011 expands the PHY
layer feature set layer feature set

 to remedy the disadvantages of  to optimize large outdoor


802.15.4. wireless mesh networks for field
 to better suitable in factory and area networks (FANs)
process automation, and smart grid  to better suitable in smart grid or
smart utility network (SUN)
 Main modifications were: communication
• frame format,
• security,  Main modifications were:
• determinism mechanism, and • New PHY definitions
• frequency hopping • some MAC modifications were
needed to support the new PHY

13-10-2020 Dr. Manas Khatua 25


Wi-SUN PHY layer
• 802.15.4g-2012 and 802.15.4e-2012 led to additional difficulty in
– achieving the interoperability between devices and mixed vendors

• Wi-SUN Alliance was formed to guarantee interoperability

• IEEE 802.15.4 maximum payload size of 127 bytes  2047 bytes for SUN PHY.
– Fragmentation is no longer necessary at Layer 2 for IPv6 packets

• Error protection was improved in IEEE 802.15.4g by the CRC from 16 to 32 bits.
• SUN PHY supports multiple data rates and more channels in ISM bands

• Modulation schemes:
– MR-FSK : Multi-Rate and Multi-Regional Frequency Shift Keying
• good transmit frequency
– MR-OFDM : Multi-Rate and Multi-Regional Orthogonal Frequency Division
Multiplexing
• good data rate
– MR-O-QPSK : Multi-Rate and Multi-Regional Offset Quadrature Phase-Shift Keying
• cost effective design

13-10-2020 Dr. Manas Khatua 26


802.15.4e MAC layer
• IEEE 802.15.4e amendment modifies: frame format, security, determinism
mechanism, frequency hopping

• Physical layer for implementation could be Wi-SUN PHY

• TSCH: Time Slotted Channel Hopping


 One type of MAC operation mode

 guaranteed media access by time slotted access


 time is divided in fixed time period – “time slots”
 in a time slot, one packet and its ACK can be transmitted
 multiple slots together form a “slot frame” which is repeated regularly
 offers guaranteed bandwidth
 offers predictable latency

 provide channel diversity by channel / frequency hopping


 reduce interference
 increase robustness in noisy environment
 increase network capacity by parallel communication via multiple cell

 Transmitter and receiver maintain time & channel synchronization


 by a global timeslot counter and a global channel hopping sequence list

13-10-2020 Dr. Manas Khatua 27


Cont…

Source: Palattella et al., “Standardized Protocol Stack for the Internet of


(Important) Things”, IEEE Comm. Surv. & Tutor, vol. 15, no. 3, 2013, pp. 1389–1406.

13-10-2020 Dr. Manas Khatua 28


Cont…
• IE: Information Element
 allow for the exchange of information at the MAC layer
 either as header IEs (standardized) and/or payload IEs (private)
 carry additional metadata to support MAC layer services
 IEEE 802.15.9 key management
 Wi-SUN 1.0 IEs to broadcast and unicast schedule timing information,
 frequency hopping synchronization information for the 6TiSCH architecture

• EB: Enhanced Beacon


 allow the construction of application-specific beacon content
 includes relevant IEs in EB frames
 network metrics, frequency hopping broadcast schedule, and PAN information

• EBR: Enhanced Beacon Request


 allow the sender to selectively specify the request of information
 EBRs leverages IEs to specify

• Enhanced ACK
 allow for the integration of a frame counter for the frame being acknowledged
 helps to protect against certain attacks

13-10-2020 Dr. Manas Khatua 29


802.15.4e/g Frame Format
One or
more IEs

13-10-2020 Dr. Manas Khatua 30


Security and Topology
• Encryption is done by
AES with a 128-bit key

• Message integrity
code (MIC) validates
the data that is sent

Mesh Topology
• Battery-powered nodes
with a long lifecycle
requires
– optimized Layer 2
forwarding or
– optimized Layer 3
routing protocol

13-10-2020 Dr. Manas Khatua 31


IEEE 802.11ah

IEEE 802.11ah is a wireless networking protocol published in 2016.

For more details: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=7920364

13-10-2020 Dr. Manas Khatua 32


IEEE 802.11ah
• Advantages of WiFi • Disadvantages of WiFi
– Most successful endpoint wireless – Less signal penetration
technology – Unsuitable for battery powered
– Useful for high data rate devices, for nodes
audio-video analytics devices, for – Unable to support large number
deploying WiFi backhaul infrastructure of devices

• Wi-Fi Alliance defined a new technology


called Wi-Fi HaLow
 ah  Ha
 Low power network  Low

• Main use cases for IEEE 802.11ah


 Sensors and meters covering a smart grid
 Backhaul aggregation of industrial sensors
and meter data
 Extended range Wi-Fi

13-10-2020 Dr. Manas Khatua 33


802.11ah PHY layer
• Operating in unlicensed sub-GHz bands
 868–868.6 MHz for EMEAR (Europe, Middle East, Africa, and Russia)
 902–928 MHz for North America and Asia Pacific (India, Japan, Korea, …)
 314–316 MHz, 430–434 MHz, 470–510 MHz, 779–787 MHz for China

• OFDM Modulation

• Channels of 2, 4, 8, or 16 MHz (and also 1 MHz for low-bandwidth


transmission)

• Provides one-tenth of the data rates of IEEE 802.11ac

• Provide an extended range for its lower speed data


 For data rate of 100 kbps, the outdoor transmission range approx 1 Km

13-10-2020 Dr. Manas Khatua 34


802.11ah MAC layer
Enhancements and features
• Number of devices: Has been scaled up from 250 to 8192 per access point (AP).
• MAC header: Has been shortened

• Null data packet (NDP) support: to cover control and management frames.
– It is only transmitted by a STA; It carry’s no data payload.

• Restricted access window (RAW): increase throughput and energy efficiency by


– dividing stations into different RAW groups.
– Only the stations in the same group can access the channel simultaneously.

• Sectorization: partition the coverage area of a Basic Service Set (BSS) into sectors, each
containing a subset of stations. it uses an antenna array and beam-forming technique.
– reduces contention by restricting which group, in which sector, and at which time window.
– to mitigate the hidden node problem; to eliminate the overlapping BSS problem.

• Target wake time (TWT): AP can define times when a STA can access the network

• Speed frame exchange: Enables an AP and endpoint to exchange frames during a


reserved transmit opportunity (TXOP)
– TXOP is the amount of time a station can send frames when it has won contention for the medium

13-10-2020 Dr. Manas Khatua 35


802.11ah Topology

• Star topology

• Includes simple hops


relay to extend its range
– Max 2 hops
– Client handle the relay
operation

13-10-2020 Dr. Manas Khatua 36


LoRaWAN

LoRaWAN is a wireless networking protocol published in 2015.

For more details: https://lora-alliance.org/sites/default/files/2018-07/lorawan1.0.3.pdf

13-10-2020 Dr. Manas Khatua 37


LPWA Technology
• a new set of wireless technologies has received a lot of attention from the
industry, know as
– Low-Power Wide-Area (LPWA) technology

• unlicensed-band LPWA technology


– LoRaWAN

• licensed-band LPWA technology


– NB-IoT and Other LTE Variations

13-10-2020 Dr. Manas Khatua 38


LoRa Alliance
• Initially, LoRa was a PHY layer modulation scheme
– developed by a French company “Cycleo”; Later, Cycleo was acquired by Semtech.

• Semtech LoRa: Layer 1 PHY modulation technology available by multiple chipset vendors

• The LoRa Alliance is a technology alliance


– committed to enabling large scale deployment of Low-Power Wide Area Networks (LPWAN) IoT
– publishing LoRaWAN specifications for LPWAN

• LoRaWAN is a premier solution for global LPWAN deployments

LoRaWAN
Protocol Stack

13-10-2020 Dr. Manas Khatua 39


LoRaWAN PHY layer
• Semtech LoRa PHY

• Uses chirp spread spectrum modulation


 it allows demodulation below the noise floor, offers
robustness to noise and interference

 manages a single channel occupation by different


spreading factors (SFs) LoRa Module: SX1276
868MHz band
• Main unlicensed sub-GHz frequency bands
 433 MHz
 779–787 MHz
 863–870 MHz ( In India: 868 MHz)
 902–928 MHz

LoRa GPS Shield


with Arduino LoRa Shield for Arduino
13-10-2020 Dr. Manas Khatua 40
LoRaWAN MAC layer
• Classifies LoRaWAN endpoints into three classes. Uplink Transmission

Class A:
• this is default
implementation
• optimized for battery-
powered nodes
• allows bidirectional
communications
• two receive windows are
available after each
transmission

Class B:
• Class B node should get additional
receive windows compared to Class A Class C:
• gateways must be synchronized • This class is particularly adapted for
through a beaconing process powered nodes
• “ping slots”, can be used by the • enables a node to be continuously
network infrastructure to initiate a listening by keeping its receive window
downlink communication open when not transmitting

13-10-2020 Dr. Manas Khatua 41


LoRaWAN MAC Frame Format

Node Addressing:
endpoints are also
known by their 32-bit
end device address
• 7 bit for network
• 25 bit for devices

13-10-2020 Dr. Manas Khatua 42


LoRaWAN Address Space
• LoRaWAN knows a number of identifiers for devices, applications and
gateways.
 DevEUI - 64 bit end-device identifier, EUI-64 (unique)
 DevAddr - 32 bit device address (non-unique)
 AppEUI - 64 bit application identifier, EUI-64 (unique)
 GatewayEUI - 64 bit gateway identifier, EUI-64 (unique)

• LoRaWAN devices have a 64 bit unique identifier (DevEUI) that is assigned to


the device by the chip manufacturer.

• However, all communication is done with a dynamic 32 bit device address


(DevAddr) of which 7 bits are fixed for the Network, leaving 25 bits that can
be assigned to individual devices.

13-10-2020 Dr. Manas Khatua 43


LoRaWAN Gateway
• LoRa gateway is deployed as the center hub of a star
network architecture.

• It uses multiple transceivers and channels

• It can demodulate multiple channels at once

• It can also demodulate multiple signals on the same


channel simultaneously
Dragino LoRa Gateway
• LoRa gateways serve as a transparent bridge relaying
data between endpoints

• The endpoints use a single-hop wireless connection to


communicate with one or many gateways

• Data rate varies depending on the frequency bands and adaptive data rate (ADR)

• ADR is an algorithm that manages data rate and radio signal for each endpoint.

13-10-2020 Dr. Manas Khatua 44


Cont…
• LoRa has the ability to handle various data rates via spreading factor (SF)
• Best practices:
– Use ADR for fixed endpoints
– Use fixed data rate or spreading factor for mobile endpoints

LoRaWAN Data Rate


Example
• Low SF  high data rate,
less distance
• High SF  low data rate,
longer distance

13-10-2020 Dr. Manas Khatua 45


LoRaWAN Security
• LoRaWAN supports: protect communication and data privacy across the network

• LoRaWAN endpoints must implement two layers of security


– Network security applied in MAC layer
• authentication of the endpoints
• protects LoRaWAN packets by performing encryption based on AES

• Each endpoint implements a network session key (NwkSKey)


• The NwkSKey ensures data integrity through computing and checking the message integrity
code (MIC) of every data message

– Data privacy applied at the end points (end device and application server)
• second layer is an application session key (AppSKey)
• performs encryption & decryption functions between the endpoint and its application
server.
• it computes and checks the application-level MIC

• LoRaWAN service provider does not have access to the application payload if it is
not allowed

13-10-2020 Dr. Manas Khatua 46


LoRaWAN Node Registration
• LoRaWAN endpoints attached to a LoRaWAN network must get registered and
authenticated.

– Activation by personalization (ABP)


• Endpoints don’t need to run a join procedure
• Individual details (e.g. DevAddr and the NwkSKey and AppSKey keys) are preconfigured and
stored in the end device.

• This same information is registered in the LoRaWAN network server.

– Over-the-air activation (OTAA)


• Endpoints are allowed to dynamically join a particular LoRaWAN network after successfully
going through a join procedure.
• During the join process, the node establishes its credentials with a LoRaWAN network server,
exchanging its globally unique DevEUI, AppEUI, and AppKey.

• AppKey is then used to derive the session keys: NwkSKey and AppSKey.

13-10-2020 Dr. Manas Khatua 47


NB-IoT
and
Other LTE Variations

13-10-2020 Dr. Manas Khatua 48


NB-IoT
• Well-known Cellular Technology • Disadvantage
– GSM: Global System for Mobile Communications
– GPRS: General Packet Radio Service
– Not adapted to battery-
– CDMA: Code Division Multiple Access
powered small devices like
– EDGE: Enhanced Data Rates for GSM Evolution IoT smart objects
– 3G/UMTS: Universal Mobile Telecommunications System
– 4G/LTE: Long-Term Evolution

• In 2015, 3GPP approved a proposal to standardize a new narrowband radio access


technology called Narrowband IoT (NB-IoT)

• It address the requirement:


 massive number of low-throughput devices,
 low device power consumption,
 extended coverage – rural and deep indoors
 optimized network architecture.

• NB-IoT is addressing the LPWA IoT market opportunity using licensed spectrum
• New physical layer signals and channels are designed

• NB-IoT can co-exist with 2G, 3G, and 4G mobile networks

13-10-2020 Dr. Manas Khatua 49


Comparison of Key Attributes

WiFi BLE Thread Sub-GHz: TI SigFox ZigBee LoRa


Max. Data 72 Mbps 2 250 200 100 250 50
throughput Mbps Kbps Kbps bps Kbps Kbps
Range 100 m 750 m 100 m 4 km 25 km 130 m 10 km
Topology Star P2P/ Mesh/ Star Star Mesh/ Star of Star
Mesh Star Star
Frequency 2.4 GHz 2.4 GHz 2.4 GHz Sub-GHz Sub-GHz 2.4 GHz Sub-1GHz
Power 1 Year (AA Up to years on a coin-cell battery for limited range Few Years
consumption battery) (AA battery)
IP at the Yes No Yes No No No No
device node
Deployed AP smart No No No No No
Devices phones

13-10-2020 Dr. Manas Khatua 50


Lessons Learned
 Different Attributes of Access Technologies in IoT
 Communication criteria
 Communication Range
 Frequency Band
 Power consumption
 Topology

 Different Access Technologies in IoT


 IEEE 802.15.4
 IEEE 802.1.5.4e
 IEEE 802.11ah
 LoRaWAN
 NB-IoT

13-10-2020 Dr. Manas Khatua 51


Figures and slide materials are taken from the following sources:

1. David Hanes et al., “IoT Fundamentals: Networking Technologies, Protocols,


and Use Cases for the Internet of Things”, 1st Edition, 2018, Pearson India.

13-10-2020 Dr. Manas Khatua 52


CS578: Internet of Things
IEEE 802.15.4
Standard: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6471722

Dr. Manas Khatua


Assistant Professor, Dept. of CSE, IIT Guwahati
E-mail: manaskhatua@iitg.ac.in

“The highest education makes our life in harmony with all existence.” – Rabindranath Tagore
IEEE 802.15 Task Group 4
• TG4 defines low-data-rate PHY and MAC layer specifications for wireless personal
area networks (WPAN)

• This standard has evolved over the years: • PAN


 IEEE 802.15.4-2003 ; IEEE 802.15.4-2006 – span a small area (e.g.,
 IEEE 802.15.4-2011; IEEE 802.15.4-2015 a private home or an
individual workspace)
– communicate over a
short distance
– low-powered
communication
– primarily uses ad-hoc
networking
– could be wireless or
wired (e.g. using USB)

27-10-2020 Dr. Manas Khatua 2


IEEE 802.15.4 market feature
 Low power consumption
 Low cost system and operation
 Low offered message throughput
 Supports large network (<= 65k nodes)
 Low to no QoS guarantees
 Flexible protocol design

• IEEE 802.15.4 PHY and MAC layers are the foundations for several
networking protocol stacks used in different market applications.
• Few well-known protocol stacks:
 ZigBee
 ZigBee IP • ZigBee shows how 802.15.4 can be
 6LoWPAN leveraged at the PHY and MAC
 WirelessHART layers, independent of the protocol
 Thread layers above.

27-10-2020 Dr. Manas Khatua 3


What is ZigBee Alliance?
• An alliance of organizations with a
mission to define
– reliable,
– cost effective,
– low-power, • Alliance provides
– wirelessly networked,
– monitoring and control products
– interoperability,
– based on an open global standard – certification testing, and
– branding

• ZigBee Alliance
 45+ companies: Semiconductor mfrs, IP providers, OEMs, etc.

27-10-2020 Dr. Manas Khatua 4


ZigBee/802.15.4 architecture
• ZigBee Alliance
 Defining upper layers of protocol stack:
from network to application, including
application profiles
• ZigBee takes full advantage
• IEEE 802.15.4 Working Group of a powerful physical radio
 Defining lower layers of protocol stack: MAC specified by IEEE 802.15.4
and PHY
• ZigBee adds logical
network, security and
Applications application software

Application Framework

Network & Security ZigBee


Specification
Application
MAC Layer
802.15.4 ZigBee stack
PHY Layer
Hardware

27-10-2020 Dr. Manas Khatua 5


ZigBee network applications

monitors TV VCR
sensors DVD/CD
automation Remote control
control
INDUSTRIAL & CONSUMER
COMMERCIAL ELECTRONICS

monitors mouse
diagnostics ZigBee keyboard
sensors LOW DATA-RATE joystick
PC &
RADIO DEVICES PERIPHERALS
PERSONAL
HEALTH CARE

security
consoles HVAC
portables lighting
educational TOYS & HOME closures
GAMES AUTOMATION

27-10-2020 Dr. Manas Khatua 6


IEEE 802.15.4 PHY

27-10-2020 Dr. Manas Khatua 7


IEEE 802.15.4 PHY overview
• PHY functionalities:

• Activation & deactivation of the radio transceiver


• Energy detection within the current channel

• Link quality indication for received packets


• Clear channel assessment (CCA) for CSMA-CA

• Channel frequency selection


• Data transmission and reception

27-10-2020 Dr. Manas Khatua 8


Spectrum
• Federal Communications of Commissions (FCC) in USA allocates frequency bands

• Applications using ISM band do not require a licence for stations emitting less than 1W.

FCC Band Max. Transmit Power Frequencies


Industrial Band <1W 902 MHz – 928 M Hz
Scientific Band <1W 2.4 GHz – 2.48 GHz
Medical Band <1W 5.725 GHz – 5.85 GHz
U-NII (Unlicensed < 40 mW 5.15 GHz – 5.25 GHz
National Information < 200 mW 5.25 GHz – 5.35 GHz
Infrastructure)
< 800 mW 5.725 GHz – 5.82 GHz

• Physical layer transmission options in IEEE 802.15.4-2015

– 2.4 GHz, 16 channels, data rate 250 kbps


– 915 MHz, 10 channels, data rate 250 kbps
– 868 MHz, 3 channel, data rate 100 kbps

27-10-2020 Dr. Manas Khatua 9


Spread Spectrum
• Idea of Spread Spectrum is to spread the information signal over a wider
bandwidth to make jamming and interception more difficult.
– can be used to transmit analog / digital data, using an analog signal
• Types:
 frequency hopping spread spectrum (FHSS)
 direct sequence spread spectrum (DSSS)

Channel coding is accomplished by selectively introducing redundant bits into the transmitted information stream.
Modulation is the process by which some characteristic of a carrier wave is varied in accordance with an information
signal, or modulating wave.

27-10-2020 Dr. Manas Khatua 10


Cont…
• Pseudorandom numbers
– generated by an algorithm using some initial value called the seed
– produce sequences of numbers that are not statistically random, but passes
reasonable tests of randomness
– unless you know the algorithm and the seed, it is impractical to predict the
sequence

• Gain from this apparent waste of spectrum


– The signals gains immunity from various kinds of noise and multipath
distortion.
– Immune to jamming attack
– It can also be used for hiding and encrypting signals.
– Several users can independently use the same higher bandwidth with very
little interference. (e.g. CDMA)

27-10-2020 Dr. Manas Khatua 11


DSSS
• each bit in the original signal is represented by multiple bits in the transmitted signal,
using a spreading code

• spreading code spreads the signal across a wider frequency band in direct proportion
to the number of bits used

Spread the
data stream

Transmit the
spread data using
modulation

27-10-2020 Dr. Manas Khatua 12


Modulation
Modulation schemes
• OQPSK PHY : DSSS PHY employing Offset Quadrature Phase-Shift Keying (OQPSK)
• BPSK PHY : DSSS PHY employing binary phase-shift keying (BPSK)
• ASK PHY : PSSS PHY employing Amplitude Shift Keying (ASK) and BPSK

Amplitude Shift Keying (ASK) Binary Phase-Shift Keying (BPSK)

27-10-2020 Dr. Manas Khatua 13


QPSK

In-phase
Constellation diagram
quadrature for QPSK
phase

Quadrature Phase-Shift Keying (QPSK)


• More efficient use of bandwidth
– as each signalling element
represents more than one bit.
27-10-2020 Dr. Manas Khatua 14
Orthogonal QPSK
• Problem in QPSK: large phase shift at high transition rate is difficult to perform.
Phase shift is 180° in QPSK.

• OQPSK
 a variation of QPSK known as
offset QPSK or orthogonal
QPSK
 a delay of one bit time is
introduced in the Q stream of
QPSK
 Its spectral characteristics and
bit-error performance are the
same as that of QPSK
 at any time the phase change
in the combined signal never
exceeds 90° (π/2)

27-10-2020 Dr. Manas Khatua 15


Other Attributes

• IEEE 802.15.4 does not prefer to use frequency hopping to minimize energy consumption.
• To minimize interference in 2.4 GHz band, IEEE 802.15.4 prefer channel no. 15, 20, 25, 26

• Transmission power is adjustable from 0.5 mW (min in 802.1.5.4) to 1 W (max in ISM band)
• Transmission power 1 mW provides theoretical distances as:
– Outdoor range 300 m.
– Indoor range 100 m.

27-10-2020 Dr. Manas Khatua 16


Cont…
• 802.15.4 PHY provides energy detection (ED) feature
– Application can request to asses each channel’s energy level
– Coordinator can make optimal selection of channel based on channels energy level

• 802.15.4 PHY provides link quality information (LQI) to NET and APP layers
– Transmitter may decide to use high transmission power based on LQI
– Applications may dynamically change 802.15.4 channels based on LQI

• 802.15.4 uses CSMA/CA which ask the PHY layer to do CCA


– Clear Channel Assessment (CCA):
• Can be energy threshold regardless of modulation
• Can be detection of modulation
• Can be both the above

27-10-2020 Dr. Manas Khatua 17


PHY Frame
• PHY packet fields
– Preamble (32 bits) – synchronization of data transmission
– SFD (8 bits) – shall be formatted as “1110 0101”
– PHY header (8 bits) – PSDU length
– PSDU (0 to 127 bytes) – data field

Sync Header PHY Header PHY Payload


Start of Frame Reserved PHY Service
Preamble Frame Length (1 bit) Data Unit (PSDU)
Delimiter (7 bit)
4 Octets 1 Octets 1 Octets
0-127 Bytes

27-10-2020 Dr. Manas Khatua 18


IEEE 802.15.4 MAC

27-10-2020 Dr. Manas Khatua 19


IEEE 802.15.4 Device Types
• There are two different device types :
– full function device (FFD)
– reduced function device (RFD)

• The FFD can operate in three modes by serving as


– PAN Coordinator
• scanning the network and selecting optimal RF channel
• selecting the 16 bit PAN ID for the network
– Coordinator (aka Parent, Join Proxy)
• relaying messages to other FFDs including PAN coordinator
• transmits periodic beacon (under beacon enable access mode)
• respond to beacon requests
– Device
• cannot route messages
• usually receivers are switched off except during transmission
• attached to the network only as leaf nodes

• The RFD can only serve as:


– Device
27-10-2020 Dr. Manas Khatua 20
Topology

27-10-2020 Dr. Manas Khatua 21


General MAC Frame Format

MAC frame types:


• Data frame
• ACK frame
• Beacon frame
• Command frame

27-10-2020 Dr. Manas Khatua 22


Cont…

Frame Control

27-10-2020 Dr. Manas Khatua 23


Beacon Frame Format

Octets:2 1 4 or 10 2 variable variable variable 2


Beacon Pending Frame
Frame Source address Superframe GTS
sequence address Beacon payload check
control information specification fields
number fields sequence
MAC
MAC header MAC payload
footer

Bits: 0-3 4-7 8-11 12 13 14 15


Beacon Superframe Final CAP Battery life PAN Association
Reserved
order order slot extension coordinator permit

27-10-2020 Dr. Manas Khatua 24


Command Frame Format

Octets:2 1 4 to 20 1 variable 2
Data Frame
Frame Address Command
sequence Command payload check
control information type
number sequence
MAC
MAC header MAC payload
footer

• Command Frame Types


– Association request – Orphan Notification
– Association response – Beacon request
– Disassociation notification – Coordinator realignment
– Data request – GTS request
– PAN ID conflict notification

27-10-2020 Dr. Manas Khatua 25


Data & ACK Frame Format
Data Frame
Octets:2 1 4 to 20 variable 2
Data Frame
Frame Address
sequence Data payload check
control information
number sequence
MAC
MAC header MAC Payload
footer

ACK Frame
Octets:2 1 2
Data Frame
Frame
sequence check
control
number sequence
MAC
MAC header
footer

27-10-2020 Dr. Manas Khatua 26


Device Addressing
• Two or more devices communicating on the same physical channel constitute a WPAN.
– A WPAN includes at least one FFD (PAN coordinator)
– Each independent PAN will select a unique PAN identifier

• Each device operating on a network has a unique 64-bit address, called extended unique identifier (EUI-
64)
– This address can be used for direct communication in the PAN

• A device also has a 16-bit short address, which is allocated by the PAN coordinator when the device
associates with its coordinator.

• IEEE 802.15.4 devices can be grouped into Personal Area Networks (PANs). These are identified by
their 2 Byte PAN identifier (PAN ID).

27-10-2020 Dr. Manas Khatua 27


Addressing Modes
• IEEE 802.15.4 frames contain address information for both the source and
destination.

• Each of these can be (independently) configured as one of three different


addressing modes, which sets the address data (none/short/long,
with/without PAN ID)

– Short address: The address field includes a short address and a PAN ID (total of 4
bytes).

– Long address: The address field includes a long address and a PAN ID (total of 10
bytes).

– No address:
• Both addresses are missing from ACK frames.
• For data and command frames, only one (either source or destination) field can be omitted
– if the source address is omitted, it means the PAN coordinator sent the frame;
– if the destination address is missing, it means it should be received by the PAN coordinator.

27-10-2020 Dr. Manas Khatua 28


Superframe
Beacon Beacon

CAP CFP

GTS GTS
Inactive
0 1

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

SD = aBaseSuperframeDuration*2SO symbols (Active)

BI = aBaseSuperframeDuration*2BO symbols

• A superframe is divided into two parts • superframe order (SO) : decides


– Inactive: all station sleep. the length of the active portion in
• no communication a superframe
• nodes can turn their radios off and go into
power saving mode • beacon order (BO) : decides the
– Active: length of a superframe or beacon
• Active period is divided into 16 slots transmission period
• 16 slots are further divided into two parts
– Contention access period (CAP) • beacon-enabled network should
– Contention free period (CFP) satisfy 0≦SO≦BO≦14
– Beacon only period (BOP) • PAN coordinator decides SO, BO
27-10-2020 Dr. Manas Khatua 29
Cont…
• aBaseSlotDuration = The number of symbols forming a superframe slot when
the superframe order (SO) is equal to zero = 60 PHY symbols

• aBaseSuperframeDuration = The number of symbols forming a superframe


when the superframe order (SO) is equal to zero. = aBaseSlotDuration ×
aNumSuperframeSlots

• aNumSuperframeSlots = The number of slots contained in any superframe = 16

• Length of a superframe can range from 15.36 msec to 215.7 sec (= 3.5 min).

• Beacons are used for


– starting superframes
– synchronizing with other devices
– announcing the existence of a PAN
– informing pending data in coordinators

27-10-2020 Dr. Manas Khatua 30


Cont…
• In a “beacon-enabled” network (i.e. uses superframe structure)

– Devices use the slotted CAMA/CA mechanism to contend for the channels

– FFDs who require fixed rates of transmissions can ask for GTS from the coordinator

• In a “nonbeacon-enabled” network (i.e. do not use superframe structure)

– Devices use the unslotted CAMA/CA mechanism for channel access

– GTS shall not be permitted

• CSMA/CA is not used for Beacon transmission; also not for Data frame transmission during CFP

• Each device will be


– active for 2-(BO-SO) portion of the time
– sleep for 1 - 2-(BO-SO) portion of the time

• Duty Cycle:

BO-SO 0 1 2 3 4 5 6 7 8 9 ≧10
Duty cycle (%) 100 50 25 12 6.25 3.125 1.56 0.78 0.39 0.195 < 0.1

27-10-2020 Dr. Manas Khatua 31


Data Transfer: Device -> Coordinator
• Data transferred from device to coordinator
– In a beacon-enable network,
• a device finds the beacon to synchronize to the superframe structure.
• Then it uses slotted CSMA/CA to transmit its data.

– In a non-beacon-enable network,
• device simply transmits its data using unslotted CSMA/CA

Communication to a coordinator Communication to a coordinator


In a beacon-enabled network In a non-beacon-enabled network

27-10-2020 Dr. Manas Khatua 32


Data Transfer: Coordinator -> Device
• Data transferred from coordinator to device
– in a beacon-enabled network:
• The coordinator indicates in the beacon that some data
is pending.
• A device periodically listens to the beacon and transmits
a Data Request command using slotted CSMA/CA.
• Then ACK, Data, and ACK

• Data transferred from coordinator to device


– in a non-beacon-enable network:
• The device transmits a Data Request using unslotted CSMA/CA.
• If the coordinator has its pending data, an ACK is replied.
• Then the coordinator transmits Data using unslotted CSMA/CA.
• If there is no pending data, a data frame with zero length
payload is transmitted.

27-10-2020 Dr. Manas Khatua 33


Channel Access Mechanism
• CSMA/CA random channel access is used more often

 beacon-enabled network  uses slotted CSMA/CA

In slotted CSMA/CA:
 The backoff period boundaries of every device in the PAN shall be aligned with the
superframe slot boundaries of the PAN coordinator
 i.e. the start of first backoff period of each device is aligned with the start of the beacon
transmission

 The MAC sublayer shall ensure that the PHY layer commences all of its transmissions on the
boundary of a backoff period

 nonbeacon-enabled network  uses unslotted CSMA/CA

In unslotted CSMA/CA:
 The backoff periods of one device are not related in time to the backoff periods of any other
device in the PAN.

• Algorithms runs using units of time called backoff periods, where one backoff
period shall be equal to aUnitBackoffPeriod.

27-10-2020 Dr. Manas Khatua 34


Slotted CSMA/CA
• Each device maintains 3 variables for each transmission attempt

– NB (Number of Backoff): number of times that backoff has been taken in this
attempt of transmission
• if exceeding macMaxCSMABackoff, the attempt fails

– BE (Backoff Exponent): the backoff exponent is related to how many backoff


periods a device shall wait before attempting to assess a channel.
• the number of backoff periods is greater than the remaining number of backoff periods in the
CAP
– MAC sublayer shall pause the backoff countdown at the end of the CAP,
and resume it at the start of the CAP in the next superframe

– CW (Contention Window): contention window length, the number clear slots that
must be seen after each backoff
• always set to 2 and count down to 0 if the channel is sensed to be clear
• The design is for some PHY parameters, which require 2 CCA for efficient channel usage.

• Battery Life Extension (BLE):


– designed for very low-power operation, where a node only contends in the first few
slots

27-10-2020 Dr. Manas Khatua 35


Cont…
Slotted CSMA
need 2 CCA
Delay for
random(2BE - 1) unit to ensure no
backoff periods
CW=2
NB = 0, CW =0 collision

Y Perform CCA on
Battery life BE = lesser of
backoff period
extension? (2, macMinBE)
boundary
N

BE = macMinBE Y
Channel idle?

Locate backoff CW = 2, NB = NB+1, CW = CW - 1


period boundary BE = min(BE+1, aMaxBE)

N NB> N
macMaxCSMABackoffs CW = 0?
?

NB (Number of Backoff) Y Y
BE (Backoff Exponent)
CW (Contention Window) Failure Success

CCA (Clear Channel Assessment)


27-10-2020 Dr. Manas Khatua 36
Contention in 802.11 & 802.15.4

Contention in
IEEE 802.11 DCF

Contention in
IEEE 802.15.4

27-10-2020 Dr. Manas Khatua 37


Why 2 CCAs to Ensure Collision-Free
• Each CCA occurs at the boundary of a backoff slot (= 20 PHY symbols),
and each CCA time = 8 PHY symbols.

• The standard specifies that a transmitter node performs the CCA twice
in order to protect acknowledgment (ACK).

– When an ACK packet is expected, the receiver shall send it after a tACK
time on the backoff boundary
• tACK varies from 12 to 31 symbols

– One-time CCA of a transmitter may potentially cause a collision between


a newly-transmitted packet and an ACK packet.

– (See examples below)

27-10-2020 Dr. Manas Khatua 38


Why 2 CCAs (case 1)
Backoff slot aUnitBackoffPeriod =
boundary aTurnaroundTime +
aCcaTime = 12+8 sym

Existing
session for
DATA & ACK

New CCA
transmitter
Backoff Detect
end here an ACK

New
transmitter CCA CCA

Backoff Detect
end here an ACK
27-10-2020 Dr. Manas Khatua 39
Why 2 CCAs (Case 2)
Backoff slot
boundary aTurnaroundTime

Existing
session

New CCA
transmitter
Backoff Detect
end here an ACK

New
transmitter CCA

Backoff Detect
end here an DATA
27-10-2020 Dr. Manas Khatua 40
Why 2 CCAs (Case 3)
Backoff boundary

Existing
session

New CCA CCA


transmitter
Backoff Detect
end here an ACK

New
transmitter CCA

Backoff Detect a
end here DATA
27-10-2020 Dr. Manas Khatua 41
Unslotted CSMA/CA
Un-slotted CSMA

NB = 0,
only one
BE = macMinBE
CCA

Delay for
random(2BE - 1) unit
backoff periods

Perform CCA

Y
Channel idle?

NB = NB+1,
BE = min(BE+1, aMaxBE)

N NB>
macMaxCSMABackoffs
?
NB (Number of Backoff) Y
BE (Backoff Exponent)
Failure Success
CW (Contention Window)
CCA (Clear Channel Assessment)
27-10-2020 Dr. Manas Khatua 42
GTS Concepts
• A guaranteed time slot (GTS) allows a device to operate on the channel within
a portion of the superframe

• A GTS shall only be allocated by the PAN coordinator

• The PAN coordinator can allocated up to 7 GTSs at the same time

• The PAN coordinator decides whether to allocate GTS based on:


– Requirements of the GTS request
– The current available capacity in the superframe

• A GTS can be deallocated


– At any time at the discretion of the PAN coordinator or
– By the device that originally requested the GTS

• A device that has been allocated a GTS may also operate in the CAP

• A data frame transmitted in an allocated GTS shall use only short addressing

27-10-2020 Dr. Manas Khatua 43


Cont…
• Before GTS starts, the GTS direction shall be specified as either
transmit or receive
– Each device may request one transmit GTS and/or one receive GTS

• A device shall only attempt to allocate and use a GTS if it is


currently tracking the beacon

• If a device loses synchronization with the PAN coordinator, all its


GTS allocations shall be lost

• The use of GTSs by an RFD is optional

27-10-2020 Dr. Manas Khatua 44


Association Procedures
• A device becomes a member of a PAN by associating with its coordinator

• Procedures:
Coordinator Device • The ACK to an Association Request
command does not mean that the device
has associated.
Scan
Association req. channel
• In IEEE 802.15.4, association results are
ACK announced in an indirect fashion.
– A coordinator responds to Association Requests
by appending devices’ long addresses in Beacon
Make Beacon Wait for frames
decision (pending address) response

Data req. • Devices need to send a data request to


the coordinator to acquire the
ACK
association result
Association resp.

ACK • After associating to a coordinator, a


device will be assigned a 16-bit short
address.

27-10-2020 Dr. Manas Khatua 45


Security

• IEEE 802.15.4 specification uses Advanced Encryption Standard (AES) with a 128-bit
key length as the base encryption algorithm

• Message integrity code (MIC), which is calculated for the entire frame using the
same AES key, to validate the data that is sent

27-10-2020 Dr. Manas Khatua 46


Limitations in 802.15.4
• Disadvantages of IEEE 802.1.5.4
– MAC reliability
– unbounded latency
– multipath fading
• IEEE 802.15.4e amendment of • IEEE 802.15.4g amendment of
802.15.4-2011 expands the MAC 802.15.4-2011 expands mainly
layer feature set PHY layer feature set

 to remedy the disadvantages of  to optimize large outdoor


802.15.4. wireless mesh networks for field
 to better suitable in factory and area networks (FANs)
process automation, and smart grid  to better suitable in smart grid or
smart utility network (SUN)
 Main modifications were: communication
• frame format,
• security,  Main modifications were:
• determinism mechanism, and • New PHY definitions
• frequency hopping • some MAC modifications needed to
support the new PHY

27-10-2020 Dr. Manas Khatua 47


Lessons Learned
 What is IEEE 802.15.4

 What is ZigBee

 IEEE 802.15.4. PHY


– Functionalities
– Spread Spectrum, DSSS
– Modulation, QPSK, OQPSK

 IEEE 802.15.4 MAC


– MAC Frame Formats
– Timeslot, Superframe
– Device Addressing
– Data Transfer Model
– Channel Access Methods
– Guaranteed time slot (GTS)
– Association Procedure
– Security

 Limitations of IEEE 802.15.4

27-10-2020 Dr. Manas Khatua 48


Figures and slide materials are taken from the following sources:

1. David Hanes et al., “IoT Fundamentals: Networking Technologies, Protocols,


and Use Cases for the Internet of Things”, 1st Edition, 2018, Pearson India.
2. Oliver Hersent et al., “The Internet of Things: Key Applications and Protocols”,
2018, Wiley India Pvt. Ltd.
27-10-2020 Dr. Manas Khatua 49
CS578: Internet of Things
IEEE 802.15.4e
802.15.4e Standard: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6471722
Survey Article: “IEEE 802.15.4e: A survey” https://www.sciencedirect.com/science/article/pii/S0140366416301980

Dr. Manas Khatua


Assistant Professor, Dept. of CSE, IIT Guwahati
E-mail: manaskhatua@iitg.ac.in

“The best among you is the one who doesn’t harm others with his tongue and hands.” – Muhammad
Limitations of 802.15.4 MAC
 Unbounded latency  No protection against
 Both BE and Non-BE mode use interferences/multipath fading
CSMA-CA  Due to usage of single channel
 No bound on maximum delay to
reach destination
 Powered relay nodes in multi-hop
network
 Non-reliable communication
 Relay nodes keep their radio active always.
 Very low delivery ratio due to the
 Results in complex synchronization and
inefficiency of CSMA-CA
beacon scheduling in BE mode
 Consume large energy

• So, 802.15.4 is unsuitable for many critical scenarios


• when applications have stringent requirements

02-11-2020 Dr. Manas Khatua 2


Requirements of Critical Applications
 Timeliness
 Deterministic latency for packet delivery

 Reliability
 Wire‐like reliability may be required, e.g., 99.9% or better

 Scalability
 Large network size

 Energy Efficiency
 Target battery lifetime: 5 years, or more

02-11-2020 Dr. Manas Khatua 3


Introduction to 802.15.4e
 IEEE 802.15 Task Group 4e was created in 2008

 To redesign the existing 802.15.4 MAC

 IEEE 802.15.4e MAC Enhancement Standard document approved in 2012

 Contains idea from existing WirelessHART and ISA 100.11.a


 Time slotted access
 Shared and dedicated slots
 Multi-channel communication
 Frequency hopping

 Introduce five MAC behaviour modes to support specific applications

 General functional enhancements


 Not tied to any specific application domain

02-11-2020 Dr. Manas Khatua 4


MAC behaviour modes
 Time Slotted Channel Hopping (TSCH)
 Industrial automation and process control
 Non-delay tolerant applications

 Deterministic and Synchronous Multi-channel Extension (DSME)


 Industrial and commercial applications
 Non-delay tolerant and delay tolerant applications

 Low Latency Deterministic Network (LLDN)


 Star network
 For single hop and single-channel networks
 Provides very low latency

02-11-2020 Dr. Manas Khatua 5


Cont..
 Asynchronous multi-channel adaptation (AMCA)
 For large network such as smart utility networks, infrastructure monitoring
 In large network single, common channel is not appropriate
 Used in non Beacon-Enabled PANs
 Device selects best link quality channel as its designated listening channel
 Sender node switch to receiver designated listening channel to transmit its data
 Beacon or Hello packet is used to advertise node designated listening channel

 Radio Frequency Identification Blink (BLINK)


 For Application like item/people identification, location and tracking
 Node communicate without prior association
 No ACK required
 Aloha protocol is used to transmit BLINK packet by “transmit only” devices

02-11-2020 Dr. Manas Khatua 6


General Functional Enhancements
These are not tied to any specific application domain:

 Low Energy (LE)


 Intended for applications that can trade latency for energy efficiency
 Operate in very low duty cycle (<= 1%)
 Appearing always on to the upper layers

 Information Elements (IE)


 Mechanism to exchange information at the MAC sublayer

 Enhanced Beacons (EB)


 Extension of the 802.15.4 beacon frames
 Provide greater flexibility
 Allow to create application-specific frames, by including relevant IEs

02-11-2020 Dr. Manas Khatua 7


Cont..
 Multi purpose Frame
 MAC wise frame format, differentiate on Information Elements (IE)

 MAC Performance Metric


 To provide feedback on channel quality to upper layers
 IP protocol may implement dynamic fragmentation of datagrams depending on
the channel conditions

 Fast Association (FastA)


 Allows a node to associate in a reduced amount of time
 Critical application gives priority to latency over energy

02-11-2020 Dr. Manas Khatua 8


TSCH Mode
 Topology independent

 Time slotted access


 Increase throughput by eliminating collision
among competing nodes
• So, TSCH provides
• increased network capacity,
 Predictable and bounded latency
• high reliability, and
• predictable latency,
 Multi‐channel communication • while maintaining very low
 More nodes exchange their frames at the same duty cycles
time
 Increases network capacity

 Channel hopping
 Mitigates the effects of interference and multi-
path fading
 Improve reliability

02-11-2020 Dr. Manas Khatua 9


Slotframe Structure

• TsTxOffset: Timeslot
Transmission Offset
= TsCCAOffset + TsCCA + TsRxTx

02-11-2020 Dr. Manas Khatua 10


Synchronization
 Nodes synchronize on a periodic slotframe

 Slotframe consists of a number of timeslots

 A timeslot is long enough to send a data frame and receive its ACK

 In each slotframe, EB is broadcasted by PAN Coordinator or other FFDs


 For network advertisement and synchronization
 EB contains information of
 Channel hopping, timeslot details and slotframe information for Synchronization

 A node can start sending its beacon only after getting a valid EB frame

02-11-2020 Dr. Manas Khatua 11


Re-synchronization
 Clock drift occurs due to
 Differences in manufacturing, temperature and supply voltage
 Clocks of different nodes typically pulse at a slightly different frequency

 Nodes need to periodically re-synchronize


 Frame-based synchronization
 ACK-based synchronization

02-11-2020 Dr. Manas Khatua 12


Channel Hopping
 The channel offset is translated in an operating frequency f using

𝑓 = 𝐹{ 𝐴𝑆𝑁 + 𝑐ℎ𝑂𝑓 mod 𝑛𝑐ℎ } ; ASN = k . S + t

 ASN (absolute slot number) : total # of slots elapsed since the network was deployed
 nch : number of physical channels presently available to consider
 F is implemented as a look‐up‐table containing the set of available channels
 k : count of slotframe cycle since the start of the network
 S : slotframe size
 t : timeslot in a slotframe
Max. no. of available
channel =16

Each channel is
identified by a
channelOffset

Channel could be
blacklisted because of
low quality
02-11-2020 Dr. Manas Khatua 13
TSCH Mode: Link
 Link: Pairwise assignment of a directed communication between devices in a
specific slot, with a given channel offset

 Link is denoted by [ t, chOf ]


 t is timeslot no. in the slotframe
 chOf is channel offset

 Two types of Link


 Dedicated links
 Direct access
 One transmitter – One receiver
 Generally used for Data Packet
 Shared links
 TSCH CSMA‐CA protocol
 Multiple transmitters/receivers
 Generally used for Control Packet

02-11-2020 Dr. Manas Khatua 14


TSCH CSMA/CA
 802.15.4 default CSMA/CA v/s TSCH CSMA/CA algorithm

 Backoff mechanism
 In 802.15.4 CSMA/CA, transmitting node waits for a random backoff time before trying to transmit
 In TSCH CSMA/CA, backoff mechanism is activated only after the node has experienced a collision

 Backoff unit duration


 In 802.15.4 CSMA/CA, backoff unit duration is 320μs
 In TSCH CSMA/CA, backoff unit duration corresponds to a shared slot duration

 Clear Channel Assessment (CCA)


 In 802.15.4 CSMA/CA, each node performs CCA to check the channel state, before performing
transmission
 In TSCH CSMA/CA, CCA is used to avoid the packet transmission if a strong external interference is
detected. Internal collision is not possible due to TSCH.

 Packet dropping
 In 802.15.4 CSMA/CA, a packet is dropped after the sender found channel busy for macMaxCSMABackoffs
consecutive times
 In TSCH CSMA/CA, a packet is dropped only if it reaches the maximum number of retransmissions i.e.,
macMaxFrameRetries

02-11-2020 Dr. Manas Khatua 15


Cont…

(2BE –1)

TSCH
Retransmission
Backoff Algorithm

CSMA/CA used in
shared link to avoid
repeated collisions.

In dedicated link, no
chance of collision.

02-11-2020 Dr. Manas Khatua 16


Network Formation
 PAN coordinator starts the process of network formation by sending EB frame
 Network advertisement

 EBs are special frames containing


 Synchronization information
 allows new devices to synchronize to the network

 Channel hopping information


 allows new devices to learn the channel hopping sequence

 Timeslot information
 describes when to expect a frame transmission and when to send an acknowledgment

 Initial link and slotframe information


 allows new devices to know:
o when to listen for transmissions from the advertising device
o when to transmit to the advertising device

02-11-2020 Dr. Manas Khatua 17


Cont..
 A new node starts listening for EB on a certain frequency

 Upon receiving an EB
 The MAC layer notifies the higher layer

 The higher layer initializes the slotframe and links


 Using information in the received EB message

 Switches the device into TSCH mode


 At this point the device is connected to the network

 The device allocates communication resources


 (i.e., slotframes and links)

 and starts advertising, on its turn

 the 802.15.4e standard did not define the EB advertising policy.

02-11-2020 Dr. Manas Khatua 18


Network Formation Goals
 Optimizing the network formation process
 Synchronized communication schedule consumes less energy of nodes by reducing
duty cycle

 Minimum Joining time


 Devices must keep the radio ON during the joining phase
 EBs should be sent frequently to reduce waiting time

 Minimize EB transmissions
 Frequent EB transmission consumes more communication resources
 Also Increases energy consumption at network and node level

• A. Kalita and M. Khatua, “Channel Condition Based Dynamic Beacon Interval for Faster Formation of 6TiSCH
Network”, IEEE Transaction on Mobile Computing, 2020.
• A. Kalita and M. Khatua, “Opportunistic Transmission of Control Packets for Faster Formation of 6TiSCH
Network”, ACM Transactions on Internet of Things, 2020.

02-11-2020 Dr. Manas Khatua 19


TSCH Link scheduling
 Assignment of unique link to node for data transmission

 Challenging in dynamic networks

 IEEE 802.15.4e standard does not specify how to derive an appropriate link
schedule

 Existing multi-channel scheduling schemes are not suitable for TSCH networks
 They do not allow per-packet channel hopping
 Not for resource-constrained nodes
 They are not efficient in terms of channel utilization

02-11-2020 Dr. Manas Khatua 20


Cont..
 Centralized Scheduling
 Link schedule computed and distributed by a special node
 Network coordinator
 Based on information received by all the nodes of the network
 Link schedule has to be re-computed and re-distributed every time a change in the
operating conditions occurs
 Not good for dynamic network and large scale network

 Distributed Scheduling
 Link schedule is computed autonomously by each node
 Based on local, partial information exchanged with its neighbors
 Limited Overhead
 Suitable for energy‐constrained nodes
 Good choice for dynamic network and large scale network

02-11-2020 Dr. Manas Khatua 21


TSCH: Open Issues
 Network Formation
 Current solution inefficient for
• Energy consumption
• Formation time
• Mobile Objects

 Security
 Selective Jamming (SJ) attacks
 Secure Beacons and Different Frequency hopping sequence

 TSCH network synchronization


 Energy consumption

 TSCH slot/cell scheduling


 Guaranteed QoS

02-11-2020 Dr. Manas Khatua 22


6TiSCH Network
 6TiSCH working group created by IETF
 Goal: integrate TSCH with the open source IP protocol stack
 To enable IPv6 over TSCH mode of IEEE 802.15.4e
 Defining a new functional entity in charge of TSCH scheduling

A new sublayer, called 6top


• Works on top of TSCH
• Build and manage TSCH
schedule
• add/delete links/cells
• 6top also collects
connectivity information
• Monitors the
performance of cells

Survey Article: “IETF 6TiSCH: A Tutorial” https://ieeexplore.ieee.org/document/8823863

02-11-2020 Dr. Manas Khatua 23


Need for 6TiSCH
 In 6TiSCH, the TSCH MAC mode is placed under an IPv6-enabled protocol stack:

• IPv6 over Low-Power Wireless Personal Area Network (6LoWPAN)


• IPv6 Routing Protocol for Low-Power and Lossy Networks (RPL), and
• Constrained Application Protocol (CoAP)

 TSCH does not define


 Policies to build and maintain the communication schedule

 Mechanisms to match the schedule to the multi‐hop paths maintained by RPL

 Mechanisms to adapt the resources allocated between neighbor nodes to the data
traffic flows

 Techniques to allow differentiated treatment of packets


 data packets & control packet

02-11-2020 Dr. Manas Khatua 24


6TiSCH Architecture
 Considers low-power lossy-network (LLN)

 Allow more than 1000 nodes

 Nodes are in same IPv6 subnet

 6LoWPAN Header compression (HC) is used to


transmit packet

 Presence of high-speed backbone (e.g. WiFi


mesh) to connect all nodes

 Constrained nodes are attached to backbone


through backbone router (BBR)

 Backbone is connected to the Internet through Fig. 6TiSCH Architecture


a Gateway
02-11-2020 Dr. Manas Khatua 25
6TiSCH Protocol Stack

02-11-2020 Dr. Manas Khatua 26


6TiSCH Scheduling
 6TiSCH considers three modes for building and maintaining the TSCH schedule

 1. Minimal Scheduling [RFC 8180]


 Default schedule
 TSCH schedule is static, and either preconfigured or learnt by a node at joining time
 Used during network bootstrap, or when a better schedule is not available

 2. Centralized Scheduling
 A central entity called Path Computation Element (PCE) collects network state
information and traffic requirements
 It builds and install the schedule in the network

 3. Distributed Scheduling
 Nodes agree on a common distributed schedule by using distributed multi‐hop
scheduling protocols and neighbor‐to‐neighbor scheduling negotiation
 Reservation phase & negotiation phase

02-11-2020 Dr. Manas Khatua 27


Research Articles on Scheduling
• M. R. Palattella, N. Accettura, M. Dohler, L. A. Grieco, and G. Boggia, “Traffic aware scheduling algorithm for reliable low-power multi-hop IEEE
802.15.4e networks,” in Proc. of the PIMRC, Sydney, Australia, September 2012, pp. 327–332. <TASA>
• N. Accettura, E. Vogli, M.R. Palattella, L.A. Grieco, G. Boggia, M. Dohler, “Decentralized traffic aware scheduling in 6tisch networks: design and
experimental evaluation,” IEEE Internet Things Journal, vol. 2, no. 6, December 2015, pp. 455–470. <DeTAS>

• S. Duquennoy, B. Al Nahas, O. Landsiedel, T. Watteyne, “Orchestra: robust mesh networks through autonomously scheduled TSCH,” in: Proc. of the
13th ACM Conference on Embedded Networked Sensor Systems (SenSys), NY, USA, November 2015, pp. 337–350. <Orchestra>
• Seohyang Kim, Hyung-Sin Kim, Chongkwon Kim, “ALICE: Autonomous Link-based Cell Scheduling for TSCH”, ,” in: Proc. of the IPSN , April 16–18,
2019, Montreal, Canada, pp. 1-12. <ALICE>

• Taieb Hamza and Georges Kaddoum “Enhanced Minimal Scheduling Function for IEEE 802.15.4e TSCH Networks”, IEEE Wireless Communications
and Networking Conference, 15- 18 April 2019, Marrakesh, Morocco, pp. 1-7. <EMSF>
• Nastooh Taheri Javan, Masoud Sabaei and Vesal Hakami, “IEEE 802.15.4.e TSCH-Based Scheduling for Throughput Optimization: A Combinatorial
Multi-Armed Bandit Approach”, IEEE Sensors Journal, 2019, pp. 1-12. <CMAB>

• SEUNGBEOM JEONG, JEONGYEUP PAEKz, HYUNG-SIN KIM, and SAEWOONG BAHK “TESLA: Traffic-aware Elastic Slotframe Adjustment in TSCH
Networks”, IEEE Access, 2019, Vol. 4, pp. 1-16. <TESLA>
• Mike O. Ojo, Stefano Giordano, Davide Adami and Michele Pagano, “Throughput Maximizing and Fair Scheduling Algorithms in Industrial Internet of
Things Networks”, IEEE Transactions on Industrial Informatics, 2019. pp.1-11. <Throughput-maximum>

• Vasileios Kotsiou, Georgios Z. Papadopoulos, Periklis Chatzimisios, F. Theoleyre, “Whitelisting without Collisions for Centralized Scheduling in
Wireless Industrial Networks”, IEEE Internet of Things Journal, 2019, pp. 1-9. <Whitelist>
• T. Chang, M. Vucinic, X. Vilajosana, S. Duquennoy, and D. Dujovne, “6TiSCH Minimal Scheduling Function (MSF) draft-ietf-6tisch-msf-16,” April 2020.
<MSF>

• Seungbeom Jeong, Hyung-Sin Kimy, Jeongyeup Paek, and Saewoong Bahk, “OST: On-Demand TSCH Scheduling with Traffic-Awareness,” INFOCOM
2020. <OST>

02-11-2020 Dr. Manas Khatua 28


02-11-2020 Dr. Manas Khatua 29
CS578: Internet of Things
Link Scheduling Algorithm,
MSF

Dr. Manas Khatua


Assistant Professor, Dept. of CSE, IIT Guwahati
E-mail: manaskhatua@iitg.ac.in

“He who regards all men as equals is religious.” – Guru Nanak


Introduction
➢ IEEE 802.15.4 has several limitations such as
▪ Low Reliability

▪ Unbounded packet delays

▪ No protection against interference/ fading

o So unable to handle strict requirement of IIoT


➢ To make it capable to address the need of emerging industrial applications
▪ IEEE 802.15.4 amendment introduces several enhancements to the MAC layer

▪ Some general enhancements plus defines three MAC behaviour modes

✓ Time Slotted Channel Hopping (TSCH)

✓ Deterministic and Synchronous Multi-channel Extension (DSME)

✓ Low Latency Deterministic Network (LLDN)

04-11-2020 Dr. Manas Khatua 2


TSCH (Time Slotted Channel Hopping)
▪ TSCH is specifically introduced for supporting Industrial automation application.
▪ Combines time slotted access , channel hopping with multichannel capabilities.
▪ Main Characteristics

Beacons Yes (EB)


Time organization PERIODIC SLOTFRAME:
✓ arbitrary number of time slots
✓ Dedicated and Shared time slots
Channel Access ✓ Time Slotted (dedicated Time slots)
✓ TSCH-CSMA-CA ( Shared Time slot)
Topologies STAR, TREE, MESH
Multichannel Mechanism Channel Hopping
Timeslot Scheduling Mechanism NOT SPECIFIED
Group ACK's No
Network Synchronization Frame /ACK based synchronization

04-11-2020 Dr. Manas Khatua 3


TSCH Cont...

TSCH provides
✓ Increases network capacity
✓ High reliability
Time Synch ✓ Predictable latency
TSCH
Scheduling ronisation ✓ While maintaining very low duty cycle

Network
formation Slotframe

Channel
hopping

TSCH Components

04-11-2020 Dr. Manas Khatua 4


Slot frame Structure & synchronisation
▪ Slot frame is a unit which automatically repeats over time
▪ Does not require beacon to initiate communication
▪ Can be added/deleted/modified while the network is running
▪ Slot frame can be further divided into smaller subunits called time-slot to exchange data and
acknowledgement between devices
▪ Each time-slot is uniquely determined by ASN (Absolute Slot Number)
✓ Number of time-slots elapsed since the start of the network and increases globally
after each time-slot
▪ A time-slot can be dedicated or shared.

Fig: TSCH Slot frame Fig: A time-slot

04-11-2020 Dr. Manas Khatua 5


Slot frame Structure & synchronisation
Cont...
▪ Inside a timeslot, packets are transmitted exactly after TSTxOffset from the beginning of
time-slot itself
▪ Receiver starts listening GuardTime before
▪ Two ways for a node to synchronize with its time source neighbor
✓ Frame based
✓ ACK based

04-11-2020 Dr. Manas Khatua 6


Channel Hopping
▪ Transmit data on different frequencies
▪ With channel hopping, supports multichannel communication
▪ <=16 different channels are available
▪ Each channel is identified by a channel offset in the range (0-15)
▪ TSCH link is a pair of (tsoffset, chOffset)
▪ Physical channel is idenfied by
o Ch= F (ASN + chOffset) % nch
o F can be implemented as lookup table and nch is total number of channels available
o Returns different frequency for the same link at different time slots.

04-11-2020 Dr. Manas Khatua 7


Link Scheduling
▪ Procedure which create a schedule through which nodes communicate in a TSCH network
▪ Assignment of links to nodes for data transmission
▪ A schedule instruct a node what to do in a time-slot( I.e. Transmit/ receive or sleep)
▪ 802.15.4.e only specifies how to execute a schedule but does not define any procedure to
build a schedule
▪ Finding optimal schedule is not trivial in large network with multi-hop topology and more
challenging in dynamic network where the topology changes over time

Fig: A sensor network with a tree


Fig: possible link schedule
topology
04-11-2020 Dr. Manas Khatua 8
Link Scheduling Taxonomy
▪ New scheduling Algorithms specifically designed for TSCH network, have recently appeared
in literature
▪ Several dimensions on which scheduling algorithm can be mapped
o Algorithm execution model: how the scheduling algorithm is executed by nodes
✓ Centralized Approach
✓ Distributed Approach
✓ Autonomous Approach
✓ Hybrid Approach
o Design Characteristics: specifies the criteria based on which scheduling decision takes
place. ✓ Traffic aware
✓ Priority based

o Design Objectives: indicates primary goal of TSCH Algorithm. Such as


✓ Minimization of end-to-end delay
✓ Minimizing Slot-frame length
✓ Maximizing reliability and scalability
✓ Etc.

04-11-2020 Dr. Manas Khatua 9


Link Scheduling Taxonomy Cont...
o Type of data indicates type of data generated and transmitted by nodes
✓ Homogenous data
✓ Heterogenous data

o Application domain: indicates numerous environments and conditions where TSCH


is applicable.
✓ Industrial Wireless Networks (IWN)
✓ Industrial Internet of Things (IIoT)
✓ Non-Deterministic Network (NDN)
✓ Low Latency Network (LLN)
✓ Etc.

o Solving Methodology specifies solving technique used for TSCH scheduling

✓ Linear Programming (LP)


✓ Non-Linear programming (NLP)
✓ Mixed Integer Programming (IP)
✓ Graph based Methods (GB)
✓ Etc.
04-11-2020 Dr. Manas Khatua 10
Link Scheduling Taxonomy Cont...
Taxonomy of TSCH Scheduling Algorithms

04-11-2020 Dr. Manas Khatua 11


Link Scheduling: Centralized Approach

Fig: Centralized Scheduler

✓ A specific node ( coordinator) in the network


creates distributes and updates the network
schedule based on the information(topology
& traffic information) received from all nodes
in the network.

✓ Creates the schedule with global view of the


network
Fig: Generalized mechanism of a Centralized
scheduler
04-11-2020 Dr. Manas Khatua 12
Centralized Approach Cont...
➢ Centralized Approach Pros:
✓ advantage of simplicity in a small and stable network
✓ Can construct maximally efficient schedules, assuming sufficient information on the
controller
➢ Centralized Approach Cons:
✓ There is high signaling overhead as large anount of information flows from the nodes to
controller and vice versa
✓ Limited scalability
✓ As link schedule needs to be recomputed and redistributed every time a change happens ,
not suitable for large-scale and dynamic networks
✓ Quick action can't be taken when the network changes suddenly.
➢ Few Centralized Scheduling schemes
✓ Traffic Aware Scheduling Algorithm (TASA)
✓ Adaptive Multi-hop Scheduling (AMUS)

04-11-2020 Dr. Manas Khatua 13


Link Scheduling: Distributed Approach
➢ Link schedule is computed autonomously
by each node based on local, partial
information exchanged between its
neighbors

➢ Distributed Approach Pros

✓ They are more affordable for energy


constrained nodes since their overhead is
quite limited.
✓ Information is collected locally so low
Fig: Distributed Scheduling signaling overhead
✓ adapt to dynamic topology and traffic
load changes efficiently without signaling
overhead to controller.

04-11-2020 Dr. Manas Khatua 14


Distributed Approach Cont...
➢ Distributed Approach Cons
✓ Overall schedule provided by the distributed algorithm is usually not the optimal one.
✓ Prone to collisions due to interference.
✓ Due to scanty of information, lacks visibility on the view of the whole network
✓ It is difficult for the network operator to monitor and to debug a low power network in
which the decisions are made through the intra-node negotiation in a complex and
opaque process.

➢ Distributed Approach schemes


✓ Decentralized Traffic Aware Scheduling in 6TiSCH Networks (DeTAS)

✓ 6TiSCH Minimal Scheduling Function (MSF)

04-11-2020 Dr. Manas Khatua 15


Link Scheduling: Autonomous Approach
➢ No negotiation is used to create the TSCH
schedule
➢ Only used information from routing protocol
(RPL)
➢ Nodes autonomously calculate their cell
usage plan based on the RPL structure.
➢ Does not require any central coordinator,
negotiation ,signaling or any path reservation

Fig: Autonomous Scheduler Autonomous Approach Pros


✓ Simple
Autonomous Approach Algorithms ✓ Light weight scheduling algorithm
✓ Scheduling-routing Consistency by
✓ Orchestra: Robust Mesh Networks design
through Autonomously scheduled ✓ Quickly reacts to changes in TSCH
TSCH network
✓ Autonomous link-based cell
scheduling for TSCH (ALICE)
04-11-2020 Dr. Manas Khatua 16
MSF Introduction
➢ About MSF:
▪ MSF: 6TiSCH Minimal Scheduling Function
▪ Publication year: 2020 (last updated)

➢ Objective of MSF:
▪ To manage the communication
schedule in the 6TiSCH schedule
in a distributed manner.

▪ To describe the behavior of a


node when joining the network​

6TiSCH protocol stack

❑ https://tools.ietf.org/html/draft-ietf-6tisch-msf-18
04-11-2020 Dr. Manas Khatua 17
Solution Approach
▪ A node implementing MSF should implement 6TiSCH minimal configuration.
▪ Minimal cell is for broadcast frames(EB,DIO)​
▪ 3 slotframes used​
✓ Slotframe0(Minimal cell)​
✓ Slotframe1(Autonomous cells)​
✓ Slotframe2 (6P Negotiated cells)​

➢ Autonomous cells
▪ Maintained autonomously by node without 6P negotiation​
▪ AutoTxCell (cell options Tx=1,Rx=0,shared=1)(added/deleted on demand)​
✓ When there is a frame to send and there is no negotiated Tx cell and uninstall
after sending out the frame​ ✓ For Tx cell,
▪ AutoRxCell (cell options Tx=0,Rx=1,shared=0)(permanent)​ EUI64
✓ Always remain scheduled after synchronization​ of destination
▪ SlotOffset = 1+ hash (EUI64, Slotframe1 –1) node
▪ ChannelOffset = hash (EUI64, NumberOfChannels) ✓ For Rx cell,
hash of EUI64
of node itself
04-11-2020 Dr. Manas Khatua 18
Solution Approach Cont...
➢ Node Behavior at Boot
1) Randomly choosing a frequency​ JP
2) Receiving EB's and chose a Join Proxy(JP)​ AutoTxCell NegotiatedTxCell
3) Setting up autonomous cells for join process​
4) Acquiring RPL rank and select a routing parent​
5) Setting up first Tx negotiated cell​
6) Send EB's and DIO's on the minimal cell​ AutoTxCell AutoTxCell
• Cell options: Tx=1,Rx=0 or Tx=0 Rx=1 Or
Pledge JRC
• Number of cells:1 NegotiatedTxCell
• Cell list: at least 5
6P ADD Request
over AutoTxCell Fig: Setting Up Autonomous cell for
Selected join process
Joined node Parent
6P Response
over AutoTxCell

Fig: Setting Up the first


Negotiated cell

04-11-2020 Dr. Manas Khatua 19


Solution Approach Cont...
➢ End state of Join Process
▪ It is synchronized to the network​
▪ It is using the link layer keying material it learned​
▪ Selected one neighbor as its Routing Parent​
▪ Has one AutoRx Cell​
▪ Has one negotiated Tx cell to the selected parent​
▪ Starts sending DIO's serving as a Router​
▪ Starts sending EB's serving as a JP​

➢ Rules for adding/deleting cells(Negotiated cells)


✓ Adapting to traffic
▪ For a node, monitors current usage of the cells it has with one of its
neighbors
▪ If frames to send is more than capacity of the scheduled cell, triggers a 6P
ADD command to add cells
▪ Maintains two separate pairs of NumCellsElapsed and NumCellsUsed co
unters for Tx and Rx cells.

04-11-2020 Dr. Manas Khatua 20


Solution Approach Cont...
▪ NumCellsElapsed will be incremented by 1 when the cell is declared as
negotiated cell and NumCellsUsed will be incremented by 1 when it is used for
transmission or on reception of valid frames.
▪ Cell usage = NumCellsUsed / NumCellsElapsed

▪ Both initialized to zero when node boots


▪ when NumCellsElapsed reaches MaxNumCell
✓ If NumCellsUsed > LIM_NUMCELLSUSED_HIGH
• Triggers 6P to add a single cell to the selected parent
✓ If NumCellsUsed < LIM_NUMCELLSUSED_LOW
• Triggers 6P to remove a single cell to the selected parent
✓ Reset to zero

o Since there is no NegotiatedRxCell initially, so counter increases for AutoRxCell


also.

04-11-2020 Dr. Manas Khatua 21


Solution Approach Cont...

An example of 2 step 6P
transaction
04-11-2020 Dr. Manas Khatua 22
Solution Approach Cont...
➢ Rules for Cell list
✓ To have at least NumCells in
CellList
✓ Each cell must have different slot
offset value
✓ Must not have any scheduled cell
on the same slot offset
✓ Can't be with slotoffset 0
✓ Should be randomly chosen
among all slotoffset values
✓ Channel offset is chosen
randomly from
[0...NoOfFrequencies]
❑ IETF 6TiSCH:A Tutorial
❑ https://tools.ietf.org/html
An example of 3 step 6P
/draft-ietf-6tisch-6top-
transaction
protocol
04-11-2020 Dr. Manas Khatua 23
Solution Approach Cont...
✓ Switching parent
▪ Counts the number of negotiated Tx cell it has with the old parent
per slot frame.
▪ Triggers one or more 6p ADD request with same cell options to the
new parent.
▪ Then issues 6p CLEAR command to its old parent.

✓ Handling schedule collisions

▪ Two pair of nodes may get same (SlotOffset, ChannelOffset) pair.


▪ For each negotiated Tx cell, maintains counters NumTx and NumTXAck
▪ NumTx is to count transmission attempts and NumTXAck counts
successful transmission on that cell.
▪ PDR = NumTXAck / NumTx
▪ All cells to the parent of that node should have same PDR otherwise
indicate collision on that cell

04-11-2020 Dr. Manas Khatua 24


Solution Approach Cont...
✓ Rules for relocation of cell(Negotiated cells)

▪ Every Housekeeping period the node execute


✓ For each negotiated Tx cell with that parent compute its PDR
✓ Identifies cell with highest PDR
✓ For other cell, find the difference with highest PDR.
✓ If difference in PDR> Relocate_PDRThRESH then it triggers
relocation command.

o Relocation of negotiated Rx cell is not supported by MSF

04-11-2020 Dr. Manas Khatua 25


Solution Approach Cont...
➢ 6P Timeout value
✓ For each retransmission it backoff with the largest value
✓ ((2^MAXBE) –1) * MAXRETRIES *SLOTFRAME_LENGTH
• Where ,MAXBE is maximum backoff exponent used
• MAXRETRIES is the maximum retransmission time
• SLOTFRAME_LENGTH is the length of the slotframe
➢ 6P error handling
✓ Nothing:no error
✓ Clear: abort 6P transaction. Remove all
cells scheduled.
✓ Quarantine: like Clear + remove the node
from neighbor and routing table
✓ WaitRetry: Abort the 6P Transaction and
retry after random time the same
transaction

Fig: 6P error code and its recommended


behavior
04-11-2020 Dr. Manas Khatua 26
Solution Approach Cont...
➢ MSF Constants

Fig: MSF constants and their recommended


values

04-11-2020 Dr. Manas Khatua 27


Solution Approach Cont...
➢ MSF Security Considerations
✓ MSF does not define a new protocol or packet format
✓ It triggers several actions carried out by the protocol defined in 6Tisch
operation sublayer, 6P and constrained Join Protocol (CoJP)

04-11-2020 Dr. Manas Khatua 28


04-11-2020 Dr. Manas Khatua 29
CS578: Internet of Things
6TiSCH Network Formation

Dr. Manas Khatua


Assistant Professor, Dept. of CSE, IIT Guwahati
E-mail: manaskhatua@iitg.ac.in
6TiSCH communication stack

• Upper Layer: IPv6 connectivity


– 6LoWPAN, CoAP, MQTT, RPL

• 6TiSCH Layer
– 6TiSCH Minimal Configuration, 6top

• Bottom Layer: IEEE 802.15.4e


– TSCH

15-11-2020 Dr. Manas Khatua 2


6TiSCH Network Formation Process
 Join Registrar/Coordinator (JRC)
starts the formation process
 Enhanced Beacon (EB)
 Routing Information (DIO)
 Pledge (new node) scans for EB on a
random channel (RDC 100%)
 After receiving an EB, pledge
synchronized with the underlying
TSCH network (RDC ~1%)
 Synchronized node waits for DIO,
after exchanging JRQ & JRS
 After receiving DIO, pledge becomes
joined node; can transmit own packets
 Network formation completes when
all the pledge join the network
15-11-2020 Dr. Manas Khatua 3
Why Network formation is an issue?
• Channel hopping feature of TSCH
– A pledge does not know in which channel transmission of control packets
is happening

• Limited resource allocated for control packets


– Only one shared cell in a slotframe

15-11-2020 Dr. Manas Khatua 4


TSCH Vs 6TiSCH Network formation

• TSCH formation/synchronization time


– A pledge gets synchronized with a TSCH network after receiving a valid
EB frame
– The time when a pledge receives its first EB frame is considered as TSCH
synchronization time or TSCH formation time

• 6TiSCH formation time


– When a TSCH synchronized node receives a valid DIO packet, it becomes
a 6TiSCH joined node
– The DIO receiving time is considered as 6TiSCH joining time

15-11-2020 Dr. Manas Khatua 5


Goals during Network formation

• Reduce pledge joining time


– To immediately transmit data

• Save energy consumption


– Radio duty cycle is 100% before TSCH synchronization
– Maximum energy consumption

15-11-2020 Dr. Manas Khatua 6


6TiSCH minimal configuration (RFC 8180)
 In 2017, 6TiSCH Working Group released the 6TiSCH minimal configuration
standard in order to provide details about the minimal resource usage during
network bootstrapping
 Only one shared cell per slotframe can be used for transmission of control
packets by all the nodes
 Both EB and DIO packets are required to complete joining process
 EB has the highest priority over other control frames like DIO, DIS, etc.
 Control packets (JRQ and JRS) for secure enrolment of a node are also
exchanged in shared cell

Shortcomings

• Static Allocation
• Joining time is more

15-11-2020 Dr. Manas Khatua 7


Dynamic Resource Allocation
• Vallati et.al. proved that the 6TiSCH minimal configuration does not provide
enough resource
– To transmit all the generated control packets

• Increased the number of shared cells per slotframe


– As per the generated control packets

• Achieved faster formation

• Shortcomings
– Consumes more energy
– Hampers data transmission schedule
– More shared cell Fig. DRA allocation strategy

Carlo VALLATI et al. “Improving Network Formation in 6TiSCH Networks”. In : IEEE Transactions on Mobile Computing 18.1
(2019), p. 98-110. ISSN : 1536-1233.

15-11-2020 Dr. Manas Khatua 8


Channel Condition based
Dynamic Beacon Interval (C2CBI)

• Shows the demerit of fixed beacon generation interval


– Congest the shared cell when the number of joined nodes increases

• Proposed dynamic beacon interval instead of fixed beacon interval


– Less congestion, shorter beacon generation interval
– More congestion, longer beacon generation interval

• Congestion is measured by channel busy ration (CBR)

A. Kalita and M. Khatua, “Channel Condition Based Dynamic Beacon Interval for Faster Formation of 6TiSCH Network". IEEE
Transaction on Mobile Computing. [Online]. Available : https ://doi.org/10.1109/TMC.2020.2980828.

15-11-2020 Dr. Manas Khatua 9


Contd..

• Measuring channel condition

𝐵𝑢𝑠𝑦 𝑠ℎ𝑎𝑟𝑒𝑑 𝑠𝑙𝑜𝑡𝑠


CBR=
𝐵𝑢𝑠𝑦 𝑠ℎ𝑎𝑟𝑒𝑑 𝑠𝑙𝑜𝑡𝑠 + 𝐸𝑚𝑝𝑡𝑦 𝑠ℎ𝑎𝑟𝑒𝑑 𝑠𝑙𝑜𝑡𝑠

• Determining beacon interval


– The value of CBR is used to calculate next beacon interval as follows

𝐼𝑚𝑖𝑛 ; 𝑖𝑓 𝐶𝐵𝑅 = 0
𝐼𝑒𝑏 =ቊ 𝐶𝐵𝑅
𝐼𝑚𝑖𝑛 + 𝐼𝑚𝑎𝑥 − 𝐼𝑚𝑖𝑛 ; 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

where, 𝐼𝑒𝑏 is the calculated beacon interval and 𝐼𝑚𝑖𝑛 and 𝐼𝑚𝑎𝑥 are the minimum and maximum
value of 𝐼𝑒𝑏

A. Kalita and M. Khatua, “Channel Condition Based Dynamic Beacon Interval for Faster Formation of 6TiSCH Network". IEEE
Transaction on Mobile Computing. [Online]. Available : https ://doi.org/10.1109/TMC.2020.2980828.

15-11-2020 Dr. Manas Khatua 10


Contd..

• Achieves faster formation than 6TiSCH minimal configuration but not


as compared to DRA

• Consumes less energy compared to 6TiSCH minimal configuration and


DRA

A. Kalita and M. Khatua, “Channel Condition Based Dynamic Beacon Interval for Faster Formation of 6TiSCH Network". IEEE
Transaction on Mobile Computing. [Online]. Available : https ://doi.org/10.1109/TMC.2020.2980828.

15-11-2020 Dr. Manas Khatua 11


Opportunistic Transmission of Control Packets (OTCP)
• Mainly, considered three problems
– Problem due to EB’s highest priority
– Negative effect of Trickle Algorithm
– Uncertainty in accessing the shared cell

• Problem due to EB’s highest priority


• DIO packet starves to get transmitted due to EB’s highest priority
• New node has to wait for DIO packet

Solution:

Provide highest priority to DIO packet


during its requirement
 Received DIS request
 Received JRQ frame

A. Kalita and M. Khatua,“Opportunistic Transmission of control packets for Faster Formation of 6TiSCH Network” in ACM Transactions on
Internet of Things,

15-11-2020 Dr. Manas Khatua 12


Contd..
 Negative Effect of Trickle Algorithm
• DIO packets are generated using Trickle Algorithm
• In stable network, Trickle Algorithm doubles the DIO generation interval after
each interval
• In worst case, a new node has to wait at least maximum Trickle interval time

Solutions

– Reset the Trickle algorithm


when a joined node receives a
JRQ

A. Kalita and M. Khatua,“Opportunistic Transmission of control packets for Faster Formation of 6TiSCH Network” in ACM Transactions on
Internet of Things,

15-11-2020 Dr. Manas Khatua 13


Opportunistic Priority Alternation and
Rate control scheme (OPR)

A. Kalita and M. Khatua,“Opportunistic Transmission of control packets for Faster Formation of 6TiSCH Network” in ACM Transactions on
Internet of Things,

15-11-2020 Dr. Manas Khatua 14


Contd..
 Delayed Channel Access for Control Frames
• CSMA/CA is used to send control packets in shared slots
• Therefore, there exist uncertainty in accessing the shared slot
• Uncertainty in accessing shared channel increases with the increasing number of
joined nodes
• This results in increasing joining time for new nodes

Solutions

– A joined node does not need to wait for more time to participate in contention race in
order to transmit its urgent control packet once the node has encountered channel
busy

A. Kalita and M. Khatua,“Opportunistic Transmission of control packets for Faster Formation of 6TiSCH Network” in ACM Transactions on
Internet of Things,

15-11-2020 Dr. Manas Khatua 15


Opportunistic Channel Access Scheme (OCA)

A. Kalita and M. Khatua,“Opportunistic Transmission of control packets for Faster Formation of 6TiSCH Network” in ACM Transactions on
Internet of Things,

15-11-2020 Dr. Manas Khatua 16


Contd..

• The proposed scheme performs better than the benchmark schemes (6TiSCH
minimal configuration) in terms of joining time and energy consumption

A. Kalita and M. Khatua,“Opportunistic Transmission of control packets for Faster Formation of 6TiSCH Network” in ACM Transactions on
Internet of Things,

15-11-2020 Dr. Manas Khatua 17


15-11-2020 Dr. Manas Khatua 18
CS578: Internet of Things
6LoWPAN:
IPv6 over 802.15.4

Dr. Manas Khatua


Assistant Professor, Dept. of CSE, IIT Guwahati
E-mail: manaskhatua@iitg.ac.in

“Peace comes from within. Do not seek it without.” – Gautama Buddha


6LoWPAN
IETF formed 6LoWPAN WG in 2004 to
design the Adaptation Layer

6LoWPAN: IPv6 over Low-Power


Wireless Personal Area Networks

An Open IoT Networking Protocol

 Open: Specified by the Internet Engineering Task Force (IETF)


 Specifications available without any membership or license fee

 IoT: Making “Things” Internet-aware


 Usage of IPv6 to make use of internet protocols
 Leverage the success of open protocols in contrast to proprietary solutions

 Networking: Stopping at layer 3


 Application layer protocols are flexible and can vary

08-11-2020 Dr. Manas Khatua 2


6LoWPAN Architecture

o H: Host
o R: Router
o ER: Edge router

Three different kinds of LoWPANs:


• Simple LoWPANs,
• Extended LoWPANs, and
• Ad hoc LoWPANs.

08-11-2020 Dr. Manas Khatua 3


RFCs
“Transmission of IPv6 Packets over
RFC4919: This document
IEEE 802.15.4 Networks” describes the overview,
assumptions, problem
statement, and goals for
transmitting IP over IEEE
802.15.4 networks.

RFC6568: This document


investigates potential
application scenarios and
use cases for LoWPANs

This document This document describes RFC6606: This document provides the
specifies an simple optimizations to IPv6 problem statement and design space for
IPv6 Header Neighbor Discovery, its 6LoWPAN routing. Defines how
Compression addressing schemes, and 6LoWPAN formation and multi-hop
format for IPv6 duplicate address detection routing could be supported.
packet delivery for 6LoWPAN
in 6LoWPAN

08-11-2020 Dr. Manas Khatua 4


Device Characteristics

 Dedicated to specific task; not used in general purpose

Limited hardware resources:


 Low processing power (microcontroller/ dsp)
 Little memory
 Low power

Limited networks capabilities:


 Short range
 Low bitrate
 Small message-size

08-11-2020 Dr. Manas Khatua 5


Usage Scenarios

 Building automation

 Industrial automation

 Logistics

 Environmental Monitoring

 Personal/ Health Monitoring

 etc.

08-11-2020 Dr. Manas Khatua 6


Motivation to use IP
Benefits of IP over IEEE 802.15.4 Network (RFC 4919):
 The pervasive nature of IP networks allows use of existing Infrastructure.
 IP-based technologies already exist, and are well-known

 Open and freely available specifications (v/s. Closed proprietary solutions).


 Tools for diagnostic, management already exist.

 IP-based devices can be connected readily to IP-based networks, without


gateways or proxies.

08-11-2020 Dr. Manas Khatua 7


Why IPv6?
 Large simple address (2^128 address space)
 Network ID + Interface ID
 Plenty of addresses, easy to allocate and manage

 Auto-configuration and Management


 ICMPv6

 Integrated bootstrap and discovery


 Neighbors, routers, DHCP

 Global scalability
 2^128 Bit Addressing = 3.4*10^38 unique addresses

08-11-2020 Dr. Manas Khatua 8


IPv6 Challenges
1. Header Size Calculation

 IPv6 header: 40 octets


 UDP header: 8 octets
 802.15.4 MAC frame header: up to 25 octets ( with null security)
or 25+21=46 octets (with AES-CCM-128)

 With 802.15.4 frame size of 127 octets, we have following space


left for application data!
 127-(8+40+25) = 54 octets (for null security)
 127-(8+40+46) = 33 octets (for AES-CCM-128)

08-11-2020 Dr. Manas Khatua 9


Cont…

2. IPv6 MTU Requirements


 IPv6 requires that links should support an MTU of 1280 octets
 So, Link-layer fragmentation / reassembly is needed

3. IP assumes devices are always on


 But embedded devices may not have enough power and duty cycles

4. Multicast support
 IEEE 802.15.4 & other radios do not support multicast (as it is expensive)

08-11-2020 Dr. Manas Khatua 10


Goals of 6LoWPAN
 Define adaptation layer to match IPv6 MTU requirements
 by fragmentation/reassembly

 Specify methods to do IPv6 Address formation


 By stateless address auto configuration

 Specify/use header compression schemes.

 Methods for mesh broadcast/multicast below IP, i.e. layer 2


networking and forwarding

08-11-2020 Dr. Manas Khatua 11


Adaptation Layer
 The 6LoWPAN protocol is an adaptation layer
 allowing to transport IPv6 packets over 802.15.4 links .

 Adaptation layer sits between Datalink and (IP) Network layers

08-11-2020 Dr. Manas Khatua 12


Cont...
Adaptation layer mainly performs the following functionalities:

 Fragmentation and Reassembly -> as MTU of 802.15.4 and IPv6 does


not match.

 Header Compression -> Compresses 40B IPv6 and 8B UDP headers

 Stateless Autoconfiguration -> Devices inside 6LoWPAN generate


their own IPv6 address

08-11-2020 Dr. Manas Khatua 13


6LoWPAN Stacked Headers
• 6LoWPAN uses
• stacked headers, and
• extension headers. (analogous to IPv6)

• 6LoWPAN headers define the capability of


each sub-header.

• Three sub-headers are defined:


• Mesh addressing,
• Fragmentation,
• Header compression
Fragmentation is a
core part IPv4 header
LoWPAN Encapsulation

LoWPAN encapsulation are the payload in the IEEE 802.15.4 MAC protocol data unit (PDU).
Cont…
 All LoWPAN encapsulated datagrams are prefixed by encapsulation header stack.

 Each header in the stack starts with a header type field followed by zero or more header fields
6LoWPAN Headers
 Each header in the stack starts with
 a header type field
 followed by zero or more header fields

 First byte of each header (i.e. dispatch byte) identifies the nature of each header

 NALP -> Not a part of LOWPAN encapsulation, should be discarded.


 IPv6 -> uncompressed IPv6 header
 LoWPAN_HC1 -> Compressed IPv6 header.
 LoWPAN_BC0 -> for mesh broadcast/multicast support header
 ESC -> supports for dispatch values larger than 127
08-11-2020 Dr. Manas Khatua 17
Cont…
Dispatch Header
 Dispatch Type & header

 Dispatch type defined by 1st & 2nd bits = 01.


 Dispatch -> identifies type of header immediately following Dispatch Header
 Type-specific header which is determined by dispatch header.

08-11-2020 Dr. Manas Khatua 19


Mesh Addressing Header
 Mesh Addressing Type & Header

 1st & 2nd bits = 10.

 OA : link layer address of originator.


 FDA : link layer address of final-destination

 V: 0 => if OA is 64-bit EUI address


1 => if OA is16-bit short address

 F: 0 => if FDA is 64-bit EUI address


1 => if FDA is16-bit short address

 HopsLft: 4 bit, decremented by each forwarding node


08-11-2020 Dr. Manas Khatua 20
Cont…
Example of Mesh Routing header:
• Mesh networking is required to extend the network into multihop scenario
Fragmentation Header
 Fragmentation type and Header

First Fragment

Subsequent Fragments

Datagram size : 11 bit, encode the size of entire packet.


Datagram tag : 16bit, same for all link fragments of a payload.
Datagram offset : present only in subsequent fragments

08-11-2020 Dr. Manas Khatua 22


Fragmentation and Reassembly
Fragmentation Principles (RFC 4944)
 When an IPv6 packet exceeds link-layer payload size then
segments the packet into fragments.

6LoWPAN packet structure of FRAG1 and FRAGN

08-11-2020 Dr. Manas Khatua 23


Cont...
 Only the 1st fragment carries end-to-end routing information.

 1st fragment carries a header that includes :


 datagram size,
 datagram tag .

 Subsequent fragments carry


 the datagram size,
 the datagram tag,
 the offset.

 Time limit for reassembly is 60 seconds.

 For a lost fragment we need to resend entire set of fragments.

08-11-2020 Dr. Manas Khatua 24


Stateless Address Autoconfiguration
• It defines how to obtain an IPv6 interface identifier (IID)

 IPv6 can perform stateless auto-configuration of address for an interface.


 Allows a node to connect to the internet without DHCP server
 Uses both local and non-local information to generate its address.

Introduction of IPv6 addressing:


 Addresses are 128 bit long
 Divided into 8 hextets, each hextet is 16 bit
 Each character is 4 bit, a nibble
 A common configuration is a
 48-bit network prefix,
 16-bit subnet mask,
 64-bit host address.
 e.g., 2001:1234:ABCD:0001:1023:FD45:0033:0002

08-11-2020 Dr. Manas Khatua 25


Cont... (for IPv6)
Steps involved in auto-configuration to obtain IPv6 address (128 bits):

 Host send Router Solicitation (RS) to all


routers

 Routers reply with Router Advertisement (RA)


 announces prefix used on link.

 Host generates address


 by combining the prefix received and
host identifier (EUI-64)

 Hosts performs Duplicate Address Detection


(DAD)

 If successful (i.e. not duplicate one), address


becomes active

 Link-local address (128 bit) is generated

08-11-2020 Dr. Manas Khatua 26


Link-local address
A link-local address is a network address that is valid only for communications
within the network segment or the broadcast domain that the host is connected to.

How does a host generate a link-local address in 6LoWPAN?

 Generated when a computer runs IPv6 boots up


 Valid only for communication on a local network
 Always have a prefix FE80::/64

08-11-2020 Dr. Manas Khatua 27


Cont…
Generating IID (EUI-64) from 48-bits MAC address (i.e. device address).

48 bit MAC address

64 bit Interface ID

08-11-2020 Dr. Manas Khatua 28


Cont…

All 802.15.4 devices have an IEEE EUI-64 address typically.


But 16-bit short addresses are also possible.

In these cases, a "pseudo 48-bit address" is formed first, and then EUI-64
interface id is formed from the pseudo 48-bit MAC address.

• 1st step: <16 bit PAN ID :16 zero bits>


• 2nd step: <32 bits got in previous step:16 bit short address>
• 3rd step: 48 bits MAC address => 64 bit Interface ID
6LoWPAN Header Compressions
 Started with HC1 (for IP) and HC2 (for UDP) compressions
 Assume common values for header fields and define compact forms.
 Reduce header size by omission
Omit headers that...
• Can be reconstructed from L2 layer headers (i.e. redundant)
• Contain information not needed or used in the context (i.e. unnecessary)
Version: version number of Internet Protocol = 6.
IPv6 header Traffic Class: indicates the class or priority of IPv6 packet

Flow Label: used by source to label the packets belonging


to the same flow in order to request special handling by
intermediate IPv6 routers
Payload Length: size (in octets) of the rest of the packet
that follows the IPv6 header

Next header: type of header that immediately follows the


IPv6 header
Hop limit: Decremented by one by each node that forwards
the packet.

08-11-2020 Dr. Manas Khatua 30


Compressions: HC1
HC1: Compresses IPv6 headers

IPv6 Header:40-Byte

How to get other fields:


Source address -> Derived from link address
Destination address -> Derived from link address
Reduced
to 0 Byte
Traffic class & Flow level -> Zero (if ECN, DS, Flow level all zero)
Next Header -> Indicated in HC1 (TCP/UDP/ICMPv6)
08-11-2020 Dr. Manas Khatua 31
Cont...
Ipv6 Header compression

Uncompressed
08-11-2020 Dr. Manas Khatua 32
Cont...
HC1 Compressed IPv6 Header

 IPv6 address <prefix64 || Interface ID64> for nodes in IEEE 802.15.4 subnet
derived from the link address.
o PAN ID maps to a unique IPv6 prefix
o Interface ID generated from EUID 64 or PAN ID or short address

 HopLimit is the only incompressible IPv6 header field.

08-11-2020 Dr. Manas Khatua 33


Cont...
6LoWPAN: Compressed IPv6 Header

08-11-2020 Dr. Manas Khatua 34


Compressions: HC2
HC2:Compresses UDP Headers
Reduced to
UDP header format
[ 8 Byte]  Source port = P+4bits, P=61616 1 Byte
 Destination port= P+4bits, P=61616

 Length derived from IPv6 length 2 Byte


 Checksum is always carried inline

From 15.4 header


08-11-2020 Dr. Manas Khatua 35
Limitations of HC1&HC2
 LoWPAN_HC1 & LoWPAN_HC2 are insufficient for most practical uses.
 Effective only for link-local unicast communication,

 So, they are usually not used for application layer data traffic in present times

So, RFC 6282 came as an advancement


o Defines LoWPAN_IPHC
• Better compression for global and multicast addresses not only link- local
• Compress header fields with common values: version, traffic class, flow
label, hop-limit

o Defines LoWPAN_NHC (for arbitrary next headers)


• Adds ability to elide UDP checksum

 Possible to invent your own scheme if you have repeating


usage patterns in your use case
08-11-2020 Dr. Manas Khatua 36
The Header Size Solution
The 48-byte ( IPv6 + UDP header) could in the best cases be
reduced to 6 bytes.

08-11-2020 Dr. Manas Khatua 37


Forwarding Mechanisms
6LoWPAN supports two routing mechanisms:
 Mesh-under
 Route-over

Mesh-under Route-over
 Uses L2 addresses to  Uses L3 addresses to
forward data forward data.
 Only IP router is the edge  Each hop acts as an IP
router router.
 Individual fragments may  As routing decision
take different paths. taken on a per packet
 Suitable for small and local basis, all fragments are
networks sent to same path

08-11-2020 Dr. Manas Khatua 38


Cont...

Mesh-under

Route-over
08-11-2020 Dr. Manas Khatua 39
Neighbour Discovery Protocol
 Hosts uses to discover Routers
 Duplicate Address Detection(DAD)
 Uses ICMPv6
 RS(Router Solicitation) , RA (Router Advertisement)
 NS(Neighbour Solicitation ) , NA (Neighbour Advertisement)

6LoWPAN Neighbour Discovery

08-11-2020 Dr. Manas Khatua 40


Cont...
Router Solicitation and Advertisement

08-11-2020 Dr. Manas Khatua 41


Cont...
Neighbor Solicitation and Advertisement

08-11-2020 Dr. Manas Khatua 42


6LoWPAN Security
 Security is also important for IOT systems
 It takes advantage of 802.15.4 link layer security
 Also TLS (Transport Layer Security) mechanisms works for
6LoWPAN systems

08-11-2020 Dr. Manas Khatua 43


Lessons Learned
 What is Open Standard

 Motivation behind the development of Adaptation Layer

 6LoWPAN
 Architectures
 RFCs
 Stacked headers concept
 Dispatch Header
 Fragmentation Header
 Mesh Routing Header

 Address Autoconfiguration

 Header Compression

 Neighbour Discovery

 Data Forwarding : Mesh under & Route over

 6LoWPAN Security
Thanks!

08-11-2020 Dr. Manas Khatua 45


CS578: Internet of Things
RPL: Routing over Low-Power and
Lossy Networks
RFC 6550: https://tools.ietf.org/html/rfc6550

Dr. Manas Khatua


Assistant Professor, Dept. of CSE, IIT Guwahati
E-mail: manaskhatua@iitg.ac.in

“The Man who works for others, without any selfish motive, really does good to himself.” – Shri Ramakrishna
What is Low-Power and Lossy Network?
RFC 7228
 Constrained Node: A node where some of the characteristics that are otherwise pretty much taken for
granted for Internet nodes are not attainable, often due to cost constraints and/or physical constraints on
characteristics such as size, weight, and available power and energy.
 tight limits on power, memory, and processing resources

 Constrained Network: A network where some of the characteristics pretty much taken for granted with
link layers in common use in the Internet are not attainable.
 low achievable bitrate/throughput; high packet loss and variability of packet loss; limits on reachability over time

 Constrained-Node Network: A network whose characteristics are influenced by being composed of a


significant portion of constrained nodes.

 LLN (Low-Power and Lossy Network): Typically composed of many embedded devices with limited power,
memory, and processing resources interconnected by a variety of links, such as IEEE 802.15.4 or low-power
Wi-Fi.

17-11-2020 Dr. Manas Khatua 2


Routing challenges in LLNs
 Energy consumption is a major issue (for battery powered sensors/controllers)

 Limited processing power

 Very dynamic topologies


 Link failure (as Low-powered RF)
 Node failures (as fast energy depletion)
 Node mobility (in some environments)

 Data processing usually required on the node itself,

 Sometimes deployed in harsh environments (e.g. Industrial, hilly region),

 Potentially deployed at very large scale,

 Must be self-managed network (auto-discovery, self-organizing, )


Can’t use OSPF, OLSR, RIP, AODV, DSDV, DSR, etc
17-11-2020 Dr. Manas Khatua 3
Routing over Low-power and Lossy link: ROLL WG
• ROLL Working Group Formed in Jan 2008

• Mission: define Routing Solutions for LLN


 Should be able to operate over a variety of different link layer technologies

• Work Items:
 Routing Protocol work
 Routing is designed to support different LLN application requirements
 RFC 5548 - Routing requirements for Urban LLNs
 RFC 5673 - Routing requirements for Industrial LLNs
 RFC 5826 - Routing requirements for Home Automation LLNs
 RFC 5867 - Routing requirements for Building Automation LLNs
 Routing metrics for LLN
 Produce a security Framework
 Applicability statement of ROLL routing protocols

• Proposed protocol: RPL (IPv6 Routing Protocol for LLNs)

17-11-2020 Dr. Manas Khatua 4


RPL is a ……
• Distance Vector (DV) protocol
• Source Routing Protocol

What is a Distance Vector (DV) protocol?


• The term distance vector refers -
• protocol manipulates vectors of distances to other nodes in the network
• Distance-vector protocols are based on calculating the Direction and Distance
to any node/link in a network.
• "Direction" usually means the next hop address and the exit interface.
• "Distance" is a measure of the cost to reach a certain node.

• Least cost route between any two nodes is the route with minimum distance.
• Each node maintains a vector (table) of minimum distance to every node.
• Requires that a router inform its neighbours of topology changes periodically

• Intra-domain routing protocol (i.e. inside a AS)


• Have less computational complexity and message overhead
17-11-2020 Dr. Manas Khatua 5
Cont…
What is a Source Routing (path addressing) protocol?
• Allows a sender of a packet to partially or completely specify the route the
packet takes through the network.
• Enables a node to discover all the possible routes to a host.

Two modes of RPL:


• Storing mode:
• All nodes contain the full routing table of the RPL domain.
• Every node knows how to directly reach every other node.

• Non-storing mode:
• Only the border router(s) of the RPL domain contain(s) the full routing table.
• Boarder router knows how to directly reach every other node.

17-11-2020 Dr. Manas Khatua 6


RPL Topology (1/2)
RPL organizes a topology as a DAG

• A DAG is a directed graph


where no cycles exist.

DAG(Directed Acyclic Graph)

17-11-2020 Dr. Manas Khatua 7


RPL Topology (2/2)
• A DAG rooted at a single destination
• A basic RPL process involves building a
at a single DAG root (DODAG root) DODAG.
with no outgoing edges
• In RPL, this destination occurs at a
border router known as the DODAG
root.

 Simplest RPL topology: single DODAG


with one root

 Complex scenario: multiple


uncoordinated DODAGs with
independent roots

 More sophisticated and flexible


configuration: single DODAG with a
virtual root that coordinates several
LLN root nodes

DODAG (Destination Oriented DAG)


17-11-2020 Dr. Manas Khatua 8
RPL Instance
• A RPL Instance is a set of one • RPLInstanceID is a unique identifier
or more DODAGs that share a within a network.
common RPLInstanceID.
• DODAGs with the same RPLInstanceID
share the same Objective Function (OF)
– used to compute the position of node in the
DODAG .

• An objective function (OF) defines


– how metrics are used to select routes and
establish a node’s rank.
– RFC 6552 and RFC 6719

• Objective Function computes the “rank”


– rank is the “distance” between the node and
DODAG root
– Rank should monotonically decrease along
the DODAG and towards the destination
RPL Instance

17-11-2020 Dr. Manas Khatua 9


RPL Control Messages
1) DODAG Information Solicitation (DIS):
• Link-Local multicast request for DIO (i.e. neighbor discovery).
• Do you know of any DODAGs, asked by a node?

2) DODAG Information Object (DIO):


• Downward RPL instance multicasts
• Allows other nodes to discover an RPL instance and join it

3) Destination Advertisement Object (DAO):


• From child to parents or root
• Can I join you as a child on DODAG #x?

4) DAO-ACK: Yes, you can! Or Sorry, you can’t!

5) Consistency Check (CC): Challenge-response messages for security

17-11-2020 Dr. Manas Khatua 10


RPL Traffic Types
1) MP2P : Multipoint-to-Point
 is the dominant traffic in many LLN applications.
 usually routed towards destination nodes such as LLN gateway
 these destinations are the DODAG roots, and they act mainly
as data collection points

2) P2MP: Point-to-Multipoint
 data streams can be used for actuation purposes
 messages sent from DODAG roots to destination nodes

3) P2P: Point-to-Point
 to allow communications between two devices belonging to
the same LLN

17-11-2020 Dr. Manas Khatua 11


DAG Construction (1/9)
• LLN links are depicted
LBR-1 • RPL Objective functions:
1 2 – ETX https://tools.ietf.org/html/draft-
gnawali-roll-etxof-00
3
– OF0 https://tools.ietf.org/id/draft-ietf-
1 1 roll-of0-14.html
A B C

1
1
1 • Links are annotated w/ ETX
1
F D 4
E • It is expected that ETX variations
will be averaged/filtered as per
1
1 1 1 ROLL Metrics to be stable
enough for route computation
1 – Nodes observe the metric and
G H I gain confidence before use

The ETX metric of a wireless link is the expected number of transmissions required to successfully
transmit and acknowledge a packet on the link.

17-11-2020 Dr. Manas Khatua 12


DAG Construction (2/9)

• Objective Code Point (OCP) for


LBR-1
1 2
example
3 – Metric: ETX
1 1 – Objective: Minimize ETX
A B C
– Depth computation: Depth ~ ETX
1
1 1 • Note that a practical computation
may be more coarse
1
4
F D E
1
1 1 1

1
G H I

17-11-2020 Dr. Manas Khatua 13


DAG Construction (3/9)
• LBR-1 multicasts RA-DIO (i.e. router
advertisement using DIO)
LBR-1
1 2 • Nodes A, B, C receive and process
3 RA-DIO
1 1
A B C • Nodes A, B, C consider link metrics
1
to LBR-1 and the optimization
1 1 objective
1
F D 4
E • The optimization objective can be
satisfied by joining the DAG rooted
1 1
1
1 at LBR-1

1 • Nodes A, B, C add LBR-1 as a DAG


G H I parent and join the DAG

17-11-2020 Dr. Manas Khatua 14


DAG Construction (4/9)
• Node A is at Depth 1 in the DAG, as
LBR-1 calculated by the routine indicated
1 2 by the example OCP (Depth ~ ETX)
3

1 1 • Node B is at Depth 3, Node C is at


A B C Depth 2
1
1 1
• Nodes A, B, C have installed default
F
1
D 4
E
routes (::/0) with LBR-1 as
successor
1
1 1 1
• Note: An arrow shows who is your
1 parent. But, the links are
G H I
bidirectional.

17-11-2020 Dr. Manas Khatua 15


DAG Construction (5/9)
• The RA timer on Node C expires
LBR-1
1 2 • Node C multicasts RA-DIO
3

1 1 • LBR-1 ignores RA-DIO from


A B C deeper node
1
1 1
• Node B can add Node C as
F
1
D 4
E alternate DAG Parent,
remaining at Depth 3
1
1 1 1
• Node E joins the DAG at Depth
G
1
H I
3 by adding Node C as DAG
Parent

17-11-2020 Dr. Manas Khatua 16


DAG Construction (6/9)

LBR-1 • Node A is at Depth 1, and can


1 2
reach ::/0 via LBR-1 with ETX 1
3

1 1
• Node B is at Depth 3, with DAG
A B C Parents LBR-1, and can reach
1
::/0 via LBR-1 or C with ETX 3
1 1

1
4
• Node C is at Depth 2, ::/0 via
F D E LBR-1 with ETX 2
1
1 1 1
• Node E is at Depth 3, ::/0 via C
1 with ETX 3
G H I

17-11-2020 Dr. Manas Khatua 17


DAG Construction (7/9)

LBR-1 • The RA timer on Node A expires


1 2
3 • Node A multicasts RA-DIO
1 1
A B C • LBR-1 ignores RA-DIO from deeper
node
1
1 1

1
• Node B adds Node A
4
F D E
1
• Node B can improve to a more
1 1 1 optimum position in the DAG

G
1
H I • Node B removes LBR-1 and Node C
as DAG Parents

17-11-2020 Dr. Manas Khatua 18


DAG Construction (8/9)

LBR-1 • Node A is at Depth 1, ::/0 via


1 2 LBR-1 with ETX 2
3

A
1
B
1
C • Node B is at Depth 2, ::/0 via
1 A with ETX 2
1 1

• Node C is at Depth 2, ::/0 via


1
4
F D E
1
LBR-1 with ETX 2
1 1 1

G
1
H I
• Node E is at Depth 3, ::/0 via
C with ETX 3

17-11-2020 Dr. Manas Khatua 19


DAG Construction (9/9)

LBR-1 • DAG Construction


1 2 continues…
3

1 1
A B C
1
1 1 • And is continuously
1
4
maintained
F D E
1
1 1 1

1
G H I

17-11-2020 Dr. Manas Khatua 20


MP2P Traffic

LBR-1 • MP2P traffic flows inwards


1 2
along DAG, toward DAG Root
3

1 1
• DAG Root may also extend
A B C connectivity to other prefixes
1
beyond the DAG root, as
1 1 specified in the DIO
1
F D 4 E • Nodes may join multiple DAGs
1 as necessary to satisfy
1 1 1 application constraints
1
G H I

17-11-2020 Dr. Manas Khatua 21


Destination Advertisements (1/7)

LBR-1 • Destination Advertisements (DAs)


build up routing state
1 2
– to support P2MP traffic flows
3 outward, from the sink to other
nodes
1 1
A B C
1
• DA uses the same DAG
1 1

1
4
F D E
1
1 1 1
• For simplicity, we will focus on a
subset of DA in the example
1
G H I

17-11-2020 Dr. Manas Khatua 22


Destination Advertisements (2/7)
• Let us consider,
– Some nodes may be able to store routing
LBR-1 state for outward flows (LBR-1, A, F)
1

– Some nodes may not (B, D)


1
A B – Some nodes may have a limited ability;
1
• DAs may indicate a priority for storage
1
F D • DAs may be triggered by DAG root or node
who detects a change
1 1

• DA timers configured such that DAs start at


G
1
H
greater depth, and may aggregate as they
move up

17-11-2020 Dr. Manas Khatua 23


Destination Advertisements (3/7)
• LBR-1 triggers DA mechanism in DIO
LBR-1
1 • G emits neighbor advertisement (NA) to
F with DAO
– indicating reachability to destination prefix
1
A B G::

1
• F stores G:: via G
1
F D
• H emits NA to F for destination prefix H::
1 1
• F stores H:: via H
1
G H

17-11-2020 Dr. Manas Khatua 24


Destination Advertisements (4/7)

LBR-1 • Suppose in this example F has a


1 prefix F*:: capable of aggregating
{F::, G::, H::}
1 – The method to provision such a
A B prefix is beyond the scope of RPL

1
• F emits NA to D with DAO
F
1
D
indicating reachability to
destination prefix F*::
1 1

• D cannot store…
1
G H
(continued)

17-11-2020 Dr. Manas Khatua 25


Destination Advertisements (5/7)

LBR-1 • D adds F to the Reverse Route


1 Stack in the DAO, and passes
DAO on to B for F*:: [F]
1
A B
• D also emits a DAO indicating
1 prefix D:: to B
1
F D • B cannot store routing state…
1 1

1 (continued)
G H

17-11-2020 Dr. Manas Khatua 26


Destination Advertisements (6/7)

• B adds D to the Reverse Route


LBR-1 Stack in the DAO for D::, and
1 passes DAO D:: [D] on to A

1
A B • A stores D:: via B, with the
piecewise source route [D]
1

F
1
D • B also emits a DAO indicating
prefix B:: to A
1 1

1
• A stores B:: via B
G H
(continued)

17-11-2020 Dr. Manas Khatua 27


Destination Advertisements (7/7)

LBR-1 • A emits DAOs to LBR-1 for destination


prefixes A::, B::, D::, and F*
1

• LBR-1 stores A:: via A, B:: via A, D:: via


1 A, and F*:: via A
A B

1
• It is done. So, in brief,

1 – LBR-1 stores A:: via A, B:: via A, D:: via A,


F D and F*:: via A

1 1 – A stored B:: via B, D:: via B [D], F* via B


[D, F]
1
G H – B, D stored nothing

– F stored G:: via G, H:: via H

17-11-2020 Dr. Manas Khatua 28


P2MP Traffic (1/2)

LBR-1 • The routing state setup by


1 Destination Advertisement (DA)
is used to direct P2MP traffic
1
outward
A B

1 • LBR-1 directs traffic for G (F*::)


to A
1
F D
• A adds source routing directive,
1 1
[D, F], and forwards to B
1
G H
• B uses source routing directive
to forward to D...

17-11-2020 Dr. Manas Khatua 29


P2MP Traffic (2/2)

LBR-1 • D uses source routing


1 directive to forward to F
1
A B
• F uses routing state to
1 forward to G
1
F D
• Note the use of source
1 1 routing to traverse the
1
stateless region of the LLN
G H

17-11-2020 Dr. Manas Khatua 30


DAG Maintenance (1/10)

• Consider the case where the


LBR-1
link B—D goes bad
1 2
3

1 1 • Node D will remove B from


A B C
its DAG parent set
1
1 1

1
4
• Node D no longer has any
F D E
DAG parent in the grounded
1 1
1
1
DAG, so it will become the
root of its own floating DAG
1
G H I

17-11-2020 Dr. Manas Khatua 31


DAG Maintenance (2/10)
• Node D multicasts an router
LBR-1 advertisement (RA)-DIO
1 2
– to inform its sub-DAG of the
3
change
1 1
A B C

1
1
1 • Node ‘I’ has an alternate DAG
1
Parent, E
F D 4 E – so it does not have to leave the
1 DAG rooted at LBR-1.
1 1 1

1
G H I • Node I removes Node D as a
DAG Parent

17-11-2020 Dr. Manas Khatua 32


DAG Maintenance (3/10)
• Node F does not have an
LBR-1 option to stay in the DAG
1 2 rooted at LBR-1 (no alternate
3
DAG Parents),
1 1
A B C – So, Node F follows Node D into
1
the floating DAG
1 1

1
F D 4 E • Node F multicasts an RA-DIO
1
1 1 1

• Nodes G and H follow Node F


1
G H I into the floating DAG

17-11-2020 Dr. Manas Khatua 33


DAG Maintenance (4/10)
• The sub-DAG of node D has
LBR-1 now been frozen
1 2
3

1 1 • Nodes contained in the sub-


A B C
DAG have been identified,
1
1 1 and by following node D into
1
4
the floating DAG, all old
F D E
routes to LBR-1 have been
1 1
1
1 removed
1
G H I
• The floating DAG seeks to
rejoin a grounded DAG…

17-11-2020 Dr. Manas Khatua 34


DAG Maintenance (5/10)
Re-join the Sub-DAG
LBR-1
1 2
3
• Node I multicasts an RA-DIO
1 1
A B C
1
• Node D sees a chance to rejoin
1 1
grounded DAG at depth 5
F
1
D 4 E
through Node I
1
• Node D starts a DAG Hop timer
1 1 1

G
1
H I
of duration  4 (i.e. depth)
associated with Node I

17-11-2020 Dr. Manas Khatua 35


DAG Maintenance (6/10)
• Suppose a link A—F becomes
LBR-1 viable
1 2
3
• Node A multicasts an RA-DIO
1 1
A B C

1 1
1
1 • Node F sees a chance to rejoin
grounded DAG at depth 2
1
F D 4 E through Node A
1
1 1 1
• Node F starts a DAG Hop timer
G
1
H I of duration  1 (i.e. depth)
associated with Node A

17-11-2020 Dr. Manas Khatua 36


DAG Maintenance (7/10)
• Node F’s DAG Hop Timer
LBR-1 expires
1 2
3
• Node F joins to the grounded
1 1
A B C DAG at depth 2 by adding A as
1 a DAG parent, and removing D
1 1 1

• Node F multicasts an RA-DIO


1
F D 4 E
1
1 1 1
• Nodes G and H follow Node F
G
1
H I to the grounded DAG

17-11-2020 Dr. Manas Khatua 37


DAG Maintenance (8/10)
• Node D sees a chance to
LBR-1 rejoin DAG LBR-1 at depth 3
1 2 through Node F
3

1 1
A B C • Node D starts a DAG Hop
1 1
1
1 timer of duration  2
1
associated with Node F,
F D 4 E
• in addition the DAG Hop
1 1
1
1 timer already running with
duration  4 associated with
1
G H I Node I

17-11-2020 Dr. Manas Khatua 38


DAG Maintenance (9/10)
• Node D’s DAG Hop timer of
LBR-1 duration  2 tends to expire
1 2
first
3

1 1
A B C
• Node D joins the grounded
1
1 1 1 DAG at depth 3 by adding
1
4
Node F as a DAG Parent
F D E
1
1 1 1
• The breaking-off and re-
1 joining of the broken sub-
G H I
DAG is thus coordinated with
loop avoidance

17-11-2020 Dr. Manas Khatua 39


DAG Maintenance (10/10)
• Loop Avoidance
 mechanisms to avoid count-to-infinity problem

Solutions:
 Floating DAG
• Leave DAG, color sub-DAG, then look for new routes
• Operation local to nodes that must increase their depth
• Does not guarantee loop freedom

 Sequence number change


• Loop freedom, but expensive network-wide operation
• Used infrequently if possible
17-11-2020 Dr. Manas Khatua 40
Trickle Algorithm [RFC 6206]
• Concerns
– Broadcast is expensive
– Wireless channel is a shared, spatial resource
• Idea
– Dynamic adjustment of DIO transmission period
– Suppress transmissions that may be redundant

• Parameters: • Suppression:
– T_min: Minimum advertisement period – Increment count (c) when receiving similar
– T_max: Maximum advertisement period advertisement
– k: Suppression threshold – At end of period, transmit if c < k, set c = 0

• Period adjustment: • Proposal:


– On receiving inconsistent route – Carry T_min, T_max, and k in RA-DIO
information, reset to T_min
– Otherwise, double up to T_max

17-11-2020 Dr. Manas Khatua 41


Figures and slide materials are taken from the following sources:

1. https://tools.ietf.org/agenda/75/slides/roll-1.ppt

17-11-2020 Dr. Manas Khatua 42


CS578: Internet of Things
MQTT:
Message Queuing Telemetry Transport

Dr. Manas Khatua


Assistant Professor, Dept. of CSE, IIT Guwahati
E-mail: manaskhatua@iitg.ac.in

“Lead us from unreal to real. From darkness into


11-10-2019 light. From
Dr. Manas death to immortality, Om Shanti Shanti Shanti.”
Khatua 1
What is MQTT?
• MQTT : Message Queueing Telemetry Transport protocol.
• Reliable, Lightweight, Cost-effective protocol
• Suited for the transport of telemetry data (sensor and actor data),

Example:
• Light sensor continuously sends sensor data to the broker.
• Building control application receives sensor data from the broker and decides to activate Camera.
• The application sends an activation message to the camera node (i.e. actuator) through the broker.

• Invented by Andy Stanford Clark of IBM


and Arlen Nipper of Arcom (now Eurotech)
in 1999

• Used by real-life applications:


• Amazon Web Services (AWS),
• IBM WebSphere MQ,
• Microsoft Azure IoT,
• Facebook Messenger,
• etc.

11-10-2019 Dr. Manas Khatua 2


MQTT Characteristics
In 2014, MQTT was adopted and
published as an official standard
by OASIS (Organization for the
Advancement of Structured
Information Standard)

 Asynchronous communication model with messages (events)


 Low overhead (2 bytes header) for low network bandwidth applications

 Publish / Subscribe (PubSub) model


 Decoupling of data producer (publisher) and data consumer (subscriber) through topics (message
queues)

 Runs on connection-oriented transport (TCP). To be used in conjunction with 6LoWPAN (TCP


header compression)
 MQTT mainly designed for M2M communication

11-10-2019 Dr. Manas Khatua 3


Publish & Subscribe Messaging
Terminology
 A producer sends (publishes) a message (publication) on a topic (subject)
 A consumer subscribes (makes a subscription) for messages on a topic (subject)
 A message server / broker matches publications to subscriptions

Who will get the message ?


 If no matches the message is discarded
 If one or more matches the message is delivered to each matching subscriber/consumer

Topic
 A topic forms the namespace in hierarchical with each “sub topic” separated by a /
 An example topic space :
 A house publishes information about itself on:
<country>/<region>/<town>/<postalcode>/<house>/energyConsumption
<country>/<region>/<town>/<postalcode>/<house>/solarEnergy
• And subscribes for control commands:
<country>/<region>/<town>/<postalcode>/<house>/thermostat/setTemp

11-10-2019 Dr. Manas Khatua 4


Cont…
Wildcards
 A subscriber can subscribe to an absolute topic / can use wildcards:
 Single-level wildcards “+” can appear anywhere in the topic string
For example:
 Energy consumption for 1 house in Hursley
 UK/Hants/Hursley/SO212JN/1/energyConsumption

 Energy consumption for all houses in Hursley


 UK/Hants/Hursley/+/+/energyConsumption

 Multi-level wildcards “#” must appear at the end of the string


For example:
 Details of energy consumption, solar and alarm for all houses in SO212JN
 UK/Hants/Hursley/SO212JN/#

NOTE :
 Wildcards must be next to a separator
 Cannot be used wildcards when publishing

11-10-2019 Dr. Manas Khatua 5


Cont…
 A subscription can be durable or non durable
 Durable:
 Once a subscription is in place a broker will forward matching messages to the subscriber:
• Immediately if the subscriber is connected.
• If the subscriber is not connected messages are stored on the server/broker until the next
time the subscriber connects.

 Non-durable / Transient (i.e. subscription ends with client session):


• The subscription lifetime is the same as the time the subscriber is connected to the server /
broker

11-10-2019 Dr. Manas Khatua 6


MQTT Message Format

• Message Type: identifies the kind of MQTT packet within a message


• DUP: Duplicate flag – indicates whether the packet has been sent previously or not

• QoS Level: it allows to select different QoS level


• Retain: this flag notifies the server to hold onto the last received PUBLISH message data
• Remaining Length: specifies the size of optional fields

 MQTT is lightweight
 because each packets consists of a 2-byte fixed header with optional variable header fields
and optional payload

11-10-2019 Dr. Manas Khatua 7


Cont…
Message header field Description / Values
Message Type 0: Reserved 8: SUBSCRIBE
1: CONNECT 9: SUBACK
2: CONNACK 10: UNSUBSCRIBE
14 message types, 3: PUBLISH 11: UNSUBACK
2 are reserved 4: PUBACK 12: PINGREQ
5: PUBREC 13: PINGRESP
6: PUBREL 14: DISCONNECT
7: PUBCOMP 15: Reserved
DUP Duplicate message flag. Indicates to the receiver that this message may have already been received.
1: Client or server (broker) re-delivers a PUBLISH, PUBREL, SUBSCRIBE or UNSUBSCRIBE message
(duplicate message).

QoS Level Indicates the level of delivery assurance of a PUBLISH message.


0: At-most-once delivery, no guarantees, «Fire and Forget».
1: At-least-once delivery, acknowledged delivery.
2: Exactly-once delivery.

RETAIN 1: Instructs the server to retain the last received PUBLISH message and deliver it as a first message to
new subscriptions.

Remaining Length Indicates the number of remaining bytes in the message, i.e. the length of the (optional) variable length
header and (optional) payload.

11-10-2019 Dr. Manas Khatua 8


Message Types
RETAIN
RETAIN=1 in a PUBLISH message instructs the server to keep the message for this topic.
When a new client subscribes to the topic, the server sends the retained message quickly.

 Typical application scenarios:


 Clients publish only changes in data, so subscribers receive the last known good value.

 Example:
 Subscribers receive last known temperature value from the temperature data topic.
 RETAIN=1 indicates to subscriber B that the message may have been published some time ago.

11-10-2019 Dr. Manas Khatua 10


Remaining length (RL)
• The remaining length field encodes the sum of the lengths of:
1. (Optional) variable length header
2. (Optional) payload

• To save bits, remaining length is a variable length field with 1…4 bytes.
• The most significant bit (msb) of a length field byte has the meaning continuation bit (CB).
• If more bytes follow, it is set to 1.

Remaining length is encoded as:: a * 1280 + b * 1281 + c * 1282 + d * 1283


and placed into the RL field bytes as follows:

msb 7 bits

11-10-2019 Dr. Manas Khatua 11


MQTT QoS
 Even though TCP/IP provides guaranteed data delivery, data loss can still occur if a TCP connection
breaks down and messages in transit are lost.

 Therefore, MQTT adds 3 quality of service (QoS) levels on top of TCP

at least once

11-10-2019 Dr. Manas Khatua 12


Cont…
QoS level 0:
 At-most-once delivery («best effort»).
 Messages are delivered according to the delivery guarantees of the underlying network (TCP/IP).
 Example application: Temperature sensor data which is regularly published. Loss of an individual
value is not critical since applications (i.e. consumers of the data) will anyway integrate the
values over time

QoS level 1:
• At-least-once delivery.
 Messages are guaranteed to arrive, but there may be duplicates.
 Example application: A door sensor senses the door state. It is important that door state
changes (closed->open, open->closed) are published losslessly to subscribers (e.g. alarming
function). Applications simply discard duplicate messages by evaluating the message ID field.

QoS level 2:
 Exactly-once delivery.
 This is the highest level that also incurs most overhead in terms of control messages and the need
for locally storing the messages.
 Exactly-once is a combination of at-least-once and at-most-once delivery guarantee.
 Example application: Applications where duplicate events could lead to incorrect actions, e.g.
sounding an alarm as a reaction to an event received by a message. So, it avoids duplicate.

11-10-2019 Dr. Manas Khatua 13


PUBLISH msg flow
QoS level 0:
 With QoS level 0, a message is delivered with at-most-once delivery semantics («fire-and-forget»).

QoS level 1:
 QoS level 1 affords at-least-once delivery semantics. If the client does not receive the PUBACK in
time, it re-sends the message.

11-10-2019 Dr. Manas Khatua 14


Cont…
QoS level 2:
 QoS level 2 affords the highest quality delivery semantics exactly-once, but comes with the cost of
additional control messages.

11-10-2019 Dr. Manas Khatua 15


Example: CONNECT & SUBSCRIBE msg flow
Case 1:
• Session and subscription setup with clean session flag = 1 (transient subscription)

11-10-2019 Dr. Manas Khatua 16


Cont…
Case 2:
• Session and subscription setup with clean session flag = 0 (durable subscription)

11-10-2019 Dr. Manas Khatua 17


Thanks!

11-10-2019 Dr. Manas Khatua 18


CS578: Internet of Things
Data Analytics in IoT

Dr. Manas Khatua


Assistant Professor, Dept. of CSE, IIT Guwahati
E-mail: manaskhatua@iitg.ac.in

“Truth is indestructible, virtue is indestructible, purity is indestructible.” – Swami Vivekananda


Introduction to Data Analytics for IoT
• One of the biggest challenges in IoT:
– Management of massive amounts of data
generated by sensors.

• Few great examples


– commercial aviation industry
– utility industry

• Modern jet engines are fitted with


thousands of sensors that generate a
whopping 10GB of data per second

• A twin engine commercial aircraft with


these engines operating on average 8 hours
a day will generate over 500 TB of data Commercial Jet Engine
daily, and this is just the data from the
engines!

18-11-2020 Dr. Manas Khatua 2


Structured v/s Unstructured Data
• Not all data is the same
• it can be categorized and thus analyzed in different ways.

• Structured data :
– data follows a model/schema
– defines data representation
– e.g. Relational Database
– easily formatted, stored, queried, and processed
• has been core type of data used for making business
decisions
• Wide array of data analytics tools are available

• Unstructured data:
– lacks a logical schema
– Doesn’t fit into predefined data model
– e.g. text, speech, images, video

• Semi-structured data:
− hybrid of structured and unstructured data
− Not relational, but contains a certain schema
− e.g. Email : fields are well defined, but body and
attachments are unstructured

18-11-2020 Dr. Manas Khatua 3


Data in Motion v/s at Rest v/s in Use
• Different states of digital data can be • Data in motion is data
– in transit (data in motion) that is currently travelling
– being held/stored (data at rest)
across a network or
– being processed (data in use)
• sitting in a computer’s
RAM ready to be read,
updated, or processed.

• Data being processed by


one/more applications.
• data in the process of • Data at rest is typically in a
being generated, stable state.
viewed, updated, • It is not travelling within the
appended, or erased. system or network, and
• it is not being acted upon by
any application or the CPU.
18-11-2020 Dr. Manas Khatua 4
IoT Data Analytics Overview
• The true importance of IoT data from smart objects is realized only when
– the analysis of the data leads to actionable business intelligence and insights.

• Data analysis is typically broken down by


– the types of results that are produced.

18-11-2020 Dr. Manas Khatua 5


Cont…
• Descriptive
– It tells you what is happening, either
Application of Value and Complexity
now or in the past. Factors to the Types of Data Analysis
• e.g., thermometer in a truck engine
reports temperature values every
second.
Modern trend in
• Diagnostic IoT data analysis
– It can provide the answer to “why” it
has happened
• e.g. why the truck engine failed

• Predictive
– It aims to foretell problems or issues
before they occur.
• e.g., it could provide an estimate on
the remaining life of the truck
engine.

• Prescriptive
– It goes a step beyond predictive and
recommends solutions for upcoming
problems. Most data analysis
• e.g. it might calculate various space in IoT
alternatives to cost-effectively
maintain our truck.

18-11-2020 Dr. Manas Khatua 6


IoT Data Analytics Challenges
• Traditional data analytics solutions are not always adequate
– It typically employs a standard RDBMS and corresponding tools

• IoT data places two specific challenges on relational database data:


– Scaling problems:
• large number of smart objects continually send data,
• relational databases grow incredibly large very quickly.
• Results in performance issues which is costly to resolve
– Volatility of data:
• In RDBMS, schema is designed from the beginning,
• changing the scheme later creates problem.
• IoT data is volatile in the sense that the data model is likely to change and evolve over time.
• A dynamic schema is often required.

• Solution: NoSQL database in used


– does not use SQL to interact with the database
– do not enforce a strict schema
– support a complex, evolving data model
– databases are inherently much more scalable

18-11-2020 Dr. Manas Khatua 7


Cont…
• IoT brings challenges to streaming and network analytics
– with the live streaming nature of its data, and
– with managing data at the network level.
• usually of a very high volume
• real-time analysis of streaming data
– Google, Microsoft, IBM, etc., have streaming analytics offerings

– with the area of network data i.e. network analytics.


• it can be challenging to ensure that the data flows are effectively managed,
monitored, and secure.
– Network analytics tools: Flexible NetFlow, IPFIX

18-11-2020 Dr. Manas Khatua 8


Machine Learning
• How to make sense of the data that is generated in IoT?
– by Machine Learning
– ML is used to find the data relationships that will lead to new business insights

• ML is a part of a larger set of technologies commonly grouped under the


term artificial intelligence (AI).

• AI includes any technology that allows a computing system to mimic human


intelligence
– e.g., an App that can help you find your parked car.
– e.g., a GPS reading of your position at regular intervals calculates your speed.

• In more complex cases, static rules cannot be simply inserted into the
program
– because the programs require parameters that can change.
– e.g., dictation program – it does not know your accent, tone, speed, and so on.
You need to record a set of predetermined sentences to help the tool. This
process is called machine learning.

18-11-2020 Dr. Manas Khatua 9


Types of ML
• Supervised: All data is labeled and the algorithms learn to predict the output from
the input data.
• Unsupervised: All data is unlabeled and the algorithms learn to inherent structure
from the input data.

18-11-2020 Dr. Manas Khatua 10


Few ML Algorithms

18-11-2020 Dr. Manas Khatua 11


Examples from IoT
Supervised Learning
• Suppose you are training a system to recognize when there is a human in a
mine tunnel.
– sensor equipped with a basic camera can capture shapes
– return them to a computing system.
– hundreds or thousands of images are fed into the machine.
– each image is labelled (human or nonhuman in this case)
– An algorithm is used to determine common parameters and common
differences between the images.
– This process is called training.
– Each new image is compared with “good images” of human as per training
model
– This process is called classification.
– the machine should be able to recognize human shapes.

– the learning process is not about classifying in two or more categories but
about finding a correct value.
– regression predicts numeric values, whereas classification predicts categories.

18-11-2020 Dr. Manas Khatua 12


Cont…
Unsupervised Learning
• Suppose that you are processing IoT data from a factory manufacturing
small engines. You know that about 0.1% of the produced engines on
average need adjustments to prevent later defects.
• Your task is to identify them before they shipped away from the factory.
– you can test each engine
– record multiple parameters, such as sound, pressure, temperature of key parts,
and so on.
– Once data is recorded, you can graph these elements in relation to one another.
– You can then input this data into a computer and use mathematical functions to
find groups.
– A standard function to operate this grouping, K-means clustering
– Grouping the engines this way can quickly reveal several types of engines that
all belong to the same category.

– There will occasionally be an engine in the group that displays unusual


characteristics
– This is the engine that you send for manual evaluation
– this determination is called unsupervised learning.

18-11-2020 Dr. Manas Khatua 13


Applications of ML for IoT
It revolves around four major domains:
I. Monitoring
• ML can be used with monitoring to detect early failure conditions or to better
evaluate the environment

II. Behavior control


• Monitoring commonly works in conjunction with behavior control.
• When a given set of parameters reach a target threshold, monitoring functions
generate an alarm OR would trigger a corrective action

III. Operations optimization


• The objective is not merely to pilot the operations but to improve the efficiency
and the result of these operations.
• e.g., NN based system for a water purification plant in a smart city estimate the
best chemical and stirring mix for a target air temperature

IV. Self-healing, self-optimizing


• The system becomes self-learning and self-optimizing.
• ML engine can be programmed to dynamically monitor and combine new
parameters, and automatically deduce and implement new optimizations

18-11-2020 Dr. Manas Khatua 14


What is Big Data?
• Industry looks to three V’s to categorize big data

Volume refers to the scale of


the data.

It is common to see clusters of


servers for storing and
processing data
Velocity refers to how
quickly data is being
collected and analysed.

Variety refers
to different
types of data.

Hadoop is able to collect


Hadoop Distributed File and store all three types –
System is designed to structured, unstructured,
process data very quickly. or semi-structured.
18-11-2020 Dr. Manas Khatua 15
Characteristics of Big Data
• can be defined by the sources and types of data
– Machine data
• generated by IoT devices and is typically unstructured data.

– Transactional data
• from the sources that produce data from transactions on these
systems, and, have high volume and structured.

– Social data
• which are typically high volume and structured.

– Enterprise data
• data that is lower in volume and very structured.

18-11-2020 Dr. Manas Khatua 16


Database Technologies
• Relational databases and historians are mature technologies
• Relational databases, such as Oracle and Microsoft SQL, are good for transactional, or process,
data.
• Historians are optimized for time-series data from systems and processes

• Database technologies used in an IoT context.


– NoSQL
• It is not a specific database technology; rather, it is an umbrella term that encompasses several
different types of databases.
• Can quickly ingest rapidly changing data
• Can be able to query and analyse data within the database itself
• built to scale horizontally i.e. database can span to multiple hosts (so distributed)
• Best fit for IoT data:
– Document stores: stores semi-structured data, such as XML or JSON.
» allowing the database schema to change quickly
– Key-value stores: stores associative arrays where a key is paired with a value.
» capable of handling indexing and persistence.
– Massively Parallel Processing
• built on the concept of the relational data warehouses
• designed to allow for fast query processing; often have built-in analytic functions
• designed in a scale-out architecture such that both data and processing are distributed across
multiple systems
– Hadoop

18-11-2020 Dr. Manas Khatua 17


Hadoop
• Most popular choice as a data repository and processing engine

• Originally developed as a result of projects at Google and Yahoo!


– original intent was to index millions of websites and quickly return search
results for open source search engines.

• Initially, the project had two key elements:


– Hadoop Distributed File System (HDFS): A system for storing data across
multiple nodes
– MapReduce: A distributed processing engine that splits a large task into smaller
ones that can be run in parallel

• Hadoop relies on a scale-out architecture


• Both MapReduce and HDFS
– take advantage of this distributed architecture to store and process massive
amounts of data
– leverages local processing, memory, and storage from all nodes in the cluster

18-11-2020 Dr. Manas Khatua 18


Cont…
• For HDFS, this capability is handled by specialized nodes in the cluster –
NameNode and DataNode

• NameNode coordinate
where the data is stored,
and maintain a map of
where each block of data
is stored and where it is
replicated.

• DataNodes are the


servers where the data is
stored at the direction of
the NameNode.

18-11-2020 Dr. Manas Khatua 19


Hadoop Ecosystem
• Hadoop plays an increasingly big role in the collection, storage, and
processing of IoT data

• Hadoop Ecosystem comprises of more than 100 software projects under


the Hadoop umbrella
– Capabale of every element in the data lifecycle, from data collection, to storage,
to processing, to analysis and to visualization

• Several of these packages


– Apache Kafka
– Apache Spark
– Apache Storm
– Apache Flink
– Lambda Architecture

18-11-2020 Dr. Manas Khatua 20


Edge Streaming Analytics
• In the world of IoT vast quantities of data are generated on the fly
– Often they are time sensitive i.e. needs immediate attention,
– waiting for deep analysis in the cloud simply isn’t possible.
– e.g., automobile racing industry
• Formula One racing car has 150-200 sensors that generate more than 1000 data points per second
• enormous insights leading to better race results can be gained by analyzing data on the fly

• Big Data tools like Hadoop and MapReduce are not suited for real-time analysis
– because of distance from the IoT endpoints and the network bandwidth requirement

• Streaming analytics allows you to continually monitor and assess data in real-time so that
you can adjust or fine-tune your predictions as the race progresses.

• In IoT, streaming analytics is performed at the edge (either at the sensors themselves or
very close to them such as gateway)

• The edge isn’t in just one place. The edge is highly distributed.

• Does the streaming analytics replaces big data analytics in the cloud?
– Not at all.
– Big data analytics is focused on large quantities of data at rest, edge analytics continually processes
streaming flows of data in motion.

18-11-2020 Dr. Manas Khatua 21


Key Values of Edge Streaming Analytics
• Reducing data at the edge
– Passing all data to the cloud is inefficient and is unnecessarily expensive in
terms of bandwidth and network infrastructure.

• Analysis and response at the edge


– Some data is useful only at the edge and for small window of time
– e.g., Roadway sensors combined with GPS wayfinding apps may tell a
driver to avoid a certain highway due to traffic. This data is valuable for
only a small window of time.

• Time sensitivity
– When timely response to data is required, passing data to the cloud for
future processing results in unacceptable latency.

18-11-2020 Dr. Manas Khatua 22


Edge Analytics Core Functions
• Raw input data
– This is the raw data coming from the sensors into the analytics processing unit.

• Analytics processing unit (APU)


– The APU filters and combines (or separates) data streams, organizes them by time windows, and
performs various analytical functions.

• Output streams
– The data that is output is organized into insightful streams and passed on for storage and further
processing in the cloud.

18-11-2020 Dr. Manas Khatua 23


Network Analytics
• This form of analytics extremely important in managing IoT systems

• Data analytics: concerned with finding patterns in the data generated


by endpoints

• Network analytics: concerned with discovering patterns in the


communication flows

– It is network-based analytics
– power to analyze details of communications patterns made by protocols

– correlate this pattern across the network


– allows to understand what should be considered normal behavior in a
network

18-11-2020 Dr. Manas Khatua 24


Benefits
Benefits of Network Analytics:
• Offer capabilities to cope with capacity planning for scalable IoT deployment

• Security monitoring in order to detect abnormal traffic volume and patterns


– e.g. an unusual traffic spike for a normally quiet protocol
– for both centralized or distributed architectures

• Network traffic monitoring and profiling

• Application traffic monitoring and profiling

• Capacity planning

• Security analysis

• Accounting

• Data warehousing and data mining


18-11-2020 Dr. Manas Khatua 25
Challenges
Challenges with deploying flow analytics tools in an IoT network

• Flow analysis at the gateway is not possible with all IoT systems
– LoRaWAN gateways simply forward MAC-layer sensor traffic to the centralized
LoRaWAN network server, which means flow analysis (based on Layer 3) is not
possible at this point.
– A similar problem is encountered when using an MQTT server that sends data
through an IoT broker

• Traffic flows are processed in places that might not support flow analytics,
and visibility is thus lost.

• IPv4 and IPv6 native interfaces sometimes need to inspect inside VPN
tunnels, which may impact the router’s performance.

• Additional network management traffic is generated by analytics reporting


devices

18-11-2020 Dr. Manas Khatua 26


18-11-2020 Dr. Manas Khatua 27
CS578: Internet of Things
IoT Frameworks

Dr. Manas Khatua


Assistant Professor, Dept. of CSE, IIT Guwahati
E-mail: manaskhatua@iitg.ac.in

“Strength is Life, Weakness is Death.” – Swami Vivekananda


IoT Framework
• Framework provides a development environment.

– It provides appropriate infrastructure & tolls to design and implement the architecture

• IoT framework comprises of large number of components

– sensors, sensor systems, gateways, mobile app, embedded controller, data management
platform, analytical platform, and so on.

– support interoperability among all devices, provides secure connectivity, reliability in data
transfer, interface to 3rd party application to built on it, and many more.

Few IoT Framework Few IoT Framework


RTI (Real-Time Innovations) Connext DDS Cisco Ultra IoT
Salesforce IoT cloud Azure IoT
Eclipse IoT ThingWorx
GE (General Electronic) Predix AWS IoT
Watson IoT Kaa

15-11-2020 Dr. Manas Khatua 2


Cisco Ultra IoT
 It is a fully virtualized, 5G-ready services core

 It supports the 3GPP Cellular IoT (CIoT) architecture

 It also supports wide range of IoT solutions across vertical markets

 It includes core network support for all wireless IoT connectivity (e.g. 2G/3G/LTE, NB-IoT
& CAT-M1, WiFi, LoRaWAN, etc.)

 Cisco relies on three major


components:
 Virtualized data centre
 Intelligent network
 Connected devices

 Cisco Ultra IoT is a part of


Cisco Ultra Service Platform

Source: https://www.cisco.com/c/en/us/solutions/collateral/service-provider/ultra-services-platform/cisco-ultra-iot-at-a-glance.html

15-11-2020 Dr. Manas Khatua 3


Cont…
• It delivers fully-virtualized mobile core functions that bring benefits to Service Providers:

 Simplifies and automates services provisioning with Cisco’s industry-leading orchestration solutions

 Provide end-to-end 5G network slicing, which uses powerful provisioning and management
capabilities to enable each enterprise customer or IoT Service to get its own secure, highly reliable,
dedicated virtualized mobile core

 Separates the user plane from the control plane with a distributed architecture using SDN, allowing
traffic to go directly to the Internet without costly backhaul

 Cisco CIoT Serving Gateway Node (CSGN): it terminates multiple access technologies

 Cisco enhanced Service Capability Exposure Function (eSCEF): associates endpoints with applications
and exposes network capabilities and data to applications through an open API.

 Benefits/Goal at-a-glance:
 Grow revenues by securely connecting IoT devices and sensors over a multi-access core with unified
policy, charging, and service capabilities
 Monetize network intelligence and services by enhancing capabilities of IoT applications
 Meet the scaling requirements of Massive IoT with a fully virtualized 5G-ready mobile core solution

15-11-2020 Dr. Manas Khatua 4


Salesforce IoT Cloud
• Salesforce IoT Framework
– Combines IoT and big data

• A new data is sent to Kafka,


where Spark is responsible
to transmit it to Cassandra
for further processing.
• Meanwhile, Storm analyses
the dataset to formulate
responses for current events

• The backbone of these


technologies:
– Salesforce’s Heroku PaaS
– AWS Cloud
– Apache Technologies and
Thunder event-processing
engine

15-11-2020 Dr. Manas Khatua 5


AWS IoT

• AWS IoT provides cloud services


– that connect the IoT devices to other devices and AWS cloud services.

• AWS IoT provides device software


– that facilitate development and integration of the IoT devices with AWS
IoT-based solutions

15-11-2020 Dr. Manas Khatua 6


AWS IoT Interfaces
How the IoT end devices and apps access AWS IoT:
• AWS IoT Device SDKs
– Build applications on your devices that send messages to and receive messages
from AWS IoT.

• AWS Command Line Interface (AWS CLI)


– Run commands for AWS IoT on Windows, MacOS, and Linux.
– These commands allow you to create and manage thing objects, certificates,
rules, jobs, and policies.

• AWS IoT API


– Build your IoT applications using HTTP or HTTPS requests.
– These API actions allow you to programmatically create and manage thing objects,
certificates, rules, and policies.

• AWS SDKs
– Build your IoT applications using language-specific APIs.
– These SDKs wrap the HTTP/HTTPS API and allow you to program in any of the
supported languages.

15-11-2020 Dr. Manas Khatua 7


How AWS IoT works
• Cloud services
– Cloud services are distributed, large-
scale data storage and processing
services that are connected to the
Internet.
– e.g. IoT connection and management
services (AWS IoT)
– e.g. Compute services (AWS Lambda)
– e.g. Database services (Amazon
DynamoDB)

• Communications
– Devices communicate with cloud
services by using various technologies
and protocols.
– e.g. Wi-Fi/ Broadband Internet,
• Apps Broadband/ Narrowband cellular data
– Apps give end users access to IoT devices and the
features provided by the cloud services to which those
devices are connected. • Interfaces
– An interface is a component that
connects a device to the physical
• Devices world.
– A device is a type of hardware that manages interfaces – e.g. User interfaces, Sensors,
and communications. Actuators
– e.g. Raspberry Pi, Arduino, Custom IoT devices

15-11-2020 Dr. Manas Khatua 8


AWS IoT services

• AWS IoT Greengrass extends AWS to edge devices so they can act locally on the data they generate and use the cloud for
management, analytics, and durable storage.

• AWS IoT Core is a managed cloud service that enables connected devices to securely interact with cloud applications and
other devices.

• AWS IoT Analytics filters, transforms, and enriches IoT data before storing it in a time-series data store for analysis.

15-11-2020 Dr. Manas Khatua 9


AWS IoT Core services

• AWS IoT Core provides the services that connect your IoT devices to the AWS Cloud so that other cloud
services and applications can interact with your internet-connected devices.

• The Message broker handles communication between your devices and AWS IoT.
• The Device Shadow service maintains a device's state so that applications can communicate with a device
whether the device is online or not.
• The Rules engine connects data from the message broker to other AWS services for storage and additional
processing.
15-11-2020 Dr. Manas Khatua 10
Connecting to AWS IoT Core

• AWS IoT Core supports connections with IoT devices, services, and apps.

• Devices connect to the AWS IoT Core so they can send data to and receive data from AWS IoT services and
other devices.

• Apps and other services also connect to AWS IoT Core to control and manage the IoT devices and process the
data from your IoT solution.

• In general, the two ways to interact with AWS IoT are through the AWS IoT Core service endpoints and the
AWS IoT device endpoints.

15-11-2020 Dr. Manas Khatua 11


What AWS IoT can do? - Example
IoT in Industry IoT in Home automation

• Use AWS IoT to build predictive quality • Use AWS IoT in your
models in industrial operations connected home

• Use AWS IoT to build predictive quality • Use AWS IoT to provide home
models in industrial operations security and monitoring

15-11-2020 Dr. Manas Khatua 12


Azure IoT
• Azure IoT is a collection of Microsoft-managed cloud services that connect, monitor,
and control billions of IoT assets.
– It deals with how these services work together across three components – Things, Insights, Actions

15-11-2020 Dr. Manas Khatua 13


Azure IoT Sample Architecture

• Things: The physical objects or things, such as industrial equipment, devices or sensors, that connect to the
cloud persistently or intermittently.

• Insights: Information collected by the things, which is analysed and turned into actionable knowledge
either by people or AI.

• Action: The way people respond to those insights and connect them to their business, as well as the
systems and tools they use.

15-11-2020 Dr. Manas Khatua 14


Cont…
• Things:
– Secure your edge devices and hardware
• Azure Sphere and RTOS
• Windows IoT
– Simplify connectivity with certified devices
• IoT Plug and Play
• Action:
• Azure Certified Devices – Integrate with your business
– Push applications and workloads to the edge applications
• Power BI
• Azure IoT Edge
• Dynamics 365
• Azure Stack
• CRM
• Azure Stack Edge
• Field Services
– Security from edge to cloud
• Insights: • Azure Defender for IoT
– Connect and manage your device data with – Build connected ecosystems
flexibility
• Azure IoT Hub
• Azure IoT Central
– Transform your data for interoperability
• Azure APIs
– Create digital models of entire environments
• Azure Digital Twins

15-11-2020 Dr. Manas Khatua 15


Azure IoT Hub
• Azure IoT Hub and Digital Twins provide the building blocks for companies
– to construct customised solutions for complex IoT scenarios.

• Enable highly secure and reliable communication between your IoT application and the
devices it manages.
• Security-enhanced communication channel for sending and receiving data from IoT devices

• Provides a cloud-hosted solution back end to connect virtually any device.

• Extend your solution from the cloud to the edge with per-device authentication

• Built-in device management and provisioning to connect and manage IoT devices at scale

• Compatibility with Azure IoT Edge and Azure Stack for building hybrid IoT applications

• Azure Digital Twins:


– Digital representation of your connected device.
– It’s a JSON file in the cloud managed by IoT Hub, and there is one of them for each of
your IoT devices connected to IoT Hub.

15-11-2020 Dr. Manas Khatua 16


Example: Azure IoT for healthcare
Enabling the next generation of healthcare IoT solutions Seamless

• Deliver personalised care, Smart

• Empower care teams and employees, and Secure

• Improve operational outcomes.


Continuous patient monitoring

In-home care

Smart hospital equipment

Applications Smart hospital building

Cold chain supply tracking

Healthcare manufacturing

Inventory management for medical supplies

15-11-2020 Dr. Manas Khatua 17


Figures and slide materials are taken from the following:
1. Mayur Ramgir, “Internet of Things: Architecture, Implementation and Security”,
1st Edition, 2020, Pearson India.
2. https://docs.aws.amazon.com/iot/latest/developerguide/what-is-aws-iot.html
3. https://docs.microsoft.com/en-us/azure/iot-fundamentals/

15-11-2020 Dr. Manas Khatua 18

You might also like