Improving the Network Lifetime in Wireless Sensor Network for Internet of Thing Applications

Mobile Wireless sensor networks have acquired a great interest recently due to their capability to provide good solutions and low-priced in multiple fields. Internet of Things (IoT) connects different technologies such as sensing, communication, networking, and cloud computing. It can be used in monitoring, health care and smart cities. The most suitable infrastructure for IoT application is wireless sensor networks. One of the main defiance of WSNs is the power limitation of the sensor node. Clustering model is an actual way to eliminate the inspired power during the transmission of the sensed data to a central point called a Base Station (BS). In this paper, efficient clustering protocols are offered to prolong network lifetime. A kernel-based fuzzy C-means clustering algorithm (KFCM) is adopted to cluster sensor nodes, while a cluster head (CH) is selected for each cluster based on a fuzzy logic system. Results depicts that the new work performs better than the existing algorithms (as Low Energy Adaptive Cluster Hierarchy-Mobile (LEACH-M) and Low Energy Adaptive Cluster Hierarchy-Mobile Enhancement (LEACH-ME)) in terms of network lifetime, energy consumption, packet transmission and stability period.


Introduction
IoT is one of the common subjects currently. Sensors and smart devices simplified the supplying of communication and information [1]. One of the IoT aspects is the Wireless Sensor Networks (WSN). The data is collected from all the sensors in a network characterized by low power consumption and a wide range of communication elements [2].
WSN encompasses number of nodes, whereas every node created by different parts such as sensors which are utilized to sense a physical parameter in an environment. The received analog signal can be converted to digital form by the analog to digital converter. The signal will be easily read and utilized by the processing element [3]. The sensing task is performed by individual nodes and consumed much energy that reduces the network lifetime. An increase in energy depletion and a decrease in the existence make sensor networks to be useless. Also, other issues, processing ability, limited bandwidth, and memory of nodes can impact the network lifetime [4].
The future demand is sensor-based applications which will be requested in different domains of real-time scenarios such as observing the critical gases in industry, health care monitoring, air pollution monitoring and smartphones etc. The WSN yields a collection of sensor nodes organized over an application area and work together in synchronized form to observ and manage the environment and each node joins to other to form a network.
The purpose of improving WSN is based on the military applications, mostly surveillance in conflict section [6]. By reason of the difficult jobs in planning an energy effective network, many types of routing protocols have been planned. One of the suggested techniques, the hierarchical routing protocols which are also called clusterbased routing were content with the restrictions in WSNs [5]. There are two-layer structure. One layer is included in the selection of the cluster head and the other layer is responsible for routing. The node in hierarchical routing that is responsible for accumulating data from different nodes in the cluster is called the cluster head (CH). It assembles all data from nodes and sends them to the base station.
The cluster-based routing protocol is implemented in this paper. This protocol involves sequences with two stages in each round, the setup stage and the steady-state stage. In the setup stage, the kernel-based fuzzy C-means clustering algorithm (KFCM) is utilized via the base station to cluster the sensor nodes regularly. The twophase fuzzy logic method is used to select a notable node in the cluster as the head of the cluster. Within the steady-state phase, the nodes sense the environment and then transmit the data to the base station.
Expanding network lifespan is a real hard task in Mobile Wireless Sensor Networks because sensors have restricted energy, where limited battery energy is one of the major constraints of mobile wireless sensor networks. The researchers have taken into consideration the cluster-based technique for data transmission to avoid the power exhaustion, LEACH [6], LEACH-M [7], LEACH-ME [8], enriched cluster established routing protocol for movable nodes in WSN ECBR-MWSN [9], and Cluster Based Routing (CBR) Mobile [10] are mentioned as cluster-based energy-efficient protocols.
In Leach [6], the operation is divided into twostage, the setup stage and the steady-state stage. In the setup stage, CHs are designated such that in the steady-state stage each node transmits its data to its own cluster head and then the CH collect the information received from the nodes that is owned by the same group and transmit them to the BS. One of the LEACH drawbacks is that it does not provide mobility. However, the LEACH-Mobile protocol that supports the navigation has been introduced and is considered an improvement on the LEACH [7]. The CH choice has been developed by Leach-M Improved [8] (Leach-ME). The sensor node that has the least mobility is selected as the cluster head.
ECBR-MWSN [9] is a protocol wherein the cluster heads are chosen by means of the factors of maximum residual power, little mobility and tiniest distance from the base station. CBR-Mobile [10] advocate the sensor nodes movability via using adaptively redistributing the timeslots in steps with sensor nodes movement. The CH selection in CBR-Mobile, like Leach-M, relies on the possibility model.
In static WSN, there are many improvements on LEACH such as a stable improved LEACH (SILEACH) algorithm [11] which is proved to be highly efficient in terms of stability. An improvement on LEACH in terms of enhancing network life and reducing energy waste have been presented in [12]. Another improvement has been suggested [13] on LEACH Protocol in Wireless Sensor Networks to diminish energy depletion and the transmissions to the Base Station by aggregating data.
The rest of the paper describes the system model in section 2, simulation results in section 3, and finally the conclusion in section 4.

Setup Phase
Cluster head option and cluster forming are the main purposes of the setup phase. Figure Fig. 3 shows the Setup Phase algorithm where each block is described as follows.

Initialization
At the beginning, each sensor node sends the required information about its residual energy, the location and move count of the node. This information is sent as a "Hi" message as shown in figure Fig. 4.

Cluster Formation
The kernel-based fuzzy C-means clustering (KFCM) collects the sensor nodes. It interchanges the kernel-induced distance metric over the original Euclidean distance. It enhances the precision with fewer error rate than in the fuzzy Cmeans algorithm [14]; thus, it can decrease the iteration needed time for producing clusters considerably. This is very important in the formation of the clusters. To find the objective function in the fuzzy C-means algorithm, the following equation is used: c: is the number of clusters and designated as a specified value. n: is the number of nodes. ‫ݔ‬ : is the coordinate of sensor node k. ‫ݑ‬ : is the membership of ‫ݔ‬ in cluster i, . m: is the quantity adjusting clustering fuzziness which is utilized to control nodes' membership, m is usually equal 2 [15] ‫:ݒ‬ is the set of cluster centres.
The function ‫ܬ‬ is eliminated by known alternate iterative process. KFCM algorithm partitions k into c fuzzy separations by reducing the following cost function: The difference between the equations (1) and (2) is by changing the kernel-induced distance metric over the original Euclidean distance [14]. Minimizing equation (2) under the constraint of ‫ݑ‬ , we have: With KFCM algorithm, the cluster centroid is calculated as the average of all the sensor points measured by the cluster association gradation. Repeatedly, upgrading the membership ‫ݑ‬ by equation (3), ‫ݑ‬ has the following conditions: The iterative updating will stop either when ‫ܧ‬ ௧ ≤ ε Where: Sensor nodes are categorized to the clusters as stated by maximal degree of membership to generate regular spread clusters. If a k The sensor node has the highest degree of cluster affiliation i in t th execution, the sensor node k will join the cluster i, that is expressed as: Despite these communications (between nodes and the base station (BS)), if the nodes perform the operations instead of BS, the power consumptions will be much greater than when the Bs perform those calculations. So for longer lifetime, case two has been adopted in this work. The process of finding the location of the node and placing it inside the cluster depends on the method of (KFCM). In this method, finding the location of a node and selecting the appropriate cluster for that node according to the membership level of each other nodes (this depends on the distance between the node and the centre of cluster) have been done in the BS so that the power consumption occurs in the base station.

Calculation of Mobility Factor
The mobility is one of the substantial factors that decides the head nodes. It is preferable to design a cluster head that does not move rapidly to stay away from frequent cluster head changes.
The node may be separated from its cluster head and link a new one as the cluster head moves fast. This will lead to decrease the number of data packets exchanged between the cluster head and the node. Therefore, BS, which is more robust than normal nodes, considers the mobility factor in the proposed protocol and uses the fuzzy logic method to evaluate the mobility factor in an efficient way. Mobility factor is evaluated by three parameters, these are relative mobility of the node according to its neighbours, velocity of the node, and transition count of the node. The lowermost mobility factor can be obtained with respect to lowest velocity, transition count, and relative mobility. The velocity (V) of the sensor node (vi), is computed as: ܸሺ‫ݒ‬ ሻ ൌ ඥሺ௫ ି௫ షభ ሻ మ ାሺ௬ ି௬ షభ ሻ మ ∆௧ …(9) Where: ‫ݔ(‬ ௧ ‫ݕ,‬ ௧ ), ‫ݔ(‬ ௧ିଵ ‫ݕ,‬ ௧ିଵ ): are the coordinate status of node (vi) at the time t, t-1 respectively. ∆: is the interval time between t and t -1.

The mobility metric (M) of a sensor node (vi) according to its neighbours is calculated by:
Where: ݀ ሺ‫ݐ‬ሻ: is the distance between neighbour (vj) and sensor node vi at time t. ݀ ሺ‫ݐ‬ െ 1ሻ: is the distance between vj and sensor node vi at time t-1. Neis the amount of sensor node neighbour's vi.
As a Hi-message, the amount of transitions from one cluster to another during the past five rounds will be directed to the BS from the sensor node. This assessment relies on the amount of times the node transitions.
The concept of fuzzy logic is created primarily through four steps: fuzzification, rule evaluation, aggregation, and defuzzification. It can be used for mobility factor due to the simplicity of the Mamdani fuzzy inference technique computation. To calculate the mobility factor, four steps are needed to be used within the fuzzy inference System (FIS) as follows: The inputs to the fuzzification step shown in figure Fig. 5 are the transition count of the node, relatve mobilty of the node with respect to its neighbours, and the velocity of the node. Their membership functions can be shown in figure Fig.  6.  6. Functions for fuzzification (a, b, c) Then the membership values are supplied to IF-THEN rules as illustrated in Table 1. An (OR) operation selects the maximum rule calculation values to produce the new fuzzy sets, which are the input to the defuzzification stage.
The centre of gravity (COG) technique is used to compute the chance rate for each sensor node to be a cluster head [16]: Where ‫:ݏ‬ is described as the amount of output sample values, ‫ݔ‬ : is defined as value of the output element ߤ ሺ‫ݔ‬ ሻ: is the score of a membership function of fuzzy set A. The fuzzy sets for the output variable are show in figure Fig. 7.

Cluster Head and the Backup Clus Head Selection
Cluster head is elected using a two-phase fuzzy approach when pointing the clusters. The BS calculates the opportunity for all nodes. Figure  Fig. 8 displays the offered model for fuzzy based CH appointment.

Fig. 8. Two Phase Fuzzy Logic System for Cluster Head Election.
A radio model is used in this paper and the following equations explain its mathematical model. To conduct an l-bit data at a distance d, a node employs the energy as: • ‫ܧ‬ : defines energy expended to run the electronic circuits. • ∈ ௦ and ∈ : represents the transmitter amplifier characteristics. The dissipated energy to receive a K-bit packet is ‫ܧ‬ ோ ሺ‫ܭ‬ሻ ൌ ‫ܭ‬ ‫ܧ‬ …(14) In addition to above, the cluster head also goes to waste the energy due to data collection. In the first phase, the inputs are energy and mobility factor of the node and the output is First chance. The second phase of the fuzzy logic system for cluster head election has three input parameters: First-chance from the first phase, closeness to BS and node expected efficiency. Node probable efficiency [17] is the quotient between probable residual energy (the remains energy of node after attaining its function such as head of cluster for a round) and the predictable average energy of the cluster. To compute the probable average energy of cluster, the predictable spent energy of node is determining to be a cluster head (CH) and the expected expended energy of the non-CH nodes as: The predictable consumed energy is given as: … (15) Then the probable remaining energy of node to be a CH after a steady-state phase could be given as: …(16) The likely spent energy of non-CH node could be demonstrated after steady-state phase via: …(17) Then the estimated residual energy of non-CH node next steady-state phase is: After the steady-state phase, the expected residual energy of cluster can be obtained consequently as follows: Where: ݀ ௧ ௌ : represents the distance between a CH and the BS. ‫ܧ‬ : describes the aggregation operation and it is constant. ‫ܧ‬ ௦ௗ௨ : is the residual energy of node before CH choice. n: symbolizes the number of cluster members. ݈ : is the Size sensed packet.
N: represents the number of nodes spread in the network field. ‫:ܭ‬ is the number of clusters at each round.

Advertisement, Acknowledgment, TDMA Scheduling
The CH broadcast an announcement message to the sensor nodes in its cluster (members of cluster). The node directs an acknowledgment message to inform this CH that it belongs to it. Then the CH creates a TDMA Schedule and announces it to the members of the cluster. If sensor nodes do not receive data request packet from cluster head because of the dead of both the cluster head and backup cluster head, then sensor nodes send JOIN_REQUEST to the nearby cluster heads.

Steady-State Phase
The steady-state stage involves the number of frames and the data transmission occurred in each frame, and this occurs in each round. After the end of one frame and so on, another frame begins. The steady-state stage is finished and another round begins after the end of the last frame with a new setup stage and a steady-state stage. Figure Fig. 9 shows the flowchart of one frame.

Simulation Results
This paper presents an improved effective routing protocol in autonomic wireless sensor networks for IoT applications. The adopted application is a system follows the movements of doctors inside the hospital to be called in urgent cases and the possibility of reaching them easily. Figure Fig. 10 shows the city of medicine in Baghdad and the red marks indicate where doctors are located. When the doctors (sensors) have been moved, the doctor's site is transferred to the base station and the base station will transmit the information to the internet to be viewed from any department within the hospital. The mobility model for sensors is a Random waypoint model Table 2.  figure Fig.17. Then, it is measured with the adjustment of BS as in figure Fig. 18. Finally, number of packets transmitted is measured when static sensors are used in addition to mobile sensors as illustrated figure Fig. 19.   The comparison between the proposed protocols with other work [18] can be shown in Table 3 in terms of the round number when the first node expires and the successful number of sent packets.

Conclusion
Routing protocols that provide motion of sensor nodes have been designed and improved by researchers like the mobile wireless sensor networks. They propose a good solution in many fields especially in IoT fields. In this paper, an algorithm is proposed to improve the routing protocol by increasing the number of transmitted packets. In this way, the kernel-based fuzzy Cmeans clustering algorithm (KFCM) and a Twophase fuzzy logic methodology for CH determination are used to build a technique based on gathering the nodes into clusters. Simulation results showed an enhancement in the network lifetime, packet transmission, stability period, and energy consumption as to LEACH-M and LEACH-ME schemes.

Protocol
First Node Dies