# A Reliable Publish-Subscribe Mechanism for Internet of Things-Enabled Smart Greenhouses
## 2 Related Approaches  
The establishment of the messaging protocol in a smart greenhouse application is contingent upon the unique circumstances of the system, including factors such as connection speed, limited bandwidth, and device capabilities. Selecting a protocol that is both efficient and scalable is imperative in achieving the objectives of the smart greenhouse system while ensuring that the necessary functionality is delivered. The work of reference [26] explored a comprehensive academic investigation of IoT messaging protocols from the standpoint of information transmission for each message and evaluated their performance in a research environment. The findings discussed in the study indicate that MQTT represents the appropriate protocol for data extraction, citing its efficiency, scalability, and reliability. In comparison, CoAP, while excelling in transmission time due to its UDP-based protocol, lacks the reliability characteristic of MQTT, which is crucial for applications requiring assured message delivery. In 2020, reference [16] describes the significance of IoT messaging protocols in smart farming along with the challenges involved in determining the appropriate protocol for a particular application. The research paper subsequently provides an overview of various IoT communications protocols, including MQTT, CoAP, XMPP, etc., and examines their efficacy based on major factors such as latency, energy and bandwidth specifications, throughput, reliability, and security. According to the author's analysis, MQTT represents one of the majority of widespread and trustworthy protocols for smart farming programs owing to its accessibility, dependability, and industry-wide usage, whereas CoAP and XMPP technologies exhibit certain drawbacks, including an enormous network packet loss rate (PLR), message loss, and excessive latency. Therefore, this study aims to develop a new methodology within the MQTT protocol to enable the supervision and surveillance of an advanced greenhouse. The study executed by [27] presents an approach to employ a key exchange technique as a lightweight and reliable authentication mechanism between an interface and a smart device. This investigation incorporates the MQTT communication protocol to execute the  
Figure 1: MQTT protocol publish–subscribe message communication between sensors and the IoT-based greenhouse environment. monitoring and control functionalities. Nevertheless, the implementation of the platform using traditional MQTT protocol has specific constraints, such as categorizing each device as a distinct node, which increases the cost and complicates the architecture. When dealing with big data, it is advisable to avoid limiting the exploration to just three separate subjects for categorizing the given data. As a response, a revised MQTT protocol structure suggest to better cater to the specific requirements of greenhouse settings, optimizing both performance and management overhead. The present work examines the efficacy of five distributed MQTT brokers utilizing the recommended BORDER framework architecture, as described in [28]. Additionally, significant metrics such as latency, throughput, and scalability are investigated during the testing and analysis phase of pub-sub mechanisms in this study. Nonetheless, it is worth noting that data transmission between the brokers can result in greater overhead compared with employing a single broker. When numerous clients of the same broker are interested in the same resource, each client develops a distinct connection with the broker supplying the resource. Consequently, this may culminate in insufficient network capacity utilization [29]. Subsequently, we present a novel architecture with a singular broker that not only eliminates complexity but also improves scalability and reliability. Similarly, Ref. [30] concentrates on an improved MQTT technology for edge processing with a double broker in the fog and cloud, including an analytical framework for calculating performance indicators of the proposed architecture.