essential capabilities of an iot cloud platform - aws online tech talks

76
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Ian Massingham, Chief Evangelist (EMEA), Amazon Web Services @IanMmmm Essential Capabilities of an IoT Cloud Platform

Upload: amazon-web-services

Post on 21-Jan-2018

551 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Ian Massingham,

Chief Evangelist (EMEA),

Amazon Web Services

@IanMmmm

Essential Capabilities of an IoT

Cloud Platform

Page 2: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Getting started: What is AWS IoT?

Page 3: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS: hyperscale infrastructure for connected devices

Amazon SNS

Mobile Push

and Notifications

AWS Lambda

Run Code in

Response to Events

Amazon DynamoDB

Predictable and Scalable

NoSQL Data Store

Amazon Kinesis

Streaming Analytics

Amazon Redshift

Petabyte-Scale

Data Warehouse

…and more

Amazon API Gateway

Build, Deploy, and Manage

APIs

Amazon Cognito

User Identity and Data

Synchronization

Page 4: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

IoT Applications : An Early Use Case for AWS

Page 5: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT: simplify & accelerate IoT development

Amazon SNS

Mobile Push

and Notifications

Amazon DynamoDB

Predictable and

Scalable NoSQL

Data Store

AWS Lambda

Run Code in

Response to Events

Amazon Redshift

Petabyte-Scale

Data Warehouse

…and more

Amazon

API Gateway

Build, Deploy, &

Manage APIs

Amazon Kinesis

Streaming Analytics

Amazon Cognito

User Identity and

Data Synchronization

AWS IoT

Connect Devices to

the Cloud

Page 6: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT

“Securely connect one or one billion devices to AWS,

so they can interact with applications and other devices”

Page 7: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT: Core Capabilities

Message Broker

AWS-grade security

Rules engine

Device Shadows

Device Registry

Managed Platform

Seamless integration

with all of AWS

Page 8: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT

Page 9: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Many Successful IoT Deployments Running On AWS

Page 10: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Topics for this session

Security: Job Zero

Device SDKs

Communicating with Things

Process & act on device data

Store & query device metadata attributes

Store & retrieve device state with the Device Shadow

Support for edge computing capabilities

Page 11: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Security: Job Zero

Page 12: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks
Page 13: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks
Page 14: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

http://192.168.1.200:8080 http://a.public.address:8080

Page 15: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks
Page 16: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

WHERE DO BOTNETS COME FROM?

Page 17: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

It doesn’t have to be this way

Page 18: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

http://192.168.1.200:8080

Page 19: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Secure Communications with Things

Page 20: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Mutual TLS Authentication

TLS/SSL

MUTUAL TLS AUTHENTICATION

Page 21: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Public Key Cryptography Options

For same bits & level of security ECC keys are much smaller that RSA keys

Symmetric Key Size (bits) RSA Key Size (bits) Elliptic Curve Key size (bits)

80 1024 160

112 2048 224

128 3072 256

192 7680 384

256 15360 512

https://aws.amazon.com/blogs/iot/elliptic-curve-cryptography-and-forward-secrecy-support-in-aws-iot-3/

Page 22: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Communicating with non-things

(Humans)

Page 23: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

How we implement this

MQTT + Mutual Authn TLS AWS Authn + HTTPS

Server Authn TLS + Cert TLS + Cert

Client Authn TLS + Cert AWS API Keys

Confidentiality TLS TLS

Protocol MQTT HTTP

Page 24: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Strong Thing Identity

Page 25: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Strong Thing Identity

X.509 Certificates

https://aws.amazon.com/blogs/iot/just-in-time-registration-of-device-certificates-on-aws-iot/

Page 26: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Fine Grained Authorisation

Page 27: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT

Data Plane

Control Plane

Service Access

Data Plane

Page 28: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Applying Permissions to Thing Management

{

"Version": "2012-10-17",

"Statement": [

{

"Sid": ”ManageCerts",

"Action": [

"iot:CreateCertificateAndKeys",

"iot:CreateCertificateFromCsr",

"iot:DescribeCertificate",

"iot:UpdateCertificate",

"iot:DeleteCertificate",

"iot:ListCertificates”

],

"Effect": "Allow",

"Resource": "*"

}

]

}

{

"Version": "2012-10-17",

"Statement": [

{

"Sid": "RevokeOneThing",

"Action": [

"iot:UpdateCertificate"

],

"Effect": "Allow",

"Resource":

"arn:aws:iot:us-east-1:123456972007:cert/d7677b0…SNIP…026d9",

"Condition": {

"IpAddress": {

"aws:SourceIp": "192.168.42.54"

}

}

}

]

}

Page 29: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Allowing/Denying Access to MQTT Topics

{

"Version":"2012-10-17",

"Statement":[ {

"Effect":"Allow",

"Action":[ "iot:Connect" ],

"Resource":"*"

}, {

"Effect":"Allow",

"Action":[ "iot:Publish" ],

"Resource":[

"arn:aws:iot:us-east-1:123456972007:

topic/$aws/things/MyThing/shadow/update"]

}, {

"Effect":"Allow",

"Action":[ "iot:Subscribe", "iot:Receive" ],

"Resource":[

"arn:aws:iot:us-east-1:123456972007:

topicfilter/$aws/things/MyThing/shadow/*"

]

}

]

}

Page 30: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Creating certificates & keys

Page 31: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Key & certificate creation with the AWS CLI

Page 32: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Device Provisioning at Scale:

How do you getting keys &

certificates onto your devices?

Page 33: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Getting keys & certificates onto your devices

• Simple at the device prototyping stage

• Copy or flash them (& the CA cert) onto your device

• More complex in volume manufacturing

• Still copying or flashing keys & certs, but the numbers increase

• Use AWS SDKs/CLI to automate key & certificate creation.

Provide keys & certificates to your device manufacturing partners

Page 34: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Register on first use

Page 35: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

https://aws.amazon.com/blogs/iot/just-in-time-registration-of-device-certificates-on-aws-iot/

Just-in-Time Registration of Device Certificates

Register your

CA Cert with

AWS IoT

Sign device certs

with your CA cert

$aws/events/certificates/registered/<caCertificateID>

{"certificateId": "<certificateID>","caCertificateId": "<caCertificateId>","timestamp": "<timestamp>","certificateStatus": "PENDING_ACTIVATION","awsAccountId": “<awsAccountId>",

}

AWS IoT

MQTT Endpoint

New certificate state set to

PENDING_ACTIVATION AWS IoT Rule invokes

AWS Lambda function

AWS Lambda function

activates certificate &

attaches policy

New certificate state set to

ACTIVE

Page 36: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Device SDKs:

Abstract & Simplify Access to

Platform Features

Page 37: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Get Started with the AWS IoT Device SDK

C SDK

(Ideal for embedded

OS)

JavaScript SDK

(Ideal for Embedded

Linux Platforms)

Arduino Library

(Arduino Yun)

Mobile SDK

(Android and iOS)

Python SDK Java SDK

https://aws.amazon.com/blogs/iot/introducing-aws-iot-device-sdks-for-java-and-python/

Page 38: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Prototyping with the Raspberry Pi

• Raspberry Pi hardware

• Electronics Starter Kits• One examples is the SunFounder 37 modules Sensor Kit v2.0 for

Raspberry Pi 3, 2, Model B+ with 40-Pin GPIO Extension Board &

Jump Wires

• Example tutorial

• Raspberry Pi Sense Hat (optional fun) • https://www.raspberrypi.org/products/sense-hat/

Page 39: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Setting up the Raspberry Pi GPIO & Sense Hat

Your own electronics/sensor build

C (for embedded C)

http://wiringpi.com

Python Wrapper Module for WiringPI

https://github.com/WiringPi/WiringPi-Python

For the Sense Hat

Python Module

https://github.com/RPi-Distro/python-sense-hat

Page 40: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Official IoT Starter Kits, Powered by AWS

Dragonboard 410c

(by Arrow)

Beaglebone Green

(by Seeed Studio)

Seeeduino Cloud

(by Seeed Studio)

Intel Edison

(by Seeed Studio)

MediaTek LinkIt One

(by Seeed Studio)

Broadcom BCM4343W

(by Avnet)

Marvell EasyConnect

(By Marvell)

Renesas RX63N

(by Micrium)

Microchip WCM

(by Microchip)

Ti Launchpad

(By Ti)

Page 41: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Communicating with Things

Page 42: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Message Broker

DEVICE GATEWAYCommunicate with devices via

MQTT and HTTP

Page 43: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Message Broker

Page 44: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

MQTT

MQTT vs HTTPS:

• 93x faster throughput

• 11.89x less battery to send

• 170.9x less battery to receive

• 50% less power to keep connected

• 8x less network overhead

Source:

http://stephendnicholas.com/archives/1217

• OASIS standard protocol (v3.1.1)

• Lightweight, pub-sub, transport protocol

that is useful for connected devices

• MQTT is used on oil rigs, connected

trucks, and many more sensitive and

resource-sensitive scenarios

• Customers have needed to build,

maintain, and scale a broker to use

MQTT with cloud applications

Page 45: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Message Broker : managed service

Highly Scalable

Device Gateway

Millions of devices

sending billions of

messages

SubscribersPublishers

Page 46: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Process & act on device data

Page 47: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Rules Engine

RULES ENGINETransform messages

based on rules and route

to AWS Services

Page 48: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Rules Engine

Page 49: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Simple & familiar syntax

- SQL Statement to define topic filter

- Optional WHERE clause

- Advanced JSON support

Functions improve signal : noise

- String manipulation (regex support)

- Mathematical operations

- Context-based helper functions

- Crypto support

- UUID, Timestamp, rand, etc.

AWS IoT Rules Engine basics

SELECT * FROM ‘things/thing-2/color’

WHERE color = ‘red’

Page 50: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Rules Engine’s flexibility

SELECT *, clientId() as MQTTClientId

FROM 'one/rule'

WHERE

startsWith(topic(2), 'IME33') AND

(state = 'INIT' OR hydro_temp >

surface_temp)",

"actions":

[{

"republish": {

"topic":

"controllers/${substring(topic(3),

3, 5)}",

}]

http://docs.aws.amazon.com/iot/latest/developerguide/iot-sql-functions.html

Page 51: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Rules Engine

Complex Evaluations

Respond to the fleet, not just a single unit. Dozens of functions() available.

Multiple / Simultaneous Actions

Sometimes a situation requires you to take many actions.

Page 52: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Rules Engine actions

RULES ENGINETransform messages

based on rules and route

to AWS Services

AWS Services

- - - - -

3P Services

AWS Services

- - - - -

3P Services

Page 53: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

1. AWS Services

(Direct Integration)

Rules Engine

Actions

AWS IoT Rules Engine

LambdaSNS SQS

S3Amazon

KinesisDDB RDS

Amazon

Redshift

Amazon Glacier

EC2

3. External Endpoints

(via Lambda and SNS)

Rules Engine connects AWS

IoT to External Endpoints and

AWS Services.

2. Rest of AWS

(via Amazon Kinesis,

Lambda, S3, and more)

Page 54: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Rules Engine Actions

Rules Engine evaluates

inbound messages published

into AWS IoT, and transforms

and delivers to the appropriate

endpoint based on business

rules.

External endpoints can be

reached via Lambda and

Simple Notification Service

(SNS).

Put object in an S3 bucket

Insert into a DynamoDB table

Publish to an SNS Topic/Endpoint

Insert into an Amazon Kinesis stream

ActionsPersist via Amazon Kinesis Firehose

Republish to AWS IoT

Make a Machine Learning prediction

Invoke a Lambda function

Store in Amazon Elasticsearch cluster

Page 55: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Store & query device metadata

attributes

Page 56: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Thing Registry

THING REGISTRYIdentity and Management of

your things

REGISTRYIdentity and Management of

your things

Page 57: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Thing Registry

• Static attributes associated to Thing

• Firmware version

• Serial Numbers

• Device Type

• Device Group

• Device Description

• Sensor description

• Support and Maintenance

• Reference Manual URL

• Part # reference

• Reference to external support system

Page 58: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Thing Registry: Create & List Things

http://docs.aws.amazon.com/iot/latest/developerguide/thing-registry.html

$ aws iot create-thing --thing-name "MyLightBulb" --attribute-payload "{\"attributes\": {\"wattage\":\"75\", \”model\":\"123\"}}"{

"thingArn": "arn:aws:iot:eu-west-1:554625704737:thing/MyLightBulb","thingName": "MyLightBulb"

}$ aws iot list-things{

"things": [{

"attributes": {"model": "123", "wattage": "75"

}, "version": 1, "thingName": "MyLightBulb"

}]

}

Page 59: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Registry: Search for Things

http://docs.aws.amazon.com/iot/latest/developerguide/thing-registry.html

$ aws iot list-things --attribute-name "wattage" --attribute-value “75"{

"things": [{

"thingTypeName": "StopLight", "attributes": {

"model": "123", "wattage": "75"

}, "version": 3, "thingName": "MyLightBulb"

}, {

"thingTypeName": "LightBulb", "attributes": {

"model": "123", "wattage": "75"

}, "version": 1, "thingName": "MyRGBLight"

}]

}

Page 60: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Registry: Thing Types

http://docs.aws.amazon.com/iot/latest/developerguide/thing-registry.html

Thing types allow you to store description and configuration

information that is common to all things associated with the same

thing type.

For example, you can define a LightBulb thing type. All things

associated with the LightBulb thing type share a set of attributes.

aws iot create-thing-type --thing-type-name "LightBulb" \\--thing-type-properties "thingTypeDescription=light bulb type, searchableAttributes=wattage,model"

Page 61: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Device State Cache:

Asynchronously access device

state via the Thing Shadow

Page 62: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Thing Shadow

THING SHADOWPersistent thing state during

intermittent connections

SHADOWPersistent thing state during

intermittent connections

APPLICATIONS

Page 63: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Thing Shadows

Page 64: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Thing Shadow

Shadow

Page 65: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Shadow Flow

Shadow

Device SDK

1. Device Publishes Current State

2. Persist JSON Data Store

3. App requests device’s current state

4. App requests change the state5. Device Shadow syncs

updated state

6. Device Publishes Current State7. Device Shadow confirms state change

AWS IoT

Page 66: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Device Shadow - Simple Yet Powerful

{"state" : {

“desired" : {"lights": { "color": "RED" },"engine" : "ON"

},"reported" : {

"lights" : { "color": "GREEN" },"engine" : "ON"},"delta" : {

"lights" : { "color": "RED" }} },

"version" : 10}

Thing

Report its current state to one or multiple shadows

Retrieve its desired state from shadow

Mobile App

Set the desired state of a device

Get the last reported state of the device

Delete the shadow

Shadow

Shadow reports delta, desired and reported

states along with metadata and version

Page 67: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS IoT Device Shadow Topics (MQTT)

Thing SDK makes it easy for you to

build shadow functionality into your

device so it can automatically

synchronize the state with the device.

AWS IoT Thing Shadow

UPDATE: $aws/things/{thingName}/shadow/update

DELTA: $aws/things/{thingName}/shadow/update/delta

GET: $aws/things/{thingName}/shadow/get

DELETE: $aws/things/{thingName}/shadow/delete

Sensor Reported Desired Delta

LED1 RED YELLOW

LED1 = Yellow

TEMP = 60FACCEL X=1,Y=5,Z=4 X=1,Y=5,Z=4

TEMP 83F 60F

Page 68: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Support for edge computing

capabilities

Page 69: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Round-trip latency

Intermittent connectivity

Expensive bandwidth

Programming and updating embedded software needs specialized skills

Limited to what is on the device unless you rewrite or program the device

Challenges Of Devices Living On The Edge

Page 70: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS GreengrassEmbed Lambda Compute (& Other AWS Services) in Connected Devices

Preview Available Now

Use The Same AWS Programming Model In Devices And The Cloud

Page 71: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS Greengrass: Local Compute, Messaging & Data Caching

Local

compute

Local

data caching

Secure

communications

Local

messaging

Page 72: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

AWS Greengrass: How It Works

Built into

devices at

manufacture

Install the

Greengrass

runtime

Lambda functions

on AWS & devices

Manage from

AWS Console

Same programming

model

Local

communication

and orchestration

Page 73: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Amazon Greengrass: Example Use Cases

Smart Homes Agriculture Manufacturing

Page 74: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

aws.amazon.com/iot/

Page 75: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Thank you!

Ian Massingham,

Chief Evangelist (EMEA),

Amazon Web Services

@IanMmmm

Page 76: Essential Capabilities of an IoT Cloud Platform - AWS Online Tech Talks

Questions?