6 Application Protocols for IoT
Yuemin Ding
Tecnun School of Engineering
University of Navarra
1
Outlines
• Transport Layer Protocols
• Application layer protocol not present
• Supervisory control and data acquisition
(SCADA)
• IoT application layer protocols
▪ Constrained Application Protocol (CoAP)
▪ Message Queuing Telemetry Transport (MQTT)
2
Transport Layer-TCP
• Transmission Control Protocol (TCP) →
connection-oriented protocol
• TCP requires a session to get established
between the source and destination before
exchanging
• TCP ensures reassembly in a correct sequence,
flow control and window adjustment, and
retransmission of lost packets.
3
Transport Layer
• User Datagram Protocol (UDP)→connectionless
protocol
• Data can be quickly sent between source and
destination, but with no guarantee of delivery.
• While TCP can be challenging on constrained IoT
devices and networks, UDP is more used in LLNs
sending few bytes of data.
4
Outlines
• Transport Layer Protocols
• Application layer protocol not present
• Supervisory control and data acquisition
(SCADA)
• IoT application layer protocols
▪ Constrained Application Protocol (CoAP)
▪ Message Queuing Telemetry Transport (MQTT)
5
No Application Layer Protocol
• Class 0 devices are usually simple and severely
constrained.
• They do not implement a fully structured
network protocol stack, such as IP, TCP, or UDP,
or even an application layer protocol.
• E.g., a low-cost temperature (2 bytes) and
relative humidity sensor (2 bytes) may directly
send the data through MAC Layer
6
No Application Layer Protocol
• For Class 0 devices, the lack of fully structured
protocol and standardization makes it difficult for
interoperability purposes.
• Imagine different kinds of temperature sensors
from different manufacturers are used, the
sensors will report temperature data in varying
formats.
7
No Application Layer Protocol
• If this is your scenario, the solution is to use an
IoT data broker
8
Outlines
• Transport Layer Protocols
• Application layer protocol not present
• Supervisory control and data acquisition
(SCADA)
• IoT application layer protocols
▪ Constrained Application Protocol (CoAP)
▪ Message Queuing Telemetry Transport (MQTT)
9
Introduction to SCADA
• SCADA refers to automation control systems that was
initially implemented without IP.
• Many of them were defined and implemented decades ago
based on serial links, such as RS-232 and RS-485.
• SCADA systems allow global, real-time, data-driven
decisions to be made about how to improve business
processes
10
Source: wikipedia.org
Adapting SCADA for IP
• The rapid adoption of Ethernet networks in the
industrial world drove the evolution of SCADA
application layer protocols. E.g.:
▪ DNP3 (Distributed Network Protocol version 3) specifies
the use of TCP or UDP on port 20000 for transporting
DNP3 messages over IP.
▪ The Modbus messaging service utilizes TCP port 502.
▪ …
• Benefits of moving to Ethernet and IP include the
ability to leverage existing equipment and
standards
11
Adapting SCADA for IP
• An insight into DNP3:
▪ DNP3 (Distributed Network Protocol 3) is based on a
Master/Slave relationship
▪ Master refers to a powerful computer located in the
control center, e.g. a manager
▪ Slave is a remote device with computing resources, e.g.
sensors/actuators
DNP3 node
over RS485
12
Adapting SCADA for IP
• DNP3 over IP:
▪ The IEEE 1815-2012 specification describes how the
DNP3 must be adapted to run either over TCP
(recommended) or UDP.
▪ Connection management links the DNP3 layers with the
IP layers
13
Tunneling Legacy SCADA over IP
• End-to-end native IP support is preferred, like in
the case of DNP3.
• Otherwise, transport of the original serial
protocol over IP can be achieved by tunneling or
protocol translation.
14
Tunneling Legacy SCADA over IP
• End-to-end native IP support is preferred, like in
the case of DNP3.
• Otherwise, transport of the original serial
protocol over IP can be achieved by tunneling or
protocol translation.
15
Tunneling Legacy SCADA over IP
• End-to-end native IP support is preferred, like in
the case of DNP3.
• Otherwise, transport of the original serial
protocol over IP can be achieved by tunneling or
protocol translation.
16
SCADA Transport over LLNs with MAP-T
• Long-term evolution of SCADA or other industrial
protocols is to natively support IPv6.
• It must be highlighted that most of the industrial
devices supporting IP today support IPv4 only.
17
SCADA Transport over LLNs with MAP-T
• On the sending side, IPv4 Address+port is mapped into an
IPv6 header
• On the receiving side, the IPv4 header is re-created
18
Source: huawei.com
Outlines
• Transport Layer Protocols
• Application layer protocol not present
• Supervisory control and data acquisition
(SCADA)
• IoT application layer protocols
▪ Constrained Application Protocol (CoAP)
▪ Message Queuing Telemetry Transport (MQTT)
19
IoT Application Layer Protocols
• When considering constrained networks and/or
large-scale deployment of constrained nodes, the
IoT industry is working on new lightweight
protocols.
▪ Constrained Application Protocol (CoAP) → over UDP
▪ Message Queuing Telemetry Transport (MQTT) → over
TCP
20
CoAP
• CoAP resulted from the IETF Constrained RESTful
(Representational State Transfer) Environments
working group’s efforts.
• RFC 6690: Constrained RESTful Environments (CoRE)
Link Format
• RFC 7252: The Constrained Application Protocol (CoAP)
• RFC 7641: Observing Resources in CoAP
• RFC 7959: Block-Wise Transfers in CoAP
• RFC 8075: Guidelines for Mapping Implementations:
HTTP to the (CoAP)
• RFC 7252: securing CoAP with DTLS.
21
CoAP
• CoAP has a fixed header length of 4 bytes
22
CoAP
• Just like HTTP, CoAP is based on the REST
architecture, but with a “thing” acting as both
the client and the server.
23
CoAP
• Reliable transmission with CoAP
CoAP Reliable Transmission Example with confirmable message
24
Outlines
• Transport Layer Protocols
• Application layer protocol not present
• Supervisory control and data acquisition
(SCADA)
• IoT application layer protocols
▪ Constrained Application Protocol (CoAP)
▪ Message Queuing Telemetry Transport (MQTT)
25
MQTT
• A reliable, lightweight, and cost-effective
protocol to monitor and control a large number
of sensors → Message Queuing Telemetry
Transport (MQTT)
26
MQTT
• MQTT is a lightweight protocol with each control
packet consisting of a 2-byte fixed header
• The first MQTT field in the header is Message
Type, which identifies the kind of MQTT packet
within a message.
27
MQTT
• DUP (duplication flag) → to notate that the
packet has been sent previously, but an
acknowledgement was not received
• QoS header field allows for the selection of three
different QoS levels: 0, 1, 2
• Retain flag→ notifies the server to hold onto the
message data
28
MQTT
• QoS header field allows for the selection of three
different QoS levels: 0, 1, 2
29
CoAP v.s. MQTT
30
Outlines
• Transport Layer Protocols
• Application layer protocol not present
• Supervisory control and data acquisition
(SCADA)
• IoT application layer protocols
▪ Constrained Application Protocol (CoAP)
▪ Message Queuing Telemetry Transport (MQTT)
31
Thank you!
Q&A
32