# A Failure Risk-Aware Multi-Hop Routing Protocol in LPWANs Using Deep Q-Network
## 5 Detailed Description of the Proposed Protocol  
In this section, FFDR is introduced in detail with the overall flowchart illustrated in Figure 2.  
To deliver an event-related data packet to the GW, data-holding EN (DEN) in FFDR first checks whether the GW is within its one-hop communication range. If direct transmission is feasible, the data packet is forwarded directly. Otherwise, DEN triggers the relay selection process, which consists of two phases: candidate router selection and optimal relay decision-making. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Scale** & **Numerical Rating** & **Reciprocal** \\ \hline Equally importance & 1 & 1 \\ Slight importance & 2 & 1/2 \\ Moderate importance & 3 & 1/3 \\ Moderate to strong importance & 4 & 1/4 \\ Strong importance & 5 & 1/5 \\ Strong to very strong importance & 6 & 1/6 \\ Very strong importance & 7 & 1/7 \\ Very strong to extreme importance & 8 & 1/8 \\ Extreme importance & 9 & 1/9 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: 1–9 scale. \begin{table}
\begin{tabular}{c c c c c c c c c c c} \hline \hline \(k\) & **1** & **2** & **3** & **4** & **5** & **6** & **7** & **8** & **9** & **10** \\ \hline RI & 0 & 0 & 0.58 & 0.9 & 1.12 & 1.24 & 1.32 & 1.41 & 1.45 & 1.49 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Random consistency index. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & \(E_{n}\) & \(N_{n}\) & \(LQ\) \\ \hline \(E_{n}\) & 1 & 2 & 3 \\ \(N_{n}\) & 1/2 & 1 & 2 \\ \(LQ\) & 1/3 & 1/2 & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Pairwise comparison matrix for three criteria in RFRV. Given the need for real-time topology awareness in dynamic networks, FFDR utilizes the Sensor Protocol for Information via Negotiation (SPIN) [28] to manage neighbor discovery and state updates, with its message sequence detailed in Figure 3. The specific workflow is outlined as follows:  
Figure 3: Diagram of SPIN-based message interaction flow. Figure 2: Overall flowchart of FFDR. DEN initiates the relay selection process by broadcasting an Advertisement (ADV) message with transmission power regulated by the Power Regulation Mechanism (PRM). This mechanism dynamically adjusts EN activation ranges based on the average neighbor signal SNR to enhance energy efficiency. Neighboring ENs that receive the ADV message parse its metadata to extract information such as the DEN-to-GW distance. To prevent redundant participation, a pre-selection mechanism is employed to restrict relay requests from ENs that receive the ADV message. Each EN autonomously determines whether to apply for packet forwarding based on its residual energy and distance to the GW. Eligibility criteria for the application are as follows:  
1. The distance from the EN to the GW must be shorter than the DEN-to-GW distance recorded in the ADV metadata, thereby preventing data backhaul. 2. The residual energy of the EN must exceed a predefined threshold \(e_{th}\), which is derived from the energy cost of receiving and forwarding a data packet at the minimum transmission power level. This criterion prevents resource wastage caused by ENs with insufficient energy applying for relay tasks. Neighboring ENs that fail either condition discard the ADV packet, and qualified ENs respond with a Request (REQ) message containing self-reported metrics (i.e., residual energy and distance to the GW). These responding ENs form the candidate set of next-hop routers. If the DEN receives no REQ packet within the designated reception window, it rebroadcasts the ADV packet at its maximum power level to activate more potential relays. If this second broadcast also fails to elicit any response, the transmission is deemed a failure due to the unavailability of suitable relays. Conversely, when REQ responses are received, the DEN executes a DQN-based routing decision mechanism, as detailed in Section 5.2, to determine the optimal relay from candidates. Following this selection, the DEN forwards the data packet to the chosen relay.