# EBR: Routing Protocol to Detect Blackhole Attacks in Mobile Ad Hoc Networks
## 3 Proposed Protocol
### EBR Routes Properties
This protocol is developed through using the AOMDV as the reactive protocol paired with our TR algorithm to detect the blackhole nodes. The performance metrics used in the simulation experiments are as follows [45; 46; 47]. ### Performance Metrics

Here, we compare the performance of the EBR protocol with AODV, AOMDV, and SUPERMAN. The performance metrics include the average energy consumption, end-to-end delay, frame delivery ratio and throughput. In addition, we simulated multiple network scenarios with and without blackhole attack. This enabled us to study the performance and effect of blackhole attacks on the other routing protocols. End-to-end delay: This metric is defined as the average time taken for data packets transmission across the network from source to destination. This is calculated as:

\[\text{End}-\text{to}-\text{end delay}=\frac{\sum_{i=0}^{n}\text{Ri }-\text{Si}}{l} \tag{1}\]

In this equation, \(l\) stands for the number of successfully received packets; Ri represents the current time the destination node received the \(i\)th packet; and Si stands for the current time the source node sent the \(i\)th packet. Energy consumption: This metric is used to indicate the variations of energy consumed in the nodes. \[\text{Energy Consumption}=\sum\text{int}_{i}-\text{ene}_{i} \tag{2}\]

In this equation, \(\text{int}_{i}\) is the initial energy of the node \(i\), and \(\text{ene}_{i}\) is its energy at the end of the simulation. Packet delivery ratio (PDR): Represents the percentage of the successfully received frames to the number of frames sent. \[\text{PDR}=\frac{\text{number of packets received}}{\text{number of packets sents}}\times 100 \tag{3}\]

Throughput: This is defined as the rate of the successful data transmission through the network. \[\text{Throughput}=\frac{\text{number of bytes Received}*8}{\text{Simulation Time}}\times 1 0^{6} \tag{4}\]

Routing overhead ratio: This stands for the number of routing packets needed to be sent out during the route discovery and route maintenance processes. Routing and data packets must mostly utilize the same link bandwidth. As a result, routing data is countedas overhead. Routing overhead influences negatively the bandwidth effective use and energy consumption of the network nodes. The formula for routing overhead is as follows:

\[\text{Routing overhead }(\%)=\frac{R_{p}}{R_{p}+D_{p}}\times 100 \tag{5}\]

In this equation, \(\text{R}_{\text{p}}\) and \(\text{D}_{\text{p}}\) stand for the number of routing packets and the number of data packets, respectively. ### Simulation Evaluation

In Table 1, we show the assumptions of the simulation parameters. The simulation area considered is 500 m \(\times\) 500 m, as we are using MANETs. Our implementation was carried out using the NS2.35. TTL has the value \(n=2\), unless otherwise stated directly. In Figure 2a, with increasing the number of nodes, routes will have more nodes that data packets should go through. Therefore, the processing and queuing times will enlarge, particularly when routes have congested traffic. EBR outperforms other protocols, and it has the smallest time delay. In this test, the TR algorithm is not used, as there is no malicious node in the network. On the other hand, EBR selects the route with the minimum RTT. Therefore, EBR can decide the path that has the least traffic, avoiding congested routes. In Figure 2b, the number of nodes increases, the number of blackhole nodes in the network increases, and this is because their percentage is 10%, as shown in Table 1. EBR \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt}} \hline \hline
**Parameters** & **Values** \\ \hline Number of Nodes & 100 \\ \hline Mobility Speed & 10 m/s \\ \hline Mobility & Random Way point Model \\ \hline Propagation model & Free space propagation model \\ \hline Area & 500 m \(\times\) 500 m \\ \hline Blackhole nodes & 10\% \\ \hline MAC Type & 802.11 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Simulation parameters.