###### Abstract
Water management, irrigation management systems, soil monitoring, climate management, precision agriculture, and waste management are the most important sections that can be improved by IoT in smart agriculture [13; 14]. See Figure 1.  
Due to the extension of IoT networks around the world and the heterogeneity of IoT devices, routing and secure data transfer through IoT sensors are very important in IoT-based smart agriculture. Usually, IoT sensors have constraints on resources, computing power, and memory [15; 16; 17]. As a result, each secure routing method must be lightweight and efficient [18; 19; 20]. The research studies show that many researchers have separately researched and studied communication security and energy efficiency in IoT networks but energy-efficient secure methods have received less attention because security and energy efficiency have an inverse relationship with each other [21; 22]. Robust security mechanisms consume a lot of energy. However, most IoT nodes suffer from limited resources, especially energy. For this reason, the design of an energy-efficient secure routing approach is a serious challenge in IoT [23; 24; 25]. To achieve both security and energy efficiency in the data transmission process, researchers must focus on energy-efficient secure routing schemes and  
Figure 1: Smart agriculture based on IoT. design lightweight security mechanisms for Internet of Things so that they are compatible with the specific characteristics of these networks [26; 27; 28]. In this paper, a cluster-tree-based energy-efficient secure routing protocol using the dragonfly algorithm (CISRD) is proposed for IoT networks. The goal of this approach is to enhance security and achieve energy efficiency simultaneously. CISRD is a hierarchical routing algorithm, which includes two operations: secure clustering (T-Clustering) and a dragonfly algorithm-based routing tree (DA-Tree). Furthermore, the trust mechanism presented in this paper can be a suitable defense mechanism against black hole attacks. In the following, the contributions of this paper are briefly introduced:  
* CTSRD provides a distributed and lightweight trust mechanism called weighted trust (W-Trust). This mechanism evaluates the trust value of IoT nodes in accordance with interactions between them and other nodes. If W-Trust detects the abnormal behavior of an IoT node, it quickly reduces the direct trust value related to this node based on a penalty factor to avoid its hostile activities in the network. On the other hand, if W-Trust detects the normal behavior of a node, it improves the trust level of this node based on a reward factor to increase the participation probability of this node in the routing process. * CTSRD introduces a trust-based clustering method called T-Clustering. In this clustering process, cluster head nodes (CHs) are selected from honest nodes. Note that clustering reduces communication overhead and energy consumption, improves the packet delivery rate (PDR), and lowers delay in the data transfer process. In CTSRD, nodes that are closer to the cluster center and have a higher energy and neighbor degree, and are closer to the sink node, and increase their chance of becoming the cluster head. * CTSRD forms a routing tree based on the dragonfly algorithm (DA-Tree) between the cluster head nodes. The DA-Tree provides a fitness function for evaluating the routing tree. The parameters used in the fitness function include the number of hops to the base station, remaining energy, intra-cluster traffic, and the trust value. This algorithm finds an optimal, stable, and secure routing tree, and consequently makes a balanced energy distribution in the network. * Finally, CTSRD is compared with EMSR and E-BEENISH in terms of network lifetime, energy consumption, and packet delivery ratio. This comparison shows that CTSRD evenly distributes the consumed energy in IoT and prolongs the network lifetime. However, it has a slightly lower PDR than EEMSR.