IoT Communication Protocols

Internet of Things: Foundations and Applications [./]
Spring 2015 — INFO 290 (CCN 41607)

Erik Wilde, Siemens Web of Things Research Group
2015-04-03

Creative Commons License [http://creativecommons.org/licenses/by/3.0/]

This work is licensed under a CC
Attribution 3.0 Unported License
[http://creativecommons.org/licenses/by/3.0/]

Contents Erik Wilde: IoT Communication Protocols

Contents

Erik Wilde: IoT Communication Protocols

(2) Abstract

In this lecture we are looking at both lower layer (CoAP) and specific communication protocols (XMPP, WebSocket, AMQP, MQTT, WebRTC, PuSH), as examples of how specific requirements in application areas have resulted in a variety of protocols. The main challenge in this space is to not compare protocols feature-by-feature, but to understand what they do and do not cover, and what they have been designed for.



Erik Wilde: IoT Communication Protocols

(3) So/Too Many Protocols



Erik Wilde: IoT Communication Protocols

(4) People And Hammers

If you've never seen a screw it looks a lot like a nail.

Erik Wilde: IoT Communication Protocols

(5) Creating the Silver Unicorn Hammer

The nice thing about standards is that there are so many to choose from.

Constrained Application Protocol (CoAP)

Outline (Constrained Application Protocol (CoAP))

  1. Constrained Application Protocol (CoAP) [3]
  2. Extensible Messaging Protocol (XMPP) [5]
  3. WebSocket [3]
  4. Advanced Message Queueing Protocol (AMQP) [1]
  5. Message Queue Telemetry Transport (MQTT) [1]
  6. Web Real Time Communications (WebRTC) [1]
  7. PubSubHubbub (PuSH) [2]
  8. Conclusions [1]
Constrained Application Protocol (CoAP) Erik Wilde: IoT Communication Protocols

(7) CoAP as tiny HTTP++



Constrained Application Protocol (CoAP) Erik Wilde: IoT Communication Protocols

(8) Constrained RESTful Environments (CoRE) Link Format



Constrained Application Protocol (CoAP) Erik Wilde: IoT Communication Protocols

(9) Concise Binary Object Representation (CBOR)



Extensible Messaging Protocol (XMPP)

Outline (Extensible Messaging Protocol (XMPP))

  1. Constrained Application Protocol (CoAP) [3]
  2. Extensible Messaging Protocol (XMPP) [5]
  3. WebSocket [3]
  4. Advanced Message Queueing Protocol (AMQP) [1]
  5. Message Queue Telemetry Transport (MQTT) [1]
  6. Web Real Time Communications (WebRTC) [1]
  7. PubSubHubbub (PuSH) [2]
  8. Conclusions [1]
Extensible Messaging Protocol (XMPP) Erik Wilde: IoT Communication Protocols

(11) XMPP History

xmpp-logo.png

Extensible Messaging Protocol (XMPP) Erik Wilde: IoT Communication Protocols

(12) XMPP Messaging



Extensible Messaging Protocol (XMPP) Erik Wilde: IoT Communication Protocols

(13) XMPP Messaging Example

C: <?xml version='1.0'?>
   <stream:stream to='example.com'
                  xmlns='jabber:client'
                  xmlns:stream='http://etherx.jabber.org/streams'
                  version='1.0'>
S: <?xml version='1.0'?>
   <stream:stream from='example.com'
                  id='someid'
                  xmlns='jabber:client'
                  xmlns:stream='http://etherx.jabber.org/streams'
                  version='1.0'>

...  encryption, authentication, and resource binding ...

C:   <message from='juliet@example.com'
              to='romeo@example.net'
              xml:lang='en'>
C:     <body>Art thou not Romeo, and a Montague?</body>
C:   </message>
S:   <message from='romeo@example.net'
              to='juliet@example.com'
              xml:lang='en'>
S:     <body>Neither, fair saint, if either thee dislike.</body>
S:   </message>
C: </stream:stream>
S: </stream:stream>


Extensible Messaging Protocol (XMPP) Erik Wilde: IoT Communication Protocols

(14) Presence Information



Extensible Messaging Protocol (XMPP) Erik Wilde: IoT Communication Protocols

(15) XMPP Roster Example

C: <iq from='juliet@example.com/balcony'
       id='hu2bac18'
       type='get'>
     <query xmlns='jabber:iq:roster'/>
   </iq>


S: <iq id='hu2bac18'
       to='juliet@example.com/balcony'
       type='result'>
     <query xmlns='jabber:iq:roster' ver='ver11'>
       <item jid='romeo@example.net'
             name='Romeo'
             subscription='both'>
         <group>Friends</group>
       </item>
       <item jid='mercutio@example.com'
             name='Mercutio'
             subscription='from'/>
       <item jid='benvolio@example.net'
             name='Benvolio'
             subscription='both'/>
     </query>
   </iq>


WebSocket

Outline (WebSocket)

  1. Constrained Application Protocol (CoAP) [3]
  2. Extensible Messaging Protocol (XMPP) [5]
  3. WebSocket [3]
  4. Advanced Message Queueing Protocol (AMQP) [1]
  5. Message Queue Telemetry Transport (MQTT) [1]
  6. Web Real Time Communications (WebRTC) [1]
  7. PubSubHubbub (PuSH) [2]
  8. Conclusions [1]
WebSocket Erik Wilde: IoT Communication Protocols

(17) Non-HTTP Internet Connectivity

websockets-logo.png

WebSocket Erik Wilde: IoT Communication Protocols

(18) HTTP to WebSocket Upgrade

GET ws://echo.websocket.org/?encoding=text HTTP/1.1
Origin: http://websocket.org
Cookie: __utma=99as
Connection: Upgrade
Host: echo.websocket.org
Sec-WebSocket-Key: uRovscZjNol/umbTt5uKmw==
Upgrade: websocket
Sec-WebSocket-Version: 13
HTTP/1.1 101 WebSocket Protocol Handshake
Date: Fri, 10 Feb 2012 17:38:18 GMT
Connection: Upgrade
Server: Kaazing Gateway
Upgrade: WebSocket
Access-Control-Allow-Origin: http://websocket.org
Access-Control-Allow-Credentials: true
Sec-WebSocket-Accept: rLHCkw/SKsO9GAH/ZSFhBATDKrU=
Access-Control-Allow-Headers: content-type


WebSocket Erik Wilde: IoT Communication Protocols

(19) WebSocket Protocol



Advanced Message Queueing Protocol (AMQP)

Outline (Advanced Message Queueing Protocol (AMQP))

  1. Constrained Application Protocol (CoAP) [3]
  2. Extensible Messaging Protocol (XMPP) [5]
  3. WebSocket [3]
  4. Advanced Message Queueing Protocol (AMQP) [1]
  5. Message Queue Telemetry Transport (MQTT) [1]
  6. Web Real Time Communications (WebRTC) [1]
  7. PubSubHubbub (PuSH) [2]
  8. Conclusions [1]
Advanced Message Queueing Protocol (AMQP) Erik Wilde: IoT Communication Protocols

(21) Asynchronous Enterprise Messaging

amqp-logo.jpg

Message Queue Telemetry Transport (MQTT)

Outline (Message Queue Telemetry Transport (MQTT))

  1. Constrained Application Protocol (CoAP) [3]
  2. Extensible Messaging Protocol (XMPP) [5]
  3. WebSocket [3]
  4. Advanced Message Queueing Protocol (AMQP) [1]
  5. Message Queue Telemetry Transport (MQTT) [1]
  6. Web Real Time Communications (WebRTC) [1]
  7. PubSubHubbub (PuSH) [2]
  8. Conclusions [1]
Message Queue Telemetry Transport (MQTT) Erik Wilde: IoT Communication Protocols

(23) An IoT Funnel Protocol

mqtt-logo.png

Web Real Time Communications (WebRTC)

Outline (Web Real Time Communications (WebRTC))

  1. Constrained Application Protocol (CoAP) [3]
  2. Extensible Messaging Protocol (XMPP) [5]
  3. WebSocket [3]
  4. Advanced Message Queueing Protocol (AMQP) [1]
  5. Message Queue Telemetry Transport (MQTT) [1]
  6. Web Real Time Communications (WebRTC) [1]
  7. PubSubHubbub (PuSH) [2]
  8. Conclusions [1]
Web Real Time Communications (WebRTC) Erik Wilde: IoT Communication Protocols

(25) More P2P Than IoT



PubSubHubbub (PuSH)

Outline (PubSubHubbub (PuSH))

  1. Constrained Application Protocol (CoAP) [3]
  2. Extensible Messaging Protocol (XMPP) [5]
  3. WebSocket [3]
  4. Advanced Message Queueing Protocol (AMQP) [1]
  5. Message Queue Telemetry Transport (MQTT) [1]
  6. Web Real Time Communications (WebRTC) [1]
  7. PubSubHubbub (PuSH) [2]
  8. Conclusions [1]
PubSubHubbub (PuSH) Erik Wilde: IoT Communication Protocols

(27) Push as a Pattern



PubSubHubbub (PuSH) Erik Wilde: IoT Communication Protocols

(28) PuSH Subscription Flow

  1. Client discovers hub link in a server's information feed
  2. Client POSTs subscription request to hub with a callback URI
  3. Hub sends a verification request to check subscription request authenticity
  4. Hub adds URI to its internal list of subscribed clients
  5. Server and hub cooperate (push or pull) to get new content to the hub
  6. Updates to server feeds are POSTed to callback URIs
  7. Subscriptions (mostly) time out and have to be refreshed periodically


Conclusions

Outline (Conclusions)

  1. Constrained Application Protocol (CoAP) [3]
  2. Extensible Messaging Protocol (XMPP) [5]
  3. WebSocket [3]
  4. Advanced Message Queueing Protocol (AMQP) [1]
  5. Message Queue Telemetry Transport (MQTT) [1]
  6. Web Real Time Communications (WebRTC) [1]
  7. PubSubHubbub (PuSH) [2]
  8. Conclusions [1]
Conclusions Erik Wilde: IoT Communication Protocols

(30) Architecture is Hard



2015-04-03 Internet of Things: Foundations and Applications [./]
Spring 2015 — INFO 290 (CCN 41607)