IoT Unit1
IoT Unit1
Lecture 1
Characteristics:
1. Dynamic and Self-Adapting: IoT devices and systems may have the
capability to dynamically adapt with the changing contexts and take actions
based on their operating conditions, user’s context, or sensed environment. For
example, consider a surveillance system comprising of a number of surveillance
cameras. The surveillance cameras can adapt their modes (to normal or infra-
red night modes) based on whether it is day or night, Cameras could switch
1
Unit 1 CSE VII Sem Internet of Things
Figure 1: The full spectrum of various levels of IoT architecture from the sensor to
cloud and back.
from lower resolution to higher resolution modes when ?any motion is detected
and alert nearby cameras to do the same. In this example, the surveillance
system is adapting itself based on the context and changing (e.g., dynamic)
conditions:
2
Unit 1 CSE VII Sem Internet of Things
4. Unique Identity: Each IoT device has a unique identity and a unique iden-
tifier (such as an IP address or a URI). IoT systems may have intelligent
interfaces which adapt based on the context, allow communicating with users
and the environmental contexts. IoT device interface, allow users to query the
devices, monitor their status, and control them remotely, in association with
the control, configuration and management infrastructure.
3
Unit 1 CSE VII Sem Internet of Things
nicate and exchange data. Integration into the information network helps in
making IoT systems ?smarter? due to the collective intelligence of collabora-
tion with the infrastructure. Thus, the data from a large number of connected
weather monitoring IoT nodes can be aggregated and analyzed to predict the
weather.
The IoT will touch nearly every segment in industrial, enterprise, health, and
consumer products.The impact from IoT or any technology comes in the form of:
4
Unit 1 CSE VII Sem Internet of Things
Lecture 2
Things in loT
The “Things” in IoT usually refers to IoT devices which have unique identities and
can perform remote sensing, actuating and monitoring capabilities. IoT devices can
exchange data with other connected devices and applications (directly or indirectly),
or collect data from other devices and process the data either locally or send the data
to centralized servers or cloud-based application back-ends for processing the data,
or perform some tasks locally and other tasks within the IoT infrastructure, based on
temporal and space constraints (i. memory, processing capabilities, communication
latencies and speeds, and deadlines).
An IoT device may consist of several interfaces for connections to other devices,
both wired and wireless. These include (i)I/O interfaces for sensors, (ii) interfaces
for internet connectivity (iii) memory and storage interface and (iv) audio/video
interfaces. An IoT device can collect various types of data from the on-board or
attached sensors, such as temperature, humidity, light intensity. The sensed data
can be communicated either to other devices or cloud-based servers/storage. IoT
devices can be connected to actuators that allow them to interact with other physical
entities (including non-IoT devices and systems) in the vicinity of the device. For
example, a relay switch connected to an IoT device can turn an appliance on/off
based on the commands sent to the IoT device over the Internet.
IoT devices can also be of varied types, for instance, wearable sensors, smart
watches, LED lights, automobiles and industrial machines. Almost all IoT devices
generate data in some form or the other which when processed by data analytics
systems leads to useful information to guide further actions locally or remotely. For
5
Unit 1 CSE VII Sem Internet of Things
IoT Protocols
Link Layer
Link layer protocols determine how the data is physically sent over the network’s
physical layer or medium (e.g., copper wire, coaxial cable, or a radio wave). The
scope of the link layer is the local network connection to which host is attached.
Hosts on the same link exchange data packets over the link layer using link layer
protocols. Link layer determines how the packets are coded and signaled by the
hardware device over the medium to which the host is attached (such as a coaxial
cable). Let us now look at some link layer protocols which are relevant in the context
of IoT.
6
Unit 1 CSE VII Sem Internet of Things
1OBASE-F Ethernet over fiber optic connections, 802.3ae is the standard for
10 Gbit/s Ethernet over fiber, and so on. These standards provide data rates
from 10 Mb/s to 40 Gb/s and higher. The shared medium in Ethernet can
be a coaxial cable, twisted-pair wire or an optical fiber. The shared medium
(i.e., broadcast medium) carries the communication for all the devices on the
network, thus data sent by one device can received by all devices subject to
propagation conditions and transceiver capabilities.
7
Unit 1 CSE VII Sem Internet of Things
GSM and CDMA), third generation (3G - including UMTS and CDMA2000)
and fourth generation (4G - including LTE). IoT devices based on these stan-
dards can communicate over cellular networks. Data rates for these standards
range from 9.6 Kb/s (for 2G) to upto 100 Mb/s (for 4G) and are available
from the 3GPP websites.
IoT Protocols
Network/Internet Layer
The network layers are responsible for sending of IP datagrams from the source
network to the destination network. This layer performs the host addressing and
packet routing. The datagrams contain the source and destination addresses which
8
Unit 1 CSE VII Sem Internet of Things
are used to route them from the source to destination across multiple networks.
Host identification is done using hierarchical such as IPv4 or IPv6.
• IPv4 : Internet Protocol version 4 (IPv4) is the most deployed Internet pro-
tocol that is used to identify the devices on a network using a hierarchical
addressing scheme. IPv4 uses a 32-bit address scheme that allows total of
232? or 4,294,967,296 addresses. As more and more devices got connected
to the Internet, these addresses got exhausted in the year 2011. IPv4 has
been succeeded by IPv6. The IP protocols establish connections on packet
networks, but do not guarantee delivery of packets. Guaranteed delivery and
data integrity are handled by the upper layer protocols (such as TCP).
• 6LoOWPAN : 6LoWPAN (IPv6 over Low power Wireless Personal Area Net-
works) brings IP protocol to the low-power devices which have limited pro-
cessing capability. 6LoWPAN operates in the 2.4 GHz frequency range and
provides data transfer rates of 250 Kb/s. 6LoWPAN works with the 802.15.4
link layer protocol and defines compression mechanisms for IPv6 datagrams
over IEEE 802.15.4-based networks.
9
Unit 1 CSE VII Sem Internet of Things
Lecture 3
Transport Layer
The transport layer protocols provide end-to-end message transfer capability in-
dependent of the underlying network. The message transfer capability can be
set up on connections, either using handshakes (as in TCP) or without hand-
shakes/acknowledgements (as in UDP). The transport layer provides functions such
as error control, segmentation, flow control and congestion control.
TCP
Transmission Control Protocol (TCP) is the most widely used transport layer proto-
col, that is used by web browsers (along with HTTP, HTTPS application layer pro-
tocols), email programs (SMTP application layer protocol) and file transfer (FTP).
TCP is a connection oriented and stateful protocol. While IP protocol deals with
sending packets, TCP ensures reliable transmission of packets in-order. TCP also
provides error detection capability so that duplicate packets can be discarded and
lost packets are retransmitted. The flow control capability of TCP ensures that
rate at which the sender sends the data is not too high for the receiver to process.
The congestion control capability of TCP helps in avoiding network congestion and
congestion collapse which can lead to degradation of network performance.
UDP
Unlike TCP, which requires carrying out an initial setup procedure, UDP is a con-
nectionless protocol. UDP is a transaction oriented and stateless protocol. UDP
does not provide guaranteed delivery, ordering of messages and duplicate elimina-
tion. Higher levels of protocols can ensure reliable delivery or ensuring connections
created are reliable.
10
Unit 1 CSE VII Sem Internet of Things
Application Layer
Application layer protocols define how the applications interface with the lower layer
protocols to send the data over the network. The application data, typically in files,
is encoded by the application layer protocol and encapsulated in the transport layer
protocol which provides connection or transaction oriented communication over the
network. Port numbers are used for application addressing (for example port 80 for
HTTP, port 22 for SSH, etc.). Application layer protocols enable process-to-process
connections using ports.
11
Unit 1 CSE VII Sem Internet of Things
12
Unit 1 CSE VII Sem Internet of Things
to the server (also called MQTT Broker) and publishes messages to topics
on the server. The broker forwards the messages to the clients subscribed to
topics. MQTT is well suited for constrained environments where the devices
have limited processing and memory resources and the network bandwidth is
low. MQTT specifications are available on IBM developerWorks.
13
Unit 1 CSE VII Sem Internet of Things
14
Unit 1 CSE VII Sem Internet of Things
Lecture 4
An IoT system comprises of a number of functional blocks that provide the system
the capabilities for identification, sensing, actuation, communication, and manage-
ment. These functional blocks are described as follows:
• Services: An IoT system uses various types of IoT services such as services
for device monitoring, device control services, data publishing services and
services for device discovery.
• Security: Security functional block secures the IoT system and by providing
functions such as authentication, authorization, message and content integrity,
and data security.
15
Unit 1 CSE VII Sem Internet of Things
• Application: IoT applications provide an interface that the users can use to
control and monitor various aspects of the IoT system. Applications also allow
users to view the system status and view or analyze the processed data.
16
Unit 1 CSE VII Sem Internet of Things
Publishers send the data to the topics which are managed by the broker. Pub-
lishers are not aware of the consumers. Consumers subscribe to the topics
which are managed by the broker, When the broker receives data for a topic
from the publisher, it sends the data to all the subscribed consumers.
17
Unit 1 CSE VII Sem Internet of Things
18
Unit 1 CSE VII Sem Internet of Things
Lecture 5
• Stateless: Each request from client to server must contain all the information
necessary to understand the request, and cannot take advantage of any stored
context on the server. The session state is kept entirely on the client.
19
Unit 1 CSE VII Sem Internet of Things
• Code on demand: Servers can provide executable code or scripts for clients
to execute in their context. This constraint is the only one that is optional.
A RESTful web service is a ”web API” implemented using HTTP and REST
principles. RESTful web service is a collection of resources which are represented
by URIs, RESTful web API has a base URI (c.g. http://example.com/api/tasks/).
The clients send requests to these URIs using the methods defined by the HTTP
protocol (e.g., GET, PUT, POST, or DELETE). A RESTful web service can support
various Internet media types (JSON being the most popular media type for RESTful
web services). IP for Smart Objects Alliance (IPSO Alliance) has published an
Application Framework that defines a RESTful design for use in IP smart object
systems.
20
Unit 1 CSE VII Sem Internet of Things
21
Unit 1 CSE VII Sem Internet of Things
setup and termination requests for each message. WebSocket is suitable for loT
applications that have low latency or high throughput requirements.
22
Unit 1 CSE VII Sem Internet of Things
Lecture 6
• Weather monitoring systems use WSNs in which the nodes collect temperature,
humidity and other data, which is aggregated and analyzed.
• Indoor air quality monitoring systems use WSNs to collect data on the indoor
air quality and concentration of various gases.
• Soil moisture monitoring systems use WSNs to monitor soil moisture at various
locations.
23
Unit 1 CSE VII Sem Internet of Things
• Surveillance systems use WSNs for collecting surveillance data (such as motion
detection data)
• Smart grids use WSNs for monitoring the grid at various points.
• Structural health monitoring systems use WSNs to monitor the health of struc-
tures (buildings, bridges) by collecting vibration data from sensor nodes de-
ployed at various points in the structure.
24
Unit 1 CSE VII Sem Internet of Things
network robust. In the event of failure of some nodes or addition of new nodes to
the network, the network can reconfigure itself.
Embedded Systems
An Embedded System is a computer system that has computer hardware and soft-
ware embedded to perform specific tasks. In contrast to general purpose computers
or personal computers (PCs) which can perform various types of tasks, embedded
systems are designed to perform a specific set of tasks, Key components of an em-
bedded system include, microprocessor or microcontroller, memory (RAM, ROM,
cache), networking units (Ethernet, WiFi adapters), input/output units (display,
keyboard, etc.) and storage (such as flash memory). Some embedded systems have
specialized processors such as digital signal processors (DSPs), graphics processors
and application specific processors. Embedded systems run embedded operating sys-
tems such as real-time operating systems (RTOS). Embedded systems range from
low-cost miniaturized devices such as digital watches to devices such as digital cam-
eras, point of sale terminals, vending machines, appliances (such as washing ma-
chines), etc. In the next chapter we describe how such devices form an integral part
of IoT systems.
Communication Protocols
Communication protocols form the backbone of IoT systems and enable network
connectivity and coupling to applications. Communication protocols allow devices
to exchange data over the network. In previous section, you learned about various
link, network, transport and application layer protocols. These protocols define the
data exchange formats, data encoding, addressing schemes for devices and routing of
packets from source to destination. Other functions of the protocols include sequence
control (that helps in ordering packets determining lost packets), flow control (that
25
Unit 1 CSE VII Sem Internet of Things
helps in controlling the rate at which the sender is sending the data so that the
receiver or the network is not overwhelmed) and retransmission of lost packets.
Cloud Computing
26
Unit 1 CSE VII Sem Internet of Things
Big data is defined as collections of data sets whose volume, velocity (in terms of its
temporal variation), or variety, is so large that it is difficult to store, manage, process
and analyze the data using traditional databases and data processing tools. Big
data analytics involves several steps starting from data cleansing, data munging (or
wrangling), data processing and visualization. Some examples of big data generated
by IoT systems are described as follows:
27
Unit 1 CSE VII Sem Internet of Things
• Machine sensor data collected from sensors embedded in industrial and energy
systems for monitoring their health and detecting failures.
• Health and fitness data generated by IoT devices such as wearable fitness
bands.
• Variety: Variety refers to the forms of the data. Big data comes such as
structured or unstructured data. including text data. image. audio. video
and sensor data.
28
Unit 1 CSE VII Sem Internet of Things
Lecture 7
In this section we define various levels of IoT systems with increasing completely.
An IoT m comprises of the following component:
• Device:A smart connected thing or smart device is defined as one which has
communication capabilities, compute power, and can make decisions at a local
level in a limited context. An IoT device allows identification, remote sensing,
actuating and remote monitoring capabilities. Moreover, power resources are
also very important, as they can provide operational autonomy to the Devices.
29
Unit 1 CSE VII Sem Internet of Things
Resources can process data, for instance they can take sensor information as
input and produce aggregated or more high-level information as output. Also,
Network Resources can be storage Resources, which typically do not suffer
from the limitations of their on-device counterparts. Storage Resources can
store information produces by Resources and they can thus provide informa-
tion about Physical Entities. This may include location and state-tracking
information (history), static data (like product-type information), and many
other properties.
• Database: Database can be either local or in the cloud and stores the data
generated by the IoT device. Historically data collection from devices, data
management, and analysis were sequential steps. Today in the world of IoT,
increased volume of data and greater compute capabilities gives us opportuni-
ties to quickly impact device level or microoperational level business process
decision making, thereby breaking the linearity from data to analysis. Right
after the creation of data from devices or other intermediate processes, we
do two things simultaneously distribute the message to appropriate contain-
ers of the IoT ecosystem, and perform complex event processing for real-time
analysis to get quick insights leading to quick decision influences.
• Web Service: Web services serve as a link between the IoT device, appli-
cation, database and analysis components. Web service can be either imple-
mented using HTTP and REST principles (REST service) or using WebSocket
protocol (WebSocket service), A comparison of REST and WebSocket is pro-
30
Unit 1 CSE VII Sem Internet of Things
vided below:
– Header Overhead: REST services operate over HTTP, and each re-
quest is independent of others. Thus each request carries HTTP headers
which is an overhead. Due the overhead of HTTP headers, REST is not
suitable for real-time applications. WebSocket on the other hand does
not involve overhead of headers. After the initial handshake (that hap-
pens over HTTP), the client and server exchange messages with minimal
31
Unit 1 CSE VII Sem Internet of Things
• Application: IoT applications provide an interface that the users can use to
control and monitor various aspects of the IoT system. Applications also allow
users to view the system status and view the processed data.
32
Unit 1 CSE VII Sem Internet of Things
Lecture 8
IoT Level-1
A level-1 IoT system has a single node/device that performs sensing and/or actu-
ation, stores data, performs analysis and hosts the application as shown in Figure
1.14, Level-I IoT systems are suitable for modeling low-cost and low-complexity so-
lutions where the data involved is not big and the analysis requirements are not
computationally intensive.
Let us now consider an example of a level-1 IoT system for home automation.
The system consists of a single node that allows controlling the lights and appliances
in a home remotely. The device used in this system interfaces with the lights and
appliances using electronic relay switches. The status information of each light or
appliance is maintained in a local database. REST services deployed locally allow
retrieving and updating the state of each light or appliance in the status database.
The controller service continuously monitors the state of each light or appliance (by
retrieving state from the database) and triggers the relay switches accordingly. The
application which is deployed locally has a user interface for controlling the lights
or appliances. Since the device is connected to the Internet, the application can be
accessed remotely as well.
IoT Level-2
A level-2 IoT system has a single node that performs sensing and/or actuation and
local analysis as shown in Figure 1.15. Data is stored in the cloud and application is
usually cloud-based. Level-2 IoT systems are suitable for solutions where the data
33
Unit 1 CSE VII Sem Internet of Things
34
Unit 1 CSE VII Sem Internet of Things
levels over a period of time, which can help in making decisions about irrigation
schedules.
IoT Level-3
A level-3 IoT system has a single node. Data is stored and analyzed in the cloud
and application is cloud-based as shown in Figure 1.16. Level-3 IoT systems are
35
Unit 1 CSE VII Sem Internet of Things
suitable for solutions where the data involved is big and the analysis requirements
are computationally intensive.
Let us consider an example of a level-2 IoT system for tracking package handling.
The system consists of a single node (for a package) that monitors the vibration
levels for a package being shipped. The device in this system uses accelerometer
and gyroscope sensors for monitoring vibration levels. The controller service sends
the sensor data to the cloud in real-time using a WebSocket service. The data is
stored in the cloud and also visualized using a cloud-based application. The analysis
36
Unit 1 CSE VII Sem Internet of Things
components in the cloud can trigger alerts if the vibration levels become greater than
a threshold. The benefit of using WebSocket service instead of REST service in this
example is that, the sensor data can be sent in real time to the cloud. Moreover,
cloud based applications can subscribe to the sensor data feeds for viewing the real-
time data.
IoT Level-4
A level-4 IoT system has multiple nodes that perform local analysis. Data i cloud
and application is cloud-based as shown in Figure 1.17. Level-4 contains local and
cloud-based observer nodes which can subscribe to and receive information collected
in the cloud from IoT devices. Observer nodes can process information and use it for
various applications, however, observer nodes do not perform any control functions.
Level-4 IoT systems are suitable for solutions where multiple nodes are required, the
data involved is big and the analysis requirements are computationally intensive.
Let us consider an example of a level-4 IoT system for noise monitoring, The
system consists of multiple nodes placed in different locations for monitoring noise
levels in an area, The nodes in this example are equipped with sound sensors. Nodes
are independent of each other, Each node runs its own controller service that sends
the data to the cloud. The data is stored in a cloud database. The analysis of data
collected from a number of nodes is done in the cloud. A cloud-based application is
used for visualizing the aggregated data.
IoT Level-5
A level-5 IoT system has multiple end nodes and one coordinator node as shown in
Figure 1.18. The end nodes that perform sensing and/or actuation. Coordinator
node collects data from the end nodes and sends to the cloud. Data is stored
and analyzed in the cloud and application is cloud-based. Level-5 IoT systems are
37
Unit 1 CSE VII Sem Internet of Things
suitable for solutions based on wireless sensor networks, in which the data involved
is big and the analysis requirements are computationally intensive.
Let us consider an example of a level-5 IoT system for forest fire detection.
The system consists of multiple nodes placed in different locations for monitoring
temperature, humidity and carbon dioxide (CO2) levels in a forest. The end nodes
in this example are equipped with various sensors (such as temperature, humidity
and CO2). The coordinator node collects the data from the end nodes and acts
as a gateway that provides Internet connectivity to the loT system. The controller
service on the coordinator device sends the collected data to the cloud. The data
is stored in a cloud database. The analysis of data is done in the computing cloud
to aggregate the data and make predictions. A cloud-based application is used for
visualizing the data.
38
Unit 1 CSE VII Sem Internet of Things
IoT Level-6
A level-6 IoT system has multiple independent end nodes that perform sensing
and/or actuation and send data to the cloud. Data is stored in the cloud and
application is cloud-based shown in Figure 1.19. The analytics component analyzes
the data and stores the results in the cloud database. The results are visualized
with the cloud-based application. The centralized controller is aware of the status
of all the end nodes and sends control commands to the nodes.
Let us consider an example of a level-6 IoT system for weather monitoring.
The system consists of multiple nodes placed in different locations for monitoring
temperature, humidity and pressure in an area. The end nodes are equipped with
39
Unit 1 CSE VII Sem Internet of Things
various sensors (such as temperature, pressure and humidity). The end nodes send
the data to the cloud in real-time using a WebSocket service. The data is stored in
a cloud database. The analysis of data is done in the cloud to aggregate the data
and make predictions. A cloud-based application is used for visualizing the data.
40