## 2 Background and Related Works
### Related Works
The MQTT broker is responsible for the client's registration and key management. The transmitted messages are encrypted and decrypted using the Advanced Encryption Standard (AES) algorithm. The results showed that there is an improvement in the packet deliverance ratio (PDR) and energy utilization compared to TLS. However, the paper did not present a security analysis or performance evaluation (such as computation costs, communication overhead,and storage requirements) of the proposed system. In addition, the proposed protocol did not consider broker bridging, where brokers can communicate with each other to deliver messages between MQTT clients. The paper in [15] presented a lightweight security solution using elliptic curve cryptography (ECC) for the publish-subscribe protocol based on fog computing. The fog broker contains three modules: (1) The key management module is responsible for providing public parameters and generating secret keys. (2) The subscription module is used for authentication and authorization. (3) The publication module is responsible for encrypting sent data and transmitting them to subscribers. The scheme provides a shorter key length, reduces overhead, and improves scalability compared to RSA. However, the paper did not present a broker bridging mechanism, and the scheme was not implemented in an MQTT architecture with multiple brokers. In addition, one of the disadvantages of the scheme is that key management and key revocation issues were not addressed [16]. Thus, implementing the scheme in a large-scale MQTT network with brokers' communication is a complicated process. The study in [17] proposed a lightweight authentication and authorization framework for inter-device communication in a distributed environment using ECC with Transport Layer Security (TLS). The system utilized the MQTT protocol for broadcast-based data transmission. The cloud architecture has a combination of servers, such as the cloud authentication server (CAS), policy enforcement server (PES), network function virtualization, and broker server. The result showed that there is a high computation cost for encryption and decryption; moreover, the increased number of devices will increase the time of the authentication process [18]. There are also studies that proposed a distributed architecture for MQTT without focusing on security solutions. The authors of [19] modified the traditional MQTT protocol by presenting a software-defined multi-tier edge computing model. The system contains three layers. The first layer and the third layer are the sensing network (sensors and actuators) and data center (cloud), respectively. The second layer is the fog computing layer, which is divided into four tiers: brokers, critical nodes, edge nodes, and intermediate nodes. The system is designed with two types of brokers: remote brokers, which are located in the fog node, and main brokers, which are located in the cloud. The results showed that adopting the fog layer significantly improved the processing and transmission latency. In [20], the author proposed MQTT with a multicast mechanism, DM-MQTT (direct multicast-MQTT), to minimize data transfer delays and network congestion for the massive IoT communications in distributed edge networks. The mechanism relies on the following components: the software-defined networking (SDN) controller and master broker (in the cloud level), SDN switches, a slave broker and analysis server (in the edge level), and IoT devices. The slave broker collects the data of IoT devices and edge information and sends them to the master broker. The master broker collects all edge information from all slave brokers and sends them to the SDN controller. The SDN controller analyzes the edge information, creates a group table, and uses the table to set paths between different edge networks. This architecture does not apply any security solutions, such as authentication and authorization, which is one of the drawbacks.