A novel method of mobility-based clustering protocol in software defined sensor network

The distributed clustering method is widely used to extend network lifetime in traditional wireless sensor networks. However, it is difficult to achieve the idea performance of the whole network, such as transmission rate, energy consumption, and control overhead, neglecting the global stability of the network. To tackle this problem, a centralized mobility-based clustering (CMBC) protocol is proposed in the software defined sensor network. The method of CMBC mainly consists of two aspects: first, CMBC clusters the nodes with the connection time between the mobile nodes (i.e., noncluster head nodes, non-CH) and the cluster head (CH) and establishes stable topological structures between the non-CHs and the CH; second, when emergencies occur, the centralization management control center sends the configuration files to replace the CH. Compared to the distributed network of MBC, WCRA and IMP-MECA protocol, the proposed method can be applied in scenarios with high-speed mobile nodes to improve the network performance in terms of transmission successful rate, average power consumption, and average control overhead.

of the proposed method. Amini et al. [15] proposed an improved MECA model (i.e., IMP-MECA) that sensor nodes are randomly distributed across a hexagon, where the hexagonal is divided into equal cluster based on the radius of hexagonal. Simulation experiments showed the improvement of the residual energy between sensor nodes reduces total energy consumption, thereby improving the lifetime of wireless sensor networks related to previous models. Rachana et al. [16] proposed a method of mobile sink with mobile agent mobility model for WSN to study the effects of mobility on various performance parameters of the network and to explore the effective techniques to handle mobility in network. Experimental results showed that the proposed method can effectively improve the lifetime of the network.
The traditional network topology mainly extends the lifetime of WSN with the distributed clustering method [1]. However, nodes are randomly deployed in the monitoring area of distributed network, the mobility of node causes the dynamic change of the topological structure of wireless mobile sensor network. It is difficult to ensure the global stability of the network. Inspired by the clustering method in large-scale WSN [17][18][19][20], to overcome the above shortcomings, we propose a centralized mobility-based clustering (CMBC) protocol in software defined sensor network (SDSN), which is a centralized wireless sensor network, which is described in Sect. 2.1. Compared to the distributed network of the MBC, WCRA and IMP-MECA protocol, our proposed method achieved the ideal performance in terms of transmission successful rate, average power consumption and average control overheads. CMBC can also be applied to high-speed mobile scenarios.
The contribution of this paper is mainly reflected in the following aspects: first, Considering the importance of clustering strategy in load balancing, a clustering protocol supporting node mobility is proposed in large-scale mobile wireless sensor network; second, to reduce the energy consumption in distributed mobile wireless senor network, we develop a mobility-based clustering protocol named as CMBC in centralized wireless sensor network, which is described as SDSN.
The remainder of this paper is organized as follows: Sect. 2 presents the methods used in this study and describes the CMBC protocol in detail. Section 3 shows the performance evaluation and the simulation results. Finally, we draw some conclusions.   Figure 2 shows the framework of the SDSN. Similar to software-defined network, SDSN can be divided into the infrastructure layer, control layer, and application layer from bottom to top. From Fig. 2, we can see clearly that the architecture of SDSN is essentially composed of a large number of software defined sensor nodes and centralized management control center (CMCC), of which the node structure is composed of sensor module and general programmable data transceiver unit, the CMCC configures uniformly the network control technologies such as network coverage, topology control and routing protocol, and distributes the corresponding configuration files to each node, which is to obtains the global optimal network performance. The main feature of this architecture is that each layer of the architecture can realize the reconfiguration of the sensor network according to the needs of users and the network state [1].

The framework of SDSN
After deploying the network, the CMCC configures the sensing range of each sensing node in real time, so that the monitoring area is sensed and fully covered by SDSN.

CMBC protocol description
Inspired by the mobility-based clustering (MBC) protocol, the CMBC protocol is proposed to increase the control overhead and the power consumption caused by the request information sent to join the new cluster and avoid changes in the topological structure of the wireless mobile sensor network caused by the mobility of nodes. When the topology is changed due to the mobility of nodes, the management center re-clusters the entire network according to the information of nodes and builds effective and stable transmitting links. Figure 3 depicts the sequence structure of the CMBC protocol [18], where p is the proportion of CH nodes in all nodes, 1 p is the number of nodes in a cluster, and τ is the length of a time slot. As shown in Fig. 3, similar to MBC protocol [18], the CMBC protocol is mainly divided into two stages. In the first stage, CMBC generates the cluster. To improve the success rate of the packet transmission, the non-cluster nodes (i.e., non-CH nodes) choose a node with strong stability as the CH. In the second stage, CMBC transmits the data with stable transmitting links, and each non-CH node spontaneously transmits data to the CH according to the time division multiple access (TDMA) time series table formed by the cluster. When the connection time is exhausted, the non-CH nodes request information to find a suitable new cluster to reduce the packet loss rate. This new cluster is determined by the fitness value of the corresponding CH. The fitness value shows the stability between the non-CHs and CH. When the connection time between the non-CHs and CH cannot guarantee the next round of data transmission, the CH deletes the information of the node from the TDMA schedule, sends it to the rest of the non-CHs, and reports it to the MCC. In contrast, the non-CHs request information to join the new cluster, and find a new CH. The TDMA schedule of the cluster is re-justed and sent to all the non-CHs when a CH accepts the non-CHs. In this process, we assume that the members in the cluster only interact with the CH without sending information to the MCC. This information is obtained by transmitting data among the CH. Figure 4a describes the process of node movement from an old cluster to a new cluster. This shows that Node 6 moves to Cluster J, whereas Node 9 moves away from Cluster J. Therefore, the TDMA schedule of Cluster J should also be modified accordingly, that is, Node 9 is deleted from the original TDMA schedule and is rearranged into a new TDMA schedule in ascending order of connection time ∆t (Fig. 4b). The strategy of converting Node 8 to the time slot of the original Node 9 can improve not only the transmission success rate but also the effective utilization of channel bandwidth. In the CMBC protocol, each node can predict the time of maintaining a stable connection between itself and the CH. Therefore, sending a request packet and a cluster member confirmation packet is unnecessary when sending data. This feature reduces the network control overhead and node energy. Algorithm 1 describes the execution process of non-CH nodes (i.e., common nodes presented in Fig. 4a). The pseudocode of the CMBC protocol is presented in Algorithm 1 and 2. After gathering in a cluster, non-CHs send the data to the CMCC through the CH and its neighboring CH. The information, location, and range of these nodes are reported. During an emergency event, such as a CH runs out of energy or the connection time with non-CHs fails to continue to act as the CH, the topological structure of the network is damaged, and the replacement request of CH is sent to the CMCC through its neighbor CHs. After receiving the request, the CMCC responds and reconfigures the network resources in time and distributes the configuration files of the replacement of CH to the corresponding data-transmitting units. If the CH can continue to work, then the configuration files are discarded. Otherwise, the CMBC protocol is restarted.

Protocol implementation
Similar to LEACH-Mobile [3] and MBC [18], CMBC consists of the two stages of cluster generation and data transmission. The first stage mainly forms a series of clusters and creates the corresponding TDMA sequences. The second stage focuses on transmitting data between the CHs and the CMCC.

Cluster generation
If a random number between (0,1) generated by a sensor node is less than the threshold value T (n) cls , then the node is a CH [18]. T (n) cls denotes the probability of being a CH and is determined by the correlation formula of the node residual energy and mobility. Each non-CH node joins the cluster where its CH can maintain the most stable connection. After determining the CH, non-CHs send their registration information to the CH. The CH receives the node as a member of the cluster and arranges a time slot for the node to transmit data and relevant information to the CMCC. The cluster generation largely consists of four sub-stages, namely, CH generation, non-CH invitation, non-CH determination, and TDMA schedule generation.

CH generation
Prior to describing the process of CH generation, we give the description of the CH. generation probability, which is described as follows [21]: where p is the ratio of the CH in the network. 1 p is the node number in the cluster. r is the round number generated by CH. G is the node set that have not been selected as the CH in the nearest round of r mod 1 p . Equation (1) clearly shows that each node may be selected as CH in the round of 1 p . Notably, when r = 0 , the probability of each node to be selected as CH is p . In each round of 1 p − 1 , such nodes that have served as CH cannot continue to be CH. After a round of 1 p − 1 , T (n) cls = 1 means that all the remaining nodes have acted as CH. In the beginning of a round of 1 p , the nodes in the network are selected as CH in the next round.
To prolong the network lifetime, the node with maximum residual energy is considered as the CH [3,18]. Moreover, some researchers have proposed the selection of the node with the least relative mobility as the CH [22,23]. To prevent low-energy nodes from becoming CH, the CMBC protocol integrates the mobility rate and residual energy of the current node to achieve the energy balance of nodes in the network. In the CMBC protocol, the probability threshold of nodes acting as CH can be expressed as [21,24]: where E n_curr denotes the residual energy of the current node. V n_curr means the mobility rate of the current node. E max represents the original energy of the nodes in the network. V max indicates the maximum mobility rate of nodes in the network. Equation (2) presents that the nodes with low mobility rate and high residual energy have a high probability of becoming a CH. T (n) cls is normalized with . Compared to high-speed movement, a CH should have lower speed, which can realize not only data transmission with CMCC but also a stable connection with cluster members. In the MBC protocol, CH has a fixed location relative to the base station. In the CMBC protocol, the position of CH can change along with time.

Non-CH invitation
When a node is selected as the CH, it broadcasts an invitation message to the neighbor nodes and reports it to the CMCC. This information includes the location, speed, and direction of the CH. The carrier sense multiple access/collision avoidance (CSMA/CA) MAC protocol is adopted to avoid collision during communication. To ensure that eligible nodes can receive messages, CH uses the maximum transmission power to broadcast the invitation information. At this stage, non-CHs must keep their receivers "ON" to receive the invitation information from CH.

Non-CH determination
Non-CHs may receive one or more invitation information from CH, and the selection of a suitable CH should be selected by non-CHs. Similar to MBC, the fitness of W ij , which is related to the connection time, residual energy of the CH, node degree of the CH, and transmission distance, is utilized to represent the correlation between a non-CH and the CH to which it is connected in this study. W ij is described as follows [21,24]: where i is the non-CH node. j is the CH node. E j_curr is the member number of the CH node j . d ij is the distance between the non-CH and CH. t ij is the link time between the non-CH and CH, t frame is the expected time to transmit a data frame. R tr is the maximum transmission distance.
Equation (3) shows that W ij is a linear combination of a , b , and c, whose value depends on the importance of each factor and is expressed as follows [21,24]: where a , b , c ∈ (0, 1).
E j_curr E max ×N j_curr denotes the average normalized energy to each member node provided by CH j . 1 − d ij R tr represents the nodes that have large fitness values near the CH and realize their normalization. N exp is the expected value of non-CH, which can be expressed as follows [21,24]: where N total denotes the total number of sensor nodes. L p represents the length of the packet. t frame , which can be expressed as follows [21,24]: where R b denotes the data bit ratio, and p refers to the probability of CH generation. Let τ = , Eq. (6) can be described as [21,24] Equation (3) shows that the first factor considers the load balance of CH nodes when being clustered. In addition, this factor attempts to ensure the balance of residual energy and members of each CH. The second factor guarantees a short distance between non-CH and CH. The last factor ensures sufficient connection times between non-CH and CH. The fitness value of each CH that sends invitation information to all the sensor nodes is calculated by Eq. (3), and those nodes with the maximum fitness value is determined as the CH. Furthermore, the nodes transmit registration information to the selected CH via the CSMA/CA MAC protocol. In the decision stage, the receivers of all CH must keep "ON. "

TDMA schedule generation
After receiving the registration information from the cluster members, the CH forms the TDMA schedule in ascending order with the expected connection time of each cluster member. Each cluster member will sends information to the CH according to the specified time slot in the data transmission stage. Assume that k is the frame number of data transmission, 0 ≤ k ≤ n . N i is the order of cluster member in the TDMA schedule. Node i begins transmitting data spontaneously from The cluster members are arranged to ensure successful data transmission between cluster members and CH, in ascending order of t ij in the stage of TDMA schedule generation, namely, k → max .

Data transmission
In the CMBC protocol, we assume that all nodes maintain their time synchronization and enter the clustering stage at the same time. All the non-CHs send the same data to some CH and transmit the data spontaneously according to the time slot allocated by the TDMA schedule. The CH transmits the data to the CMCC through its neighboring CH. To prolong network lifetime, we introduce the heuristic wake-up mechanism to save the energy of nodes [25].
First, each sensor node rouses itself before ending its time slot according to the TDMA schedule and returns to its sleep state entering their time slot. Second, each node adaptively adjusts its transmission power to transmit data according to the distance between itself and the CH, which can be calculated with the node information in the received data packet. Finally, the CH must keep the "ON" state to receive data and maintain the communication between the CH and the CMCC.
In the MBC protocol, each non-CH spontaneously transmits the data to the CH according to the TDMA schedule, and the CH integrates these data and transmits them to the base station under the multi-hop mode. Aparting from the above functions of two-way communication between the cluster members and the CH, the CMBC protocol have the following functions. First, it should transmit the integrated data to the CMCC in a multi-hop manner. Second, each CH transmits its location information, residual energy, and the frame connection time to the CMCC, which ensures that the CMCC can distribute the configuration files of replacing CH in the concentration mode.
Notably, in the actual environment, these incidents cause the failure of node hardware and the speed or direction of the change of mobile nodes suddenly, thereby leading to packet loss. To avoid the occurrence of similar situations, acknowledgments (ACKs) are added to the data transmission, which ensure that non-CHs can realize successful data transmission. Accordingly, after receiving the packets, the CH returns the ACKs to the non-CHs. When the non-CHs receive the ACK signal sent by the CH, it indicates that the packets have been successfully sent. Otherwise, the non-CHs broadcast a request signal to join a new cluster. The CH receiving the request will send the invitation information to non-CHs according to Sect. 2.3.1.
To ensure that the CH successfully transmits data, when CH sends data to the CMCC, the ACKs are also needed to be added. After receiving the data packets, the CMCC returns the ACKs to the CH. When the CH receives the ACK sent by the CMCC, it indicates that the data has been successfully sent to the CMCC. Otherwise, the CH will send a request of replacing the CH to the CMCC, which ensures that the CMCC can centrally distribute the configuration file of replacing CH.
In CMBC protocol, similar to MBC protocol, each non-CH node joins the cluster where its CH can maintain the most stable connection through its neighbor nodes, we can infer the complexity is O(n) from Algorithm 1. Assuming that there are S neighbor nodes for each non-CH, then the complexity is O(Sn) . Prior to joining the cluster, to achieve the energy balance of nodes in the network, the CMBC protocol selects lowenergy nodes as CH by integrating the mobility rate and residual energy of the current node. From Line 10 in Algorithm 1, we can analyze that the complexity of generating CH is O(n) . From Algorithms 1 and 2, we can infer that the complexity of CMBC protocol is O n 2 .
For each non-CH node, the stable connection is built through its neighbor nodes according to the TDMA Scheduling. From Fig. 4, we can analyze that the computational complexity of the self-adaption sequence generation graph mainly depends on some an algorithm. For the quick sort algorithm, its computational complexity is O Sn log n , where S means the number of neighbor node. For each CH node, when the emergency event occurs, the replacement request is sent from CH to CMCC, which responds and reconfigures seasonably the network resources. Accordingly, CH distributes the configuration files of the replacement of CH to the corresponding data-transmitting units, i.e., non-CHs. The computational complexity of Algorithm 2 is O n 2 . Therefore, the computational complexity of CMBC is ϕ 2 log ϕ.
In short, the computational complexity of CMBC protocol is effective in polynomial time.
Notably, 1500 sensors are randomly deployed in the two-dimensional area, which is 2000 × 2000 m 2 . According to Algorithm 1 and Algorithm 2, we can infer that the convergence speed of our proposed method is relatively slow, the possible reason is that non-CHs seeks for the suitable CH within a frame time, and if a frame time is ended, the request of CH replacement to CMCC is iteratively sent. It will spend a lot of time to guarantee the execution process of our proposed algorithm. Obviously, the convergence of CMBC will be further improved with the decrease of the size of network.

Protocol assumption
In this study, the following assumptions are considered for analyzing the proposed protocol: 1. The CMCC is deployed at a fixed position beyond the network deployment area. 2. All sensors are randomly deployed in the two-dimensional area. These sensors know their position, moving speed, and direction. 3. Two sensors cannot be placed in the same position. 4. All sensors can accurately estimate the transmission time of data packets. 5. All sensor nodes have time synchronization. 6. All sensor nodes are the same, that is, they have similar energy, coverage radius, transmission capacity, and physical characteristics.
The location, moving speed, direction, and time synchronization mentioned in the hypothesis can be obtained through the location and synchronization method in the CMBC protocol [18].

Performance evaluation parameters and environment
To assess the performance of the CMBC, the following parameters are used in this study: transmission success rate, average power consumption, and average control overhead, which are described as follows [21,24]: where N r is the number of received packets. N l is the number of lost packets. E total is the total byte length of the control overhead. N ctrl is the number of control packets. L ctrl is the length of the control packet. The performance parameters of the CMBC protocol are listed in Table 1. Table 1 show that the distance between non-CHs and CH is set within a range of 20-80 m. In the experiment, the transmission distance between CH and another CH and between CH and CMCC is allowed to exceed 80 m. If the actual distance between non-CHs and CH is less than 0 m, then the distance is set to 20 m. If the actual distance is between 20 and 80 m, then the transmission power consumption of the sensor node is computed with the actual distance. The results show that the average power consumption between CH and non-CHs decreases with the increasement in the percentage of cluster heads in the network [18]. For convenience, the ratio of CH is selected at 5% [18]. The experiments show that the MBC protocol achieves satisfactory results in the distributed sensor network [18]. In this study, we compare the CMBC, MBC, WCRA, and IMP-MECA protocols with the same experimental parameters.

Simulation results
To compare the experiment result of centralized wireless sensor network and distributed wireless sensor network, the general random walk mobility model [26,27] is introduced to model the mobility pattern of each node. Figures 5, 6 and 7 present the transmission success rate, average power consumption, and average control overhead of the CMBC MBC, WCRA, and IMP-MECA protocols, respectively, when the maximum mobile rate is set to 25 m/s [18]. The number of mobile nodes varies from 0 to 1500 with a 150 increment in large-scale SDSN. Figure 5 shows the transmission success rate of a packet received by the four protocols when the number of mobile nodes changes. As shown in Fig. 5, when the number of mobile node is 0, the transmission successful rate obtains the maximum value, it is because that all sensor nodes are in a static state, the connection link is in a stable transmission state, the data packets will be successfully transmitted. With the gradual increase of the nodes, the transmission success rate of four methods slowly decreases mainly due to the probability of a link break increases gradually with the increasement of mobile nodes. Notably, when the number of mobile node is less than 300, IMP-MECA achieved a high transmission success rate, it is because that IMP-MECA is designed for the medium scale wireless sensor networks, which the number of mobile nodes is no more than 300. The value of transmission success rate of WCRA is slightly superior to CMBC, the possible reason is that WCRA mainly is proposed to solve the problem of node mobility in small-scale networks, the number of mobile nodes is no more than 100. Compared to the other three protocols, the transmission success rate of the CMBC protocol slightly decreases because of the CMCC real time monitors the link state, which reduces the failure of the data transmission when certain links are damaged. This feature shows that the CMBC protocol is suitable for the larger scale mobile sensor networks. Figure 6 describes the average power consumption of a packet received by the four protocols. With the addition of mobile nodes, the power consumption of the two protocols gradually increases because the non-CH nodes in the network consume additional power in the process of finding new cluster. This figure clearly shows that the power consumption of the CMBC protocol is significantly lower than that of the other three protocols when the number of mobile node changes mainly because the CMCC uniformly sends configuration files in the process of finding new cluster and effectively reduces the power consumption between the non-CHs and the CH. Notably, when the number of mobile node is 0, the average power consumption obtains the minimum value, it is because that all sensor nodes are in a static state, the connection link is in a stable transmission state, which needs not consume too much energy to deal with the mobile nodes. four protocols increases correspondingly, which is caused by the addition of unstable connections between the non-CHs and the CH in the cluster. Figure 7 illustrates that the average control overhead of the CMBC protocol is significantly lower than that of the other three protocols. When unstable connection occurs, the SDSN is uniformly deployed through the CMCC to reduce the time of the unstable connection. This reduction significantly improves the transmission success rate of the packet and reduces the average control overhead of the packet. Similar to Fig. 6, when the number of mobile node is 0, the average control overhead achieves the minimum value, it is because that network protocols need not consume too much control overhead to deal with the mobile nodes. Figure 8 demonstrates the changes of the transmission successful rate of the four protocols when the speed of mobile nodes changes from 5 to 40 m/s. With the increasement of the speed of mobile nodes, the connection stability between non-CHs and CH is slowly weakened, which decreases the transmission successful rate of data packets. Interestingly, when the speed of mobile node is 5 m/s, which is approximately in static state, the connection link is in a stable transmission state, all data packets can be successfully transmitted, then the maximum value of transmission successful rate is achieved. When the speed of mobile nodes is less than 10 m/s, IMP-MECA achieves the maximum value of the transmission successful rate, WCRA obtains the second high value of the transmission successful rate. When the speed of mobile nodes is 15 m/s, IMP-MECA obtains the same second high value as CMBC, and WCRA obtains the high value of the transmission successful rate.
In Fig. 8, the curve of CMBC and MBC decreases slowly, while that of IMP-MECA and WCRA changes significantly, the transmission successful rate of IMP-MECA and WCRA is superior than that of CMBC when the speed of mobile node is less than 20 m/s, the possible reason is that the two methods are mainly designed to address the mobility for small scale wireless sensor network, with the increasement of the speed of mobile nodes, as shown in Fig. 8, when the speed of mobile node is greater than 20 m/s, the lifetime of wireless sensor networks is slowly weakened, thereby decreasing the transmission successful rate. Accordingly, CMBC shows the surprising advantages. It is proved that CMBC is more suitable for large scale networks. Figure 9 describes the comparison between the speed of mobile node and the average power consumption, when the speed of mobile node is 5 m/s, which is approximately in static state, the connection link is in a stable transmission state, the data packets can be successfully transmitted, CMBC achieves the minimum value of average power consumption. With the addition of the speed of mobile node, the average power consumption is gradually increasing, to ensure the successful transmission of data packets, the number of new clusters added by the nodes from the broken link increases, the average energy consumption of packets increases slowly. As shown in Fig. 9, the performance of CMBC protocol is significantly better than that of the other three protocols. This improved performance effectively illustrates the effectiveness of the proposed clustering method based on node mobility in SDSN. Figure 10 gives the results comparison between the speed of mobile node and the average control overhead. When the speed of mobile node is 5 m/s, which is approximately in static state, the connection link is in a stable transmission state, the data packets can be successfully transmitted, it is need not consume too much energy to deal with the mobile nodes, so the minimum value of average control overhead is achieved. With the addition of the speed of mobile node, the average control overhead is gradually increasing, to ensure the successful transmission of data packets, the number of new clusters added by the nodes from the broken link increases, leading to the increase in the average control overhead of packets. Notably, in Fig. 10, the average control overhead of all methods is slightly difference. From Figs. 9 and 10, we can clearly analyze that the CMCC uniformly sends configuration files in the process of node movement with the increasement of the speed of mobile node and effectively reduces the power consumption and the average control overhead between the non-CHs and the CH, it is different from distributed wireless sensor network, which takes much longer to find new clusters.
Interestingly, as shown in Figs. 9 and 10, when the mobile speed of nodes is 5 m/s, the CMBC protocol has a significantly lower average energy consumption and average The speed of mobile node Average power consumption MBC WCRA IMP−MECA CMBC Fig. 9 Results comparison between the speed of mobile node and the average power consumption control overhead than the other three protocols. It further demonstrates that the CMBC protocol also has satisfied network performance in the near-static environment.

Conclusions
Inspired by the MBC protocol, a centralized clustering protocol called CMBC based on node mobility is proposed to solve the shortcomings of routing failure caused by the dynamic topology change in distributed sensor networks. Our proposed protocol is implemented in SDSN when the data between non-CHs and CH are transmitted. Owing to energy exhaustion or the end of connection time with cluster nodes, they cannot continue to act as CH, thus sending a request to replace the CH to the CMCC through neighboring CH nodes. Then, CMCC centrally reconfigures the network resources. Simulation results show that transmission success rate of the CMBC protocol is significantly higher than that of the MBC, WCRA and IMP-MECA protocol with lower average power consumption and control overhead. Compared to the distributed sensor network, the centralized sensor network of SDSN shows the significant performance.
For the future work, we'll further research the centralized wireless sensor network, the main work is as follows: (1) some important performance indicators, such as convergence rate and time, data transmission latency and the improvement of the centralized solution, etc. (2) network structure, such as network scale, larger transmission range, and the high dense wireless sensor network, etc. We also further research the theory proof for the experimental results.