iotaconf 2014 - iot connectivity, standards, and architecture

51
IoT Connectivity, Standards & Architecture Todd L. Montgomery @toddlmontgomery IOTAConf October 20-21, 2014

Upload: todd-montgomery

Post on 01-Jul-2015

742 views

Category:

Software


7 download

DESCRIPTION

Communication Patterns, Protocols, and Architecture in IoT.

TRANSCRIPT

Page 1: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

IoT Connectivity, Standards & ArchitectureTodd L. Montgomery @toddlmontgomery

IOTAConf!October 20-21, 2014!

Page 2: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Protocols (Standards?)

Architecture

Communication PatternsLead to…

Lead to…

“Fear is the path to the dark side. Fear leads to anger. Anger leads to hate. Hate leads to suffering.”

— Yoda

Page 3: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Communication Patterns

Page 4: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

What most of us think happens

Request

Response

Page 5: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Request

Response

And that is… what really happens… but…

Page 6: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Request

Response

What also really happens

But… Who does this?

Page 7: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Request

Response

Support (UI/Device)

Security (Challenge)

Keep-Alive or Watchdog

User State Query

Page 8: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Stream

What also really happens

News, Stocks, Texts/SMS, Video, Audio, Social, …

Page 9: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Ingest

What also really happens

Temperature, Heart Rate, Web Logs, Sensor Data, Seismic Readings, Steps, Stairs, Gyro

Data, GPS, Acceleration, Breathing, EKG, EEG, …

Page 10: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Request

Response

What also really happens

Stream & Ingest

Pretty much how everything actually works…

Page 11: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

What also REALLY happens

Page 12: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Message

Message

The Break Down

Request, Response, Stream, and Ingest are really types

Message-Driven

Message-Driven

Page 13: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Reactive Applications

Message Driven

Responsive Resilient

Elastic

http://www.reactivemanifesto.org/

Page 14: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Meanwhile… IoT…

Page 15: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture
Page 16: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

HTCPCP RFC 2324, Extended by RFC 7168

http://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol

"there is a strong, dark, rich requirement for a protocol designed espressoly [sic] for the brewing of coffee"

Page 17: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Page 18: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

418 I’m a teapot

BREW

WHEN

"This has a serious purpose – it identifies many of the ways in which HTTP has

been extended inappropriately.” — Larry Masinter, author http://larry.masinter.net/

Page 19: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture
Page 20: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

courtesy of

Page 21: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Sometimes it is good to reinvent the wheel

Page 22: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

What History Has Taught Us

Page 23: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

THE IoT Language!

Page 24: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

THE IoT Protocol!

Page 25: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

THE IoT Runtime!

Page 26: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

THE IoT ______!

Page 27: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Internet of Things

Multi-Lingual (and Polyglot)

Multi-Protocol & Multi-Standard

Multi-“Platform” Massive Scale Highly Integrated

What is already is…

Page 28: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Connected. Integrated.

Great time to be a protocol geek!

Page 29: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

pro·to·col noun \ˈprō-tə-ˌko ̇l, -ˌkōl, -ˌkäl, -kəl\ !

... !3 b : a set of conventions governing the treatment and especially the formatting of data in an electronic communications system <network protocols>

...

3 a : a code prescribing strict adherence to correct etiquette and precedence (as in diplomatic exchange and in the military services) <a breach of protocol> !

Page 30: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Protocols are the key to Integration

REST has demonstrated this!

Page 31: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Protocols & Standards

Page 32: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Battery Life

Persistent connections help a LOT! (fewer frames)

Well designed protocols help a LOT MORE!

Many simultaneous connections hurt!

Using the wrong protocol with the wrong pattern hurts A LOT!

Stay out of High Energy State!

One reason why we should care about Protocols…

ASCII Encoding hurts CPU & Bandwidth!

Binary Encoding helps save CPU & Bandwidth!

Page 33: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Request

Response

HTTP RFC 2068, 2616, …, 7230-7240

Synchronous Request/Response

Bi-Directional… kinda, but…

Event

Event

… only one direction

at-a-time

June 2014

Page 34: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Request

ACKResponse

ACK

Sync Request

Sync Response

Web Services

But… Async Request/Response… kinda

Event

Event

http://en.wikipedia.org/wiki/List_of_web_service_specifications

No, seriously, lots of these!!

Page 35: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Async Request/ Response

Streaming

WebSocket RFC 6455

Full Duplex, Asynchronous “TCP over the Web”

EventsEvents

101 Switch

HTTP Upgrade

Ingest

https://tools.ietf.org/html/rfc6455

Really a Transport Protocol

Page 36: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Async Request

Async Response

SPDY & HTTP/2 IETF Drafts

Async Request/Response Multiple Streams

Efficient Headers (HPACK) Binary Encoding

EventsEvents

http://www.ietf.org/id/draft-ietf-httpbis-http2-14.txt

Page 37: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

There is emerging implementation experience and interest in a protocol that retains the semantics of HTTP without the legacy of HTTP/1.x message framing and syntax, which have been identified as hampering performance and encouraging misuse of the underlying transport.

— IETF httpbis Charter http://datatracker.ietf.org/wg/httpbis/charter/

Page 38: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Async Request

Async Response

WebSocket over HTTP/2 IETF Draft

Streaming Ingest

Full Duplex, Asynchronous with Multiple Channels/Streams

Events Events

http://www.ietf.org/id/draft-hirano-httpbis-websocket-over-http2-01.txt

Page 39: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

MQ Telemetry Transport (MQTT)

http://mqtt.org/

Lightweight Publish/Subscribe

Messaging Transport

Runs over TCP or WebSocket (v3.1.1)

MQTT-SN for non-TCP/IP

Broker-Based

OASIS Standard

Page 40: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Constrained Application Protocol (CoAP)

https://tools.ietf.org/html/rfc7252

Runs over UDP, DTLS, or WebSocket

Request/Response (either direction), Publish/Subscribe

Standardized HTTP Mapping

Resource Discovery, Linking, etc.

IETF CoRE WG (Constrained RESTful Environments) RFC 7252

Page 41: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Extensible Messaging & Presence Protocol (XMPP)

https://tools.ietf.org/html/rfc6120

Brokered TCP + TLS + SASL

Presence & Persistent Streams

XMPP Standards Foundation

(Semi) Structured XML

IETF RFC 6120 (obsoletes 3920)

Page 42: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Protocols?

Shared Memory IPC

WebSocket

JMS

WebRTC

Not just in the traditional sense…

HTTP/1.1MQTT

HTTP/2

AMQPCoAP

TCP/UDP/IP

Aeron 0MQ

DDS

XMPP

Page 43: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Architectures

Page 44: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Micro-Services Architectures

http://martinfowler.com/articles/microservices.html

Page 45: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Languages

Erlang & Elixir

Akka Rust

Go

And Frameworks

RxJS

Rx

RxJava

Akka Streams

Page 46: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Client? Device? Browser?

Back-End? DMZ?

Protocols ProtocolsProtocols

Page 47: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Micro Architecture

Page 48: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Protocols

Nuklei

Deployment Container

LogicReactive

Message Stream

Depends on language, runtime, platform, etc. Asynchronous

Binary “Loose” Ordering

Client? Server? Browser? Device? ALL!

Page 49: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Protocols

NukleiLogic

Reactive Message Stream

Asynchronous Binary Boundary

Consistent ABI

Various Protocol Options

Choice of protocols becomes deployment concern

Deployment Container

Page 50: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

Message

Message

To Sum Up

Message-Driven

Message-Driven

Page 51: IoTaConf 2014 - IoT Connectivity, Standards, and Architecture

@toddlmontgomery

Questions?• Kaazing http://www.kaazing.com • GitHub https://github.com/kaazing • Reactive Manifesto http://www.reactivemanifesto.com • SlideShare http://www.slideshare.com/toddleemontgomery • Twitter @toddlmontgomery

Thank You!