Understanding IOT
Understanding IOT
CoAP, MQTT
Constrained RESTful Environment
• IoT and M2M devices communicate within themselves with a LAN.
Each node sends 10s of data.
• The gateway received 100s of data from many end devices. In the
communication framework, the gateway enables communication of
the devices over a REST software architecture.
• Constrained devices- data is Limited in size
• ROLL networks- a wireless network with a low power transceiver.
Devices usually are in sleep mode
• ROLL- Routing over a network of Low power and Data Loss.
REST
• The Representational State Transfer (REST) architectural style [REST] is a
set of guidelines and best practices for building distributed hypermedia
systems.
• At its core is a set of constraints, which when fulfilled enable desirable
properties for distributed software systems such as scalability and
modifiability.
• When REST principles are applied to the design of a system, the result is
often called RESTful and in particular an API following these principles is
called a RESTful API.
• Since RESTful APIs are often simple and lightweight, they are a good fit
for various IoT applications.
REST Terminologies
• Cache: A local store of response messages and the subsystem that controls storage,
retrieval, and deletion of messages in it.
• Client: A node that sends requests to servers and receives responses. In RESTful IoT
systems it’s common for nodes to have more than one role (e.g., both server and
client).
• Client State: The state kept by a client between requests. This typically includes the
currently processed representation, the set of active requests, the history of
requests, bookmarks (URIs stored for later retrieval), and application-specific state
(e.g., local variables).
• Content Negotiation: The practice of determining the “best” representation for a
client when examining the current state of a resource. The most common forms of
content negotiation are Proactive Content Negotiation and Reactive Content
Negotiation.
• Form: A hypermedia control that enables a client to change the state of a resource
or to construct a query locally.
REST Terminologies
• Forward Proxy: An intermediary that is selected by a client, usually via local
configuration rules, and that can be tasked to make requests on behalf of the client.
This may be useful, for example, when the client lacks the capability to make the
request itself or to service the response from a cache in order to reduce response
time, network bandwidth, and energy consumption.
• Gateway: A reverse proxy that provides an interface to a non-RESTful system such as
legacy systems or alternative technologies such as Bluetooth ATT/GATT.
• Hypermedia Control: A component, such as a link or a form, embedded in a
representation that identifies a resource for future hypermedia interactions. If the
client engages in an interaction with the identified resource, the result may be a
change to resource state and/or client state.
• Idempotent Method: A method where multiple identical requests with that method
lead to the same visible resource state as a single such request.
• Link: A hypermedia control that enables a client to navigate between resources and
thereby change the client state.
REST Terminologies
• Link Relation Type: An identifier that describes how the link target resource
relates to the current resource (Ref [RFC5988]).
• Media Type: A string such as “text/html” or “application/json” that is used to
label representations so that it is known how the representation should be
interpreted and how it is encoded.
• Method: An operation associated with a resource. Common methods include
GET, PUT, POST, and DELETE
• Origin Server: A server that is the definitive source for representations of its
resources and the ultimate recipient of any request that intends to modify its
resources. In contrast, intermediaries (such as proxies caching a representation)
can assume the role of a server, but are not the source for representations as
these are acquired from the origin server.
REST Terminologies
• Proactive Content Negotiation: A content negotiation mechanism where the server selects
a representation based on the expressed preference of the client.
• Reactive Content Negotiation: A content negotiation mechanism where the client selects a
representation from a list of available representations. The list may, for example, be
included by a server in an initial response. If the user agent is not satisfied by the initial
response representation, it can request one or more of the alternative representations,
selected based on metadata (e.g., available media types) included in the response.
• Representation: A serialization that represents the current or intended state of a resource
and that can be transferred between clients and servers. REST requires representations to
be self-describing, meaning that there must be metadata that allows peers to understand
which representation format is used. Depending on the protocol needs and capabilities,
there can be additional metadata that is transmitted along with the representation.
• Representation Format: A set of rules for serializing resource state. On the Web, the most
prevalent representation format is HTML. Other common formats include plain text and
formats based on JSON [RFC7159], XML, or RDF. Within IoT systems, often compact
formats based on JSON, CBOR [RFC7049], and EXI [W3C.REC-exi-20110310] are used.
REST Terminologies
• Resource: An item of interest identified by a URI. Anything that can be
named can be a resource. A resource often encapsulates a piece of state
in a system. Typical resources in an IoT system can be, e.g., a sensor, the
current value of a sensor, the location of a device, or the current state of
an actuator.
• Resource State: A model of a resource’s possible states that is
represented in a supported representation type, typically a media type.
Resources can change state because of REST interactions with them, or
they can change state for reasons outside of the REST model.
• Resource Type: An identifier that annotates the application-semantics of
a resource
REST Terminologies
• Reverse Proxy: An intermediary that appears as a server towards the
client but satisfies the requests by forwarding them to the actual server
(possibly via one or more other intermediaries). A reverse proxy is often
used to encapsulate legacy services, to improve server performance
through caching, and to enable load balancing across multiple machines.
• Safe Method: A method that does not result in any state change on the
origin server when applied to a resource.
• Server: A node that listens for requests, performs the requested
operation and sends responses back to the clients.
• Uniform Resource Identifier (URI): A global identifier for resources
Architecture
Architecture
URI
NOTE:
• The Network Layer provides logical communication between hosts.
• The Transport Layer provides logical communication between processes.
Transport Layer Protocols
Two Transport Protocols are available for Applications to use on the Internet:
1. UDP
2. TCP
TCP includes:
• Connection set-up (3-way handshake)
• Flow Control
• Congestion Control
UDP is:
• A “no frills,” “bare bones” Internet Transport protocol
• Provides “best effort” service
UDP segments may be:
lost
delivered out of order to application
• Connectionless
UDP:
has no handshaking between UDP sender, receiver
each UDP segment handled independently of others
UDP (User Datagram Protocol) (cont’d)
Uses of UDP:
TCP characteristics:
• point-to-point connections
one sender, one receiver
• full duplex data:
bi-directional data flow in same connection
• reliable, in-order byte steam transmission
with no “message boundaries” between bytes
• pipelined transmission
multiple segments are sent at the same time
Maximum segments sent simultaneously = TCP congestion/flow
control window size
send & receive buffers at sender and receiver
• connection-oriented:
handshaking occurs between the sender, receiver before data
exchange
• Uses flow control:
The sender will not overwhelm receiver’s buffer
TCP (Transmission Control Protocol) (cont’d)
Conceptual View
TCP creates reliable data service on top of IP’s (Layer 3’s) unreliable delivery service.
Important: When an Application sends a message down the protocol stack, it selects
whether TCP or UDP should be used for the transmission:
IoT Communication Models
•Request –Response
•Publish-Subscribe
•Push-Pull
•Exclusive Pair
Request Response
Communication Model
SERVER
Receives Req
from
CLIENT
Client,processes
Sends Req,looksup/ RESOURCES
Request to Fetches
Server resources,
Prepares
response and
sends response
to client
Publish-Subscribe Communication Model
Push-Pull Communication Model
Exclusive Pair Communication Model
IoT Communication API’s
50
WPAN Technologies for IoT/M2M
• Zigbee/IEEE 802.15.4
• Bluetooth and its Low-Energy Profile
• NFC
• RFID
51
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• The commercialization of consumer-based IoT services requires the introduction of
wireless, low-power, battery-powered sensors and actuators in people’s premises.
• ZigBee’s focus aimed at the “little devices” (things, objects) like light switches,
thermostats, electricity meters, remote controls (RCs), as well as more complex
sensor devices found in the healthcare, commercial building, and industrial
automation sectors.
• To avoid multiple separate consumer networks, a PHY/MAC-agnostic solution is
needed upon which IP standards and other well-known higher-layer protocols can
run with little changes.
• ZigBee is one such open standard, as discussed below. ZigBee IP (ZIP) is an example
where Zigbee systems operate in an IP context.
• Here we focus more on the wireless lower-layer aspects of Zigbee and not the IP part.
52
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• ZigBee utilizes the globally available, license-free 2.4 GHz industrial,
scientific, and medical (ISM) frequency band to provide low data rate
wireless applications
• IEEE 802.15.4, wireless links can operate in three unlicensed
frequency bands, namely the 858 MHz band, the 902-to-928 MHz
band, and the 2.4 GHz band
• IEEE 802.15.4 defines a robust radio PHY (physical) layer and MAC
(medium access control) layer, while ZigBee defines the network,
security, and application framework for an IEEE 802.15.4-based
system.
53
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• ZigBee networks support star, mesh, and cluster-tree topologies.
• These capabilities enable a network to have over 65,000 devices on a single
wireless network.
• ZigBee offers low-latency communication between devices without the
need for the initial network synchronization delays as required by
Bluetooth.
• ZigBee can create robust self-forming, self-healing wireless mesh networks.
The ZigBee mesh network connects sensors and controllers without being
restricted by distance or range limitations;
• ZigBee mesh networks allow all participating devices to communicate with
one another and act as repeaters transferring data between devices.
54
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• ZigBee is available as two feature sets,
• ZigBee PRO and ZigBee.
• Both feature sets define how the ZigBee mesh networks operate.
• ZigBee PRO, the most widely used and optimized for low-power
consumption and to support large networks with thousands of devices.
• The ZigBee Alliance announced an expanded set of features for the ZigBee
protocol.
• This new stack profile is universally referred to as ZigBee PRO and for the most
part defines specific stack settings and makes mandatory many of the features.
• ZigBee PRO also used in some new application like automatic meter
reading, commercial building automation, and home automation.
55
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• ZigBee PRO features implement support for larger networks,
• for example stochastic addressing to assign addresses using probability analysis to
simplify network formation.
• ZigBee PRO implements a technique known as frequency agility (not hopping):
• a network node is able to scan for clear spectrum (with a choice of 16 available
channels) and communicate its findings back to the ZigBee coordinator so that a new
channel can be used across the network.
• ZigBee PRO networks have the ability to aggregate routes through the use of
“many-to-one” routing;
• this allows each device to share the same routing path reducing broadcast and
network traffic and greatly improves the efficiency and stability of the network routing
table.
56
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• The ZigBee 802.15.4 spec defines a maximum packet size of 128
octets;
• this packet size is optimal for short control messages, but there may be
instances where the network needs to send larger messages;
• therefore, ZigBee PRO now has the means to automatically fragment and reassemble a message at a
receiving node relieving the host application of this overhead.
57
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• LR-WPANs (Low-Rate Wireless Personal Area Networks) applications require a
low-cost, small-size, highly reliable technology which offers long battery life,
measured in months or even years, and automatic or semiautomatic
installation.
• ZigBee is a low-power wireless specification that introduces mesh networking
to the low-power wireless space and is targeted toward applications such as
smart meters, home automation, and RC units. ZigBee technology provides
reasonably efficient low-power connectivity and ability to connect a large
number of devices into a single network.
• Some studies have shown that for the home, two wireless PHY layer
communications technologies that best meet the overall
• performance and cost requirements are Wi-Fi (802.11/n) and ZigBee (802.15.4).
58
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• Disadvantages:
• ZigBee’s relative complexity (as seen in the protocol stack) and the
apparent fact that the power consumption of ZigBee devices is higher
than the consumption of some alternatives (e.g., BLE) tend to make
ZigBee not always the most ideal solution for unmaintained devices
that need to operate for extensive periods of time from a limited
power source;
• hence, while many home applications make ideal use of ZigBee, other
IoT/M2M applications can also be supported by other approaches.
59
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• ZigBee makes use of the physical radio specified by IEEE 802.15.4; it
adds logical network capabilities, and security and application
software.
60
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• The PHY layer of the reference model specifies the network interface
components, parameters, and operation.
• The PHY layer includes a variety of features, such as
• receiver energy detection (RED),
• link quality indicator (LQI),
• clear channel assessment (CCA).
• The PHY layer is also including low-duty cycle operations, strict power
management, and low transmission overhead.
• IEEE 802.15.4 defines several addressing modes:
• it allows the use of either IEEE 64-bit extended addresses or 16-bit addresses
unique within the PAN.
61
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• MAC layer handles network association and disassociation.
• It also regulates access to the medium; this is achieved through two
modes of operation:
• beaconing
• nonbeaconing.
• The beaconing mode is specified for environments where control and data forwarding is achieved
by an always active device.
• The nonbeaconing mode specifies the use of unslotted, non persistent CSMA-based MAC protocol.
62
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• The network layer provides the functionality required to support
network routing capabilities, configuration and device discovery,
association and disassociation, topology management, MAC layer
management, and routing and security management.
• Three network topologies, namely star, mesh, and cluster tree, are
supported.
63
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• The security layer leverages the basic security services specified by
the IEEE 802.15.4 security model to provide support for infrastructure
security and application data security.
64
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• The application layer consists of the application support sublayer
(APS), the ZigBee device object (ZDO), and the manufacturer-defined
application objects.
• The responsibilities of the APS sublayer include maintaining tables for binding
devices together, based on their services and their needs, and forwarding
messages between bound devices.
65
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• ZigBee is not a frequency-hopping technology; therefore, it requires careful planning
during deployment in order to ensure that there are no interfering signals in the vicinity.
• The design of the PHY layer is driven by the need for low-cost, power-effective PHY layer
for cost-sensitive, low data rate monitoring and control applications.
• Under IEEE 802.15.4, wireless links can operate in three unlicensed frequency bands,
namely in the 858 MHz band, in the 902-to-928 MHz band, and in the 2.4 GHz band.
• Based on these frequency bands, the IEEE 802.15.4 standard defines three physical
media:
• Direct sequence spread spectrum (DSSS) using binary phase shift keying (BPSK), operating in the
868 MHz at a data rate of 20 Kbps;
• DSSS using BPSK, operating in the 915 MHz at a data rate of 40 Kbps
• DSSS using offset quadrature phase shift keying (O-QPSK), operating in the 2.4 GHz at a data rate
of 140 Kbps.
66
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• In order to accommodate the MAC protocol, the IEEE 802.15.4 standard
distinguishes devices based on their hardware complexity and
capability.
• The standard defines two classes of physical devices, namely:
• a full function device (FFD)
• a reduced function device (RFD).
• These device types differ in their use and how much of the standard they implement.
69
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• Based on these logical device types, a ZigBee WPAN can be organized
into one of three possible topologies, namely a star, a mesh (peer-to-
peer), or a cluster tree.
70
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• The star network topology supports a single coordinator, with up to
65,536 devices. In this topology configuration, one of the FFD-type
devices assumes the role of network coordinator. All other devices act
as end devices. The selected coordinator is responsible for initiating and
maintaining the end devices on the network. Upon initiation, the end
devices can only communicate with the coordinator.
• The mesh configuration allows path formation from any source device
to any destination device, using tree- and table-driven routing
algorithms.
• Cluster-tree networks enable a peer–peer network to be formed with a
minimum of routing overhead, using multihop routing.
71
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• The ZDO (ZigBee device object) represents a predefined base class of
functionality upon which all applications are written.
• The ZDO creates an abstraction so that the developer can focus on
writing application-specific code rather than dealing with the low-
level details.
• The ZDO provides an interface between the application objects, the
profile (e.g., the ZigBee Health Care), and the APS.
• The ZDO is responsible for initializing the APS, the network layer, and
the security service provider.
72
WPAN Technologies for IoT/M2M
Zigbee/IEEE 802.15.4
• ZigBee is designed for low-to-very-low-duty cycle static and dynamic
environments with many active nodes;
• Bluetooth, is designed for high QoS, variety of duty cycles, and
moderate data rates in networks with limited active nodes.
73
Bluetooth
WPAN Technologies for IoT/M2M
Bluetooth and its Low-Energy Profile- Overview
75
WPAN Technologies for IoT/M2M
Bluetooth and its Low-Energy Profile- Overview
• Bluetooth is a short-range data exchange communication protocol
widely used in cellular phones, smartphones, tablets, and PDAs (has a
range of about 10 m, or a maximum of 100 m with power boost).
• Bluetooth is designed for a small variety of tasks, such as
synchronization, voice headsets, cell-modem calls, and mouse and
keyboard input.
• The Bluetooth specification defines a low-power, low-cost technology
that provides a standardized platform for eliminating cables between
mobile devices and facilitating connections between products.
76
WPAN Technologies for IoT/M2M
Bluetooth and its Low-Energy Profile- Overview
• Bluetooth operates in the 2.4-GHz ISM band and has a bandwidth of
approximately 1–3 Mbps.
• While the cost of Bluetooth equipment is significantly lower than the
cost of WLAN, the transmission range of 10 m or less and the data
transfer rate 12 Mbps or less (in Version 2.0 of the standard) are often
considered a drawback.
77
WPAN Technologies for IoT/M2M
Bluetooth and its Low-Energy Profile- Overview
78
WPAN Technologies for IoT/M2M
Bluetooth and its Low-Energy Profile- Overview
• The sublayers of IEEE 802.15 are as follows:
• (i) RF layer;
• (ii) baseband layer;
• (iii) the link manager (an MAC-level protocol);
• (iv) the logical link control and adaptation protocol (L2CAP) (also an MAC-level
protocol).
79
WPAN Technologies for IoT/M2M
Bluetooth and its Low-Energy Profile- Overview
• RF layer: The air interface is based on antenna power range starting from 0 dBm up
to 20 dBm, 2.4 GHz band, and the link range from 0.1 to 10 m.
• Baseband layer: The baseband layer establishes the Bluetooth piconet. The piconet is
formed when two Bluetooth devices connect. In a piconet, one device acts as the
master and the other devices act as slaves.
• Link manager: The link manager establishes the link between Bluetooth devices.
Additional functions include security, negotiation of Baseband packet sizes, power
mode and duty cycle control of the Bluetooth device, and the connection states of a
Bluetooth device in a piconet.
• L2CAP: This sublayer provides the upper-layer protocols with connectionless and
connection-oriented services. The services provided by this layer include protocol
multiplexing capability, segmentation and reassembly of packets, and group
abstractions.
80
WPAN Technologies for IoT/M2M
Bluetooth and its Low-Energy Profile- Overview
• BLE is an alternative to the “power management” features as part of
the standard Bluetooth protocols.
• BLE is aimed at very low-power applications running off a coin cell:
• it is capable of reporting data from a sensor for up to a year from a small
button battery without recharging.
• data rate and radio range are lower,
• the low-power and long battery life make it suitable for short-range
monitoring applications in medicine.
• BLE sensor devices are typically required to operate for many years without
needing a new battery;
81
WPAN Technologies for IoT/M2M
Bluetooth and its Low-Energy Profile- Overview
• Current chip designs allow for two types of implementation—
• dual mode and single mode.
• In a single-mode implementation, the BLE protocol stack is implemented solely.
• In a dual-mode implementation, BLE functionality is integrated into an existing Classic Bluetooth
controller.
• Most new Bluetooth chipsets from leading Bluetooth silicon manufacturers
are expected to support Bluetooth and the new BLE functionality
82
WPAN Technologies for IoT/M2M
Bluetooth and its Low-Energy Profile- Overview
83
WPAN Technologies for IoT/M2M
Bluetooth and its Low-Energy Profile- Details
• Bluetooth radios use a spread spectrum, frequency-hopping, full-
duplex signal.
• While point-to-point connections are supported, the specification
allows up to seven simultaneous connections to be established and
maintained by a single radio.
• AFH (adaptive frequency hopping) available with newer versions
allows for better graceful coexistence with IEEE 802.11 WLAN
systems.
• The signal hops among 79 frequencies at 1 MHz intervals to give an
acceptable degree of interference immunity between multiple Bluetooth
devices and between a Bluetooth device and a WLAN device
84
WPAN Technologies for IoT/M2M
Bluetooth and its Low-Energy Profile- Details
• A Bluetooth device playing the role of “master” can communicate with
up to seven devices playing the role of “slave” (these groups of up to
eight devices are called piconets).
• At any given instant in time, data can be transferred between the
master and one slave; but the master switches rapidly from slave to
slave in a round-robin fashion. (Simultaneous transmission from the
master to multiple slaves is possible, but not used much in practice.)
• The Bluetooth specification also allows connecting two or more piconets
together to form a scatternet, with some devices acting as a bridge by
simultaneously playing the master role in one piconet and the slave role
in another piconet.
85