## 3 The Architecture of the Proposed E-BIOSARP
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Related Work** & **Attacks Covered** & **Shortcomings/Limitations** \\ \hline \multirow{4}{*}{SERP [32]} & \multirow{4}{*}{Heavy flooding attacks} & The shared secret key is pre-stored. \\  & & The secret key is preloaded and is not self-maintained by the system in \\  & & real time. \\  & & The source node ID is readable. \\  & & The system is vulnerable to brute-force search and eavesdropping attacks. \\ \hline \multirow{4}{*}{SRTLD [26]} & Selective forwarding attacks & The parameter weights for routing optimization must be re-evaluated \\  & & FILLO flood attacks & according to location. \\  & & Sybil attacks & Every sensor node in the WSN is programmed with a static location. \\  & & Wormhole attacks & The sink node is assumed to be a trusted base station. \\ \hline \multirow{4}{*}{ESPA [29]} & \multirow{4}{*}{Brute-force search attacks} & The main commands are generated from a centralized location. \\  & & Dental of service attacks & Massive traffic overhead consumes an enormous amount of energy over the network. \\ \hline \multirow{4}{*}{BIOSARP [23, 27]} & Sybil attacks & The network collapses when and where key information is not shared. \\  & & Selective forwarding attacks & Not tested for unknown attacks. \\  & & Replayed or altered routing & Needs to be tested on a real experimental WSN test bed including \\  & & information attacks & all attacks. \\  & & Acknowledgment spoofing attacks & \\  & HELLO flood attacks & & \\ \hline \multirow{4}{*}{DCHM [38]} & Jamming attacks & The need for a trust system and feedback from the base station to the \\  & & cluster heads generates enormous data packet overhead. \\ \cline{1-1}  & & Falsification of local values & Assumes that the base station is a trusted computing platform. \\ \cline{1-1}  & & Falsification of fusion & The cluster key is unique for every cluster, increasing complexity. \\ \cline{1-1}  & & Has not been compared with any state-of-the-art security algorithm. \\ \hline \multirow{2}{*}{DWGRP [18]} & \multirow{2}{*}{Wormhole attacks} & Beacon packets are broadcasted with unencrypted information. \\ \cline{1-1}  & & Nodes rebroadcast at an interval of 0.3 s. \\ \cline{1-1}  & & Very costly because the nodes require a GPS. \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison of recent routing protocols for WSN security. arrive from the application layer, then the E-BIOSARP routing mechanism sends a request to the Mathematical Encryption Function for encryption. The mathematical function reads the packet details and acquires the values of _Pkt_ID_, _D_ID_ and _S_ID_D_ID_ and _S_ID_ are encrypted by the mathematical function based on \(k\) and _Pkt_ID_. The encrypted packet, with hidden _D_ID_ and _S_ID_ values, is sent to the MAC layer, as shown in Figure 2, for the frame to be forwarded to the optimal neighboring node. The encryption of all data in a packet is avoided because this process would consume an enormous amount of energy and because the information is split into a number of data packets (because the packet size in a WSN is very small). Moreover, because of the encoding of the packet sequence ID, source ID and destination ID, the data packets become fully secure because they cannot be processed by adversaries and thus are unrecognizable to them. When a data packet is received from the MAC layer, the BIOSARP routing mechanism sends a request to the mathematical function for decryption, as shown in Figure 2. In the decryption process, the algorithm decrypts the destination ID (_D_ID_) and source ID (_S_ID_). Because every self-node in the network contains a random generator function, each node can generate the same random key based on the values of _Pkt_ID_ and \(k\) to decrypt the header fields of the packet. The decryption function performs authentication by evaluating the output.