How do Things talk? IoT Application Protocols 101

Post on 28-Jan-2015

109 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

Analysts predict that in 2020 50 billion devices are connected to the internet. Together with the fact that more and more of these "things" are connected over the cellular network, new challenges are introduced to the communication of Internet of Things (IoT) and machine-to-machine (M2M) scenarios. There are a lot of protocols which claim to be ideal for these use cases, for example MQTT and COAP. In this talk you will get an overview of commonly used protocols and their underlying architectural styles. We will also look at advantages/disadvantages, use cases and the eco-system around them for Java developers.

Transcript

Talking leads to Knowledge

GPSGPS

GPSGPS

GPS

GPSGPS

Detected: Traffic Jam!

...but waitwho’s talking here

author & speaker

things speech therapist ;)

CEO & co-founder developer

@goetzchr

THINGS talk?

THINGS?

Consumer Goods

Industry Machines

objects in our everyday life

logistics has a lot of things...

M2MIoT

IoEWoT

Web of Things

Internet of Things

Internet of Everything

Machine to Machinecommunication

UbicompUbiquitous computing

CPSCyper Physical Systems Pervasive

Computing

Technology that connects Devices

over wired or wireless communication

why should I care ?

Source: http://www.cisco.com/web/about/ac79/docs/innov/IoT_IBSG_0411FINAL.pdf

0

12,5

25

37,5

50

2003 2010 2015 2020

3,4

1,8

0,08

World Population Connected Devices

Ratio6,5

new devices per second

http://blogs.cisco.com/news/cisco-connections-counter/

2013 2014 2020

250

10080

finally a use case for IPv6 ;)

Open Hardware

simple

accessible

affordable

Raspberry Pi is a trademark of the Raspberry Pi Foundation

Developers are the new King Makers

… if you don’t believe me, read this book ;) http://thenewkingmakers.com/

So how do these things talk?

HTTP/RESTused since 1991

widely known and adapted

request/response

point 2 point

HTTP 2.0 - still work in progress

ChallengesConstrained devices

Bi-directional communication

Scaling to 100.000s of devices

Unreliable networks

Push messaging

Security

HTTPIoT

CoAPConstrained Application Protocol

CoAP HTTP

Introducing . . .

CoAP Message

0 1 2 30 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+|Ver| T | TKL | Code | Message ID |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Token (if any, TKL bytes) ...+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Options (if any) ...+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+|1 1 1 1 1 1 1 1| Payload (if any) ...+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

protocol stack

CoAP

UDP

6LoWPan

HTTP

TCP

IP

vs

Message Flow

Client ServerRequest

Response

Non-Confirmable Message

1/2

Message Flow

Client Server

Request

Response

Ack

Ack

Confirmable Message2/2

URL REST style

coap://host:port/path?param=value

coap://localhost:5683/temp

coap://server/temp/critical?above=42

ObserveServer

Client

http://tools.ietf.org/html/draft-ietf-core-observe-13

Get O

pt O

bser

ve Response

Response

Response

Response

10 ℃ 8 ℃ 7 ℃ 5 ℃ 4 ℃

10 ℃ 8 ℃ 7 ℃ 4 ℃

lost

Response

5 ℃

Discovery of Resources

/.well-known/core

Multicast

Content-Negotiation

Proxy CoAP-HTTP and HTTP-CoAP

DTLS

Other features

Tools

Californium and Copper Logo from http://people.inf.ethz.ch/mkovatsc/

Californium & Copper

+More Implementations

http://en.wikipedia.org/wiki/Constrained_Application_Protocol#Implementations

XMPP at a glance• developed for chat

• based on XML

• extensible

• decentral / inter-server

• TLS and SASL

Typical XMPP Flow<iq type =’get’

from =’client@jax.de’

to =‘tempsensor@jax.de’

id =’S0001’>

<req xmlns =’urn:xmpp:iot:sensordata’ seqnr =’1’ momentary =’true’ >

</iq>

1/3

<iq type =’result’

from =’client@jax.de’

to =‘tempsensor@jax.de’

id =’S0001’>

<accepted xmlns =’urn:xmpp:iot:sensordata’ seqnr =’1’/ >

</iq>

2/3

<message from =’...’ to =’...’><fields xmlns=’urn:xmpp:iot:sensordata’ seqnr =’1’ done =’true’>

<node nodeId =’Device01’>

<timestamp value=‘2013-03-07T16:24:30’>

<numeric name =’Temperature’ momentary =‘true’ automaticReadout =’true’

value =’23.4’ unit =’°C’ >

</timestamp>

</node>

</fields>

</message>3/3

From chat to IoT - status quo

Who’s a friend ?

XMPP IoT Extensions323 Sensor Data experimental 04/2014324 Provisioning experimental 03/2014325 Control experimental 04/2014326 Concentrators experimental 03/2014347 Discovery experimental 04/2014??? Interoperability not approved??? Pub/Sub IoT not existent

Source: http://xmpp.org/xmpp-protocols/xmpp-extensions/

More XEPs

EXI (Efficient XML Interchange)

Service Discovery<query xmlns =’http://jabber.org/protocol/disco#info’/ >

it’s still XML

ToolsClients

http://xmpp.org/xmpp-software/libraries/

Server

http://xmpp.org/xmpp-software/servers/

Temperaturfühler MQTT-Broker

Laptop

Mobiles Endgerät

publish: “21°C“publish: “21°C“

publish: “21°C“

subscribe

subscribe

Topics

rheingoldhalle Goldsaal A

Goldsaal B

people

temp

people

temp

/ /

1/5

rheingoldhalle Goldsaal A

Goldsaal B

people

temp

people

temp

/ /

rheingoldhalle/Goldsaal-A/temperature

2/5

rheingoldhalle Goldsaal A

Goldsaal B

people

temp

people

temp

/ /

rheingoldhalle/+/temp

3/5

rheingoldhalle Goldsaal A

Goldsaal B

people

temp

people

temp

/ /

rheingoldhalle/Goldsaal B/#

4/5

rheingoldhalle Goldsaal A

Goldsaal B

people

temp

people

temp

/ /

#

5/5

Characteristics• Topics

• lightweight

• QoS Levels

• Retained / LWT

• MQTT over Websockets

• Bridging

• SSL

Broker• central communication point

• different implementations

• additional features

+ othershttp://mqtt.org/wiki/doku.php/brokers

MQTT-SensorNetworks

MQTT for WSN

utilizes UDP

Gateway to MQTT

Topic Preregistration

Sleeping Clients

-SN

protocol stack

MQTT-SN

UDP

6LoWPan

MQTT

TCP

IP

ToolsPublic Broker

http://mqttdashboard.com

Java-Broker with Plugin SDK

Client Lib

CONNECTaccept-version:1.0,1.1,2.0host:example.com/stomplogin:guestpasscode:guest

^@

Simple/Streaming Text Oriented Messaging Protocol

SENDdestination:/queue/test

This is a simple STOMP Message!

^@

Simple/Streaming Text Oriented Messaging Protocol

Facts• simple

• text-based

• publish/subscribe

• Websockets support

• Transaction support

Tools

reference broker impl

Stampyserver/client impl

+ othershttp://stomp.github.io/implementations.html

CoAP

HTTP

protocol war

You Mean the One and Unique Solutions

For All Problems

DOES NOT EXIST?

coexistence

How to choose a protocol• How constrained are the devices?

• Reliable/unreliable network?

• What is the message rate?

• How is the data processed further?

• Push or Pull ?

@goetzchr

Thanks

top related