Performance comparison of communication protocol algorithms in WSN based agriculture: PlanTech case study

. Wireless sensor networks (WSN) have become increasingly important in agriculture in recent years because they provide critical tools for better decision-making (knowledge -collection- storage-analysis-dissemination of data). These technologies provide resources for making informed decisions and implementing control measures on time. They are also essential tools for understanding the effects of climate change on agriculture, such as shrinking arable land and providing solutions to mitigate the negative consequences of these phenomena. In this paper, we propose a model based on WSN for the supervision of agricultural data. We investigate the impact of deterministic, random, and selective CH routing protocols on the network's lifetime, residual energy, and exchanged information quantity. The deterministic CH protocol showed significant results in terms of the number of functional nodes and the energy consumption in the network. Thus, the selective CH protocol outperformed both protocols regarding the quantity of exchanged data in the network.


Introduction
With the world's population rapidly increasing, as well as the negative effects of climate change and other unforeseen circumstances on agricultural sustainability and farmers' ability to produce enough food to feed a population expected to reach 9 billion by 2050, agricultural sustainability and farmers' ability to produce enough to feed the world's population are under threat. Farmers must have an efficient monitoring and early warning system in place to meet this challenge, as well as real-time access to all the knowledge about their farms.
One of the main concerns of major farmers is their ability to track and identify early environmental and physical factors [1] that impede production and crop yield, allowing them to take the appropriate preventive measures to mitigate the negative impact of climate and other factors on agricultural processes. Without the use of WSN along with other technologies to help monitor factors that are not visible to the naked eye, farmers cannot monitor and detect these phenomena on very large farms in order to take timely actions [2]. Therefore, precision agriculture research has gained popularity in the scientific community as a result of its relevance and the potential for using technology, WSN and IoT to enhance processes.
WSNs are composed of a large number of wirelessly networked sensors that must function in a potentially hostile environment for an extended period of time without human interference. After initial deployment, several WSN application scenarios include batterypowered nodes remaining active for an extended period of time without external human control. Moreover, the network nodes are typically used in harsh environments where a person's ability to replace the battery is limited. The collection of data on physical phenomena, as well as the encoding, sending, and receiving of information, account for the majority of energy consumption. In the absence of energy-saving methods, a node's battery will be depleted in a matter of days. As a result of this need, researchers have turned to developing protocols that minimize the consumption of energy. The most difficult aspect of WSN design is figuring out how to save node energy while also preserving desirable network behaviour. WSNs will only complete their missions while they are still alive. As a result, maximizing network lifetime is the target of any energy-efficient technique. Hence, the lifetime of every single node has a significant impact on this. The selection of routing strategies is critical for WSNs. All routing protocols have the same goals [3], such as network survivability, availability and service; increasing sensor network lifetime [4]; reducing complexity; controlling energy consumption efficiently; minimizing mission-critical information transmission delays; and improving WSN efficiency.
Because the WSN has several energy-constrained sensors, it is beneficial to divide the sensors into clusters to reduce energy dissipation and increase the network's lifetime. Every cluster has a cluster head (CH) , which can change on a regular basis. The phase of the group forming is clustering [5]. Simply put, the CH can take data from a sensor node and combine it with other data to create aggregated data [6]. After this, CH passes it on to the base station. The combination of data reduces the amount of data sent to the base station. This reduces the amount of energy used and the amount of bandwidth available [7]. As a result, clustering is a viable strategy for reducing energy consumption and thus extending the network lifetime [8].
This paper investigates the influence of routing protocols on the network lifetime, residual energy, and exchanged information quantity. The presented work is a part of the PlanTech project that aims to address the issue of agricultural pests invading and excessive pesticide use resulting in disease [9]. Plant diseases can be detected early, allowing for the use of fewer pesticides, the production of more natural products, and the protection of harvests from damage.PlanTech's global architecture is comprised of four layers: (1) Hybrid Wireless Sensor Network, which consists of multimedia nodes (MNodes) and ground nodes (GNodes) embedded in the crop; these nodes communicate wirelessly and transmit data to the gateway.
(2) The Internet layer, which includes the gateway that connects the WSN layer to cloud computing services. (3) At the cloud computing layer, all data from Gnode and Mnode is processed to arrive at a final decision, identifying issues and possible solutions. Displaying this information and providing sound advice to farmers via a graphical user interface entails four components: (4) the visualization layer, as illustrated in Fig.1. This paper's reminder is structured as follows. Related works are presented in Section II. We introduce the WSN architecture, the network nodes, the energetic model, and the used LEACH network protocols in the section III. The performances of LEACH protocols are evaluated and discussed in section IV. Section V concludes the overall paper.

Related work
Because of their low cost, ease of deployment, and costeffective environment, WSN technologies have been used in a variety of fields in recent years [10], [11]. In a WSN, wherein a large number of sensor nodes are strewn across the area, observing the data that is needed. All data is collected and forwarded to the base station (BS) for a post analysis using a single or multi-hop data transmission paradigm. Agriculture is now a critical component of any country's development and economic growth. As a result, new technologies like IoT-based WSN can be used in agriculture to save time and effort while increasing agricultural throughput in a quality manner [12]. Different types of sensors are used in agriculture land to determine soil, weather, moisture, and temperature conditions. Many researchers in the agricultural domain have used WSN to increase efficiency and reduce farmer burden [13], [14]. However, memory, encoding, transmission, and energy capacity are all restricted in the deployed sensors. Furthermore, because of the unreliable, unregulated, and free-space communication basis of WSN-based applications, data security is another major research challenge.
Many researchers have proposed different clustering schemes in WSN with the aim of extending network lifetime and ensuring effective data transmission. WSN is divided into different regions in such systems, with each region having one cluster head tasked with gathering and forwarding sensory data to the base station (BS). In addition, to extend the network's lifespan, the majority of the sensor nodes went into sleep mode. For example, Authors in [15] gave a brief overview of the routing problems and design issues in WSNs. This paper also included a comparison of different routing protocols, as well as the most energyeffective protocol (LEACH) and improved versions of it. Paper [16] looked into the different hierarchical routing protocols derived from LEACH. The issues and drawbacks of LEACH were discussed in this paper, as well as a comparison of the features and performance issues of all hierarchical protocols. I-LEACH in [17] extends the network lifetime by 59 percent over the DBS solution and by 29 percent over the LEACH-C protocol. As a result, I-LEACH uses 55 percent less energy than DSB and 27 percent less energy than the LEACH-C algorithm. In addition, the I-LEACH method increased the amount of data packets forwarded to the BS by 56 percent compared to LEACH, 21 percent compared to LEACH-C and 46 percent compared to DSB.
Several surveys [18]- [22] have been conducted on LEACH protocol and its variants for WSN. The authors of [18] looked at how LEACH, Multi-hop LEACH, MLEACH, and solar-aware LEACH protocols improved energy efficiency and throughput. The authors of [19] include a summary of several LEACH-related protocols. The paper uses a table to compare and contrast a small number of LEACH and its descendants, listing the advantages, disadvantages, CH-selection requirements, and protocol assumptions for each. There are three types of LEACH-based protocols [20]: updated CH-selection algorithms, energy-aware algorithms, and optimization in CH-selection. The paper's scope of discussion is limited to CH-selection and the parameters of energy efficiency. The authors of [21] provided an alphabetical survey of the successors to the LEACH protocol. The survey focused on a few main characteristics, such as clustering, data aggregation, mobility, and scalability. In [22], authors examined various forms of hierarchical routing protocols based on LEACH. Paper [23] presents a security analysis of SLEACH, SecLEACH, SC-LEACH, Armor LEACH and MS-LEACH that have been proposed to strengthen LEACH protocols.

Materials and Methods
Wireless Sensor Networks (WSNs) are emerging technologies that have been applied to a wide range of applications [9], [24][25][26][27]. Three critical components comprise a Wireless Sensor Network: the sensor node, the base station, and the managing node [28].

The sensor node:
A WSN's primary component is the sensor node. It is a smart sensor comprised of four modules: a sensing unit, a processing unit, a transceiver module, and a power module that supplies power to the three modules. The sensor unit (analog or digital) connects the physical world to the processor; the acquired data is processed by a dedicated processor (processing unit), such as a microcontroller, and wirelessly transmitted to neighbor nodes via a wireless communication chip, such as Bluetooth or nRF24l01+ [24]. The sensor unit selected is highly dependent on the application and type of monitoring. The processing unit chosen is critical for sensor node design because it controls the node's power consumption and network algorithm performance and contains the program memory required to implement large and complex programs. The wireless technology to be used is determined by the services offered, as well as the requirements of the network architecture and topology. Certain parameters, such as power, rate, scope, cost, security, and the number of incurred nodes, should be considered. A critical component of an autonomous WSN is the power unit. It is necessary for the WSN's survival.
There are numerous types of sensor nodes marketed by various manufacturers, including MicaZ [29], Tmote Sky [30], TelosB [31], and others; the majority of their nodes were designed at UC Berkeley, which is regarded as the most advanced wireless sensor network research center. Each node differs from the others in terms of memory, processing unit used, wireless transmission unit used, and power unit. Fig.2 presents the global architecture of a sensor node.

The base station:
It consists of data aggregation received from sensor nodes or cluster heads, depending on the network topology used by the WSN. The base station typically has several communication interfaces that allow interfacing between the sensor nodes and the managing node; if the data is sent to the managing node via the internet, the architecture is Internet of Things. When the base station computes data received from the network and takes a decision, it is called edge computing [32].

The managing node:
The managing node is the interface between the final user and the sensor network; it allows the display of received data and, if necessary, can issue commands. The managing node can take the form of a mobile application, a Web application, or a local application, incorporating simple or complex algorithms. The purpose of the next section is to model and simulate a WSN using the LEACH algorithm in order to determine which topology to implement in our real-time wireless sensor network. As mentioned previously, our sensor network consists of "GNode" nodes embedded in agricultural fields and "MNode" camera-equipped nodes. We're particularly taken by the work of "GNode" as presented in Fig.3.

The GNode
GNode is the used sensor node, was developed in the ENSAM-Rabat at the E2SN research laboratory, and it is equipped with sensors that provide five critical parameters for agricultural monitoring: crop temperature, soil humidity, ambient temperature, relative humidity, and lighting.  The wireless unit used is the nRF24l01 + module, which provides radio connectivity through a standard SPI interface. The same chip can act as a receiver and transmitter (transmitter), and it supports over a hundred channels while consuming very little electricity. nRF24l01 + chips modulate in GFSK on channels beginning at 2.4 GHz + RF_CH (RF_CH up to 126). This module implements a proprietary protocol known as "Enhanced ShockBurst" or ESB. A radio preamble, destination address, header, payload, and CRC are all included in ESB protocol frames. The payload may be fixed or variable in length; Table 3. shows an Enhanced ShockBrust packet format, and Table 4. present the nRF24l01+ chips details. The energy unit used where a known Lithium-Ion Polymer battery delivering 3.7 V and 3800 mAh.

Energetic model of sensor node
A simple energy model is used in this study, in which the transmitter dissipates energy to run the radio electronics that transmit and amplify the signals [31]. As shown in Fig.5, the receiver only dissipates energy for reception. The free space model is employed for relatively short distances. For longer distances, multi path fading model is considered [33]. To transmit a k-bit data packet over a separation d, the energy consumption is considering the Heilzman model [34]: The term denotes energy spent per-bit during transmission. The amplification energy per-bit, is given by: The parameters and _ _ denote amplification factors for free-space and two-ray model respectively. The value of 0 can be calculated as follows: To receive a k-bit data packet the receiver expends: It is important to note that, in order to make the CH model more realistic, an energy consumption parameter called EDA was added, which represents the energy consumed by the node for the information processing of the various sensor nodes.

CH based LEACH protocol routines
Cluster Head (CH) node aggregates the measurements from the sensor nodes that have made measurements. The aggregated data is then sent to the base node by the CH. To select a CH, three strategies were investigated: Deterministic CH: CH selection is done in turn. Each node is selected as a CH for a predetermined number of iterations. When the residual energy of a node falls below a certain threshold Emin (0.5J in our case), it is no longer selected during voting. Fig.6 illustrates the algorithm steps of the deterministic CH protocol. Random CH: CHs are selected randomly. Fig.7 illustrates the algorithm steps of the Random CH protocol. Fig. 7. Random CH algorithm details.

Selective CH:
The selection of a CH is based on a probability that is calculated using the residual energy of the nodes; the selected node remains a CH for a determinate number of measurements; CH voting is performed on nodes whose residual energy is above a selected threshold. Fig.8 illustrates the algorithm steps of the Selective CH protocol.

Results and discussion
In order to implement the optimal communication protocol in our PlanTech project, we evaluated the performances of the Deterministic CH, Random CH, and Selective CH algorithms. We defined the simulation parameters as illustrated in Table 5. Firstly, the base station sends agricultural data to the CH chosen according to the three algorithms' protocols. Secondly, the CH coordinates with sensors nodes to confirm CH assigned tasks -receiving / emitting data from sensor nodes (GNodes) or the base station. We defined three key performance indicators (KPIs) for selecting the optimal protocol: the number of functional nodes (dead node), the network's power (the sum of the nodes' residual energies), and the amount of information exchanged in the network.
The lifetime of the network GNodes determines the lifetime of the PlanTech Wireless Sensor Network; the graph below shows how nodes degrade over time as the number of iterations increases; the initial node count is twenty (the base station, the CH, and 18 GNodes). As shown in Fig.9, the "deterministic CH" algorithm is slightly more efficient in terms of node lifetime, with 11 nodes remaining functional after 100 iterations, compared to only 10 nodes remaining functional after 100 iterations for the selective CH algorithm and only 9 nodes remaining functional for the random CH algorithm. In terms of network power, the "deterministic CH" protocol outperforms the other two algorithms tested. Fig.10 shows that the residual energy of GNodes using deterministic CH protocol is higher after 100 iterations than random CH protocol, and the residual energy of GNodes using the CH selective protocol is the lowest one. In terms of the quantity of agricultural information exchanged in the PlanTech network, we find that the "selective CH" algorithm outperforms both the deterministic CH and the random CH algorithms as shown in Fig.11.   Fig. 11. Exchanged Quantity information in the network.

Conclusion
This paper investigates three LEACH protocols, CH selective, CH random, and CH deterministic, based on the number of functional GNodes, the sum of the GNodes' residual energies, and the amount of information exchanged in the PlanTech network, in order to determine which is the best in our real agricultural WSN environment. The simulation results demonstrate that the communication protocol, which is based on deterministic Cluster Head selection, outperforms other protocols in terms of minimizing dead GNodes and power consumption in the PlanTech network, which is consistent with our objective.