from drones to cars - amazon s3 · pdf filefrom drones to cars ... communication protocol...

44
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Jan Metzner Solutions Architect, Amazon Web Services From Drones to Cars Connecting the Devices in Motion to the Cloud Pop-up Loft

Upload: phambao

Post on 07-Mar-2018

221 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

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

Jan Metzner Solutions Architect, Amazon Web Services

From Drones to Cars Connecting the Devices in Motion to the Cloud

Pop-up Loft

Page 2: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

What to Expect from the Session

•  Understand the challenges •  Architecture building blocks •  Architecture patterns •  Examples •  Demos •  Practical experience and guidelines

Page 3: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

IoT in Motion at Monsanto

Page 4: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

IoT creates new opportunities in precision agriculture

4

Plan Experiment

Plant

Monitor/apply Harvest

Analyze

Page 5: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Monsanto tests products all around the world

5

Data needs to be reliably gathered from various equipment in remote locations where data connectivity is unreliable

Plan

Plant

Monitor Harvest

Analyze

Plan

Plant

Monitor Harvest

Analyze

Plan

Plant

Monitor Harvest

Analyze

Plan

Plant

Monitor Harvest

Analyze

Plan

Plant

Monitor Harvest

Analyze

Page 6: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

The formula for reliable data transfer and processing

6

Store and forward on

edge

Low overhead communication

protocol

Broker-based processing in

cloud

Page 7: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Data ingestion and storage

Analytics Cloud code

Communication Rest API Visualizations

HTTP

Page 8: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

8

Page 9: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Devices in motion

Page 10: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Devices in motion carry a lot of value

•  Automated harvesting •  Automated transport •  Connected cars and vehicles •  Aviation •  Sports, gaming, leisure •  Medical and public service •  Tourism

Page 11: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Technical characteristics

•  Mobile networks: kBit/s •  Lightweight:

Every gram, every watt counts Low RAM, low CPU, low power

•  Near real-time: Seconds count •  Location-based •  Large-impact use cases

Page 12: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Dash streams more than 1 TB of real-time data per day

Dash connects your smartphone to your car with a simple, low-cost device which provides real-time road

safety information to drivers.

As a startup, using AWS has allowed us to scale nicely and use resources without spending a lot

of capital. Brian Langel CTO, Dash

“ •  Real-time information for drivers

•  Streams more than 1 TB of real-time data per day over Amazon Kinesis

•  Processes billions records using Amazon DynamoDB

•  Thousands of updates per second during spikes

•  Reduced operating costs by $200,000 per year

Page 13: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Devices in motion: Challenges

•  How to handle constrained resources? •  How to manage millions of things? •  How to communicate securely? •  How to deal with unreliable connections? •  How to handle geo-location? •  How to deal with map data?

?

Page 14: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Devices in motion: Challenges

•  How to handle constrained resources? •  How to manage millions of things? •  How to communicate securely? •  How to deal with unreliable connections? •  How to handle Geo-Location? •  How to deal with map data?

?

Page 15: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

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 16: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Devices in motion: Challenges

•  How to handle constrained resources? •  How to manage millions of things? •  How to communicate securely? •  How to deal with unreliable connections? •  How to handle Geo-Location? •  How to deal with map data?

? ✔

Page 17: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Highly scalable Pub/Sub broker

MQTT

Subscribers

Publishers

Secure by default Connect securely via X509 certs and TLS v1.2 client mutual auth

Multi-protocol message gateway Millions of devices and apps can connect over MQTT or HTTP

topic Elastic Pub/Sub broker Go from 1 to 1 billion long-lived, bi-directional connections with zero provisioning

AWS IoT: Securely connect devices

Page 18: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Devices

Apps

Secure Pub/Sub broker

AWS IoT Pub/Sub broker

Page 19: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

1. AWS services (direct integration)

Rules Engine

Actions

AWS IoT Rules Engine

Lambda SNS SQS

S3 Amazon Kinesis DDB 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 20: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Devices in motion: Challenges

•  How to handle constrained resources? •  How to manage millions of things? •  How to communicate securely? •  How to deal with unreliable connections? •  How to handle Geo-Location? •  How to deal with map data?

? ✔ ✔

Page 21: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

AWS IoT security

Authentication Authorization

MQTT/HTTP over TLS v1.2 (X.509 certs) cipher suites TLS mutual auth: (Client/server certificates for things) HTTPS over sigv4 (for apps) Amazon Cognito/IAM (for mobile apps)

Certificates are attached to policies Policies (JSON) give granular access to AWS IoT control and data plane Policies allow and deny permissions on specific resources (rules, shadows, topics)

Page 22: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Devices

Apps

Secure Pub/Sub broker

AWS IoT Pub/Sub broker

MQTT/TLS

HTTP/TLS

MQTT/TLS

MQTT/TLS

MQTT/TLS

Page 23: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Devices in motion: Challenges

•  How to handle constrained resources? •  How to manage millions of things? •  How to communicate securely? •  How to deal with unreliable connections? •  How to handle Geo-Location? •  How to deal with map data?

? ✔ ✔ ✔

Page 24: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Apps Shadow

Secure Pub/Sub broker

Thing SDK

AWS IoT Device Shadows

Page 25: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

AWS IoT Device Shadows flow

Shadow

Thing SDK

1. Device publishes current state

2. Persist JSON data store

3. App requests device’s current state

4. App requests change the state 5. Device Shadow syncs updated state

6. Device publishes current state 7. Device Shadow confirms state change

Page 26: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Devices in motion: Challenges

•  How to handle constrained resources? •  How to manage millions of things? •  How to communicate securely? •  How to deal with unreliable connections? •  How to handle geo-location? •  How to deal with map data?

? ✔ ✔ ✔ ✔

Page 27: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Geo-location and mapping use cases

•  Tracking •  Geo-fencing •  Find nearby objects •  Alert nearby things •  Map matching •  Routing

Page 28: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Geohashing

•  Easy to compute •  Arbitrary precision •  Similar positions yield

similar prefixes •  Removing characters reduces

precision •  Simple way to look up and manage

geo objects

Picture: https://github.com/stephenlb/geohash-chat-by-proximity

Page 29: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Distribute messages to geo-located things with topic tiles

•  One topic per geohash •  Things subscribe to their

current geohash tile’s topic as they move

•  Send messages to tile topics •  Use geohash lengths to

change area impact of message

Page 30: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Geo library for Amazon DynamoDB

•  Ready-to-use Java JAR •  Library and sample apps

available on GitHub •  Supports GeoJSON •  Uses geohashes for

DynamoDB local secondary indexes

•  Simplifies box and radius queries

Page 31: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

AWS IoT Service and DynamoDB with Geohashing Architecture

Rules Engine Send lat/lon AWS Lambda +

Geo library for Amazon DynamoDB

Look up geohash

Moving thing

Amazon DynamoDB

Return matches

1 2

3 4

5

Page 32: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Amazon RDS for PostgreSQL with PostGIS

•  Powerful support for: •  Geo data formats •  Geometric projections •  Transform operations •  Query functions

•  Well understood, easy to use

•  Supported on Amazon RDS for PostgreSQL

Page 33: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

AWS IoT and Amazon RDS for PostgreSQL

Rules Engine Send lat/lon AWS Lambda

Geo- queries

Moving thing

Amazon RDS for PostgreSQL

Return matches

1 2

3 4

5

Page 34: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Processing map graphs with TitanDB

•  Scalable graph database •  Import maps as graphs •  Supports routing and

other complex map queries

•  Amazon DynamoDB storage back end for TitanDB available

Page 35: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

AWS IoT and Amazon DynamoDB for TitanDB

Rules Engine Send lat/lon AWS Lambda

Map queries

Moving thing

Amazon DynamoDB

Return matches

1 2

3 4

5

TitanDB + Amazon DynamoDB

back end

Page 36: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Amazon Elasticsearch Service

•  Powerful, real-time, distributed, open-source •  Supports geolocation searches:

•  Geo-points, geohashes, geo-aggregations, geoshapes

Amazon Elasticsearch Service •  Managed service •  Easy to set up, scale, operate

Page 37: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

AWS IoT and Amazon Elasticsearch Service architecture

Rules Engine Send lat/lon AWS Lambda

Run queries

Moving thing

Amazon Elasticsearch

Service

Return matches

1 2

3 4

5

Page 38: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Devices in motion: Challenges

•  How to handle constrained resources? •  How to manage millions of things? •  How to communicate securely? •  How to deal with unreliable connections? •  How to handle geo-location? •  How to deal with map data?

✔ ✔ ✔ ✔ ✔ ✔

Page 39: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Summary

•  Use AWS IoT to manage and communicate with your things

•  Scalable, easy to use MQTT pub/sub message broker •  Powerful AWS IoT Rules Engine

•  Use AWS IoT Device Shadows for unreliable connections •  Take advantage of AWS Lambda to connect to geo-aware

services: •  Amazon DynamoDB with geohash and/or TitanDB support •  Amazon RDS for PostgreSQL with PostGIS •  Amazon Elasticsearch Service

Page 40: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

Demo: Connected car safety Search for MBL203

Page 41: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

http://www.iteris.com/cvria/html/applications/app74.html#tab-3

Page 42: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

https://github.com/smartdevicelink

Page 43: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

OBE Vehicle

RSE

Notification function

DMS

Vehicle

GIS

Rules engine Rules engine Notification

topic

Traffic information center

Partner notification

Shadow

Reported state

Reported state

Desired state

Environment situation stream

Traffic incident service

OBE

Prediction API

Reported state

Desired state

Desired state

Page 44: From Drones to Cars - Amazon S3 · PDF fileFrom Drones to Cars ... communication protocol Broker-based processing in ... Dash connects your smartphone to your car with a simple,

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

Thank You

Pop-up Loft

Jan Metzner @janmetzner