## 5 Intelligent Opportunistic Protocol (IOP)
For i = 1 to n and k = i, ArrProb[Ri]\(\leftarrow\)P\({}_{k}\)/To find the node with maximum probability. 6. Select the first node of the array ArrProb[0] as the node with maximum value Pmax i.e., Pmax\(\leftarrow\)-ArrProb[0]
7. Go through the rest of the elements of the array, i.e., from the 2 nd element to the last (n - 1) element, for i = 1 to n - 1. 8. For i = 1 to n - 1, if any value in the array ArrProb[i] is found to be greater than the current value Pmax. i.e., if ArrProb[i] > Pmax then, Pmax\(\leftarrow\) ArrProb[i]
9. When the end of the array is reached, then the current value of the Pmax is the greatest value in the array, Pmax\(\leftarrow\)-ArrProb[i]. 10. The node Ri with Pmax value is selected as a relay node from the forwarder list, as the node with the highest probability. The node with the next highest probability acts as a relay node in case the first selected relay node fails to broadcast. 11. Broadcast transmission of the data packet as [Ri, coordinates, data]
12. Destination node D is reached, if Yes, go to step 15. Else, apply Algorithm 1 on Ri S\(\leftarrow\)-Ri and go to step 2. 13. END Output: A potential forwarder node is selected from the list of forwarder nodes. ```

**Algorithm 2**Forwarder_Node_Selection (S = Source, D = Destination)

In the same manner, we can compute \(P(R3|S)\) by multiplying \(P(R3_{PRR}|S)*P(R3_{RE}|S)*P(R3_{D}|S)\), i.e.,

\[P(R1_{RE}|S)=\frac{P(S|R1_{RE})*P(R1_{RE})}{P(S)}\]0 \[P(R1_{RE}|S)=\frac{P(S|R1_{RE})*P(R1_{RE})}{P(S)}\]1 (20) \[P(R1_{RE}|S)=\frac{P(S|R1_{RE})*P(R1_{RE})}{P(S)}\]2

Again, putting the values in the above Equations (19)-(21) from the table given below, we can compute:

\[P(R1_{RE}|S)=\frac{P(S|R1_{RE})*P(R1_{RE})}{P(S)}\]3

\[P(R1_{RE}|S)=\frac{P(S|R1_{RE})*P(R1_{RE})}{P(S)}\]4

\[P(R1_{RE}|S)=\frac{P(S|R1_{RE})*P(R1_{RE})}{P(S)}\]5

Therefore,

\[P(R1_{RE}|S)=\frac{P(S|R1_{RE})*P(R1_{RE})}{P(S)}\]6

Finally using the proposed method of relay node selection using naive [PERSON]'s algorithm, we could compute probability \(P(R1,R2,R3|S)\), using Equation (26). \[P(R1_{RE}|S)=\frac{P(S|R1_{RE})*P(R1_{RE})}{P(S)}\]7

Thus, node R2 would be selected as the relay node in the forwarder list of R1, R2, and R3 for source node S. Similarly, the process was followed again for the neighbors of S, which consequently would check the neighbors of R1, R2, and R3. The Tables 5-7 describe the features of neighboring nodes of R1, R2, and R3, respectively. After the execution of Phase I and Phase II on the above said example, the final route was intelligently selected for the onward transmission of the data packet from source node S to destination node D, using the naive [PERSON]'s algorithm shown in \[P(R1_{RE}|S)=\frac{P(S|R1_{RE})*P(R1_{RE})}{P(S)}\]8

Figure 3 gives the details about the route selected using the IOP. The source node S broadcasts the data packet among its neighboring nodes, using Algorithm 1 to create a forwarders list. The node R1, R2, and R3 in the figure, were selected as the nodes in the forwarders list. These were the potential nodes that would be used for the selection of a potential forwarder node. Here, R2 was selected as the potential node using Algorithm 2. The same procedure was adopted again and until the data reached its final destination. The final route was selected intelligently using IOP is S\(\rightarrow\)R2\(\rightarrow\)R5\(\rightarrow\)D.

## 6 Simulation and Results

With the end goal of examination and comparison of the proposed OR protocol, the simulation was performed in MATLAB. The simulation used the environment provided by the MATLAB to simulate the computer networks and other networks. MATLAB provides a good scenario to design a network of sensor nodes and also to define a sensor node and its characteristics. The simulation results were compared with the results of the EEOR [25] and the MDOR [26] protocols. Table 8 below shows the parameter setting of the network. ### Deployment of Sensor Nodes

The motes are haphazardly deployed in \(500\times 500\) m field.