## 2 Related Work
### Academic Solutions
#### 2.2.3 Protocol Compatibility Approaches  
In order to create uniform, scalable and easily configurable systems, different researchers have addressed the compatibility issues associated with the diversity of protocols, technologies and standards that exist in the field of home automation. The solutions presented usually propose universal and open standards. Some of them use a configuration system based on the eXtensible Markup Language (XML) format that can be easily exchanged among standards [72]. Other researchers [73] suggest the use of the Universal Plug and Play (UPnP) open standard as a communications protocol for devices on a local network, since it offers technology independence and increases scalability. The most relevant initiative for adding plug-and-play capabilities to intelligent devices based on transducers (i.e., on sensors and actuators) is the ISO/IEC/IEEE 21451 standard (previously known as IEEE 1451). The standard is highly-flexible and generic, which implies a certain degree of complexity that makes it difficult to implement in the resource-constrained devices usually found in home automation installations. For such a reason, some authors proposed modified and simpler versions aimed explicitly at home automation applications [74]. Besides standards, messaging protocols have arisen as a way for connecting heterogeneous IoT nodes. Such protocols are really useful in applications where different components are designed and implemented independently using diverse programming languages or hardware platforms, but they  
Figure 2: Generic fog computing architecture. have to be able to communicate, collaborate in tasks, and share data among them. Traditionally, this kind of communication was performed by exchanging files, sharing a common database or by using calls to remote procedures (i.e., creating Remote Procedure Call (RPC) based systems), but, in the last few years, it finally was derived in what is called a messaging system or Message-Oriented Middleware (MOM). A messaging system centralizes communications in order to minimize the coupling between the components of a distributed system. This decoupling and the use of asynchronous communications allow for carrying out more robust communications: the components to be communicated do not have to be working at the same time, so they delegate the delivery of the data to a messaging system, what enables them to stay focused on the information to be sent instead of on how to send it. A messaging system is also in charge of establishing and managing the connection points and channels created among the different clients. It is usually implemented as a software process called a \"messaging server\" or \"messaging broker\". Most messaging brokers can cooperate to provide advanced features like load balancing, fault tolerance, or sophisticated routing systems, which are really useful in IoT applications. Messaging systems transmit data over channels that connect a transmitter and a receiver virtually. There are basically two channel models: the peer-to-peer queue model and the publish/subscribe model. The peer-to-peer queue model is currently the most used. It allows a transmitter to send a message to a queue where it will be read by a particular receiver. Note that, although the transmitter sends the message to a queue, it does not indicate who the receiver is: it only specifies the name of the queue where the data are shared. Any receiver that knows the name of the queue can connect to it and collect the message, which will be removed from the queue. Thus, the model does not guarantee that a specific receiver will always collect the data, but it does guarantee that, if someone connects to the queue and collects the message, it will only be collected once and by a single receiver. In the publish/subscribe model, messages are transmitted to one or more recipients who have previously expressed interest in them. When the transmitter publishes a message on the channel, it sends a copy to each of the output channels.