## 3 Ferry Node Ranking Clustering Algorithm (FNRCA)  
Since data transmission can account for up to 70% of the power consumed by typical sensor nodes [28, 29, 30, 31], substantial energy can be saved by reducing the distance messages are transported over and the amount of data transmitted to the base station. The distance of the nodes from the base station and inter-node distances can have a high impact on nodes' energy consumption and thus in prolonging the network lifetime. Network lifetime can be defined either as the time for the first node to die, the time for the last node to die or the time for a certain percentage of nodes in the WSN to die [32]. Moreover, in dense deployments of sensor nodes in a WSN, nodes can cooperate to send data and therefore distribute the energy consumption between them.  
In this paper a proposed ferry-based node ranking clustering algorithm (FNRCA) is used to collect data from nodes. The difference between this algorithm and other algorithms is that this one uses a more efficient mechanism to select cluster heads (CHs). This is done by considering the nodes' distances and locations within the sensing field, current energy levels of nodes and by calculating the number of rounds that each node can be a cluster head for, to maximize the network lifetime and decrease excessive communication overheads used for electing new cluster heads. In this algorithm, nodes are ranked based on their current energy level (En) and their positions (Dn) with reference to the predetermined checkpoints on the mobile ferry's trajectory. This ranking is used for choosing cluster heads which are also ranked into levels based on their position, the Euclidean distance from the ferry's checkpoints. Therefore, each node is assigned a rank Rn (En, Dn) reflecting its candidacy for it being elected as a cluster head.  
In our algorithm, once the ferry reaches a checkpoint, it broadcasts a notification message to all nodes in its communication range informing them of its presence at the respective checkpoint they are associated with. Nodes within each cluster will then start sending to their associate cluster heads any sensed data to be carried to the base station. The ferry stopping time at each checkpoint is determined by the number of attached cluster heads to that particular checkpoint as will be shown later. Using this strategy, cluster-heads will not have to worry about the speed or the direction of the ferry and energy wasted in doing this will be preserved. The algorithm also is provided with efficient energy management strategy where cluster heads are only waking up when the ferry sends them a notification message to inform them of its presence. The idea of using the ferry to collect data further preserved energy by reducing multi hopping which consumes energy. To optimize the ferry's path, a weight was assigned to each checkpoint to be able to choose the best sequence, the order of checkpoints to be visited and the needed stopping time at each one. This eliminates the loss of messages due to any wrong prediction of the position of the ferry or its movement. Our algorithm uses three phases as shown below in Figure 1.  
The proposed algorithm is shown to be energy efficient because it aims to minimize the energy consumed in the network to collect and transfer data to the BS using a mobile ferry. In the next subsection we introduce the proposed algorithm in more details.