Вы находитесь на странице: 1из 77

INTERNET OF THINGS

Presentation by Arshdeep Bahga - Internet of Things


1
The Four Industrial Revolutions

Internet of Things (IoT)


Blockchain, Analytics will
Play a Central Role in
Cyber-Physical Systems

www.weforum.org

Presentation by Arshdeep Bahga - Internet of Things 2


The new world – Web 3.0
Goal: Secure, transparent & efficient business and financial transactions between a large number of diverse
and untrusting entities

Businesses
Regulatory
Bodies

Governments

Individuals

Banks
Devices

Presentation by Arshdeep Bahga - Internet of Things 3


Evolution of the Internet & Web Technologies

Presentation by Arshdeep Bahga - Internet of Things 4


Web 1.0 - Simply Distributed Data to Clients

Presentation by Arshdeep Bahga - Internet of Things 5


Web 2.0 - Evolution of the Internet & Web Technologies

Presentation by Arshdeep Bahga - Internet of Things 6


Large Servers & Platforms & Scalable Applications = Web 2.0

Presentation by Arshdeep Bahga - Internet of Things 7


Big Centralized Servers to Fully Decentralized Nodes

Presentation by Arshdeep Bahga - Internet of Things 8


What are the building blocks of Web 3.0 ?

Presentation by Arshdeep Bahga - Internet of Things 9


Definition of IoT

A dynamic global network infrastructure with self-configuring


capabilities based on standard and interoperable
communication protocols where physical and virtual "things"
have identities, physical attributes, and virtual personalities and
use intelligent interfaces, and are seamlessly integrated into the
information network, often communicate data associated with
users and their environments.

Presentation by Arshdeep Bahga - Internet of Things 10


Characteristics of IoT

• Dynamic & Self-Adapting


• Self-Configuring
• Interoperable Communication Protocols
• Unique Identity
• Integrated into Information Network

Presentation by Arshdeep Bahga - Internet of Things 11


Physical Design of IoT

• The "Things" in IoT usually refers to IoT devices which have unique
identities and can perform remote sensing, actuation and monitoring.
• IoT devices can:
• Exchange data with other connected devices and applications (directly or indirectly),
or
• Collect data from other devices and process the data 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

Presentation by Arshdeep Bahga - Internet of Things 12


Generic block diagram of an IoT Device

• An IoT device may consist of


several interfaces for
connections to other devices,
both wired and wireless.
• I/O interfaces for sensors
• Interfaces for Internet connectivity
• Memory and storage interfaces
• Audio/video interfaces.

Presentation by Arshdeep Bahga - Internet of Things 13


IoT Protocols
• Link Layer
• 802.3 – Ethernet
• 802.11 – WiFi
• 802.16 – WiMax
• 802.15.4 – LR-WPAN
• 2G/3G/4G
• Network/Internet Layer
• IPv4
• IPv6
• 6LoWPAN
• Transport Layer
• TCP
• UDP
• Application Layer
• HTTP
• CoAP
• WebSocket
• MQTT
• XMPP
• DDS
• AMQP
Presentation by Arshdeep Bahga - Internet of Things 14
Logical Design of IoT

• Logical design of an IoT system


refers to an abstract
representation of the entities and
processes without going into the
low-level specifics of the
implementation.

• An IoT system comprises of a


number of functional blocks that
provide the system the capabilities
for identification, sensing,
actuation, communication, and
management.

Presentation by Arshdeep Bahga - Internet of Things 15


Request-Response communication model

• Request-Response is a
communication model in which the
client sends requests to the server
and the server responds to the
requests.

• When the server receives a


request, it decides how to respond,
fetches the data, retrieves
resource representations,
prepares the response, and then
sends the response to the client.

Presentation by Arshdeep Bahga - Internet of Things 16


Publish-Subscribe communication model

• Publish-Subscribe is a
communication model that
involves publishers, brokers and
consumers.
• Publishers are the source of data.
Publishers send the data to the
topics which are managed by the
broker. Publishers 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.

Presentation by Arshdeep Bahga - Internet of Things 17


Push-Pull communication model

• Push-Pull is a communication
model in which the data producers
push the data to queues and the
consumers pull the data from the
queues. Producers do not need to
be aware of the consumers.
• Queues help in decoupling the
messaging between the producers
and consumers.
• Queues also act as a buffer which
helps in situations when there is a
mismatch between the rate at
which the producers push data
and the rate rate at which the
consumers pull data.

Presentation by Arshdeep Bahga - Internet of Things 18


Exclusive Pair communication model

• Exclusive Pair is a
bidirectional, fully duplex
communication model that
uses a persistent connection
between the client and
server.
• Once the connection is
setup it remains open until
the client sends a request to
close the connection.
• Client and server can send
messages to each other
after connection setup.

Presentation by Arshdeep Bahga - Internet of Things 19


REST-based Communication APIs

• Representational State Transfer


(REST) is a set of architectural
principles by which you can design
web services and web APIs that
focus on a system’s resources and
how resource states are
addressed and transferred.
• REST APIs follow the request-
response communication model.
• The REST architectural
constraints apply to the
components, connectors, and data
elements, within a distributed
hypermedia system.

Presentation by Arshdeep Bahga - Internet of Things 20


WebSocket-based Communication APIs

• WebSocket APIs allow bi-


directional, full duplex
communication between
clients and servers.
• WebSocket APIs follow the
exclusive pair
communication model

Presentation by Arshdeep Bahga - Internet of Things 21


IoT Levels & Deployment Templates

An IoT system comprises of the following components:


• Device: An IoT device allows identification, remote sensing, actuation and
remote monitoring.
• Resource: Resources are software components on the IoT device for
accessing, processing, and storing sensor information, or controlling
actuators connected to the device. Resources also include the software
components that enable network access for the device.
• Controller Service: Controller service is a native service that runs on the
device and interacts with the web services. Controller service sends data
from the device to the web service and receives commands from the
application (via web services) for controlling the device.

Presentation by Arshdeep Bahga - Internet of Things 22


IoT Levels & Deployment Templates

• Database: Database can be either local or in the cloud and stores the data
generated by the IoT device.
• Web Service: Web services serve as a link between the IoT device,
application, database and analysis components. Web service can be either
implemented using HTTP and REST principles (REST service) or using
WebSocket protocol (WebSocket service).
• Analysis Component: The Analysis Component is responsible for
analyzing the IoT data and generate results in a form which are easy for the
user to understand.
• 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.

Presentation by Arshdeep Bahga - Internet of Things 23


IoT Level-1

• A level-1 IoT system has a single


node/device that performs sensing
and/or actuation, stores data,
performs analysis and hosts the
application
• Level-1 IoT systems are suitable
for modeling low-cost and low-
complexity solutions where the
data involved is not big and the
analysis requirements are not
computationally intensive.

Presentation by Arshdeep Bahga - Internet of Things 24


IoT Level-2

• A level-2 IoT system has a single


node that performs sensing and/or
actuation and local analysis.
• Data is stored in the cloud and
application is usually cloud-based.
• Level-2 IoT systems are suitable
for solutions where the data
involved is big, however, the
primary analysis requirement is
not computationally intensive and
can be done locally itself.

Presentation by Arshdeep Bahga - Internet of Things 25


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.
• Level-3 IoT systems are suitable
for solutions where the data
involved is big and the analysis
requirements are computationally
intensive.

Presentation by Arshdeep Bahga - Internet of Things 26


IoT Level-4

• A level-4 IoT system has multiple


nodes that perform local analysis.
Data is stored in the cloud and
application is cloud-based.
• Level-4 contains local and cloud-
based observer nodes which can
subscribe to and receive
information collected in the cloud
from IoT devices.
• 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.

Presentation by Arshdeep Bahga - Internet of Things 27


IoT Level-5

• A level-5 IoT system has multiple end


nodes and one coordinator node.
• 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 suitable for
solutions based on wireless sensor
networks, in which the data involved is
big and the analysis requirements are
computationally intensive.

Presentation by Arshdeep Bahga - Internet of Things 28


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.
• 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.

Presentation by Arshdeep Bahga - Internet of Things 29


IoT Applications
• Home Automation • Environment
• Smart Lighting • Weather Monitoring
• Smart Appliances • Air Pollution Monitoring
• Intrusion Detection • Noise Pollution Monitoring
• Smoke/Gas Detectors
• Forest Fire Detection
• River Floods Detection
• Cities
• Smart Parking
• Smart Lighting • Energy
• Smart Roads • Smart Grids
• Structural Health Monitoring • Renewable Energy Systems
• Surveillance • Prognostics
• Emergency Response

Presentation by Arshdeep Bahga - Internet of Things 30


IoT Applications
• Retail • Agriculture
• Inventory Management • Smart Irrigation
• Smart Payments • Green House Control
• Smart Vending Machines
• Industry
• Logistics • Machine Diagnosis & Prognosis
• Route Generation & Scheduling • Indoor Air Quality Monitoring
• Fleet Tracking
• Shipment Monitoring
• Health & Lifestyle
• Remote Vehicle Diagnostics
• Health & Fitness Monitoring
• Wearable Electronics

Presentation by Arshdeep Bahga - Internet of Things 31


IoT Device

• A Device or "Thing" in Internet of Things (IoT) can be any object that has a
unique identifier and which can send/receive data (including user data)
over a network (such as a smartphone, smart TV, computer, refrigerator or
car).

• IoT devices are connected to the Internet and send information about
themselves or about their surroundings (e.g. information sensed by the
connected sensors) over a network (to other devices or servers/storage) or
allow actuation upon the physical entities/environment around them
remotely.

Presentation by Arshdeep Bahga - Internet of Things 32


IoT Device Examples

• A home automation device that allows remotely monitoring the status of


appliances and controlling the appliances.
• An industrial machine which sends information about its operation and
health monitoring data to a server.
• A car which sends information about its location to a cloud-based service.
• A wireless-enabled wearable device that measures data about a person
such as the number of steps walked and sends the data to a cloud-based
service.

Presentation by Arshdeep Bahga - Internet of Things 33


Basic building blocks of an IoT Device

• Sensors
• Sensors can be either on-board the IoT device or attached to the device.
• Actuators
• IoT devices can have various types of actuators attached that allow taking actions upon
the physical entities in the vicinity of the device.
• Communication
• Communication modules are responsible for sending collected data to other devices or
cloud-based servers/storage and receiving data from other devices and commands from
remote applications.
• Analysis & Processing
• Analysis and processing modules are responsible for making sense of the collected data.

Presentation by Arshdeep Bahga - Internet of Things 34


Block diagram of an IoT Device

Presentation by Arshdeep Bahga - Internet of Things 35


Exemplary Device: Raspberry Pi

• Raspberry Pi is a low-cost mini-computer with the physical size of a credit


card.
• Raspberry Pi runs various flavors of Linux and can perform almost all
tasks that a normal desktop computer can do.
• Raspberry Pi also allows interfacing sensors and actuators through the
general purpose I/O pins.
• Since Raspberry Pi runs Linux operating system, it supports Python "out of
the box".

Presentation by Arshdeep Bahga - Internet of Things 36


Raspberry Pi

Presentation by Arshdeep Bahga - Internet of Things 37


Raspberry Pi GPIO

Presentation by Arshdeep Bahga - Internet of Things 38


Raspberry Pi Interfaces

• Serial
• The serial interface on Raspberry Pi has receive (Rx) and transmit (Tx) pins for
communication with serial peripherals.
• SPI
• Serial Peripheral Interface (SPI) is a synchronous serial data protocol used for
communicating with one or more peripheral devices.
• I2C
• The I2C interface pins on Raspberry Pi allow you to connect hardware modules. I2C
interface allows synchronous data transfer with just two pins - SDA (data line) and
SCL (clock line).

Presentation by Arshdeep Bahga - Internet of Things 39


Raspberry Pi Example:
Interfacing LED and switch with Raspberry Pi
from time import sleep
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)

#Switch Pin
GPIO.setup(25, GPIO.IN)

#LED Pin
GPIO.setup(18, GPIO.OUT)
state=false

def toggleLED(pin):
state = not state
GPIO.output(pin, state)

while True:
try:
if (GPIO.input(25) == True):
toggleLED(pin)
sleep(.01)
except KeyboardInterrupt:
exit()

Presentation by Arshdeep Bahga - Internet of Things 40


Other Devices

• BeagleBone Black
• pcDuino
• Cubieboard

Presentation by Arshdeep Bahga - Internet of Things 41


IoT Design Methodology

Presentation by Arshdeep Bahga - Internet of Things 42


Step:1 - Purpose & Requirements
• Applying this to our example of a smart home automation system, the
purpose and requirements for the system may be described as follows:
• Purpose : A home automation system that allows controlling of the lights in a home
remotely using a web application.
• Behavior : The home automation system should have auto and manual modes. In
auto mode, the system measures the light level in the room and switches on the light
when it gets dark. In manual mode, the system provides the option of manually and
remotely switching on/off the light.
• System Management Requirement : The system should provide remote monitoring
and control functions.
• Data Analysis Requirement : The system should perform local analysis of the data.
• Application Deployment Requirement : The application should be deployed locally
on the device, but should be accessible remotely.
• Security Requirement : The system should have basic user authentication capability.

Presentation by Arshdeep Bahga - Internet of Things 43


Step:2 - Process Specification

Presentation by Arshdeep Bahga - Internet of Things 44


Step 3: Domain Model Specification

Presentation by Arshdeep Bahga - Internet of Things 45


Step 4: Information Model Specification

Presentation by Arshdeep Bahga - Internet of Things 46


Step 5: Service Specifications

Presentation by Arshdeep Bahga - Internet of Things 47


Step 5: Service Specifications

Presentation by Arshdeep Bahga - Internet of Things 48


Step 6: IoT Level Specification

Presentation by Arshdeep Bahga - Internet of Things 49


Step 7: Functional View Specification

Presentation by Arshdeep Bahga - Internet of Things 50


Step 8: Operational View Specification

Presentation by Arshdeep Bahga - Internet of Things 51


Step 9: Device & Component Integration

Presentation by Arshdeep Bahga - Internet of Things 52


Step 10: Application Development
• Auto
• Controls the light appliance automatically based on the
lighting conditions in the room
• Light
• When Auto mode is off, it is used for manually controlling
the light appliance.
• When Auto mode is on, it reflects the current state of the
light appliance.

Presentation by Arshdeep Bahga - Internet of Things 53


Implementation: RESTful Web Services
REST services implemented with Django REST
Framework
# Models – models.py
from django.db import models

class Mode(models.Model):
name = models.CharField(max_length=50)
1. Map services to models. Model class State(models.Model):
fields store the states (on/off, name = models.CharField(max_length=50)
auto/manual)

2. Write Model serializers. Serializers allow


complex data (such as model instances) to
be converted to native Python datatypes
that can then be easily rendered into JSON,
XML or other content types.

# Serializers – serializers.py
from myapp.models import Mode, State
from rest_framework import serializers

class ModeSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Mode
fields = ('url', 'name')

class StateSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = State
fields = ('url', 'name')
Presentation by Arshdeep Bahga - Internet of Things 54
Implementation: RESTful Web Services
# Views – views.py
# Models – models.py from myapp.models import Mode, State
from django.db import models
3. Write ViewSets for the Models which from rest_framework import viewsets
combine the logic for a set of related views from myapp.serializers import ModeSerializer,
class Mode(models.Model): in a single class. StateSerializer
name = models.CharField(max_length=50)
class ModeViewSet(viewsets.ModelViewSet):
class State(models.Model): queryset = Mode.objects.all()
name = models.CharField(max_length=50) serializer_class = ModeSerializer

class StateViewSet(viewsets.ModelViewSet):
queryset = State.objects.all()
serializer_class = StateSerializer

# URL Patterns – urls.py


from django.conf.urls import patterns, include, url
from django.contrib import admin
from rest_framework import routers
4. Write URL patterns for the services.
from myapp import views
admin.autodiscover() Since ViewSets are used instead of views,
router = routers.DefaultRouter() we can automatically generate the URL
router.register(r'mode', views.ModeViewSet) conf by simply registering the viewsets
router.register(r'state', views.StateViewSet) with a router class.
urlpatterns = patterns('',
Routers automatically determining how the
url(r'^', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), URLs for an application should be mapped
url(r'^admin/', include(admin.site.urls)), to the logic that deals with handling
url(r'^home/', 'myapp.views.home'), incoming requests.
)
Presentation by Arshdeep Bahga - Internet of Things 55
Implementation: RESTful Web Services

Screenshot of browsable
State REST API

Screenshot of browsable
Mode REST API

Presentation by Arshdeep Bahga - Internet of Things 56


Implementation: Controller Native Service
#Controller service def runAutoMode():
import RPi.GPIO as GPIO ldr_reading = readldr(LDR_PIN)
if ldr_reading < threshold:
import time switchOnLight(LIGHT_PIN)
Native service deployed locally import sqlite3 as lite setCurrentState('on')
import sys else:
switchOffLight(LIGHT_PIN)
setCurrentState('off')
con = lite.connect('database.sqlite')
cur = con.cursor() def runManualMode():
state = getCurrentState()
GPIO.setmode(GPIO.BCM) if state=='on':
threshold = 1000 switchOnLight(LIGHT_PIN)
setCurrentState('on')
LDR_PIN = 18 elif state=='off':
LIGHT_PIN = 25 switchOffLight(LIGHT_PIN)
setCurrentState('off')
def readldr(PIN):
def getCurrentMode():
reading=0 cur.execute('SELECT * FROM myapp_mode')
1. Implement the native service in GPIO.setup(PIN, GPIO.OUT) data = cur.fetchone() #(1, u'auto')
Python and run on the device GPIO.output(PIN, GPIO.LOW) return data[1]
time.sleep(0.1)
GPIO.setup(PIN, GPIO.IN) def getCurrentState():
cur.execute('SELECT * FROM myapp_state')
while (GPIO.input(PIN)==GPIO.LOW): data = cur.fetchone() #(1, u'on')
reading=reading+1 return data[1]
return reading
def setCurrentState(val):
query='UPDATE myapp_state set name="'+val+'"'
def switchOnLight(PIN): cur.execute(query)
GPIO.setup(PIN, GPIO.OUT)
GPIO.output(PIN, GPIO.HIGH) while True:
currentMode=getCurrentMode()
def switchOffLight(PIN): if currentMode=='auto':
runAutoMode()
GPIO.setup(PIN, GPIO.OUT) elif currentMode=='manual':
GPIO.output(PIN, GPIO.LOW) runManualMode()
time.sleep(5)
Presentation by Arshdeep Bahga - Internet of Things 57
Implementation: Application
# Views – views.py
def home(request):
1. Implement Django Application View out=‘’
if 'on' in request.POST:
values = {"name": "on"}
r=requests.put('http://127.0.0.1:8000/state/1/', data=values, auth=(‘username', ‘password'))
result=r.text
output = json.loads(result)
out=output['name']
if 'off' in request.POST:
values = {"name": "off"}
r=requests.put('http://127.0.0.1:8000/state/1/', data=values, auth=(‘username', ‘password'))
result=r.text
output = json.loads(result)
out=output['name']
if 'auto' in request.POST:
values = {"name": "auto"}
r=requests.put('http://127.0.0.1:8000/mode/1/', data=values, auth=(‘username', ‘password'))
result=r.text
output = json.loads(result)
out=output['name']
if 'manual' in request.POST:
values = {"name": "manual"}
r=requests.put('http://127.0.0.1:8000/mode/1/', data=values, auth=(‘username', ‘password'))
result=r.text
output = json.loads(result)
out=output['name']

r=requests.get('http://127.0.0.1:8000/mode/1/', auth=(‘username', ‘password'))


result=r.text
output = json.loads(result)
currentmode=output['name']
r=requests.get('http://127.0.0.1:8000/state/1/', auth=(‘username', ‘password'))
result=r.text
output = json.loads(result)
currentstate=output['name']
return render_to_response('lights.html',{'r':out, 'currentmode':currentmode, 'currentstate':currentstate},
context_instance=RequestContext(request))
Presentation by Arshdeep Bahga - Internet of Things 58
Implementation: Application
<div class="app-content-inner">
<fieldset>
<div class="field clearfix">

2. Implement Django Application <label class="input-label icon-lamp" for="lamp-state">Auto</label>


<input id="lamp-state" class="input js-lamp-state hidden" type="checkbox">

Template
{% if currentmode == 'auto' %}
<div class="js-lamp-state-toggle ui-toggle " data-toggle=".js-lamp-state">
{% else %}
<div class="js-lamp-state-toggle ui-toggle js-toggle-off" data-toggle=".js-lamp-state">
{% endif %}
<span class="ui-toggle-slide clearfix">
<form id="my_form11" action="" method="post">{% csrf_token %}
<input name="auto" value="auto" type="hidden" />
<a href="#" onclick="$(this).closest('form').submit()"><strong class="ui-toggle-off">OFF</strong></a>
</form>
<strong class="ui-toggle-handle brushed-metal"></strong>
<form id="my_form13" action="" method="post">{% csrf_token %}
<input name="manual" value="manual" type="hidden" />
<a href="#" onclick="$(this).closest('form').submit()"><strong class="ui-toggle-on">ON</strong></a>
</form></span>
</div></div>
<div class="field clearfix">
<label class="input-label icon-lamp" for="tv-state">Light</label>
<input id="tv-state" class="input js-tv-state hidden" type="checkbox">
{% if currentstate == 'on' %}
<div class="js-tv-state-toggle ui-toggle " data-toggle=".js-tv-state">
{% else %}
<div class="js-tv-state-toggle ui-toggle js-toggle-off" data-toggle=".js-tv-state">
{% endif %}
{% if currentmode == 'manual' %}
<span class="ui-toggle-slide clearfix">
<form id="my_form2" action="" method="post">{% csrf_token %}
<input name="on" value="on" type="hidden" />
<a href="#" onclick="$(this).closest('form').submit()"><strong class="ui-toggle-off">OFF</strong></a>
</form>
<strong class="ui-toggle-handle brushed-metal"></strong>
<form id="my_form3" action="" method="post">{% csrf_token %}
<input name="off" value="off" type="hidden" />
<a href="#" onclick="$(this).closest('form').submit()"><strong class="ui-toggle-on">ON</strong></a>
</form>
</span>
{% endif %}
{% if currentmode == 'auto' %}
{% if currentstate == 'on' %}
<strong class="ui-toggle-on">&nbsp;&nbsp;&nbsp;&nbsp;ON</strong>
{% else %}
<strong class="ui-toggle-on">&nbsp;&nbsp;&nbsp;&nbsp;OFF</strong>
{% endif %}{% endif %}
</div>
</div>
</fieldset></div></div></div>
Presentation by Arshdeep Bahga - Internet of Things 59
Finally - Integrate the System
• Setup the device
• Deploy and run the REST and Native services
• Deploy and run the Application
• Setup the database

Django Application

REST services implemented with Django-REST framework

SQLite Database

Native service implemented in Python

OS running on Raspberry Pi

Raspberry Pi device to which sensors and actuators are connected

Presentation by Arshdeep Bahga - Internet of Things 60


IoT Security

• Authentication
• Authentication refers to digitally confirming the identity of the entity requesting access to some protected
information.
• In IoT & Cloud, where applications and data are accessed over the internet, the complexity of digital
authentication mechanisms increases rapidly.
• Authorization
• Authorization refers to digitally specifying the access rights to the protected resources using access policies.
• Authorization in a IoT & Cloud requires the use of the cloud service providers services for specifying the
access policies.
• Security of data at rest
• Due to the multi-tenant environments used in the cloud, the application and database servers of different
applications belonging to different organizations can be provisioned side-by-side increasing the complexity of
securing the data.
• Appropriate separation mechanisms are required to ensure the isolation between applications and data from
different organizations.

Presentation by Arshdeep Bahga - Internet of Things 61


IoT Security

• Security of data in motion


• In IoT, the applications and the data are moved out of the in-house IT infrastructure to the cloud provider.
• Therefore, appropriate security mechanisms are required to ensure the security of data in motion.
• Data Integrity
• Data integrity ensures that the data is not altered in an unauthorized manner after it is created, transmitted or
stored. Due to the outsourcing of data storage in IoT & Cloud computing environments, ensuring integrity of
data is important.
• Auditing
• Auditing mechanisms are required to get visibility into the application, data accesses and actions performed
by the application users, including mobile users and devices such as wireless laptops and smartphones.

Presentation by Arshdeep Bahga - Internet of Things 62


IoT & Blockchain Reference App - SolarCharge

• IoT & Blockchain powered solar charging stations


• Decentralized application backed by a Smart Contract
• User can register with the contract and purchase SolarCoins with Ether
• User can send transactions to the solar charging stations from a mobile
app
• Transactions validated and processed on the Blockchain network
• Charging station is activated when the transaction is processed

Presentation by Arshdeep Bahga - Internet of Things 63


SolarCharge Architecture

1. Contract owner deploys the Blockchain Network


smart contract on the on which smart contract for
Blockchain solar charging stations is
deployed
Server
2. Contract owner adds
stations to the contract
Ethereum Node
(Full client)
3. User registers with the
smart contract associated
Web API
with the solar charging
station

4. User purchases SolarCoins

lls PI
by paying Ether to the smart 6. Charging station is activated

Ca T A

R
ES al
contract when the transaction is

T ls
C
RE
processed

AP
I
5. User sends transaction to
the contract to activate a Mobile App IoT Device
charging station by paying in
SolarCoins

Presentation by Arshdeep Bahga - Internet of Things 64


SolarCharge IoT Device

Plug on Solar Charging Station


Relay

Users send transactions to


smart contract associated
with the solar charging
station

BeagleBone Black
Blockchain Network
on which smart contract for
solar charging stations is
deployed

Presentation by Arshdeep Bahga - Internet of Things 65


SolarCharge Prototype

Presentation by Arshdeep Bahga - Internet of Things 66


SolarCharge App Demo

Presentation by Arshdeep Bahga - Internet of Things 67


SolarCharge Device Demo

Presentation by Arshdeep Bahga - Internet of Things 68


Agri-IoT Platform for Smart Agriculture Applications

• The proposed Agri-IoT platform


comprises a network of IoT devices (end-
nodes, routers and gateways) and a
cloud-backend system.
• The IoT devices run an Agri-IoT controller
which allow collection of data related to
crop monitoring, precision farming, soil
and water management.
• The IoT devices can be deployed in
open-farms or greenhouses.

Presentation by Arshdeep Bahga - Internet of Things 69


Reference Design for Interface Board
• The interface board makes use of digital, analog, serial
and USB interfaces to capture data from a variety of Interface Board
sensors. Interface to SBC
Power Serial
(Southbound
Supply Microcontroller Interface
Sensor Bridge)
• Sensor:
• Sensors in the crop gather environmental data and
send it through the Agri-IoT platform to the Cloud. Input/Output
• Typical sensors used include temperature,
humidity, soil moisture, pH, conductivity, water-
level, CO2. Sensors Actuators
• Air Temperature • Irrigation devices
• Humidity • Temperature controls
• Actuators • Soil Temperature • Fans
• Soil Moisture • Lighting
• Actuators include irrigation devices and • pH
temperature controls, fans and lighting, which are • Water level
• Conductivity
controlled through the Agri-IoT platform to manage • CO2
the crop.

Presentation by Arshdeep Bahga - Internet of Things 70


Agri-IoT Device Types
• Within the proposed Agri-IoT platform, the following types of IoT devices are
possible:
• End Node: The end-nodes are deployed in open-farms or greenhouses. The end-nodes do
not have Internet connectivity, therefore, to publish data to the cloud, the end-nodes send the
data to a gateway node. For communication between the end-nodes and the gateway
various wireless communication technologies such as LoRa, 802.15.4,ZigBee or Bluetooth
Low Energy (BLE), are used. The end nodes implement the Southbound, Eastbound and
Westbound interfaces.
• Router: The router nodes route the data sent by the end devices to the gateway. The router
nodes implement the Eastbound and Westbound interfaces.
• Gateway: The gateway receives data from the end-nodes and sends it to a cloud backend
over the Internet. The gateway implements the Northbound, Eastbound and Westbound
interfaces.
• Full Node: A full node is deployed in open-farms or greenhouses and publishes the data
directly to the cloud. The full nodes implements the Northbound, Southbound, Eastbound
and Westbound interfaces.
Presentation by Arshdeep Bahga - Internet of Things 71
Cloud-based Big Data Analytics Stack for Agri-IoT

Amazon
EC2
Custom Web application
dashboard Amazon EMR

Amazon MapReduce job for Analysis results saved


DynamoDB batch analysis of raw to S3
data collected in S3
Open Farm Tables to store
raw sensor data

Greenhouse AWS IoT


S3 Bucket
`
AWS IoT has rules to send
data to DynamoDB, S3 and Raw data delivered to
ElasticSearch S3 bucket
IoT Devices
(Things)
Send raw sensor data
to AWS IoT

AWS Services used:


• EC2: Virtual servers in the cloud
• IoT: Connect devices to the cloud
• DynamoDB: Managed NoSQL database Amazon Kibana Dashboard
• S3: Scalable storage in the cloud ElasticSearch Service
• EMR: Managed Hadoop framework Store, search, and analyze Analyze and visualize data
• ES: Run and scale ElasticSearch clusters large volumes of data quickly
and in near real time

Presentation by Arshdeep Bahga - Internet of Things 72


Realization of the Agri-IoT Platform
• For the end-node and gateway we used the BeagleBone Black SBC, Arduino UNO
microcontroller board and LoRa SX1272 communication shield.
• The SBC captures data from the connected sensors and sends it to the microcontroller board
over serial port.
• The microcontroller board receives data from the SBC and sends it to the gateway over the
LoRa frequencies.
• The gateway receives data from the end-node

Presentation by Arshdeep Bahga - Internet of Things 73


Agri-IoT Node Prototype
• Agri-IoT node prototype based on BeagleBone Black SBC,
Arduino UNO microcontroller board and LoRa SX1272
communication shield is shown.
• LoRa is optimized for long range communication with low-power
consumption and supports large networks with millions of devices
and low data rates (ranging from few bytes to few kilobytes per
second).
• LoRa uses unlicensed frequencies that are available worldwide,
for example, 868 MHz for Europe, 915 MHz for North America and
433 MHz and for Asia. These frequency bands are lower than the
popular 2.4 GHz band and have much less interference.
• Typical ranges for LoRa communication are upto 13 miles (line of
sight) and 1.2 miles (non line of sight, built environments).

Presentation by Arshdeep Bahga - Internet of Things 74


Agri-IoT Dashboard
Kibana Dashboard Custom Web Application Dashboard
(Django application on EC2)

Presentation by Arshdeep Bahga - Internet of Things 75


Further Reading

A Hands-On Approach Textbooks Series by Arshdeep Bahga & Vijay Madisetti

Presentation by Arshdeep Bahga - Internet of Things 76


Thank You

Вам также может понравиться