## 3 Basic Concepts  
In the proposed method, a metaheuristic dragonfly algorithm (DA) [40] has been used to improve the routing process in IoT. Recently, metaheuristic algorithms can effectively solve many complex problems, especially routing in IoT because they have important features such as self-organization, parallel operation, distributed operation, flexibility, and stability. Various research studies show that metaheuristic-based routing techniques have advantages compared to classical routing approaches. The main advantage is their ability to perform a relatively large search. In these methods, the solutions obtained at each iteration of the search process are modified to obtain the optimal solution. Moreover, to produce the optimal response, these routing methods usually provide good exploration and exploitation capabilities. Accordingly, metaheuristic routing methods operate in a distributed manner and without any central control. This means that if any part of this system fails for some reason, this does not damage the whole system and provides good stability. In the following, the dragonfly algorithm (DA) is briefly illustrated because CTSRD uses this algorithm to build the routing tree (DA-Tree) between CHs. The purpose of choosing DA is its ability to reach the global optimum, acceptable convergence speed, and high accuracy. Furthermore, DA can effectively balance global and local search processes. Table 2 briefly evaluates DA and other metaheuristic algorithms. The DA algorithm is rooted in the behavior of dragonflies in nature. In 2016, it was introduced by [PERSON]. Dragonflies move in static and dynamic swarms, and this behavior is simulated in DA. When dragonflies are organized into small groups and move to various regions in the search area, this organization is called a static swarm. The exploration phase is formed by modeling this static swarm in nature. In contrast, when a dynamic swarm is created, dragonflies are organized in larger groups and move in a certain direction in the search area. The exploitation phase can be defined by simulating the dynamic swarm of dragonflies in \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Technique** & \
\begin{tabular}{c} **Security** \\ **Mechanism** \\ \end{tabular} &
\begin{tabular}{c} **Energy** \\ **Efficiency** \\ \end{tabular} & **Strengths** & **Weaknesses** \\ \hline EHTARA [36] & ✓ & ✓ & Improving energy consumption, managing the data transmission process between nodes, presenting a trust-based data transmission process & Not providing an accurate and certain security analysis, not determining how to deal with network attacks \\ \hline SMTrust [37] & ✓ & \(\times\) & High data transmission rate and reliability, improving throughput, designing security mechanism for detecting black hole and rank attacks & Flat network model, low scalability, low communication overhead, high latency \\ \hline GAN-C [38] & ✓ & \(\times\) & Timely attack detection, decreasing latency, and packet loss & High time complexity and computational complexity, high routing overhead, low scalability \\ \hline TBSEER [39] & ✓ & ✓ & Decreasing energy consumption, improving network security, designing a robust trust mechanism, ability to identify various attacks, low latency and packet loss, high scalability \\ \hline CTSRD & ✓ & \(\checkmark\) & Presenting a robust and energy-efficient routing technique, evenly distributing the consumed energy between the network nodes, enhancing energy consumption, and network lifetime \\ \hline \hline \end{tabular}
\end{table} 
Table 1: _Cont._nature. Artificial dragonflies refresh their position with regard to the step vector \((\Delta x)\) and the position vector \((x)\) in each iteration. \(\Delta x\) is calculated based on Equation (1):  
\[\Delta X_{t+1}=\omega\Delta X_{t}+(sS_{i}+aA_{i}+cC_{i}+fF_{i}+eE_{i}) \tag{1}\]  
where \(i\) indicates the index of the dragonfly. \(s\) represents a weight coefficient for the separation value (\(S_{i}\)). \(a\) expresses the weight factor of the alignment parameter (\(A_{i}\)).