## 2 Problem and Motivation  
The major challenge in cluster-based wireless sensor networks with MS is finding suitable relay nodes to route data from CH to the MS when the latter leaves the radio range of the CH, especially in such hierarchical architecture of network and characteristics of nodes. The moment when the MS is about to leave the radio range of the CH, the CH activates the handover process to find an attachment or relay node to forward data for the sake of continuous communication and delivering of data. In the literature, research works consider the handover process in the classical wireless sensor network, and there are a few works that take into consideration the handover mechanism in hierarchical wireless sensor networks such as cluster-based wireless sensor networks. The problem in cluster-based wireless sensor networks consists of the nature and characteristics of nodes in the network where only CHs are allowed to send data to the MS. CMs are only allowed to send and route data to their CH, so it is a matter of organizing the data transfer policy in order to avoid the congestion of the network. In order to process the handover mechanism, a CM might be selected as a relay node to route data to the MS, which requires an update of the data transfer policy of this node.  
As we are interested mainly in the problem of transferring data from CHs to the MS directly or using some relay nodes, we do not focus much on sending data from CMs to CHs. In this work, we base on the clustering protocol LEACH [17] for the phase of forming clusters, selecting CHs and route data from CMs to CHs where we are interested in the packets exchanged in the cluster-forming phase, such as the advertisement packet and the joint packet which are sent by the CH and CMs, respectively. The LEACH protocol is based on a random rotation mechanism to select cluster heads in order to distribute the energy consumption of the network. However, for the sake of objectivity of our work and simplicity, we study the impact of handover mechanism on clusters in one rotation round of cluster heads in terms of energy consumption, data collection, and latency which is the scope of our work. We also assume that the MS knows the network topology and CHs positions in order to optimize the trajectory of data collection.  
In addition, we assume that the MS informs CHs by its next destination using the allow sending packet. The allow sending packet is sent by the MS to the CH to make the CH start sending data stored in the buffer. The CH uses the information of the next destination to estimate the relay node in order to active the handover process in the case of the communication between it and the MS ends up without sending all the stored data.  
The CH detects that the MS approaches to leave the communication area of CH by measuring the RSSI value of the ACK message. The CH sends data packets to the MS, and the latter sends back ACK message to confirm the reception of data packets. Each ACK message received by the CH, has an RSSI value. CH compares this value to the threshold (we set the RSSI threshold to -90 dBm). If the RSSI of the received ACK is less or equal to the RSSI threshold, CH knows that the MS is leaving, and it starts the handover mechanism.  
Figure 1 shows the studied problem of the handover mechanism in cluster-based wireless sensor networks and illustrates the main idea of the proposed protocol CLR-MSPH. When the MS leaves the radio range of CH without receiving all data from CH. CH selects relay nodes (RN) to activate the handover process in order to route data to the MS.