**4.3 Security**

One of the main problems to be solved when M2M protocols, is the issue of security [11]. The CoAP protocol is based on DTLS (Datagram Transport Layer Security), so it transfers security handling to the transport layer. Four security modes are allowed:

• NoSec: no DTLS security mechanism is applied;

*Interaction Protocols for Multi-Robot Systems in Industry 4.0 DOI: http://dx.doi.org/10.5772/intechopen.97481*


According to [12], MQTT security as well as CoAP security (**Table 1**) is performed by Transport Layer Security (TLS). In [13] a safe application model for MQTT is proposed, namely SMQTT. This model is based on a lightweight attribute that provides encryption by broadcast, on elliptical curcas. According to the authors, SMQTT was resistant to attacks from known plaintext, known ciphertex and man-in-the-middle.

**Table 2** provides a summary of the security modes of the MQTT and CoAP protocols. In the AAA and Integrity field, it refers to Authorization and


#### **Table 1.**

**4. Comparison of the protocols**

*Robotics Software Design and Engineering*

**4.1 Implementation**

**Figure 7.**

*CoAP message format.*

**4.2 Data transport**

delivery.

**4.3 Security**

**162**

hardware requirement.

modes are allowed:

reliability and QoS and data security will be analyzed.

simpler than HTTP, but even more complex than MQTT [9].

The following will demonstrate a comparison between the protocols presented (MQTT and CoAP), as implementation, data transport, communication standards,

Regarding the implementation, the MQTT protocol has a simpler specification in relation to CoAP, thus facilitating customer development. As already mentioned in the 3.2 section, CoAP clients act as HTTP clients but in binary mode, which is

The MQTT employs a connection oriented communication given by TCP and the CoAP uses UDP. The TCP protocol uses more data to exchange messages between the client and the server in relation to UDP, thus having a higher. Both the MQTT, like CoAP are designed for limited networks like 6LoWPAN (IPv6 over low-power personal area networks). According to [9], if TCP or UDP are not needed, an alternative is to choose the MQTT-SN over 6LoWPAN (IPv6 over low power personal area wireless networks) 4 or even ZigBee, avoiding the complexity of the complete TCP/IP stack. The CoAP It is also designed for limited networks such as 6LoWPAN, in order to maintain short message overload, thus limiting the need for fragmentation that causes significant reduction in the probability of packet

Regarding the message format, both MQTT and CoAP are suitable to be used in limited bands. Both have a binary message format, different from protocols like AMQP (Advanced Message Queuing Protocol), which uses uses XML formatted messages, in this case requiring the use of more interpreters complex, increasing the

One of the main problems to be solved when M2M protocols, is the issue of security [11]. The CoAP protocol is based on DTLS (Datagram Transport Layer Security), so it transfers security handling to the transport layer. Four security

• NoSec: no DTLS security mechanism is applied;

*Threats to the CoAP – RFC 7252 protocol.*


#### **Table 2.**

*Summary of the security modes of the MQTT and CoAP protocols.*

Accountability (Authentication, Authorization and Accountability). In the confidentiality field, the encryptions used by the protocol are described.
