Formal comparison of LEACH and its extensions

Formal comparison of LEACH and its extensions

Accepted Manuscript Formal Comparison of LEACH and its Extensions Ainan Ihsan, Kashif Saghar, Tayyba Fatima, Osman Hasan PII: DOI: Reference: S0920-...

2MB Sizes 0 Downloads 33 Views

Accepted Manuscript

Formal Comparison of LEACH and its Extensions Ainan Ihsan, Kashif Saghar, Tayyba Fatima, Osman Hasan PII: DOI: Reference:

S0920-5489(18)30152-1 https://doi.org/10.1016/j.csi.2018.10.001 CSI 3307

To appear in:

Computer Standards & Interfaces

Received date: Revised date: Accepted date:

4 May 2018 1 October 2018 5 October 2018

Please cite this article as: Ainan Ihsan, Kashif Saghar, Tayyba Fatima, Osman Hasan, Formal Comparison of LEACH and its Extensions, Computer Standards & Interfaces (2018), doi: https://doi.org/10.1016/j.csi.2018.10.001

This is a PDF file of an unedited manuscript that has been accepted for publication. As a service to our customers we are providing this early version of the manuscript. The manuscript will undergo copyediting, typesetting, and review of the resulting proof before it is published in its final form. Please note that during the production process errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain.

ACCEPTED MANUSCRIPT 1

Highlights

AC

CE

PT

ED

M

AN US

CR IP T

– Formally analysed cluster based WSN routing protocols LEACH, LEACH-C and LEACH-F. – A thorough comparison based on energy, lifetime and throughput of the protocols. – Both fixed and generalized topologies are catered for.

ACCEPTED MANUSCRIPT Noname manuscript No. (will be inserted by the editor)

Formal Comparison of LEACH and its Extensions

CR IP T

*Ainan Ihsan · *Kashif Saghar · †Tayyba Fatima · †Osman Hasan

Received: date / Accepted: date

to be quite effective in verifying safety, liveness and reachability properties under generalized topologies of networks. Based on our analysis results, we conclude that LEACH-F protocol is the most energy efficient among the other alternatives.

AN US

Abstract Wireless Sensor Networks comprise of clusters of low-powered sensor nodes dispersed over a vast area, mostly in an unsupervised and remote environment, with inadequate computational and detection capabilities. The batteries of these sensor nodes are often small and irreplaceable, which limits the life span of a node. It is therefore essential to retain the node energy as long as possible, otherwise a large number of nodes would die at an early stage and the network would become dysfunctional. Numerous protocols are developed for the efficient energy utilization of a WSN. However, comparing the protocols on a common ground is a big challenge, which has traditionally been accomplished using simulations and other testing techniques. To cater for the limitations of these methods we propose to leverage upon the complete and sound nature of model checking i.e., a widely used formal method. For understanding our methodology, we have created a formal framework specifically to compare the LEACH protocol with its future extensions LEACH-C and LEACH-F. The proposed approach has been found

Keywords Formal Verification · Routing Protocols · Wireless Sensor Networks (WSN) · LEACH.

CE

PT

ED

M

1 Introduction

AC

A. Ihsan Centre for Excellence in Science and Technology (CESAT), Islamabad, Pakistan Tel.: +92-322-5437811 E-mail: [email protected] K. Saghar Centre for Excellence in Science and Technology (CESAT), Islamabad, Pakistan T. Fatima School of Electrical Engineering and Computer Science, National University of Sciences and Technology (NUST), Islamabad, Pakistan O. Hasan School of Electrical Engineering and Computer Science, National University of Sciences and Technology (NUST), Islamabad, Pakistan

Wireless sensor networks (WSN), depicted in Figure 1, are generally composed of small battery-powered sensors. Due to their lightweight and miniature size, WSNs have been found to be very effective in detailed monitoring of remote and unreachable localities where installing a wired framework is infeasible. The main idea in WSNs is that every wireless sensor node gathers data from an area under its range and routes it to a central Base Station. Information packets are communicated typically in a multi-hop fashion towards the base station, employing a specific protocol according to the environments’ needs. The total count of the nodes may vary from one WSN to another. Contrary to wired systems, which have separate routers for connectivity and data progression, the nodes of a wireless sensor network can perform as routers. The requirement for the sensor nodes to function with small irreplaceable batteries for long periods of time poses numerous challenges for WSNs. In order to tackle these challenges, instead of reducing the total energy on the paths, the main focus of the current WSN research is to enhance the life-span of the network as much as possible. The main idea is to optimize the way the sensors utilize their energy while ensuring increased connectivity and enhanced network lifetime. Numerous

ACCEPTED MANUSCRIPT Formal Comparison of LEACH and its Extensions

3

Fig. 1 A Typical Wireless Sensor Network

scale them for larger networks. Thus it may be noted that formal methods requires a much greater expertise and experience in the field. However, to the best of our knowledge, there is not a formal analysis of LEACH or its extensions available in the literature.

AN US

protocols have been established to overcome the restriction imposed by the battery lifetime of sensor nodes, and thus in turn improve the network lifetime. Conventional methods, like Direct Transmission and Minimum Transmission Energy [1], do not guarantee the optimized distribution of energy as all nodes directly transmit their data to the Base Station. The distant nodes are thus at a disadvantage [2]. The LEACH protocol [3], which assures that energy is dispersed equally by creating dynamic clusters using a certain optimum probability, overcomes the above-mentioned problems. Given the success of the LEACH protocol in increasing the lifetime of WSNs, there has been a considerable interest in the research community about this approach and various extensions of LEACH have been projected, such as LEACH-C [4] and LEACH-F [5].

CR IP T

Fig. 2 An Example Trace File

M

In this paper, we formally verify and compare the LEACH protocol and its extensions. For this purpose, we have used the UPPAAL model checker. Although numerous model checkers are available, i.e., PRISM [12], UPPAAL [13], SPIN [14], NuSMV [15], our requirement was verifying routing protocols in an idealistic real-time environment which can be best fulfilled by UPPAAL.

AC

CE

PT

ED

Analyzing and comparing various LEACH extensions to find out the optimal configuration for a given WSN scenario is very important. Traditionally, such analysis is conducted using paper-pencil procedures or simulations. The paper-pencil based methods do not adjust well for the large sized WSNs. Moreover, they are prone to human errors due to the manual nature of the analysis. Simulation based methods are scalable and are a valuable tool, especially when coupled with analytic methods, static analysis and real implementations. However, given the safety-critical nature of WSN applications like forest fire detection [6] and border intrusion [7], the corner cases and hidden errors can easily be identified using our proposed formal verification techniques. Therefore, there is a growing interest in formally verifying WSN protocols [8], [9], [10]. The main idea behind formal methods [11] is to mathematically model the given system and verify its mathematically specified properties in a rigorous manner. This kind of mathematical analysis ensures compete and sound investigation, which is a dire necessity for safety-critical applications. As this method covers all scenarios possible for a system, it does have memory limitations and models need to be highly optimized to

UPPAAL employs a set of non-deterministic procedures having finite control structures and clocks, which contact each other using channels or shared / global variables. The tool is composed of three parts. A nondeterministic description language, which describes the system functionality using a mesh of timed automata. An example of a model can be seen in Figure 6. The simulator is used for the interactive analysis and verification of the model to ensure correctness for all possibilities. The model checker automatically generates a full state space of the model providing all possible scenarios, and generating a trace in case of failure of a specific property. An example trace is provided in Figure 2. In this paper, Section 2 discusses the Related work. The LEACH, LEACH-C and LEACH-F protocols are described in Section 3. The proposed formal structure along with the taken assumptions and semi-formal notations are described in Section 4. We first present the verification results for the three LEACH configurations while considering one topology in Section 5. This is followed by the verification of these LEACH configurations for generalized topologies in Section 6. Finally, Section 7 concludes the paper.

ACCEPTED MANUSCRIPT 4

*Ainan Ihsan et al.

2 Related Work

AN US

Another thesis [34] works on the modelling and analysis of wireless sensor networks with energy harvesting capabilities using UPPAAL and UPPAALSMC. It involves the development of a generic modelling framework and creates the formal models in UPPAAL. An analysis of the energy consumption using UPPAAL is also done in this research [35]. It creates a sensor network using UPPAAL. Tests and verifies the model and performs a worst case analysis of energy consumption.

CR IP T

The main objective of our work is to formally verify and compare the routing protocols based on their lifetime, energy and throughput employing exhaustive model checking. Similar works have been conducted like the comparative analysis of clustering protocols with probabilistic model checking [16] using the PRISM model checker [12]. The work involves the evaluation and comparison of four protocols i.e. LEACH, GENLEACH, HEED and PANEL, with full state space exploration.

3 Description of the protocols 3.1 LEACH

ED

M

The achievement of energy efficiency through load balancing, which is a formal verification based comparison of two WSN routing protocols (RAEED and RAEED-LB) is performed in this paper [17]. Whereas this [36] proposes a new protocol EBRP (energy balanced routing protocol) and performs a simulation based comparison with LEACH, LEACH-C and SEP. A similar research is the proposition of another new protocol Vice-Cluster-Head-Enabled Centralized Clusterbased Routing protocol (VCH-ECCR) and its comparison with LEACH, LEACH-C and BCDCP [37].

Fig. 3 LEACH Flowchart

CE

PT

Then there is the formal probabilistic analysis of a wireless sensor network for forest fire detection [18]. The authors have used theorem proving to verify scheduling performance of a real world wireless sensor network.

AC

Other interesting works with similar objectives are the analysis of communication protocols for WSNs [19], the formal verification of routing protocols for wireless adhoc networks [20], the formal performance analysis of wireless sensor networks [21] and the formal analysis of a scheduling algorithm for wireless sensor networks [22]. Many other systems have been formally checked for their efficiency, like the Flooding protocol [23], gossiping protocol [24], hybrid systems [25] etc. However, to the best of our knowledge, no formal comparative analysis of the LEACH protocol and its extensions, which is the scope of this paper, has been presented in the literature so far.

For optimizing the lifetime of a WSN, all aspects of a node should be extremely energy efficient, i.e., from the sensor module to hardware and to the network protocol. In addition to this, the protocol should be robust enough to withstand malfunctioning nodes and highly scalable to increase the system’s lifetime. LEACH is the first protocol, which fulfills all the requirements mentioned above and its basic working is illustrated in Figure 3. It uses hierarchal routing for WSNs to enhance the network’s life span as shown in Figure 4. In the protocol, all nodes of the sensor network categorize themselves into clusters and assign a node to be a cluster head. The members of every cluster transmit their information to their respective cluster head; followed by the cluster head processing and forwarding that collective information to a remote Base Station. The phenomenon is explained in Figure 5. It can thus be deduced that the cluster head consumes more energy as compared to any other node. LEACH employs the randomized rotation of cluster heads to avoid the drainage of batteries of individual nodes. In this way, this protocol takes care of energy load and balances it out across the network. Since a cluster head knows about its member nodes, it creates a Time division multiple access (TDMA) schedule that notifies each node of its allocated transmission slot. In addition,

ACCEPTED MANUSCRIPT Formal Comparison of LEACH and its Extensions

5

ters without any control. All nodes are elected as cluster heads using a cluster formation algorithm, which tries to elect every node as a cluster head approximately the same number of times. A random number is generated initially between 0 & 1. The sensor node matches this random number with a threshold value T(n) [27] [28]. ( p if n ∈ G 1 T (n) = 1−p∗(rmod p ) (1) 0 if n 6∈ G

CR IP T

Where node n is the one that is checking its compatibility of being a cluster head in the WSN, p is the percentage of cluster-heads in the whole network, r is the current round’s number, which is currently going to start, and G represents those nodes that have not been elected as cluster heads in the previous 1/p rounds. If the value of the random number is less than the threshold value, then the node appoints itself as a cluster head thus following the distributed approach, and the threshold value updates according to the formula mentioned above.

AN US

Fig. 4 LEACH Protocol

CE

PT

ED

M

After the selection of the cluster head, it sends the advertisement message (ADV) with a unique header that differentiates it as an announcement message. Each cluster head uses the Carrier sense multiple access (CSMA) media access control (MAC) protocol to broadcast its signal. All other sensor nodes turn on their receivers to receive signals and decide which cluster head they would send their own data. This is determined on the basis of the minimum energy required to communicate with a cluster head, as depicted in Figure 5. Cluster heads act as controllers to organize the data transmissions in their cluster. Every cluster head establishes a TDMA schedule, which it then shares with the nodes in the cluster to avoid collision among data messages of sensor nodes.

Fig. 5 Flowchart of Cluster formation in LEACH

AC

it prevents data collision at the cluster head. The functionality of LEACH is divided into rounds, such that each round is separated into two phases. The first phase is a setup phase, pertaining to the formation of clusters. Whereas, the next one is the steady-state phase, where the data gathered from the sensor nodes is transmitted to the cluster heads and then finally to the base station [26]. 3.1.1 Setup Phase In the setup phase of the LEACH protocol, all the nodes in the network use a distributed algorithm to form clus-

3.1.2 Steady Phase In this phase, sensor nodes send frames of information to the cluster-head in the assigned transmission slot. The cluster head gathers the data from its member nodes. Once it receives the data, it compresses and aggregates it, and outputs this to the base station. The phase of choosing cluster heads has certain deficiencies, such as the random selection of the cluster head while ignoring the energy information. Moreover, the protocol does not avoid the scenarios where very big clusters having large number of member nodes and very small clusters exist in the same network in the same round [29]. Various extensions of the LEACH protocol have been developed to overcome these limitations.

ACCEPTED MANUSCRIPT 6

*Ainan Ihsan et al.

4 Proposed Formal Framework for Analyzing LEACH

The centralized control algorithm to form cluster heads is the basic idea of the LEACH-C protocol [4]. This approach results in better cluster formation as it chooses the cluster heads depending upon their location in the wireless sensor network. The sensor nodes, throughout the setup phase of LEACH-C, use a GPS module to send the data related to their recent location and energy level. Beside this, the BS ensures balanced dissemination of energy among the nodes in the network. The Average node energy is computed by the BS, and the sensor node, with energy less than the average node energy, cannot be used as a cluster head for the present round [30]. Algorithm 1 CH selection algorithm

M

AN US

1: procedure CH–Selection 2: CH = { } 3: eligible = {n | energy(n) ≥ avg } 4: assert(|eligible| ≥ dc) 5: while |CH| < dc do V 6: if ∃n : n ∈ eligible (∀ m ∈ CH, dist(m,n))≥MSD then 7: add (n,CH) 8: end if 9: end while 10: end procedure

In order to thoroughly analyze routing protocols, a modeling framework has been established that carries an automatic exploration of the protocols. The proposed formal framework comprises of two constituent models: the BS and the sensor node. Multiple instances of the node model are initialized, which can either be a CH or a simple sensor node, based on the considered protocol’s algorithm. The sensor node’s behaviour to be a CH or not, changes every round. Consider the sensor node’s model in Figure 6. Initially the sensor node either appoints itself as a CH based on equation 1, or the BS appoints it as a CH, depending on the protocol being used. In the case that it is a normal sensor node, it transmits its information to the closest CH. But if it is a CH itself, it waits for all its member nodes to send data to it. When all the cluster heads in the wireless network receive their respective data then they forward the gathered information to the BS model, which receives it and a round is considered complete. A complete detail of the model in Figure 6 can be found in our previously published paper “Analysis of LEACH protocol(s) using Formal Verification”. [31]. The proposed formal framework is based on the following assumptions, which hold in most of the WSNs.

CR IP T

3.2 Improvised LEACH-C

PT

ED

Where MSD is the minimum separation distance, dc represents the number of desired cluster heads for a network, alive represents the set of nodes that are alive, energy (n) is the residual energy for node n and P avg is energy(n) / number of alive nodes.

AC

CE

The BS sends a message to all CHs about CH IDs. A typical node in the network compares its ID with the ID of a nearby CH, if it’s a match it appoints itself as a cluster-head. On the contrary, it receives a TDMA slot from the cluster-head and sleeps until the allocated transmission slot. The next phase of LEACH-C, known as the steady phase is similar to the steady phase of LEACH.

3.3 LEACH-F

Another extension of LEACH is LEACH-F [5], i.e., LEACH with fixed cluster. As the name explains, clusters are formed only once for the network and only the cluster heads are updated in every round. This reduces the overhead of the setup phase at the start of every round. LEACH-F follows the same centralized algorithm as LEACH-C.

– The base station (BS) is considered to be at a large distance from the network and is immobile. – All nodes are consistent having a reserved energy and an identifier. – All nodes can send data directly to the BS, if they have the required amount of energy. – Sensor nodes keep monitoring the environment at regular intervals and always have some information to send to the BS. – Cluster heads can perform data compression and aggregation. – No message is misplaced in the communication, i.e., the channel is error-free. Thus no messages are lost non-deterministically. – Sensor nodes can change the transmitting power of its transmitter according to distance. – The symmetric links in wireless networks are considered in our formal models. The CH is formalized in our model as follows:

N → ∗{N ID = gM ember} : (gInf ormation, gM ember) (2)

To understand the above expression, consider A → B: M where the message M is being transferred from A

ACCEPTED MANUSCRIPT 7

AN US

CR IP T

Formal Comparison of LEACH and its Extensions

Fig. 6 Formal Model for the Node

ED

M

to B. The ‘*’ in the equation represents a broadcast communication. It can be seen that the ‘*’ is being used in the place of B, demonstrating that the data is sent to every node residing in the range of A. The statement NID = gMember means that only the cluster members should receive the data from the CH.

PT

Similarly, the communication from the CH to the BS:

(3)

CE

N → BS : (gInf ormation, F wdData)

Fig. 7 Network model and matrix

5 Verification of LEACH configurations for a Fixed Network Topology

The node forwards the data to the BS. 5.1 Formal Framework

AC

The case when the nodes send data to their BS in LEACH-C can be formally expressed as: N → BS : (inf o)

(4)

Similarly, the communication between the BS to all the nodes can be formally expressed as: BS → N : (cluster)

(5)

The formal modeling of the LEACH-F protocols is the same as that of LEACH-C except the fact that the model only applies CH selection in the first round and uses these clusters throughout the lifetime of the nodes.

We propose to model a network topology by a Boolean N x N matrix, where N is the total number of nodes in the network. Based on the proposed modeling approach, a ‘1’ or ‘2’ entry at position (i ; j ) of this matrix specifies the existence of a direct link between nodes i and j and similarly a ‘0’ indicates the absence of a direct link. An illustrative example for this approach is given in Figure 7. The entries ‘1’ and ‘2’ in the proposed model allow us to determine that whether a certain node selects the right Cluster Head (CH) or not. These ‘1’s and ‘2’s are basically assigned based on a certain threshold. For example, we may say that if two nodes

ACCEPTED MANUSCRIPT 8

*Ainan Ihsan et al.

Fig. 8 Network models and matrix

ET x (l, d) =



E♦gT otalEnergy ≥ CON ST EN ERGY

&&gRound == CON ST ROU N D

EElec ∗ l + f s ∗ l ∗ d2 d ≤ d0 EElec ∗ l + mp ∗ l ∗ d4 d > d0

ERx (l) = EElec ∗ l

relations regarding both the invariants and system constants and verifying other interesting protocol related properties. Firstly the energy trend for the protocols is analyzed for some random topologies, as shown in Figure 9 using the property below:

AN US

than d0, mp = amplification energy when d is greater than d0), a sensor is allowed to either use its amplifier or not in the model and thus can capture the energy consumption behaviors. The following equation represents the energy consumed when transmitting to distances below or above a certain threshold value d0 .

Fig. 9 Energy trend for protocols

CR IP T

are at a distance less than ‘10 feet’ then they would be assigned a ‘1’. If the distance is greater than ‘10 feet’ and less than ‘20 feet’ then a ‘2’ and otherwise a ‘0’. This example is illustrated in Figure 8. The main advantage of the above-mentioned topology matrix is that, based on a certain threshold value q f s d0 = mp (f s = amplification energy when d is less

It has been deduced that the LEACH-C and LEACH-F protocols are much more energy efficient in contrast to the LEACH protocol. This has been deduced by the fact that the life span of LEACH is the shortest and ends at round 14 when the energy given to all protocols is the same i.e. 8000 whereas LEACH-C has a lifespan of 18 rounds and the best performance is of LEACH-F as it lasts for 19 rounds. It can be observed from Figure 10 that the LEACH protocol has a considerable percentage of dropped packets. Whereas in an ideal condition LEACH-C and LEACH-F protocols exhibit a phenomenal behaviour having no errors in transmission. Thus, in case of throughput these protocols are considered more stable as compared to the traditional LEACH protocol. The throughput was gathered using the following properties, where E means there exists a path, A is for all paths, [] is for every state in a path and ♦ means certain states in a path.

M

(6)

(7)

ED

Where ET x gives the energy consumed while transmitting l bits to another node placed at a distance d and ERx is the energy consumed in receiving a data of l bits. EElec represents the energy consumed bitwise when receiving or transmitting. [32]

AC

CE

PT

Now, according to the LEACH protocol, a node selects the CH that is nearer and thus has an entry of ‘1’ in the topology matrix. If this is not available then an entry ‘2’ is selected. Similarly, if this is also not found then the node has no direct links with CHs and in this case the node has to send its data on its own, given that it has the required energy to do so, as depicted in Figure 8. The query language of UPPAAL comprises of path and state formulae. Path formulae relate to traces of the model, whereas state formulae inculcate individual states. The former can be categorized into safety, liveness, sanity and reachability properties [33]. 5.2 Verification After the modeling phase, we verify that the protocol model is deadlock free and it exhibits the liveness and fairness properties. This is followed by giving sufficient

E♦gErrorP ackets ≥ CON ST M AX ERR P CKT S

(8)

For each protocol CON ST M AX ERR P CKT S was given incremental values starting from 0. If the property is verified then the value is increased by 1; indicating that there is a case where gErrorPackets, i.e., error packets during transmission are equal to CON ST M AX ERR P CKT S. A failing property

ACCEPTED MANUSCRIPT 9

CR IP T

Formal Comparison of LEACH and its Extensions

Fig. 10 Comparison based on throughput

Fig. 12 Life span comparison

AN US

for the maximum possible value of CON ST ROU N D when the property remains true. Figure 12 shows maximum and minimum number of rounds for which the network remains alive. From the graph, we can conclude that LEACH-C exhibits a stable behavior as the difference in the number of rounds for maximum, minimum and the first node dead conditions is minimal. For finding the minimum rounds, the following property is used: A♦gRound ≤ CON ST M IN ROU N D

(11)

The maximum possible value of CON ST M IN ROU N D for which the property remains true, is the minimum limit for rounds, i.e., for every scenario this many number of rounds would definitely occur. We used the following property for finding the maximum number of rounds:

M

Fig. 11 First Node Dead Analysis

ED

means that it is impossible that this many error packets could occur during that protocol’s transmission. Thus that would be considered the value for drop packets, which in the case of the LEACH protocol is 6.

PT

E♦gT otalP ackets ≥ CON ST M AX T T L P CKT S

(9)

AC

CE

In a similar manner, the total packets during a transmission are also calculated using this property. Figure 11 shows that LEACH-F portrays more stable and consistent behavior, i.e., in both scenarios the number of rounds for which the first node is alive are the same. Similar promising results can be seen for LEACHC as the first node dies quite late in both scenarios. These worst and best case scenarios are found by verifying the following property. E♦gCountDead == 1&&gRound == CON ST ROU N D

(10)

Here gCountDead is equal to one when the first node becomes dead and gRound represents the value of current round. The worst case scenario would be for the minimum possible value of CON ST ROU N D when the property becomes true. The best case scenario would be

E♦gRound == CON ST M AX ROU N D

(12)

The maximum possible value of CON ST M AX ROU N D is the value for the maximum rounds, i.e., there exists a scenario in the protocol where this many number of rounds is possible.

6 Verification of LEACH configurations for Generalized Topologies In the previous section, we verified the models for various LEACH configurations for fixed topologies and in this section we extend this work for a range of topologies. The classical LEACH protocol was found to be the most inefficient one from the analysis, presented in the last section. So in this section, we focus on LEACH-C and LEACH-F protocols only in order to find the optimal one out of these two. Table 1 shows the number of topologies for a specific number of nodes. These two protocols have been verified for 5 nodes having 1024

ACCEPTED MANUSCRIPT 10

*Ainan Ihsan et al.

Fig. 15 4 node models Fig. 13 Initializer model

N 2 3 4 5

6.1 Trends observed in LEACH-C for Generalized Topologies

Number of topologies for Symmetric Links 2 N (N −1)/2 2 8 64 1024

CR IP T

Nodes

6.1.1 Results based on desired clusters

The algorithm used for LEACH-C and LEACH-F has a parameter, named desired clusters (dc), that allows the BS to form exactly that number of clusters. Various trends can be observed by altering the dc value as shown below.

(b) Matrix B

ED

Fig. 14 Matrix A and B

PT

unique topologies. But we have also taken into account the threshold value, given in Equation 6, thus replacing the ’1’s in the boolean matrix with a ’1’ or ’2’ and resulting in 3N (N −1)/2 (59049) unique topologies.

CE

To understand our topology generation let’s consider 4 nodes which will have 64 different topologies as shown in Figure 15. In Figure 13 you can see the initializer model which supplies these topologies and checks all possible scenarios, as is the strength of formal verification. Thus if variable m is supplied the integers from [0,63], then UPPAAL does not randomly select a single integer from this range, instead it supplies all integer values to the model one by one and checks all the different combinations of the given variables. To further understand the conversion of our topologies into a 4x4 matrix, let us consider an example where the selected topology by UPPAAL is 45. In that case, our model converts this number into the matrix shown in Figure 14. The 1’s in the matrix are then replaced by either a 1 or a 2 using the variables u,v,w,x,y,z given in Figure 13. Thus resulting in a total of 36 (729) topologies.

AC

Desired Clusters ( dc) = 1: Figure 17(a) shows the trend for generalized topologies when each node is initialized with energy = 8000 and the value of the parameter dc is 1. The number of nodes are 4 so the model is tested for 64 different topologies. The topologies are divided into four groups of 16. To determine the life span of the 4 nodes for these groups of topologies, the graph depicts the following properties:

M

(a) Matrix A

AN US

Table 1 Topologies for a specific number of nodes

– The maximum number of rounds that can be achieved by any topology within a specified group. – The minimum number of rounds that should be completed by the whole group of topologies. – The value of the round at which in a certain topology of the group, a first node’s battery dies. It can be observed that: – For higher order network topologies i.e.(48-63), the trend for the maximum number of rounds goes high. The reason being that the nodes are closely located to each other and are interlinked via direct connections. This results in lesser number of nodes sending their data on their own, thus utilizing the cluster formation of LEACH-C and consuming energy efficiently. – For all groups of topologies, the minimum number of rounds where all nodes die are equal. This shows that the LEACH-C protocol is stable and reliable, keeping the network alive for at least the given number of rounds. – The first node dies at a minimum round value of 40, which indicates a stable behaviour by LEACH-C up to 40 rounds.

ACCEPTED MANUSCRIPT Formal Comparison of LEACH and its Extensions

11

6.2 Trends observed in LEACH-F for Generalized topologies 6.2.1 Results for the number of nodes that died for different dc values

Fig. 16 Throughput Results for different topologies

Desired Clusters ( dc) = 2: All the other parameters remain the same but the desired clusters have been changed as shown in Figure 17(b).

Upon close inspection of Figure 20 we realize that LEACH-F performs better as compared to LEACH-C; as its maximum round value is higher for all topologies. The graph displays a uniform behaviour where LEACHF for all its topologies reaches a maximum of 81 rounds, whereas LEACH-C, although for higher topologies exhibits 85 rounds but, for all other topologies reaches 76 rounds.

M

6.1.2 Throughput Results for the different topologies

6.3 Comparison of Generalized topologies of LEACH-C and LEACH-F

AN US

It can be observed that the maximum number of rounds decrease when dc = 2, which shows that an optimum number of CH plays a vital role in the LEACH-C protocol.

CR IP T

It can be seen in Figure 19 that different desired cluster (dc) values result in changing trends for the death of the different number of nodes. The dc value can be changed at the BS as explained in Section 3.2. For the different dc values a specific trend can be observed. It can be seen that for dc=4 the round at which the first node becomes dead is constant i.e. 7. So it can be inferred that the optimum number of clusters is essential.

PT

ED

The calculation of error packets and total packets is already explained using Figure 10. It can be observed from Figure 16 that no packet is dropped in any topology, thus in an ideal condition 100% data transmission is successful.

CE

6.1.3 Results for Generalized topologies

AC

A 5 node network can be configured into 1024 topologies. They are further randomized and for every bit there are two possibilities of either a ‘1’ or a ‘2’ and thus the total number of possible topologies is 1048576 as explained in Section 5. The results are shown in Figure 18. Here the whole range of topologies is divided into groups of 16 as close ranged topologies behave in a similar fashion. The same properties are used as are used for obtaining the results, depicted in Figure 12. It can be seen that higher topology networks last for a longer time as they would have more direct links and thus they would send data to their CH more often and use less energy instead of sending data on their own and using their own energy.

7 Conclusion In the paper, we have formally analysed cluster based WSN routing protocols LEACH, LEACH-C and LEACH-F. These protocols are verified using LTL(Linear Temporal Logic) properties to ensure that each and every scenario is catered for. During this process formal models are compared using safety, liveness, reachability and sanity checks. Various graphs are presented and analysed in the paper comparing energy, lifetime and throughput of the protocols to draw a clear conclusion. Our formal investigation confirmed that for all the above-mentioned comparison parameters, LEACH-F and LEACH-C are far more mature and steady protocols than LEACH. Firstly, considering a fixed topology, the throughput comparison of the protocols in an ideal condition revealed that in the LEACH protocol, packets are lost during transmission, whereas LEACHC and LEACH-F protocols appear to be error free. The comparison of the energy consumption of the protocols displays that the life span of LEACH is much shorter than its extensions. The life span comparison portrays a similar behaviour, demonstrating the instability of the LEACH protocol and a tie again for the LEACH-C and

ACCEPTED MANUSCRIPT 12

*Ainan Ihsan et al.

(b) desired clusters = 2

CR IP T

(a) desired clusters = 1

AN US

Fig. 17 Life span of 4 nodes for different topologies

M

Fig. 20 Life span of 4 nodes for different topologies LEACHC and LEACH-F

AC

CE

PT

ED

Fig. 18 Life span of 5 nodes for different topologies

Fig. 19 Trends for different number of cluster heads

LEACH-F protocols. The results were then further narrowed down by comparing the LEACH-C and LEACHF protocols under generalized topologies. A comparison of the life span of the sensor nodes led us to the conclusion that LEACH-F performs best in an ideal condition, as it does not waste its energy in the formation of new clusters in every round.

In the future we aim to test more wireless sensor network protocols, especially other cluster based protocols and LEACH extensions, like LEACH-E, Leach Multi-hop, to prove the utility and effectiveness of formal modelling and verification. We also aim to test our findings by physical implementation on MicaZ motes.

References [1] W. B. Heinzelman, A. P. Chandrakasan, and H. Balakrishnan. An application-specific protocol architecture for wireless microsensor networks. Wireless Communications, 1(4):660–670, 2002. [2] G. Smaragdakis, I. Matta, and A. Bestavros. Sep: A stable election protocol for clustered heterogeneous wireless sensor networks. In Sensor and Actor network protocols and applications, volume 3, 2004. [3] MJ. Handy, M. Haase, and D. Timmermann. Low energy adaptive clustering hierarchy with deterministic clusterhead selection. In Mobile and Wireless Communications Network, 2002., pages 368–372. IEEE, 2002. [4] S. Shi, X. Liu, and X. Gu. An energy-efficiency optimized leach-c for wireless sensor networks. In Communications and Networking in China (CHINACOM), 2012 7th International ICST Conference on, pages 487–492. IEEE, 2012.

ACCEPTED MANUSCRIPT Formal Comparison of LEACH and its Extensions

13

CR IP T

[22] M. Elleuch, O. Hasan, S. Tahar, and M. Abid. Formal analysis of a scheduling algorithm for wireless sensor networks. In Formal Methods and Software Engineering, pages 388–403. Springer, 2011. [23] AK. Mclver and A. Fehnker. Formal techniques for the analysis of wireless networks. In Leveraging applications of formal methods, verification and validation, ISoLA 2006, pages 263–270. IEEE, 2006. [24] R. Bakhshi, F. Bonnet, W. Fokkink, and B. Haverkort. Formal analysis techniques for gossiping protocols. ACM SIGOPS Operating Systems Review, 41(5):28–36, 2007. [25] R. Alur. Formal verification of hybrid systems. In Embedded Software (EMSOFT), pages 273–278. IEEE, 2011. [26] L. Yadav, C. Sunitha, and G. Haryana-India. Low energy adaptive clustering hierarchy in wireless sensor network (leach). International Journal of Computer Science and Information Technologies, 5(3):4661–4664, 2014. [27] W. R. Heinzelman, A. Chandrakasan, and H. Balakrishnan. Energy-efficient communication protocol for wireless microsensor networks. In System sciences, 2000. Proceedings of the 33rd annual Hawaii international conference on, pages 10–pp. IEEE, 2000. [28] BP. Deosarkar, N. S. Yadav, and RP. Yadav. Clusterhead selection in clustering algorithms for wireless sensor networks: A survey. In Computing, Communication and Networking, 2008, pages 1–8. IEEE, 2008. [29] V. Katiyar, N. Chand, Gautam, and A. Kumar. Improvement in leach protocol for large-scale wireless sensor networks. In Emerging Trends in Electrical and Computer Technology, page 1070 – 1075, 2011. [30] E. Hansen, J. Neander, M. Nolin, and M. Bojorkman. Efficient cluster formation for sensor networks. The Online Publication Documentation System (OPUS), M¨ alardalen University, 2006. [31] A. Ihsan, K. Saghar, and T. Fatima. Analysis of leach protocol (s) using formal verification. In Applied Sciences and Technology, pages 254–262. IEEE, 2015. [32] D. Kumar and R. B. Patel. Multi-hop data communication algorithm for clustered wireless sensor networks. In International Journal of Distributed Sensor Networks, vol. 2011, Article ID 984795, 2011., page 10 pages, 2011. [33] G. Behrmann, A. David, and K. G. Larsen. A tutorial on UPPAAL. In Department of Computer Science, Aalborg University, Denmark, 2004. [34] Wu, Nan Modelling and Analysis of Wireless Sensor Networks with Energy Harvesting Capabilities 2012 [35] Smit, Troels Frederiksen Verification of sensor network models using Uppaal Technical University of Denmark, DTU, DK-2800 Kgs. Lyngby, Denmark, 2004. [36] Li, Lin and Li, Donghui An Energy-Balanced Routing Protocol for a Wireless Sensor Network Journal of Sensors,2018 [37] Pachlor, Rohit and Shrimankar, Deepti VCH-ECCR: A Centralized Routing Protocol for Wireless Sensor Networks Journal of Sensors,2017

AC

CE

PT

ED

M

AN US

[5] J. Gnanambigai, N. Rengarajan, and K. Anbukkarasi. Leach and its descendant protocols: A survey. International Journal of Communication and Computer Technologies, 1(3):15–21, 2014. [6] C. D¨ oner, G. S ¸ im¸sek, K. S. Yıldırım, and A. Kantarcı. Forest fire detection with wireless sensor networks. 2013. [7] I. Demirkol, F. Alagoz, H. Deli¸c, and C. Ersoy. Wireless sensor networks for intrusion detection: packet traffic modeling. IEEE Communications Letters, 10(1):22–24, 2006. [8] A. Mouradian and I. A. Blum. Formal verification of real-time wireless sensor networks protocols: Scaling up. In Real-Time Systems, pages 41–50. IEEE, 2014. [9] Z. Chen, D. Zhang, R. Zhu, Y. Ma, P. Yin, and F. Xie. A review of automated formal verification of ad hoc routing protocols for wireless sensor networks. Sensor Letters, 11(5):752–764, 2013. [10] A. Mouradian and I. Aug´ e-Blum. Formal verification of real-time wireless sensor networks protocols with realistic radio links. In Real-Time Networks and Systems, pages 213–222. ACM, 2013. [11] E. M. Clarke and J. M. Wing. Formal methods: State of the art and future directions. ACM Computing Surveys, 28(4):626–643, 1996. [12] M. Kwiatkowska, G. Norman, and D. Parker. PRISM: Probabilistic symbolic model checker. In T. Field, P. Harrison, J. Bradley, and U. Harder, editors, Proc. 12th International Conference on Modelling Techniques and Tools for Computer Performance Evaluation (TOOLS’02), volume 2324 of LNCS, pages 200–204. Springer, 2002. [13] G. Behrmann, A. David, K.G. Larsen, J. H˚ akansson, P. Pettersson, W. Yi, and M. Hendriks. UPPAAL 4.0. In Proceedings of the 3rd International Conference on the Quantitative Evaluation of SysTems (QEST) 2006, IEEE Computer Society, pages 125–126, 2006. [14] G. J. Holzmann. The model checker SPIN. IEEE Transactions on software engineering, 23(5):279, 1997. [15] A. Cimatti, E. Clarke, E. Giunchiglia, F. Giunchiglia, M. Pistore, M. Roveri, R. Sebastiani, and A. Tacchella. NuSMV 2: An opensource tool for symbolic model checking. In Computer Aided Verification, pages 359–364. Springer, 2002. [16] Q. Li, P. Schaffer, J. Pang, and S. Mauw. Comparative analysis of clustering protocols with probabilistic model checking. In Theoretical Aspects of Software Engineering, pages 249–252. IEEE, 2012. [17] N. A. Khan, K. Saghar, R. Ahmad, and A. Kiani. Achieving energy efficiency through load balancing: A comparison through formal verification of two WSN routing protocols. In Proceedings of IEEE in Applied Sciences and Technology, 2016. [18] M. Elleuch, O. Hasan, S. Tahar, and M. Abid. Formal probabilistic analysis of a wireless sensor network for forest fire detection. Symbolic Computation in Software Science, EPTCS, pages 1–9, 2012. [19] D. Camara. Formal verification of communication protocols for wireless sensor networks. In Federal University of Minas Gerais, pages 1–136, 2009. [20] D. Cˆ amara, A. AF. Loureiro, and F. Filali. Formal verification of routing protocols for wireless ad hoc networks. In Guide to Wireless Ad Hoc Networks, pages 189–210. Springer, 2009. [21] M. Elleuch, O. Hasan, S. Tahar, and M. Abid. Towards the formal performance analysis of wireless sensor networks. In Enabling Technologies: Infrastructure for Collaborative Enterprises, pages 365–370. IEEE, 2013.