Sei sulla pagina 1di 173

SRINIVAS INSTITUTE OF TECHNOLOGY, MANGALURU

DEPARTMENT OF ELECTRONICS & COMMUNICATION


ENGINEERING

IoT and Sensor Networks


(15EC752)

Preapared by,
P.RAKESH MALLYA
Assistant Professor
Department Of ECE
SIT, Valachil
i n gs – I oT
r ne t o f T h
In te
MODULE 1
Internet of Things- An Overview
Design Principles for connected devices and
Web Connectivity
Internet of Things – IoT
An Overview
IoT enables communication between
internetworking devices and applications,
whereby physical objects or ‘things’
communicate through the Internet.

Ex: Identity communication devices(RFID)


Things are tagged to these devices for their
identification and tracked, controlled and
monitored using remote computers through
the Internet.
IoT enables
- GPS based tracking
- controlling and monitoring of
devices
- machine to machine communication
- connected cars
- communication between wearable
and personal devices and Industry
Internet – global network of connected servers,
computers, tablets and mobiles that is governed
by standard protocols
• sending
• receiving or communication of information
• connectivity with remote servers, cloud
Thing - object – umbrella , streetlight
-action – such a thing was not expected
- reference to a situation – such things

were plenty in that regime

Combining both the terms…


IoT means a network of physical
things(objects) sending, receiving or
communicating information using the
Internet and network just as the computers,
tablets and mobiles do, and thus enabling
the monitoring, coordinating or controlling
process across the Internet or other data
network.
IoT is the network of physical objects or
‘things’ embedded with electronics,
software, sensors and connectivity to enable
it to achieve greater value and service by
exchanging data with the manufacturer,
operator and other connected devices.

Each thing is uniquely identifiable but is able


to interoperate within the existing Internet
infrastructure.
IoT Vision
Things become ‘smart’ and function like
living entities by sensing, computing and
communicating through embedded devices
which interact with remote objects(servers,
clouds, applications, services) or persons
through the Internet or NFC
Examples:
Smart and Hyper connected Devices
Hyper connectivity means ‘constant
connectivity between devices, network,
server and multiple systems’
•IoT conceptual framework

Physical Object + Controller, Sensor and


Actuators + Internet = IoT

•Actions and communication of data at


successive levels in IoT consisting of
internetworked devices and objects.

•IoT conceptual framework for the enterprise


processes and services

Gather+ Enrich +Stream +Manage +Acquire +


Organize and Analyze = IoT with connectivity to
data centre, enterprise or cloud server
IBM IoT conceptual framework using cloud
based services
Gather + Consolidate + Connect + Collect +
Assemble + Manage and Analyse = IoT with
connectivity to cloud services
Various conceptual frameworks of IoT find
number of applications such as in M2M
communication networks, wearable devices,
city lighting, security and surveillance and
home automation.

Smart systems use the user interfaces(UIs),


application programming interfaces(APIs),
identification data, sensor data and
communication ports.
IoT Architectural View
Technology behind IoT
• Hardware (Arduino, Raspberry Pi, Intel
Galileo, Intel Edison, ARM mBed, Bosch
XDK110, Beagle Bone Black and Wireless
SoC)
• Integrated Development Environment (IDE)
for developing device software, firmware
and APIs
• Protocols [RPL, CoAP, RESTful HTTP,
MQTT, XMPP]
An integrated development environment
(IDE) is a software application that provides
comprehensive facilities to computer
programmers for software development.

An IDE normally consists of at least a source


code editor, build automation tools, and a
debugger.
Firmware(software program on a hardware)
In computing firmware is a specific class of
computer software that provides the low-level
control for the device's specific hardware

A television remote control is an example of an


engineered product that contains firmware.

The firmware monitors the buttons, controls


the LEDs, and processes the button presses to
send the data in a format the receiving device,
in this case, a television set, can understand and
process.
API
It is the set of functions  that allows software
to interact with the operating system.

Ex : The Windows API


All the API functions that Windows makes
available are called "TheWindows API".
• Communication(Zigbee, Bluetooth, WiFi,
WiMax, 2G/3G/4G, RFID,
NFC,6LowPAN,UWB)
• Network backbone (IPv4, IPv6, UDP and
6LowPAN)
• Software (RIOT OS, Contiki OS, Thingsquare
Mist firmware, Eclipse IoT)
• Internetwork Cloud Platforms/Data Centre
(Sense, ThingWorx, Nimbits, Xively, openHAB,
AWS IoT, IBM BlueMix, CISCO IoT, Iox and Fog,
EvryThng, Azure, TCSCUP)
• Machine Learning Algorithms and software.
(ML software from Numenta Inc – GROK uses
machine intelligence to analyze the
streaming data from clouds and uncover
anomalies(unusual behavior in IT analytics),
has the ability to learn continuously from
data and ability to drive action from the
output of GROK’s data models and perform
high level of automation for analyzing
streaming data)
Five levels behind an IoT system
1.Device platform consisting of device hardware
and software using a microcontroller (or soC)
and software for the device APIs and web
applications
2.Connecting and networking – enabling things
and enabling internet connectivity to remote
servers
3.Server and web programming enabling web
applications and web services
4.Cloud platform enabling storage, computing
prototype and product development platforms
5.Online transactions processing, online
analytics processing, data analytics, predictive
analytics and knowledge discovery
Server end Technology
Servers are:
application servers
enterprise servers
cloud servers
data centres and databases
Servers offer the following software
components:
• Online platforms
•Devices identification, identity management
and their access management
•Data accruing, aggregation, integration,
organizing and analyzing
• Use of web applications, services and
business processes
Major components of IoT System
1.Physical Object with embedded software into a
hardware
2.Hardware consisting of a microcontroller,
firmware, sensors, control unit, actuators and
communication module
3.Communication module software consisting of
device APIs and device interface for
communication over the network and
communication circuit/ports and middleware for
creating communication stacks using 6LowPAN,
CoAP,LWM2M, IPv4, IPv6
4. Software for actions on messages,
information and commands which the devices
receive and then output to the actuators, for
glowing LEDs
Sensors and Control Units
Sensors – senses the physical environment
A smart sensor includes computing and
communication circuits
Measures – temperature, pressure, humidity,
light intensity, traffic proximity, acceleration,
signals in a GPS, proximity sensor, magnetic
field in a compass
Two types of sensor
Analog – gives analog inputs to the control
unit.
Ex: Thermistor, photoconductor etc…
Digital – gives digital inputs to the control
unit
Ex: touch sensor, proximity sensor, metal
sensor, traffic presence sensor etc…
Control Units
Most commonly used in IoT is MCU
(Microcontroller Unit)
Popular MCs are Atmega 328, ATMega 32u4,
ARM Cortex and ARM LPC
Various functional units in an MCU that are
embedded in an IoT device or a physical
object
Communication Module
Consists of protocol handlers, message
queue and message cache
Message queue – inserts the messages in the
queue and deletes the messages from the
queue in FIFO manner.
Message cache - stores the received
messages
REST(Representational State Transfer)
architecture is used for HTTP access by
GET,POST,PUT,DELETE methods for resources
and building web services.
Software
IoT software has two components
Software at the IoT device - hardware
Software at the IoT server
Software components for the IoT device
hardware and server
Middleware
OpenIoT - is an open source middleware
Enables communication with sensor clouds
‘sensing as a service’ – cloud based
IoTSyS - enables provisioning of
communication stack for smart devices using
IPv6, oBIX, 6LoWPAN, CoAP
oBIX – standard XML and web services
protocol (Open Building Information
Xchange)
Operating Systems(OS)
RIOT, Raspbian, Alljoyn, Spark, Contiki

RIOT supports – ARM7,Cortex-M0, Cortex-


M3, Cortex-M4, MSP430, standard x86 PCs

Raspbian – Raspberry Pi OS

Alljoyn – open source OS by Qualcomm


It is an OS with APIs available for Android, iOS,
OS X, Linux and Windows Oss
Spark - cloud based IoT OS and web based
IDE. It includes command line interface,
support for multiple languages and libraries
for working with several different IoT devices.

Contiki - open source multitasking OS.


It includes 6LoWPAN,RPL,UDP,DTLS and
TCP/IP protocols which are required in low-
power wireless IoT devices
Firmware
Thingsquare Mist – an open source firmware
for true Internet- connectivity to the IoT
It is a software program programmed on a
hardware device.
It provides the necessary instructions on how
the device communicates with the other
computer hardware
Simply, a software running on any IoT device.
Development Tools and open-source
Framework for IoT Implementation
Eclipse IoT – open sourse implementation of
standards such as MQTT, CoAP etc…
It provides a tool for working with IoT
programming language Lua

Arduino – development tool includes an IDE

Kinoma software platform


APIs and Device Interfacing Components
mBed API and device interfacing components
A development platform components for an
ARM cortex microcontroller using mBed
application
Consists of
-OS, Prototype development hardware and
software for IoT
-Mbed c/c++ software platform
-IDE – tools for creating microcontroller
firmware
-Core libraries, microcontroller peripheral
drivers, RTOS, runtime environment, build tools
and test and debug scripts
-Networking module
Platforms and Integration Tools
ThingSpeak – open source IoT application and
API to store and retrieve data from things
using the HTTP protocol over the Internet via
LAN. It supports Arduino, raspberry Pi etc..
Nimbits – cloud platform supports multiple
programming languages such as Arduino,
JavaScript, HTML.
IoT Toolkit
SiteWhere
Sources of IoT
IoT development Boards
•Arduino Yun – uses microcontroller
ATmega32u4 , includes Wi-Fi, Ethernet, USB
port, micro-SD card slot and 3 reset buttons.

Board also combines with Atheros AR9331


(The Atheros AR9331 (Hornet) is a Wi-Fi
System-On-Chip (WiSoC),typically used in
access points and router platforms) that runs
Linux
•Intel Galileo
Based on Intel x86 architecture.
Pin compatible with Arduino
12 GPIO pins (20 digital I/O)
Six analog inputs
12-bit PWM for precise control
•Intel Edison
Enables device internetworking and device
to cloud communication
The tools supported can collect, store and
process data in the cloud.

•Beagle Board
Card-like computer can run Android and
Linux
Hardware designs and the software for the
IoT devices are open source.
•Raspberry Pi Wireless Inventors Kit(RasWIK)

The Wireless Inventors Kit for the Raspberry Pi (RasWIK) is


an exciting and affordable addition to the Raspberry Pi.

Used to build projects and commercial products

There are 29 fully documented projects. The 17 hardware


projects take you from very basic sensors, actuators and
light controls to more complicated ones that include
measuring temperature and light levels.

The 12 fully completed software projects show you how to


do more sophisticated stuff, including posting your
measurements on the Internet.
Examples of IoT
Wearable devices – watches, fitness trackers,
sleep monitors , health monitors etc.
track steps, distance, calories burned and
active minutes
•Stats and time with a bright OLED display
•Track how long and how well you sleep, set
a silent, vibrating alarm
•Interchangeable metal, leather and classic
bands
•Call, texts and calendar notifications when
the phone is in a defined range.
Wearable smart watch
Smart Home
Sensors and actuators manage a smart home
with an Internet connection
Wired and wireless sensors - Security sensors,
cameras, thermostat, smart plugs, lights,
entertainment systems

Do-it-Yourself (DIY) sensors and actuators


Smart plug, motion detector, door/window
detector, smoke detector, energy meter
interface(electric, gas, water),remote control,
smart relay, surveillance camera, Wireless Hi-Fi
speakers, HUE LED lights, Electric utility meter
Cloud based IoT platform for smart home
Home Automation Software
Intel –based intelligent gateway – home
automation system for telephony, mobile,
cable, broadband and security

OpenHAB – (Open Home Automation Bus)


enables smart home devices to to
communicate via home.
Cloud computing companion my.openHAB
runs on a Java-enabled system.
Thing System enables the smart home devices
communicate and are controlled via home.
Four layered architecture for Smart City -
CISCO
M2M Communication
Process of communication of a physical
object or device at machine with others of
the same type, mostly for monitoring but
also for control purposes.

Each machine embeds a smart device.

The device senses the data or status of the


machine and performs the computation and
communication functions
M2M Communication
Communication protocols are 6LowPAN,
LWM2M, MQTT and XMPP

The difference between M2M and IoT - M2m


must deploy device to device and carry out the
coordination, monitoring , controlling of the
devices and communicate without the usage of
Internet

M2m applications are industrial automation,


logistics, smart grid, smart cities, health and
defence.
M2M Communication
Device domain – physical device,
communication interface, gateway.

Communication interface - port or a


subsystem which receives the input from one
end and sends the data received to another.

Network domain - M2M server, device


identity management, data analytics, data and
device management (connect+collect+
assemble+analyse)
M2M Communication
Application domain - application for services,
monitoring, analysis and controlling of device
network
Software and development Tools
IoT/M2M system layers and design
standardisation
ITU-T Reference Model
ETSI M2M domain architecture
DATA ENRICHMENT, DATA CONSOLIDATION
AND DEVICE MANAGEMENT AT GATEWAY
Functionalities of a gateway at a data
adaptation layer are
Data privacy
Data security
Data enrichment
Data consolidation
Transformation
Device management
The communication gateway enables the
devices to communicate and network with the
web

Gateway includes two functions


 Data management and consolidation
 Connected device management
Data management and consolidation gateway
Data management functions are
• Transcoding
•Privacy, security
•Integration
•Compaction and fusion
Transcoding
Data adaptation, conversion and change of
protocol, format or code using software.

The gateway renders the web response and


messages in formats and representations
required and acceptable at an IoT device.

The IoT device requests are adapted, converted


and changed into required formats acceptable
at the server by transcoding software
Transcoding enables

Message request characters to be in ASCII – at


the device
Unicode at the server
Enables the use of XML format database at the
device, DB2 at the server, also Oracle or any
other DB
Formats, data and code conversion from one
end to another such as from a server to the
mobile TV, VoIP phone or Smartphone as the
client

Transcoding proxy can execute itself on the


client system or the application server
Privacy
The design should ensure privacy by ensuring that
the data at the receiving end is considered
anonymous from an individual or company.

Components of privacy model


•Devices and applications identity management
•Authentication
•Authorization
•Trust
•Reputation
Secure Data Access

Access to data needs to be secure


The design ensures the authentication of a
request for data

Also authorization for accessing a response or


service
Data Gathering and Enrichment
Gathering refers to data acquisition from the
devices/devices network.

Four modes of gathering

•Polling – waste filling information


•Event-based gathering – card reader
•Scheduled interval – ambient light condition
•Continuous monitoring – traffic in a street
Enrichment refers to adding value, security
and usability of the data
Data Dissemination
Data enrichment before data disseminates to
the network
Aggregation – joining together present and
previous data
Compaction – short information without
changing the meaning
Fusion – formatting the information received
in parts
Energy Dissipation in Data Dissemination

Energy is consumed when performing


computations and transmissions.
Higher the data rate , the greater will be the
energy consumed
Higher is RF used, the greater will be the
energy consumed
Higher the gathering interval, the lower will be
the energy consumed.
Energy efficient computations by data
aggregation, compaction and fusion

Lesser the data bytes communication, greater


the acquisition intervals, lower the data rate
for data transfer, lesser the energy dissipation
Data Source and Data Destination
ID for data source and separate for
destination

Address Header fields with 48 bit MAC


address at Link layer, 32-bit IPv4 address at IP
network, 128 bit IPv6 address at IPv6 network
and also port address(80 for HTTP application)
Data Characteristics, Formats and Structures
Data Characteristics temporal data(dependent
on the time), spatial data(dependent on
location), real time data(generated
continuously and acquired continuously at the
same pace), real world data(from physical
world- traffic or street light)

Data received from the devices , formats before


transmission onto Internet – XML,JSON, TLV,
MIME type file for INTERNET
JSON stands for JavaScript Object Notation. 
JSON is a lightweight format for storing and
transporting data. JSON is often used when data
is sent from a server to a web page.

XML stands for eXtensible Markup Language. 


XML is a markup language much like
HTML. XML was designed to store and transport
data. XML was designed to be self-descriptive.
Structure – ways for arranging the data bytes in
sequences with size limit = PDU for a layer
Device management Gateway (DM server)
Providing device ID or address
Device activating
Configuring(managing parameters and
settings)
Registering
Deregistering
Attaching
Detaching
Accepting subscription for its resources
Fault management – course of actions and
guidelines to be followed in case of a fault

OMA DM (OpenMobileAlliance) suggests the


use of a DM server which interacts with
devices through a gateway in IoT/M2M
applications.
Gateway functions for device management a
are
• Does forwarding function when the DM
server and device can interact without
reformatting or structuring
• Does protocol conversion when the device
and DM server use distinct protocols
• Does proxy function in case an intermediate
pre-fetch is required in a lossy environment or
network environment needs.
Web communication protocols for Connected
Devices
Two types of communication environments for
the Data of connected devices to route over
the web are
 Constrained RESTful Environment(CoRE)
 Unconstrained Environment
Constrained RESTful Environment(CoRE)
A device typically sends or receives 10s of
bytes.
The data gathered after enriching and
consolidating from a number of devices
consists of 100s of bytes.
A gateway in the communication framework
enables the data to communicate over the
Internet using the REST software architecture
• devices have the constraint in terms of limited
data size compared to data interchange
between web clients and web servers using
HTTP, TCP and IP
• another constraint is data routing on ROLL
network(Routing Over a network of Low power
and (data) Loss)
• devices may sleep in low power environment
and awaken on an event or when required
Unconstrained Environment
Web applications use HTTP and RESTful HTTP
for web client and web server communication
consisting of 1000s of bytes.

Data routes over IP networks for the Internet


using IP and TCP protocols.
IoT or M2M devices local network connectivity
and web connectivity in constrained and
unconstrained environments
Constrained Application Protocol (CoAP)
Features of CoAP are
• the URI
• a subset of MIME types
• a subset of response codes which are used
for
an HTTP object or resource
(a) direct and indirect accesses of CoAP client objects
to a CoAP server (b) CoAP client access for lookup
of object or resource using a resource directory (c)
CoAP client and server access using proxies
CoAP Client Web Connectivity
A proxy is an intermediate server, which
accepts a request from a client and sends the
response to the client using a protocol.

Also passes the request to the server and


accepts a response from the server using the
same or other protocol

As shown in fig (c) above


Transport Layer Security (TLS) is the protocol
used for securing the TCP-based Internet data
interchanges which is DTLS for datagram.
Features of DTLS are
Secured use of a key for Client Authentication
PSK- Pre Shared Key to authenticate a client
contains upto 133 characters in English
Generates a unique encryption key for each
client
PSK is a symmetric key without forward
secrecy(sender key not secret from receiver)
symmetric key - Both end 1 and end 2 uses the
same key, K12 for encryption and decryption
Private key refers to a key agreed for usage of data
encryption between a pair of sender and receiver.

Sender and receiver can be objects, applications,


web services or processes

RPK(Random Pair-wise Keys/Raw Public Key) –


private/public key - asymmetric
End 1 – K1 and Kp End 2 – K2 and Kp

K1 and K2 are kept secret between End1 and End2


Public key refers to , Kp(ex., set of 128 or 256
bits), which an intermediate server such as a
bank server provides to both the sender and
the receiver

Sender communicates using K1, receiver using


K2 to server and server Kp

Messages exchange between sender and server


using K1 & Kp
Messages exchange between receiver and
server using K2 & Kp
X.509 certificate is a certificate based on an
authorized Certification Authority(CA) and
Public Key Infrastructure(PKI)
Lightweight M2M communication protocol
(LWM2M)
An Application layer protocol specified by
OMA(OpenMobileAlliance) for transfer of
service data/messages

It enables functionalities for device


management in cellular or sensor networks.
Lightweight means – does not depend on call
to the system resources during execution
- also data transfer formats between client and
server are binary and has Tag Length
Value(TLV) or Java Script Object Notation(JSON)
batches of object arrays or resource arrays and
transfers up to 100s of bytes unlike the
WebPages of 1000s of bytes.
Protocol enables communication between
LWM2M client at IoT device and an LWM2M
server at the M2M application and service
capability layer.

Compact protocol - small header


M2M devices LAN connectivity and constrained devices
network connectivity with M2M applications and services
using LWM2M OMA standard specifications of LWM2M
LWM2M specifications and features are:
•An object or resource use CoAP, DTLS and UDP or SMS
protocols for sending a request or response
LWM2M specifications and features contd..
Example 1

Example below gives the OMA specifications


for management objects, query resources,
location resources and resource attributes
JSON Format
Ex: Codes used for data transfer in JSON
Ex: Codes used for data transfer in Java using
JSON
Tag Length Value Format
In a TLV format – first two bytes – to identify
the parameter

First and fourth bytes – length of the actual


data
Ex: codes used for data transfer in TLV format
MIME Type
Message communication protocols for
connected devices
A device/node/end-point/client/server sends
and receives messages.

A communication module includes a protocol


handler, message queue and message cache.
Terminology
Request/Response (Client/Server)
Publish/Subscribe(pubsub)
Resource Directory
Resource Discovery
Registration/Registration Update
Pull(Subscribe/Notify) data
Polling or Observing
Push (publish/Subscribe) data
Message Cache
Message Queue
Information/Query
Communication Protocols
CoAP – SMS
Protocol used when CoAP object uses IP,
cellular network and also SMS

An alternative to UDP-DTLS over ROLL for CoAP


object

SMS is used instead of UDP + DTLS by a CoAP


client or Server
A CoAP client communicates to a mobile
terminal(MT) over the GPRS, High Speed Packet
Access(HSPA) or LTE networks using CoAP-SMS
protocol
IETF recommended terminologies
•SMS-C: SMS service center
•SMS-SP:SMS service provider
CoAP –SMS features are
(a) CoAP request or response communication to
a machine, IoT device or MT
(b) computer or machine interface using IP to a
mobile service provider for data interchange
with terminal
(c) A machine or IOT device or mobile origin
communication of CoAP request or response
(d) An origin communication using
SS7/CIMD/SMPP with a computer or
machine interface using IP
CoAP-MQ
CoAP-MQ is a message queue protocol using a
broker and RD
CoAP end points are client/server

Figure below shows data interchanges between


CoAP-MQ endpoints, CoAP-MQ clients, CoAP-
MQ servers through CoAP-MQ broker and its
services
CoAP-MQ server provisioning for the resource
subscription, store from the publisher,
forwarding to the subscriber and proxy services.

RD services are resource discovery ,directory


and object registration services.

CoAP client server protocol is used for device


objects communication and web objects using
DTLS as security protocol and UDP for CoAP
APIs
MQTT(Message Queuing Telemetry Transport)
Protocol
Creator – IBM – MQTT v3.1.1
Donated to M2M ‘Paho’ project of Eclipse
Used for M2M/IoTcommunication

Version MQTT-SN v1.2 – for sensor and non


TCP/IP networks such as ZigBee

It is also a publish/subscribe messaging protocol


Messages interchange between M2M/IoT
device objects and web objects
XMPP(Extensible Messaging and Presence
Protocol)
Open source protocol accepted by IETF
RFC 6120 – XMPP for CoRE
RFC 6121 – XMPP specifies the instant
messaging (IM) and presence
RFC – 6122 - XMPP specifies the address
(message) format
Messages notify presence for the IMs to one or
many at the same time

It enables chatting and Multi-User Chat(MUC)


after creation of a chat room, where different
users can do the Ims

It enables interoperable communication:Google


Talk
Chat room is an application, in which all those
who have subscribed are provided a room-like
view and use the IMs among themselves

XMPP is extensible – XSF(XMPP standards


foundation) develops and publishes the xeps
(XMPP extension protocols)

The xeps enable the addition of features and


new applications
Examples of xeps for web objects
XMPP-IoT xeps extend the use of XMPP to IoT
and M2M messaging.
Examples are:
Many connected devices based business
applications, processes, smart home, smart city,
smart energy saving and smart street lighting
and traffic are possible using XMPP, XMPP-IoT
and other servers communicating with XMPP
servers

The XML streams in XMPP format communicate


between the devices, devices to web objects
and between the web objects
Use of XMPP and XMPP extension protocols for
connected devices and web objects for the messaging,
presence notifications, responses on demand and
service discoveries using XML streams

Potrebbero piacerti anche