How do Things talk? IoT Application Protocols 101

3,872 views

Published on

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.

Published in: Technology
0 Comments
11 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,872
On SlideShare
0
From Embeds
0
Number of Embeds
299
Actions
Shares
0
Downloads
211
Comments
0
Likes
11
Embeds 0
No embeds

No notes for slide

How do Things talk? IoT Application Protocols 101

  1. 1. Christian Götz | dc-square GmbH How do Things talk? IoT Application Protocols 101
  2. 2. Talking leads to Knowledge
  3. 3. GPSGPS GPS GPS GPS GPS GPS Detected: Traffic Jam!
  4. 4. ...but wait who’s talking here
  5. 5. author & speaker things speech therapist ;) CEO & co-founder developer @goetzchr
  6. 6. THINGS talk?
  7. 7. THINGS?
  8. 8. Consumer Goods
  9. 9. Industry Machines
  10. 10. objects in our everyday life
  11. 11. logistics has a lot of things...
  12. 12. M2M IoT IoE WoT Web of Things Internet of Things Internet of Everything Machine to Machine communication Ubicomp Ubiquitous computing CPS Cyper Physical Systems Pervasive Computing
  13. 13. Technology that connects Devices over wired or wireless communication
  14. 14. why should I care ?
  15. 15. 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 Ratio 6,5
  16. 16. new devices per second http://blogs.cisco.com/news/cisco-connections-counter/ 2013 2014 2020 250 100 80
  17. 17. finally a use case for IPv6 ;)
  18. 18. Open Hardware simple accessible affordable Raspberry Pi is a trademark of the Raspberry Pi Foundation
  19. 19. Developers are the new King Makers … if you don’t believe me, read this book ;) http://thenewkingmakers.com/
  20. 20. So how do these things talk?
  21. 21. HTTP/REST used since 1991 widely known and adapted request/response point 2 point HTTP 2.0 - still work in progress
  22. 22. Challenges Constrained devices Bi-directional communication Scaling to 100.000s of devices Unreliable networks Push messaging Security HTTP IoT
  23. 23. CoAP Constrained Application Protocol CoAP HTTP Introducing . . .
  24. 24. CoAP Message 0 1 2 3 0 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) ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  25. 25. protocol stack CoAP UDP 6LoWPan HTTP TCP IP vs
  26. 26. Message Flow Client Server Request Response Non-Confirmable Message 1/2
  27. 27. Message Flow Client Server Request Response Ack Ack Confirmable Message 2/2
  28. 28. URL REST style coap://host:port/path?param=value coap://localhost:5683/temp coap://server/temp/critical?above=42
  29. 29. Observe Server Client http://tools.ietf.org/html/draft-ietf-core-observe-13 GetOptObserve Response Response Response Response 10 ℃ 8 ℃ 7 ℃ 5 ℃ 4 ℃ 10 ℃ 8 ℃ 7 ℃ 4 ℃ lost Response 5 ℃
  30. 30. Discovery of Resources /.well-known/core Multicast Content-Negotiation Proxy CoAP-HTTP and HTTP-CoAP DTLS Other features
  31. 31. 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
  32. 32. XMPP at a glance • developed for chat • based on XML • extensible • decentral / inter-server • TLS and SASL
  33. 33. 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
  34. 34. <iq type =’result’ from =’client@jax.de’ to =‘tempsensor@jax.de’ id =’S0001’> <accepted xmlns =’urn:xmpp:iot:sensordata’ seqnr =’1’/ > </iq> 2/3
  35. 35. <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
  36. 36. From chat to IoT - status quo
  37. 37. Who’s a friend ?
  38. 38. Source: Wikipedia implementations
  39. 39. XMPP IoT Extensions 323 Sensor Data experimental 04/2014 324 Provisioning experimental 03/2014 325 Control experimental 04/2014 326 Concentrators experimental 03/2014 347 Discovery experimental 04/2014 ??? Interoperability not approved ??? Pub/Sub IoT not existent Source: http://xmpp.org/xmpp-protocols/xmpp-extensions/
  40. 40. More XEPs EXI (Efficient XML Interchange) Service Discovery <query xmlns =’http://jabber.org/protocol/disco#info’/ >
  41. 41. it’s still XML
  42. 42. Tools Clients http://xmpp.org/xmpp-software/libraries/ Server http://xmpp.org/xmpp-software/servers/
  43. 43. Temperaturfühler MQTT-Broker Laptop Mobiles Endgerät publish: “21°C“ publish: “21°C“ publish: “21°C“ subscribe subscribe
  44. 44. Topics rheingoldhalle Goldsaal A Goldsaal B people temp people temp / / 1/5
  45. 45. rheingoldhalle Goldsaal A Goldsaal B people temp people temp / / rheingoldhalle/Goldsaal-A/temperature 2/5
  46. 46. rheingoldhalle Goldsaal A Goldsaal B people temp people temp / / rheingoldhalle/+/temp 3/5
  47. 47. rheingoldhalle Goldsaal A Goldsaal B people temp people temp / / rheingoldhalle/Goldsaal B/# 4/5
  48. 48. rheingoldhalle Goldsaal A Goldsaal B people temp people temp / / # 5/5
  49. 49. Characteristics • Topics • lightweight • QoS Levels • Retained / LWT • MQTT over Websockets • Bridging • SSL
  50. 50. Broker • central communication point • different implementations • additional features + others http://mqtt.org/wiki/doku.php/brokers
  51. 51. MQTT-SensorNetworks MQTT for WSN utilizes UDP Gateway to MQTT Topic Preregistration Sleeping Clients -SN
  52. 52. protocol stack MQTT-SN UDP 6LoWPan MQTT TCP IP
  53. 53. Tools Public Broker http://mqttdashboard.com Java-Broker with Plugin SDK Client Lib
  54. 54. CONNECT accept-version:1.0,1.1,2.0 host:example.com/stomp login:guest passcode:guest ^@ Simple/Streaming Text Oriented Messaging Protocol
  55. 55. SEND destination:/queue/test This is a simple STOMP Message! ^@ Simple/Streaming Text Oriented Messaging Protocol
  56. 56. Facts • simple • text-based • publish/subscribe • Websockets support • Transaction support
  57. 57. Tools reference broker impl Stampy server/client impl + others http://stomp.github.io/implementations.html
  58. 58. CoAP HTTP
  59. 59. protocol war
  60. 60. You Mean the One and Unique Solutions For All Problems DOES NOT EXIST?
  61. 61. coexistence
  62. 62. 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 ?
  63. 63. @goetzchr Thanks

×