**2.1 M2M architecture**

production systems with distributed units, composed of a conglomerate of autonomous units, which operate in cooperation in an integrated manner. Such units can

be industrial automation machines, manipulating robots, mobile robots or

Distributed production systems, often composed of robot machines, are designed with the objective of providing efficiency and rationality in the use of distributed production resources, in order to favor the manufacture of products, in a dynamic and fast way. The production units must be able to respond, in an intelligent and effective manner, to unforeseen disturbances in the external environment, maintaining controlled and continuous production [3]. Considering the need to plan and control systems for these units, complete robotization of productive systems, which in turn need means or protocols of interaction and coordination

Therefore, the justification for proposing this chapter is to deepen the studies on

This chapter is divided as follows. In Section 2, the Machine-to-Machine (M2M) is presented, with its levels explained. In Section 3, protocols MQTT and CoAP are presented, identifying their main characteristics and limitations. A comparison between the protocols (MQTT and CoAP) will be demonstrated in the Section 4. Section 5 is shown some studies that used MQTT protocol, along with Robot Operating System (ROS) in the context of Insdustry 4.0, in addition to presenting the

According to [4] the term M2M Communications, it is the machine to machine communication, which enables the transmission of data across different devices

This communication opens up an immense range of applications that can, among other things, register, process and manipulate the data generated and transmitted by the objects that are interconnected. For example, an application that continuously receives data from a sensor that measures the temperature of an environment and, based on the data obtained, can generate statistics that describe the sensor readings over a period of time and then send an alert via e-mail or Short Message Service (SMS) to one or more individuals if the temperature has reached very high levels, or even publish this information to another device that could use it

M2M applications have the potential to become a trend in the development of software in the coming years in view of the various sectors (such as industrial and home automation) that need an automated solution that integrates the devices that are part of their environment. Devices that are part of an M2M network have the ability to at least collect data from a given environment and transmit it to an application through a connection. Eventually, these devices will not be able to transmit this data directly to other equipment, it is necessary to use a gateway to be

Thus, the M2M can be defined as a number of technologies that aims to establish

communication between devices with the ability to transmit information for a

particular application without the interference of a human action.

the interaction protocols for existing multi-robot systems and to design a new protocol that can be applied to concepts related to Industry 4.0, taking into account the characteristics of self- organization of robotics structure based on the concept of

microprocessed remote units.

*Robotics Software Design and Engineering*

between them.

industrial agents.

conclusions of the chapter.

**2. Machine-to-machine communications**

without the need for human intervention.

in another way, among other things.

an intermediary for this transmission.

**156**

According to [4], the M2M architecture (**Figure 1**) is divided into three domains, Devices, gateway and Network. The components of these domains are described as follows:

• In the domain of devices:

M2M device: A device that runs one or more M2M applications using M2M service capabilities. The M2M device connect to network domain in the following for two manners, by Direct Connectivity (M2Mdevices connect to the network domain via the access network) and Gateway as a Network Proxy (The M2M device connects to the network domain via an M2M gateway);

• M2M Gateway: object that runs M2M applications, using M2M services and acting as a proxy between M2M devices and the network domain;

Core network: Its main function is to ensure the functioning of the network with connectivity via IP and other means of connectivity, as well as control functions of network services, interconnection and roaming;

Access network allows M2M devices and gateways to communicate with the core network. According to [5], examples of M2M include technologies such as IEEE 802.15.1, Bluetooth, personal area network, among others, or local networks such as power line communication with PLC and Wireless M-BUS;

• M2M area Network:

M2M Network Area: provides the connection between devices and gateways;

Provide M2M functions that are shared by different applications;

M2M applications: run the service logic;

Network Management: brings together all the functions necessary to manage the network core and the access network;

M2M management roles: Consist of the roles needed to manage service capabilities within the network domain;

In **Figure 2** a simplified version of the M2M architecture is presented, where important elements of the architecture are shown, in addition to defining the application domain.

*publish/subscribe* architecture (**Figure 3**), which has a small transport overhead (fixed byte header of 2 bytes), making MQTT an interesting solution for unreliable networks with limited resources, such as bandwidth and high latency [4]. This protocol is based on a broker (**Figure 4**) using the message pattern *publish/ subscribe*, while the server broker acts as a intermediary for messages sent from a device that publishes to subscribing customers, providing a distribution of one-to-

For a client to send a message, it needs to publish it in a topic (called a MQTT broker) (**Figure 4**). If another client wants to receive the content of this message, he will have to subscribe to this same topic. A client can publish or subscribe to multiple topics at the same time, and there may be situations where the publication or subscription on a topic is disputed between different clients, thus having a

The PDU (Protocol Data Unit) of the MQTT protocol is encapsulated by the TCP (Transmission Control Protocol) protocol, that is, the MQTT header and data are sent in the TCP data area [8]. In this way, the MQTT protocol messages have a fixed header (**Figure 5**) composed of two bytes, where the first byte contains the field that identifies the type of message, such as also the markers (DUP, QoS level and RETAIN). There is a version of MQTT, called MQTT-SN (MQTT Sensor Network), where PDU is encapsulated by the UDP protocol, which, in turn, is encapsulated by

the IP or the 6LowPAN protocol. One of the main differences between two standards, in addition to the network layer they focus on, is the simplification of

many messages decoupled from the use case of the application.

*Interaction Protocols for Multi-Robot Systems in Industry 4.0*

*DOI: http://dx.doi.org/10.5772/intechopen.97481*

system that is asynchronous [7].

**Figure 3.**

**Figure 4.**

**159**

*Broker Publisher/subscriber messaging template.*

*Publisher/subscriber messaging template.*
