V01 - Updated - Module 3 - IoT Protocol Suite
V01 - Updated - Module 3 - IoT Protocol Suite
• Physical layer,
• Link layer -BLE, LoRaWAN
• Network layer,
• Transport layer,
• Application Layer protocols - MQTT, CoAP
• Communication Models.
Layer’s - Architecture of IoT
3 Layer 5 Layer
3 Layer- Architecture of IoT
• The perception layer is the physical layer, which
has sensors for sensing and gathering information
about the environment. It senses some physical
parameters or identifies other smart objects in the
environment.
• The network layer is responsible for connecting to
other smart things, network devices, and servers. Its
features are also used for transmitting and
processing sensor data. (BLE, Wi-Fi, LoRAWAN)
• The application layer is responsible for delivering
application specific services to the user. It defines
various applications in which the Internet of
Things can be deployed, for example, smart homes,
smart cities, and smart health.
5 Layer- Architecture of IoT
• The perception layer is the physical layer, which
has sensors for sensing and gathering information
about the environment. It senses some physical
parameters or identifies other smart objects in the
environment.
• The transport layer transfers the sensor data from
the perception layer to the processing layer and vice
versa through networks such as wireless, 3G, LAN,
Bluetooth, RFID, and NFC.
• The processing layer is also known as the
middleware layer. It stores, analyzes, and processes
huge amounts of data that comes from the transport
layer. It can manage and provide a diverse set of services to the lower
layers. It employs many technologies such as databases, cloud computing, and
big data processing modules
5 Layer- Architecture of IoT
• The application layer is responsible for delivering
application specific services to the user. It defines
various applications in which the Internet of
Things can be deployed, for example, smart homes,
smart cities, and smart health.
• The business layer manages the whole IoT system,
including applications, business and profit models,
and users’ privacy.
• This Layer also has the responsibility to design, analyze,
implement, evaluate, and monitor the requirements of
the IoT system.
• This layer can use big data analysis to support decision-
making activities.
• performs a comparison of obtained versus expected
outputs to enhance the quality of services.
Arrangement of Protocols in IoT
A binary format is a format in which file information is stored in the form of ones and zeros, or in some other binary (two-state) sequence.
Concise Binary Object Representation (CBOR) is a binary data serialization format loosely based on JSON
JSON – Java Script Object Notation
UDP – User datagram Protocol
Datagram Transport Layer Security (DTLS) is a communications protocol providing security to datagram-based applications by allowing
them to communicate in a way designed to prevent eavesdropping, tampering, or message forgery.
CoAP – Constrained Application protocol
MQTT – Message Queuing Telemetry Transport ;
Extensible Messaging and Presence Protocol is an open communication protocol designed for instant messaging (IM), presence information,
and contact list maintenance. Based on XML (Extensible Markup Language), it enables the near-real-time exchange of structured data
between two or more network entities.
IoT Access Technologies
• The technologies that IoT access for connectivity.
• Topics addressed:
• Physical layers (The wired or wireless methods and relevant
frequencies)
• MAC layers (Considerations at the Media Access Control
(MAC) layer, which bridges the physical layer with data link
control)
• Topology (The topologies supported by the technology)
• Security (Security aspects of the technology)
IoT Access Technologies
IEEE 802.15.4: an older but foundational wireless protocol for connecting
smart objects.
IEEE 802.15.4g and IEEE 802.15.4e: are targeted to utilities and smart cities
deployments.
IEEE 1901.2a: which is a technology for connecting smart objects over
power lines.
IEEE 802.11ah: a technology built on the well-known 802.11 Wi-Fi
standards that is specifically for smart objects.
BLE: Bluetooth Low Energy
LoRaWAN (Long Range Wide Area Network): a scalable technology
designed for longer distances with low power requirements in the unlicensed
spectrum.
NB-IoT (Narrow band – IoT) and Other LTE (Long-Term Evolution – 4G)
Variations: which are often the choice of mobile service providers looking to
connect smart objects over longer distances in the licensed spectrum.
IEEE 802.15.4
22
How much energy does traditional Bluetooth use?
• Traditional Bluetooth is connection oriented. When a
device is connected, a link is maintained, even if there
is no data flowing.
• Sniff modes allow devices to sleep, reducing power
consumption to give months of battery life
• Peak transmit current is typically around 25mA
• Even though it has been independently shown to be
lower power than other radio standards, it is still not
low enough power for coin cells and energy harvesting
applications
23
What is Bluetooth Low Energy?
• Bluetooth low energy is a NEW, open, short range radio
technology
• Blank sheet of paper design
• Different to Bluetooth classic (BR/EDR)
• Optimized for ultra low power
• Enable coin cell battery use cases
• < 20mA peak current
• < 5 uA average current
24
Basic Concepts of Bluetooth 4.0
• Everything is optimized for lowest power consumption
• Short packets reduce TX peak current
• Short packets reduce RX time
• Less RF channels to improve discovery and connection
time
• Simple state machine
• Single protocol
• Etc.
25
Bluetooth low energy factsheet
Range: ~ 150 meters open field
Output ~ 10 mW (10dBm)
Power:
Max Current: ~ 15 mA
Latency: 3 ms
Topology: Star
Connections: > 2 billion
Modulation: GFSK @ 2.4 GHz
Robustness: Adaptive Frequency Hopping, 24 bit CRC
Security: 128bit AES CCM
Sleep current: ~ 1μA
Modes: Broadcast, Connection, Event Data Models,
Reads, Writes
26
Bluetooth low energy factsheet #2
• Data Throughput
• For Bluetooth low energy, data throughput is not a
meaningful parameter. It does not support
streaming.
• It has a data rate of 1Mbps, but is not optimized for
file transfer.
• It is designed for sending small chunks of data
(exposing state)
27
Bluetooth low energy factsheet #2
• BLE (Bluetooth Low Energy) is wireless PAN technology designed and
maintained by Bluetooth Special Interest Group (SIG). There are
various versions of bluetooth. The version 4.2 and above is referred
as BLE. The latest in the series are v5.0 and v5.1. BLE specifications
are intended to reduce power consumption and cost of devices while
maintaining coverage range. BLE is known as "Bluetooth Smart"
where as previous version is known as "bluetooth classic".
• BLE is not backward compatible with BR/EDR protocols.
• BLE uses 2.4 GHz ISM frequency band either in dual mode or single
mode. Dual mode supports both bluetooth classic and low energy
peripherals.
• All BLE devices use the GATT profile (Generic Attribute Profile). The
GATT protocol provides series of commands for the client to discover
information about BLE server.
• The BLE protocol stack architecture consists of two parts viz.
controller and host. Both are interfaced using HCI (Host to Controller
Interface). Any profiles and applications run on top of GAP & GATT 28
protocol layers.
Device Modes
• Dual Mode
• Bluetooth BR/EDR and LE
• Used anywhere that BR/EDR
is used today
• Single Mode
• Implements only Bluetooth low energy
• Will be used in
new devices / applications
29
Device Modes
• Dual mode + single modes
BR/EDR stack Dual-mode stack Single-mode stack
30
Bluetooth Low Energy Architecture
31
Physical Layer
• 2.4 GHz ISM band
• 1Mbps GFSK
• Larger modulation index than Bluetooth BR (which means
better range)
• 40 Channels on 2 MHz spacing
• The transmitter uses GFSK modulation and operates at unlicensed
2.4 GHz frequency band.
• Using this PHY layer, BLE offers data rates of 1 Mbps (Bluetooth
v4.2)/2 Mbps (Bluetooth v5.0).
• It uses frequency hopping transceiver.
• Two modulation schemes are specified to deliver 1 Msym/s and 2
Msym/s.
• Two PHY layer variants are specified viz. uncoded and coded.
A Time Division Duplex (TDD) topology is employed in both of32 the
PHY modes.
Link Layer
• Link Layer state machine
This layer sits above the Physical layer. It
is responsible for advertising, scanning,
and creating/maintaining connections.
The role of BLE devices changes in peer
to peer (i.e. Unicast) or broadcast modes.
The common roles are Advertiser/Scanner
(Initiator), Slave/Master or
Broadcaster/Observer. Link layer states
are defined in the figure below.
33
Link Layer Connection
• Very low latency connection
34
Bluetooth Low Energy Architecture
36
Bluetooth Low Energy Architecture
• Application Layer :
• The BLE protocol stack layers interact with applications
and profiles as desired. Application interoperability in the
Bluetooth system is accomplished by Bluetooth profiles.
• The profile defines the vertical interactions between
the layers as well as the peer-to-peer interactions of
specific layers between devices.
• A profile composed of one or more services to address
particular use case. A service consists of characteristics
or references to other services.
• Any profiles/applications run on top of GAP/GATT
layers of BLE protocol stack. It handles device discovery
and connection related services for the BLE device.
37
What are the USE CASES planned for
BT 4.0?
• Proximity • HVAC
• Time • Generic I/O (automation)
• Emergency • Battery status
• Network availability • Heart rate monitor
• Personal User Interface • Physical activity monitor
• Simple remote control • Blood glucose monitor
• Browse over Bluetooth • Cycling sensors
• Temperature Sensor • Pulse Oximeter
• Humidity Sensor • Body thermometer
38
Example use: proximity
• It can enable proximity detection
• I’m in the car
• I’m in the office
• I’m in the meeting room
• I’m in the movie theater
• It can enable presence detection
• Turn the lights on when I walk around the house
• Automatically locks the door when I leave home
• Turn the alarm off if I’m already awake
39
Everyday objects can become sensors
My pulse is … My blood glucose is …
My temperature is …
02:32 AM 55
LoRaWAN
Topology
• LoRaWAN endpoints transport their selected application
data over the LoRaWAN MAC layer on top of one of the
supported PHY layer frequency bands.
• The application data is contained in upper protocol layers.
• These upper layers could just be raw data on top of the
LoRaWAN MAC layer, or the data could be stacked in
multiple protocols.
• For example, upper-layer protocols,
• ZigBee Control Layer (ZCL), Constrained Application Protocol
(CoAP), Message Queuing Telemetry Transport (MQTT), or
with/without IPv6/6LoWPAN layer.
02:32 AM 56
Security
• Security in a LoRaWAN deployment applies to
different components of the architecture.
• LoRaWAN endpoints must implement two layers of
security,
• protecting communications and
• data privacy across the network.
LoRaWAN - Security
02:32 AM 58
LoRaWAN - Security
• LoRaWAN endpoints must implement two layers of
security,
• Protecting communications
• Data privacy across the network.
02:32 AM 59
LoRaWAN - Security
• Protecting communications
• Also called “network security” but applied at the MAC layer,
• guarantees the authentication of the endpoints by the
LoRaWAN network server.
• It protects LoRaWAN packets by performing encryption
based on AES.
• Each endpoint implements a network session key
(NwkSKey), used by both itself and the LoRaWAN network
server.
• The NwkSKey ensures data integrity through computing and
checking the MIC of every data message as well as encrypting and
decrypting MAC-only data message payloads.
02:32 AM 60
LoRaWAN - Security
• Data privacy :
• An application session key (AppSKey), which performs
encryption and decryption functions between the endpoint
and its application server.
• It computes and checks the application-level MIC, if
included.
• This ensures that the LoRaWAN service provider does not have
access to the application payload if it is not allowed that access.
• Endpoints receive their AES-128 application key (AppKey)
from the application owner.
• This key is most likely derived from an application-specific root key
exclusively known to and under the control of the application
provider.
02:32 AM 61
LoRaWAN - Security
• LoRaWAN endpoints attached to a LoRaWAN network must get
registered and authenticated.
• This can be achieved through one of the two join mechanisms:
• Activation by personalization (ABP):
• Endpoints don’t need to run a join procedure as their individual details, including
DevAddr and the NwkSKey and AppSKey session 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. The join procedure must be done
every time a session context is renewed. During the join process, which involves
the sending and receiving of MAC layer join request and join accept messages,
the node establishes its credentials with a LoRaWAN network server, exchanging
its globally unique DevEUI, AppEUI, and AppKey. The AppKey is then used to
derive the session NwkSKey and AppSKey keys.
02:32 AM 62
End Nodes are LoRa embedded sensors
02:32 AM 65
Network Layer
• Network layer connectivity, which is commonly referred to as
Layer 3.
• The network transport layer sublayer that is part of the
communications network layer.
• IP Versions
• Transitioning the Internet from IP version 4 to IP version 6. The
main driving force has been the lack of address space in IPv4 as the
Internet has grown.
• IPv6 has a much larger range of addresses that should not be
exhausted for the foreseeable future.
• Today, both versions of IP run over the Internet, but most
traffic is still IPv4 based.
IP Versions
• Internet of Things support both IPv4 and IPv6 versions
concurrently.
• Techniques such as tunneling and translation need to be
employed in IoT solutions to ensure interoperability
between IPv4 and IPv6.
• A variety of factors dictate whether IPv4, IPv6, or both
can be used in an IoT solution.
• Most often these factors include a legacy protocol or
technology that supports only IPv4.
• Newer technologies and protocols almost always support
both IP versions
Main factors applicable to IPv4 and
IPv6 support in an IoT solution
• Application Protocol:
• IoT devices implementing Ethernet or Wi-Fi interfaces
can communicate over both IPv4 and IPv6, but the
application protocol may dictate the choice of the IP
version.
• For example, SCADA protocols such as DNP3/IP (IEEE
1815), Modbus TCP, or the IEC 60870-5-104 standards
are specified only for IPv4.
• For IoT devices with application protocols defined by the
IETF, such as HTTP/HTTPS, CoAP, MQTT, and XMPP, both
IP versions are supported
• Cellular Provider and Technology:
• IoT devices with cellular modems are dependent on the
generation of the cellular technology as well as the data
services offered by the provider.
• For the first three generations of data services—GPRS,
Edge, and 3G—IPv4 is the base protocol version.
• Consequently, if IPv6 is used with these generations, it
must be tunneled over IPv4.
• On 4G/LTE networks, data services can use IPv4 or IPv6
as a base protocol, depending on the provider.
• Serial Communications:
• Many legacy devices in certain industries, such as
manufacturing and utilities, communicate through serial
lines. Data is transferred using either proprietary or
standardsbased protocols, such as DNP3, Modbus, or IEC
60870-5-101.
• Encapsulation of serial protocols over IP leverages
mechanisms such as raw socket TCP or UDP. While raw
socket sessions can run over both IPv4 and IPv6,
current implementations are mostly available for IPv4
only.
Constrained Nodes
• Depending on its functions in a network, a “thing”
architecture may or may not offer similar
characteristics.
• Another limit is that this network protocol stack on
an IoT node may be required to communicate
through an unreliable path.
• Finally, power consumption is a key characteristic
of constrained nodes. Many IoT devices are battery
powered, with lifetime battery requirements
varying from a few months to 10+ years
IoT
Constrained nodes
• Devices that are very constrained in resources, may
communicate infrequently to transmit a few bytes,
and may have limited security and management
capabilities:
• This drives the need for the IP adaptation model, where
nodes communicate through gateways and proxies.
• Devices with enough power and capacities to
implement a stripped-down IP stack or non-IP stack:
• In this case, you may implement either an optimized IP stack
and directly communicate with application servers (adoption
model) or go for an IP or non-IP stack and communicate
through gateways and proxies (adaptation model).
• Devices that are similar to generic PCs in terms of
computing and power resources but have
constrained networking capacities, such as
bandwidth:
• These nodes usually implement a full IP stack (adoption
model), but network design and application behaviors
must cope with the bandwidth constraints.
Constrained Networks
• Network bandwidth capacity was restrained due to
technical limitations. Connections often depended
on low-speed modems for transferring data.
However, these low-speedconnections
demonstrated that IP could run over low-
bandwidth networks.
• Networking has seen the emergence of high-speed
infrastructures. However, high-speed connections
are not usable by some IoT devices in the last mile.
• implementation of technologies with low bandwidth,
• limited distance and bandwidth due to regulated
transmit power, and
• lack of or limited network services
• A constrained network can have high latency and a
high potential for packet loss.
Constrained Networks
• Constrained networks are often referred to as low-power and
lossy networks (LLNs).
• Lossy in this context refers to network unreliability that is
caused by disruptions in the data flow or packet loss.
• Constrained networks have unique characteristics and
requirements.
• In contrast with typical IP networks, where highly stable and
fast links are available, constrained networks are limited by
low-power, low bandwidth links (wireless and wired).
• They operate between a few kbps and a few hundred kbps and
may utilize a star, mesh, or combined network topologies,
ensuring proper operations
• Packet delivery rate (PDR) to oscillate between low and high
percentages.
• Large bursts of unpredictable errors and even loss of
connectivity at times may occur.
• These behaviors can be observed on both wireless and
narrowband power-line communication links, where packet
delivery variation may fluctuate greatly during the course of a
day.
• Due to the low bandwidth, a constrained network that
overreacts can lead to a network collapse.
• This in turn has led various standards organizations to work on
optimizing protocols for IoT
Optimizing IP for IoT
• While the Internet Protocol is key for a successful
Internet of Things, constrained nodes and constrained
networks mandate optimization at various layers and
on multiple protocols of the IP architecture.
Optimizing IP for IoT Using an
Adaptation Layer
CoAP IoT is unreliable protocol due to use of UDP. Hence CoAP messages reach
unordered or will get lost when they arrive at destination.
To make CoAP as reliable protocol, stop and wait with exponential backoff
retransmission feature is incorporated in it. Duplicate detection is also introduced.
CoAP Communications in IoT
Infrastructures
• Connections can be between devices located on the
same or different constrained networks or between
devices and generic Internet or cloud servers, all
operating over IP.
• As both HTTP and CoAP are IP-based protocols, the
proxy function can be located practically
anywhere in the network, not necessarily at the
border between constrained and non-constrained
networks.
• CoAP is based on the REST architecture, but with a
“thing” acting as both the client and the server.
• Through the exchange of asynchronous messages, a
client requests an action via a method code on a server
resource.
• A uniform resource identifier (URI) localized on the server
identifies this resource.
• The server responds with a response code that may
include a resource representation.
• The CoAP request/response semantics include the
methods GET, POST, PUT, and DELETE.
CoAP Reliable Transmission
Example
CoAP Protocol: Step-by-Step
Guide
The main features of CoAP protocols are:
•Web protocol used in M2M with constrained
requirements
•Asynchronous message exchange
•Low overhead and very simple to parse
•URI and content-type support
•Proxy and caching capabilities
CoAP Protocol: Step-by-Step
Guide
From the abstraction protocol layer, CoAP
can be represented as:
As you can see there are two different layers
that make CoAp protocol:
Messages and Request/Response. The
Messages layer deals with UDP and with
asynchronous messages. The
Request/Response layer manages
request/response interaction based on
request/response messages.
CoAP supports four different message types:
•Confirmable
•Non-confirmable
•Acknowledgment
•Reset
CoAP Protocol: Step-by-Step
Guide
CoAp protocol, structure is useful to define some terms that
we will use later:
Endpoint: An entity that participates in the CoAP protocol.
Usually, an Endpoint is identified with a host
Sender: The entity that sends a message
Recipient: The destination of a message
Client: The entity that sends a request and the destination of
the response
Server: The entity that receives a request from a client and
sends back a response to the client
CoAP Protocol: Step-by-Step
Guide
CoAP protocol uses two kinds of messages:
• Confirmable message
• Non-confirmable message
A confirmable message is a reliable message. When
exchanging messages between two endpoints, these
messages can be reliable. In CoAP, a reliable message is
obtained using a Confirmable message (CON). Using this
kind of message, the client can be sure that the message
will arrive at the server. A Confirmable message is sent
again and again until the other party sends an acknowledge
message (ACK). The ACK message contains the same ID of
the confirmable message (CON).
CoAP Protocol: Step-by-Step
•
Guide
Confirmable message