## 5 Discussion  
In this section we will analyse the results shown in Section 4.2 and then we will extract the conclusions derived from them and about our proposal. Data from Table 2 show the possible delays introduced by the proposal once the access control layer is added to the MQTT protocol. Following these results, we can conclude that the processing time of the authorization module represents a very small part of the total communication time (only 0.23 ms). To keep these processing times close to this value, it is possible to apply the solutions which are being used in Internet-based access control schemes. In those scenarios, it has been proven that the federated access control systems allow the replication of authorization servers, which limit the workload of each one of them, while maintaining response times between acceptable values. The proposed solution adds the validation of the access control permissions in each action. This time is measured in \(T_{P\_{Intros}}\). In a cloud environment such as the one deployed for these tests, the obtained values are only around the 15% of the total. \begin{table}
\begin{tabular}{l c c} \hline \hline
**Experiment** & **Mean** & **Standard Deviation** \\ \hline REST request & 33.16 & 5.71 \\ MQTT request & 19.70 & 1.01 \\ MQTT request with auth. & 30.46 & 1.75 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Results in energy consumption measurement (millijoules). REST: Representational State Transfer. This value can be limited in cloud environments by using the correct configurations to reduce the latency between the services that compose the system (placing the services in cluster of the same geographic zone, enabling priority routes, etc.). Additionally, using the obtained results, shown in Table 4, we can conclude the following:  
* **Validation of the communications system**: With the same number of messages and the same conditions, using a message-based communication system, energy consumption is lower than for a REST-based system. This is due to the simplicity of the MQTT protocol and the lower amount of redundant information sent when compared with the HTTP. * **Energy consumption overhead measurements**: From the MQTT client perspective, the actions performed to communicate with and without an access control system are the same (only needing to add the credentials to the headers of the message). As shown in lines 4 and 5 of Table 3, the current measurements for MQTT with and without authorization are very close. From these values and the results shown in Table 2, it is possible to obtain the difference in consumption between sending messages with and without authorization (as shown in Table 4). This consumption overhead is bound to the extra time needed for the Introspection request (\(T_{P\_Intros}\)). This consumption can be reduced if the device is put into an idle state when it is not preforming any activity (for instance, between sending and receiving messages, when there is no sensor monitoring, etc.). This is shown in the second and third line of Table 4, where the average of the values is almost the same. The goal of this paper is to present a unified authorization system for an IoT environment. To achieve this, we have proposed modelling the key elements that compose a message exchange protocol such as MQTT (i.e., the message queues, called topics) as resources. An authorization system based on a OAuth 2.0 profile such as UMA can be used to protect these \"resources\" as it protects Internet-based services. Analysing the results obtained in Section 4.2, and combining them with the delay introduced by the proposal and energy consumption measurements shown in Tables 2 and 4, we can assure the viability of the proposed solution. We can also conclude that in a conventional IoT environment using a cloud-based deployment, the overhead produced by the authorization schema is acceptable when compared with the advantages of using this approach.