# Energy-Aware Next-Generation Mobile Routing Chains with Fog Computing for Emerging Applications
## 3 Proposed Load-Balanced and Energy-Efficient Mobile Routing Protocol
### Proposed Algorithm  
In this section, we explained the working of the proposed algorithm. The detail is comprised of two main phases. In the first phase, transmission power is explored to achieve clustering with optimal data forwarding methods. The links are identified in a more reliable way to attain long-run communication paths. The second phase offers the trustworthiness routes with the supervision of the sink node and reduces the level of threats from malicious devices. 3.3.1. Routing Chains and Resources Allocation (RCRA)  
This section presents a detailed explanation of the routing process with the usage of network resources in an efficient manner. The source node \(s(i)\) records the entries of the neighbors that fall in their transmission radius \(R\), as defined in Equation (1). \[s(i)=D(n,\ i)\ \leq R \tag{1}\]  
where \(n\) is the neighbor. However, if none of any node is identified in the transmission range of the source node, then the source node increases its transmission power \(tr_{p}\) gradually \(\underline{\epsilon}\). However, transmission power cannot be increased more than a certain threshold \(T\), as defined in Equation (2). \[tr_{p}(i)=tr_{p}(i)+\underline{\epsilon} \tag{2}\]  
where \(tr_{p}(i)\leq T\)  
Once the neighbor nodes are identified, they are grouped in a similar cluster. Afterward, each cluster has a specific identity \(CLUS\_ID\) assigned. Each node also records its \(CLUS\_ID\) into the local table. Within clusters, the node \(i\) whose distance \(d\) is closest to the centroid \(c\), highest residual energy \(e\), and minimum rotation speed \(RS\) is declared as a cluster head \(CH_{i}\). All such computations are performed in a weighted manner and probability must be highest, as defined in Equation (3). \[CH_{i}=1/(d,\ c)+e+1/RS \tag{3}\]  
Nodes notify their status when they are elected to serve as cluster heads, and all receiving nodes record the information in their local tables. In the proposed algorithm, since nodes are mobile, re-selection is performed in either one of the conditions i.e., if the energy of the \(CH_{i}\) is dropped down to a certain threshold or \(CH_{i}\) is moved far away from the centroid of the cluster. In this situation, nodes again announce the re-election process and the new node is selected for the role of cluster head. In addition, for data forwarding to the sink node, each cluster head forms a chain with its nearest and most reliable cluster head. The chain is refined each time when data need to be transferred from the origin cluster. Each routing chain \(RC_{i}\) is established based on the distances among cluster heads and link analysis \(LA\) parameters, as defined in Equation (4). \[RC_{i}=D\big{(}CH_{i},\ CH_{j}\big{)},\ LA(i,\ j) \tag{4}\]  
To compute the \(LA\), the proposed algorithm utilizes the delay time \(DT\) for transmitting packets \(TP\) as defined in Equation (5). \[LA(i,\ j)=DT\ \ll\ TP \tag{5}\]  
Figure 1: Various stages of the proposed protocol. \(DT\) is directly proportional to the number of packets transmitted over the link \((i,\ j)\). When the number of packets increases on the link \((i,\ j)\), it indicates a high degree of traffic, such a link is marked as congested and avoids include in the routing chains. The flowchart of the proposed algorithm, in terms of fog-based routing, is shown in Figure 2. First, the nodes are organized into regions based on the adjustable transmission radius with individual identification. Each region is responsible for exploring its cluster head and sending the information to the fog nodes. The proposed algorithm offers a multi-hop model for data forwarding thus it lowers energy consumption when data are transmitted over a longer distance. In data forwarding, link analysis is also employed, in addition to the least distance between cluster heads. For link analysis, the number of sent packets on the specific link is used to compute the delay time. The proposed algorithm initiates the process of data transmission after finding a trustworthy link.