## 4 Mobility Model of the MS
### Optimization Method
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Values** \\ \hline
**Simulation Time** & 200 s \\
**Number of Nodes in topology** & 30, 60, 90, 120 (Random) \\
**Average Number of Clusters** & 5, 10, 15, 20 \\
**Mobile Node** & Sink (MS) \\
**Speed** & 5, 10, 15, 20, 25 m/s \\
**Radio Range** & 50 m \\
**Protocol** & CLR-MSP, BMAC-H \\
**Packet Delivery Rate** & 5 Pck/s (default) \\
**Node Energy** & 18,720 J \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Simulation parameters. Figure 8: Packets Reception Rate VS the velocity of the MS in m/s. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & \multicolumn{5}{c}{**The Velocity of the MS in m/s.**} \\ \hline
**Protocol** & 5 & 10 & 15 & 20 & 25 \\
**CLR-MSPH** & 98.46\% & 97.35\% & 98.05\% & 92.17\% & 97.46\% \\
**BMAC-H** & 87.83\% & 98.21\% & 94.40\% & 88.61\% & 91.69\% \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Simulation results in terms of packets reception rate with varying the speed of the MS.

Figure 9: Handover packets in each protocol with varying the speed of MS.

#### 6.1.2 Latency (End-to-End Delay)

Usually, the latency in mobile wireless sensor networks refers to the time necessary for sending a data packet through the network from a source node which is a sensor node to the final destination which is the MS. The latency in cluster-based wireless sensor networks with mobile sinks used in Omnet++/Castalia is calculated from the time \(T_{s}\) when a packet is received from a CM at CH and stored in the CH's buffer or some cases, the CH generates packets in its application layer, in this case, \(T_{s}\) will be the time when the CH stores its own data in the buffer, to the time \(T_{r}\) when the packet is received at MS. The latency of a packet \(L_{pi}\) in Omnet++/Castalia is calculated as follows using Equation (16):

\[L_{pi}=T_{ri}-T_{si} \tag{16}\]

The average latency \(L\) of all packets received by the mobile sink is calculated by Equation (17):

\[L=\frac{1}{N_{p}}\sum_{i=1}^{N_{p}}L_{pi} \tag{17}\]

where \(N_{p}\) is the number of received packets. Table 4 shows the end-to-end delay of packets received at the MS with varying its velocity using both CLR-MSPH protocols. We notice that there is a slight difference in the latency between CLR-MSPH and BMAC-H. The latency of packets using CLR-MSPH is slightly higher than the latency of packets using BMAC-H. This slight difference is due to the number of hops used for routing the data in CLR-MSPH compared to BMAC-H, i.e., the increase of the number of hops increases the latency of packets. In case of MS's speed is 5m/s the CLR-MSPH has a latency less than BMAC-H because CLR-MSPH did not perform the handover process and the CHs sent data directly to the MS, i.e., the speed of MS is enough to send all the data packets in one single hop from CH (Table 4). #### 6.1.3 Energy

In wireless sensor networks the energy is considered one of the most critical constraints. The hierarchical architecture of the network is widely used as a solution to save energy and organize the network, especially in large-scale networks. Figure 10 illustrates the energy consumed using the handover mechanisms of both CLR-MSPH and BMAC-H when the speed of the MS is varied. The energy consumed by BMAC-H is slightly more than the energy consumed by CLR-MSPH in all cases, while the speed of the MS is varying (Figure 10). \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & \multicolumn{5}{c}{**The Velocity of the MS in m/s.**} \\ \hline
**Protocol** & 5 & 10 & 15 & 20 & 25 \\
**CLR-MSPH** & 77.36 s & 35.33 s & 30.96 s & 29.49 s & 21.97 s \\
**BMAC-H** & 82.43 s & 35.62 s & 29.19 s & 25.38 s & 20.02 s \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The latency of packets received at the MS with varying the speed.