## 5 Testbed and Simulation Results
### Simulation Setup  
To show that our proposed protocol is also scalable we used simulation tools for 5 node scenario and for a very large scenario consisting of 30 nodes. The source code of the simulation is written in TCL language and runs the simulation example on ns-2.35 Linux Ubuntu version 12. For 5 node setup, we use standard AOMDV in first period from 0 to 900 in second one from 900 to 2000 we use the modified version of AOMDV. An AWK script was built to calculate the average of Throughput and End to End Delay on node 0 and node 1 before and after node 1 affected by raining. The highest priority data stream will grant to cbr1 coming from node 1 because it affected by rain and it has important data that should be send to the destination node 2. Rerouting cbr0 coming from node 0 traffic through node 4 which has data with low priority. In this way we reduce forwarding load on node 1 that means the throughput and end to end delay will be better on cbr1 after node 1 affected by rain. The Simulation Scenario Environment is shown in Table 3.  
For the complex scenario consisting of 30 nodes, we calculate that 5 out of 30 nodes were affected by rain and measure the performance and the energy consumption. There are 30 wireless nodes from node 0 to node 29 distributed with fixed location across the grid as shown in Figure 7. We will have two constant bit rates (cbr) streams one from node 0 and one from node 1 the destination for both streams will be node 29 (GW) we will call them cbr0 and cbr1 respectively. According to AOMDV protocol cbr0 traffic will go through the path node 0 -> node 1 -> \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline  & **N0** & & & **N1** & & & **N2** & \\ \hline
**Dest No.** & **Nxt Hop** & **Hop cnt** & **Dest No.** & **Nxt hop** & **Hop cnt** & **Dest No** & **Nxt Hop** & **Hop cnt** \\ \hline
3 & 3 & 1 & 3 & 3 & 1 & 3 & 3 & 1 \\ GW & GW & 1 & GW & GW & 1 & 1 & 1 & 1 \\
2 & 2 & 1 & 0 & 0 & 1 & GW & 1 & 2 \\ \multicolumn{2}{c}{**N3**} & \multicolumn{2}{c}{**GW**} & & & & \\ \hline
**Dest No.** & **Nxt Hop** & **Hop cnt** & **Dest No.** & **Nxt Hop** & **Hop cnt** & & \\ \hline
1 & 1 & 1 & 0 & 0 & 1 & & \\
0 & 0 & 1 & 2 & 1 & 2 & & \\ GW & 1 & 2 & 3 & 1 & 2 & & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Routing table after rain being detected at node 0. \begin{table}
\begin{tabular}{c c c} \hline \hline
**S\#** & **Parameter Variables** & **Five Nodes Associated Values** & **30 Nodes Associated Values** \\ \hline
1 & Simulation Tool & Ubuntu 12 + NS 2.35 & Ubuntu 12 + NS 2.35 \\
2 & Propagation & TwoRayGround & TwoRayGround \\
3 & MAC Type & Mac/802\_11 & Mac/802\_11 \\
4 & Interface Queue & Queue/DropTail/PriQueue & Queue/DropTail/PriQueue \\
5 & Physical Wireless Data speed or & 11 Mbps & 11 Mbps \\ Bandwidth Rate & Antenna/OmniAntenna & Antenna/OmniAntenna \\
6 & Packet Queue Size & 50 & 50 \\
8 & Total Number of nodes & 5 & 30 \\
9 & Base Protocol & AOMDV & AOMDV \\
10 & Optimization Algorithm & Rain Optimization & Rain Optimization \\
11 & X dimension of Topography & 797 & \\
12 & Y dimension of Topography & 595 & 595 \\
13 & Simulation Time & 2000 & 2500 \\
14 & No of rain affected Nodes & 1 & 5 \\
15 & Packet size & 1000 & 1000 \\
16 & CBR Bandwidth rate & 0.05 Mbps & 0.05 Mbps, 0.1 Mbps and 0.5 Mbps \\
17 & traffic generation starts at & 100.0 ms & 100.0 ms \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Simulation Scenario Environment. node 2 -> node 13 -> node 4 -> node 15 -> node 6 -> node 17 -> node 18 then node 29, and cbr1 traffic will go through the same path. The five nodes which are affected by rain are 1, 12, 16, 21, 25. This means that node 0 or 1 will use secondary paths when any node in the primary path is affected by RAIN. Simulation time is 2500 ms, we set up the constant bit rate (cbr) with variable rate values depending on rain level. For example, when it is raining lightly, the (cbr) rate will be 0.05 Mbps, when rain becomes heavier, the (cbr) rate changed to 0.1 Mbps and, finally, when flood occurs, the (cbr) rate changes to 0.5 Mbps.