## 5 The Proposed Protocol
### PDFH and SDFH Selection Utilizing the MPA
#### 5.2.2 The Iterative Phase  
The DFFF will be used in this phase to determine which DFH is chosen. We also comprehend that the DFFF is essential to tracking down and identifying the prey (target node) in the MPA process. This subsection introduces the DFFF's parameters before being followed by a powerful DFFF. * DFFF parameters definitions The MPA's process of choosing the best DFH depends substantially on the definition of the relevant DFFF. To achieve this, we have incorporated \(D_{CDFH_{i}\to Sink}\), a shorter distance to the sink node, less \(AvgDis_{CDFH_{i}\to DFGMs}\), more RE levels, a smaller ASBO, and a smaller number of PDFH rotations into the proposed DFFF. The purpose of the DFFF is to prolong the network's lifetime and reduce energy consumption. This subsection provides a comprehensive description of the DFFF parameters: (1) The ratio of CDFH\({}_{i}\)'s initial energy (\(E_{0}\)) to its current RE (\(RE_{CDFH_{i}}\)) \(Inv(RE_{CDFH_{i}}\)): This metric represents the amount of energy left in the DFGMs after they have been in operation. When choosing a DFH, this is the most important parameter to take into account. Due to its collection, aggregation, and transmission of DFGMs data to the sink node, DFH uses a disproportionate amount of energy as compared to other SNs. The DFFF Parameter (\(DFFF_{1}\)) is a representation of this parameter, and it should be minimized. Also, as a result of the normalizing procedure, its value falls between 0 and 1, as shown in Equation (22). This parameter guarantees that a CDFH\({}_{i}\) with more RE is selected to be a DFH. (22) Distance of the CDFH\({}_{i}\) to the sink node (\(D_{CDFH_{i}\to Sink}\)): This parameter is symbolized by \(DFFF_{2}\) and it needs to be reduced to shorten the transmission's overall distance. Equation (21) illustrates how the normalization process triggers its value to be from 0 to 1. \[DFFF_{2}=D_{CDFH_{i}\to Sink},\qquad 0<DFFF_{2}<1.\] (23) Using Euclidean distance, \(DFFF_{2}\) determines which DFGM is most suited to become a DFH depending on how close CDFH\({}_{j}\) is to the sink node. Equation (24) is used to compute \(D_{CDFH_{i}\to Sink}\). (24) Average distance between DFGMs (\(AvgDis_{CDFH_{i}\to DFGMs}\)): This parameter is the measure of how centered a CDFH\({}_{j}\) is in relation to all of its neighbors (DFGMs). This is an essential first step towards reducing intra-DFG communication costs. DFGMs use less energy to transfer data to DFHs if DFHs have lower \(AvgDis_{CDFH_{i}\to DFGMs}\) values. Therefore, \(AvgDis_{CDFH_{i}\to DFGMs}\) is denoted by \(DFFF_{3}\). Moreover, this function should be minimized. Additionally, the distance between CDFH\({}_{j}\) and its neighbor CDFH\({}_{j}\) is determined using Euclidean distance, as demonstrated in Equation (25). \[DFFFF_{3}=AvgDis_{CDFH_{i}\to DFGMs}=\frac{1}{Nc-1}\sum\limits_{j=1,j\
eq i}^{Nc} \left(D_{CDFH_{j}\to CDFH_{i}}\right)\text{, }0<DFFFF_{3}<1. \tag{25}\]  
\[D_{CDFH_{j}\to CDFH_{i}}=\sqrt{\left(CDFH_{j}-CDFH_{ij}\right)^{2}+\left(CDFH_{ j}-CDFH_{ix}\right)^{2}}. \tag{26}\]  
(4) \(X_{\text{CDFH}_{i}}\): This parameter refers to the ratio of the number of times (either rounds or batches) that the current CDFH\({}_{j}\) played the DFH role to the average number of times (either rounds or batches) that all DFGMs have become DFHs (i.e., assigned the DFH role). Therefore, \(X_{CDFH_{i}}\), which also known as \(DFFP_{4}\) can be expressed as follows:  
\[DFFP_{4}= X_{CDFH_{i}}= DFHR_{CDFH_{i}}\Bigg{/}\left(\frac{\sum\limits_{k=1}^{N_{c}}DFHR_{ CDFH_{k}}}{N_{c}}\right)\text{, }0<DFFP_{4}<1. \tag{27}\]  
where \(DFR_{CDFH_{k}}\) refers to the number of times (either rounds or batches) that a CDFH \(k\) is assigned the DFH role. (5) Average scale for buildings occlusions (\(ASBO_{CDFH_{i}}\)): ASBO refers to an estimation that represents the extent to which buildings obstruct visibility or line-of-sight in a given area. This scale can be used to assess factors like sunlight exposure, view obstruction, and even the impact on wireless signal propagation.