FLORA: Fuzzy Based Load-Balanced Opportunistic Routing for Asynchronous Duty-Cycled WSNs

Many opportunistic routing (OR) schemes treat network nodes equally, neglecting the fact that the nodes close to the sink undertake more duties than the rest of the network nodes. Therefore, the nodes located at different positions should play different roles during the routing process. Moreover, considering various Quality-of-Service (QoS) requirements, the routing decision in OR is affected by multiple network attributes. The majority of these OR schemes fail to contemplate multiple network attributes while making routing decisions. To address the aforesaid issues, this paper presents a novel protocol that runs in three steps. First, each node defines a Routing Zone (RZ) to route packets toward the sink. Second, the nodes within RZ are prioritized based on the competency value obtained through a novel model that employs Modified Analytic Hierarchy Process (MAHP) and Fuzzy Logic techniques. Finally, one of the forwarders is selected as the final relay node after forwarders coordination. Through extensive experimental simulations, it is confirmed that FLORA achieves better performance compared to its counterparts in terms of energy consumption, overhead packets, waiting times, packet delivery ratio, and network lifetime.


INTRODUCTION
A Wireless Sensor Network (WSN) consists of a large number of sensor nodes.These nodes are randomly deployed in the sensor field to collect the sensory data and send it to the sink employing multi-hops mechanism.One of the most important constraints on sensor nodes is the limited power resource.This makes energy efficiency greatly important when designing routing protocols.
Duty-cycling, an effective mechanism for energy saving, is widely used in WSNs [1].In this mechanism, the node periodically switches between active and sleep states according to predefined active/sleep intervals [2].One of the two approaches, synchronous and asynchronous, is commonly utilized for coordinating active/sleep states in the MAC layer.In the synchronous approach, MAC layer synchronizes the active/sleep states so that the sender and its receiver simultaneously wake up to forward packets.Nevertheless, this incurs a great number of control messages to maintain time synchronization among nodes.Different from the synchronous approach, the protocol running the asynchronous approach efficiently reduces the number of control messages since nodes randomly wake up according to predefined active/sleep periods.However, this increases the packet delivery delay and the sender waiting time (a.al-dubai@napier.ac.uk); as the sender has to wait until its forwarder wakes up and receives the packet.Fortunately, Opportunistic Routing (OR), benefiting from the broadcast characteristic of wireless mediums, is suitable for asynchronous duty-cycled wireless sensor networks (WSNs) by broadcasting packets to a set of forwarders instead of a single predetermined forwarder [3].This effectively reduces the packet delivery delay and the sender waiting time.However, selecting multiple forwarders can cause multiple receivers problem (packets duplication problem) since multiple receivers may simultaneously wake up and receive the same packet.This leads to unnecessary energy consumption and a high traffic load.Additionally, if the ACK packet collides at the sender, this will cause a rise in the sender waiting time since the sender continuously transmits preamble packets until successfully receiving an ACK packet [2].As a result, the sender waiting time reduced by selecting multiple receivers may be offset by the collision of ACKs.In such case, the opportunistic routing may perform even worse than single receiver based routing.
Many protocols, such as LORA [2] and ORR [4], have been proposed to balance the sender waiting time and the packets duplication problem.However, these protocols view each node as equal importance and neglect the fact that the nodes close to the sink have to undertake more duties, receiving data from farther nodes and forwarding data to the sink, than the nodes far from the sink do, which imposes the nodes close to the sink to deplete their energy faster and significantly degrades the performance of network including, but not limited to, the network connectivity and the network lifetime.Therefore, the nodes located at different positions should play different roles during the routing process.We call this the location characteristics of nodes or the roles of nodes.For example, the nodes whose number of hops to the sink is one should directly forward packets to the sink instead of employing the multi-hops mechanism according to data transmission in one-hop region as explained in [5].The nodes whose number of hops to the sink are either two or three should pay more attention to the energy of their neighbors than the transmission distance and the direction angle factors.This leads to longer network lifetime and the nodes far from the sink should forward packets to the nodes close to the sink as soon as possible.
Considering the QoS metrics such as low waiting time, few duplicate packets and long network lifetime, the routing decision in OR is influenced by multiple attributes (multiple criteria or multiple factors).For example, the transmission distance, the direction angle and the residual energy are the most common attributes involved during the selection of next hop node.The routing decision is essentially a multiple criteria decision making problem.Fuzzy logic does not only provide appropriate methods to represent multiple criteria involved during the forwarders selection, but also provides efficient solutions to identify the relationships among different criteria and to aggregate these criteria.This enables the fuzzy logic to work well in dealing with the multiple criteria decision making problem.
Motivated by the aforementioned observations, we propose a Fuzzy based Load-Balanced Opportunistic Routing for Asynchronous Duty-Cycled WSNs (FLORA) to achieve the location characteristics of nodes and infer the final routing decision affected by various criteria.The main contributions of our work are described as follows.
1) We introduce fuzzy logic into the design of opportunistic routing protocol.We propose a fuzzy-logic model, in which the Takagi-Sugeno-kang (TSK) interface [6] is used to infer the competency value of each node.Compared to traditional fuzzy-logic model, our model directly outputs a value with no need for the defuzzification process.
2) A modified Analytic Hierarchy Process method is designed to achieve the location characteristics of nodes by assigning different control parameters to nodes located at different positions.
3) To route packets toward the sink and deal with the problem resulting from the randomness of node deployment, each node defines a routing zone.Moreover, a novel approach combined with routing zone is proposed to control the number of forwarders.In this approach, each node has one of the two actions, forward and drop.Only the nodes whose action is forward have qualification to become potential forwarders.
The rest of this paper is organized as follows.Section 2 explains the related works.The preliminary knowledge of our work is described in Section 3. Section 4 is devoted to the main idea of our protocol.The performance is analyzed in Section 5. Section 6 elaborates simulation setup and experimental results.Finally, Section 7 concludes this paper.

RELATED WORK
Significant efforts have been devoted to improving the network performance.In this section, we review two main approaches for improving the network performance, Opportunistic Routing and Fuzzy-based Routing.

Opportunistic Routing
Opportunistic Routing (OR) is an efficiently promising paradigm to improve the performance of wireless networks by exploiting the multiple transmission opportunities actualized by the broadcast nature of the wireless medium [3].S. Biswas et al. [7] proposed Extremely Opportunistic Routing (ExOR) which first clearly shapes and exhibits the structure of opportunistic routing concept.In ExOR, each node chooses a prioritized set of potential forwarders based on a metric called Expected Transmission Count (ETX).Although ExOR increases the throughput of network compared to single-path traditional routing, it still suffers from some shortcomings, such as waiting time, duplicate transmissions and being sensitive to link quality.O. Landsiedel et al. [8] proposed Opportunistic Routing in Wireless Sensor Networks (ORW) using a metric called Expected Duty Cycled Wakeups (EDC).ORW efficiently reduces the sender waiting time and energy consumption by utilizing an asynchronous lowpower-listening MAC and using lightweight mechanisms to ensure a unique forwarder in case of multiple receivers.Unfortunately, it still generates a mass of redundant packets and degrades the performance of the network.Later, Opportunistic Routing Based on Residual Energy (ORR) [4] is proposed to address the load balancing problem of energy and the duplicate transmissions problem.ORR considers residual energy factor in the design of the metric and calculates its optimal number of forwarders according to forwarding cost estimation.However, it incurs a great number of control messages and costly computational cost since the sink periodically collects the entire network information and recursively computes its optimal number of forwarders.Recently, A. Hawbani et al. [2] proposed Load-Balanced Opportunistic Routing for Asynchronous Duty-Cycled WSN (LORA).In LORA, each node defines a Candidates Zone (CZ) to restrict the number of candidate nodes.These nodes are locally prioritized based on neighbors information and only the nodes within the zone are allowed to forward data packets.Although LORA achieves better performance compared to its counterparts, LORA assigns the same control parameters to each node and ignores the location characteristics of nodes like protocols mentioned above.We found that the location characteristics of node have positive impacts on the network performance.

Fuzzy-based Routing
The fuzzy logic is a promising technique in dealing with the multiple criteria decision making problem.A large number of fuzzy-based protocols (e.g.[9], [10], [11], [12], [13], [14], [15]) are proposed for clustering tasks, selecting cluster-head (CH), computing cluster size or forming cluster.These protocols can be categorized into two groups, equal-clustering protocols (e.g.[9], [10], [11]) and unequal-clustering protocols (e.g.[12], [13], [14], [15]), according to whether the size of each cluster is equal.Cluster Head Election mechanism using Fuzzy logic (CHEF) [9], a distributed CHs election algorithm, introduces fuzzy logic into WSNs to optimize the energy consumption.In CHEF, the probability of each node to be CH is computed by considering nodes residual energy and distance between nodes and the sink.Like CHEF, Distributed Fuzzy Logic-based Clustering algorithm (DFLC) [10] and Energy Aware Distributed Clustering using Fuzzy Logic (EADC-FL) [11] are also distributed CHs election algorithms.DFLC designs a filter mechanism before CHs election to reduce the overhead of unnecessary data packets.In DFLC, the probability of each node to be CH is computed according to five factors, energy, centrality, distance to the sink, number of hops, and node density.Unlike CHEF, EADC-FL performs clustering on demand instead of each round in order to reduce the extra energy dissipation resulting from consecutive clustering phases.In EADC-FL, the probability of each node to be CH depends on node energy, node degree and node centrality factors among which the node energy is a primary factor to elect CHs.Compared to non-cluster protocols, equal-clustering protocols improve the network lifetime to some extent.Unfortunately, it still brings negative influences on load balance of the entire network.H. Bagci et al. [12] proposed Energy Aware Unequal Clustering with Fuzzy (EAUCF), which is a distributed competitive unequalclustering algorithm.In EAUCF, the competition range of each node is computed by considering residual energy and the distance to the sink.A node with the highest residual energy within the competition radius is selected as the CH.However, EAUCF causes the unreasonable energy depletion at the CH.To deal with this issue, R. Logambigai et al. [13] proposed Fuzzy Based Unequal Clustering (FBUC).Like EAUCF and FBUC, Low-Energy Adaptive Unequal Clustering Protocol using Fuzzy C-Means (LAUCF) [14] and Distributed Unequal Clustering using Fuzzy Logic (DUCF) [15] are also unequal-clustering protocols.LAUCF uses Fuzzy C-Means (FCM) to select CHs to uniform energy dissipation among the CHs.Unlike LAUCF, DUCF selects CHs by considering node residual energy, node degree and the distance to the sink.Although unequal-clustering protocols outperform equal-clustering protocols to some degree in terms of energy consumption and network lifetime, these protocols bring extra overhead for forming and maintaining clusters.M. R. Minhas et al. [16] proposed Fuzzy Multiobjective Routing Algorithm (FMO) which is a centralized non-cluster algorithm.Compared to cluster protocols, FMO avoids the process of clustering tasks.Unfortunately, it induces immeasurable cost for finding the minimum weight path from the source to the sink.In FMO, for each routing request, the sink firstly collects the information of nodes.Then, the sink tries to find a minimum weight path from the source node to itself using Dijkstra's Shortest Path Algorithm [17].Finally, the source node sends data packets along the minimum weight path.
Different from the aforementioned routing schemes, we propose FLORA, which is a non-cluster, fuzzy logic based, and distributed opportunistic routing protocol for asynchronous duty cycled WSNs.FLORA efficiently avoids the process of clustering tasks and locally selects next-hop according to the information sensed from neighbor nodes instead of the information collected from the entire network.Additionally, FLORA realizes positive impacts of the roles of nodes on the network performance and takes the roles of nodes into consideration during the routing process.

PRELIMINARIES
This section is devoted to elaborating three issues.i) The assumptions.ii) BoX-MAC protocol running in MAC layer.iii) Fuzzy logic introduced in this article.The number of hops from The transmission distance from sender node n i to its neighbor node n j .ϑ i,j The direction angle between n i and n j considering the location of the sink node n d .e i,j The residual energy of neighbor node n j of n i .di,j The transmission distance crisp parameter of neighbor node n j of n j .θi,j The direction angle crisp parameter of neighbor node n j of n j .ẽi,j The residual energy crisp parameter of neighbor node n j of n j .℘ i,j The competency value of neighbor node n j of n i .

i,j
The forwarding qualification of neighbor node n j of n i .

C i
The routing zone of the sender node n i .The sensing range.φ The communication range.

Assumptions
We assume that all sensor nodes are randomly deployed in a specific area.Each node is static and is aware of its own geographical coordinate (x i , y j ) through any localization scheme such as the one studied in [18].It is worth noting that an error of 6 meters (typical of GPS positioning [19]) is between 6% and 12% of the typical transmission range, which means it may have impacts on the protocol behavior.The network is formed from a set of a finite number of nodes, denoted by Any sensor node n i ∈ N has a limited sensing range , communication range φ = 2 * and non-renewable energy.The initial energy of n i is set to e * .We define the neighbors set of n i as N i , a subset of N, here N i = {n j | n j ∈ N and d i,j < φ} where d i,j denotes the Euclidean distance from n i to n j .And the size of N i is denoted by m i = |N i |.We used the same interference model as ORR [4].The First Order Radio Model [20] is employed to compute the energy consumption of n i .The notations used frequently in this paper are listed in Table 1.

BoX-MAC
BoX-MAC [21] is an asynchronous low power listening MAC protocol meeting duty-cycling.Each node utilizes the duty-cycled mechanism and periodically switches between active and sleep modes.In Box-MAC, when a sender transmits a packet, its intended forwarders probably are in sleep mode.Therefore, the sender continuously transmits the packet until either one of its intended forwarders wakes up and receives the packet or its timer expires.When a sensor node wakes up, it checks the channel.If the channel is idle, this node will switch to sleep mode.Otherwise, if there exits a packet, the node will verify the packet to decide whether to receive it or discard it.The node sends back an ACK to the sender after receiving the packet.When the sender receives an ACK, it stops transmitting.

Fuzzy Logic
This subsection presents the basics of fuzzy logic covering four aspects.i) Fuzzy set theory.ii) Fuzzification interface.

Fuzzy Set Theory
The fuzzy set theory, introduced by Lotfi A.Zadeh, is a powerful method for dealing with the uncertainty and imprecision resulting from limited knowledge in decision making processes.A fuzzy set is a set of pairs ) is a membership function of x i in a given objective A, which maps each value x i in X to a number within 0 and 1.The number indicates the degree of satisfaction of x i to the objective A.

Fuzzification Interface
Through the Fuzzification Interface composed of the classification of crisps and membership functions, each input value, such as the transmission distance d i,j between n i and n j , is first converted into corresponding crisp parameter.Then, each crisp parameter is mapped into a crisp item modeled as a fuzzy set which is characterized by a corresponding fuzzy membership function [24].For example, the fuzzy linguistic variable used for defining the "transmission distance" includes Close, Medium and Far items.Assuming d i,j = 45 and φ = 50, we first get the transmission distance crisp parameter di,j = 0.9 using Eq.(4).Then, the di,j is mapped to Far membership function according to crisps classification listed in Table 2.There are different types of membership function to describe various fuzzy linguistic variables in different situations, such as triangular, trapezoidal and singleton membership functions.The most commonly used membership function types are triangular and trapezoidal membership functions.

Fuzzy Rules
Fuzzy rules, expressed by various modalities, are widely used to deduce fuzzy output from input linguistic variables in the fuzzy logic system.The most commonly used fuzzy rule is "if-then" rule defined on the basic of experience and expertise.The rule can be written as the form: where χ i stands for the ith input variable, m denotes the mth rule in the fuzzy rules,

Analytic Hierarchy Process
The Analytic Hierarchy Process (AHP) as introduced in [25] is a useful tool for identifying the relationships among criteria by constructing a pairwise comparison matrix, where each entry a i,j , a constant between 1 and 9, reveals the importance of the ith criterion relative to the jth.For example, the entry a i,j = 2 denotes that the importance of the ith criterion is twice that of the jth criterion.A pairwise comparison matrix, including m criteria and denoted by A * , is shown in Eq. (1).Note that a i,k * a k,i = 1 and a i,i = 1.Each entry āi,j , in the normalized pairwise comparison matrix Ā * derived from A * , is computed using Eq.(2).Finally, the weight corresponding to each criterion is formulated by Eq. .

THE PROPOSED PROTOCOL
According to the fact that the nodes close to the sink deplete their energy faster than the rest of network nodes, FLORA is proposed to infer the final routing decision and accomplish the roles of nodes by assigning different roles to nodes from different tiers.Nodes in the same tier have the same roles and the ith tier includes the nodes whose number of hops to the sink is i.The concept of the tier is explained in Fig. 1.
The basic idea of this work is described as follows.i) Each node n i defines a Routing Zone (RZ) to address the problem resulting from the randomness of node deployment.ii) The nodes within RZ are prioritized based on competency value obtained through the fuzzy-logic model considering the location characteristics of nodes.iii) One of forwarders is selected as the final relay node after forwarders coordination.The rest of this section is organized as follows.Subsection 4.1 introduces the fuzzy-logic model proposed for FLORA.The Routing Zone is explained in Subsection 4.2.Subsection 4.3 illustrates the Forwarders Selection.Finally, the Forwarders coordination is described in Subsection 4.4.

Fuzzy-Logic Model Proposed for FLORA
The fuzzy-logic model proposed for FLORA, as shown in Fig. 2, is used to compute the competency value of each node.To design this model, some basic fuzzy logic concepts are considered.Before introducing these concepts, we first elaborate the working process of the model as follow.Each input value is converted into a crisp parameter.After the classification of crisps, each crisp parameter is mapped to a crisp item modeled as a fuzzy set which is characterized by a corresponding fuzzy membership function [24].And then, we designed a modified AHP method, constructing a dynamic pairwise comparison matrix where each entry is a function related with the number of hops to the sink, to   evaluate the relationship among the items.Finally, the TSK interface as introduced in [6] is exploited to infer the final competency value according to the fuzzy rules.

Crisp Parameter
We choose values of transmission distance, direction angle and residual energy metrics as the input of our model.Each crisp parameter is calculated on the basic of corresponding input variable.The transmission distance from the sender node n i to each its neighbor node n j is expressed as a random variable 2 and is shown in Fig. 3 (a).Based on the random variable d i , the transmission distance crisp parameter is denoted by The direction angle, related with the location of the n i , n i s neighbor nodes and the sink n d , is defined as a random variable ).The ϑ i,j shown in Fig. 3 (b) is calculated using Eq. ( 5) where a = (x j − x i , y j − y i ) and c = (x d − x i , y d − y i ).Based on the ϑ i , the direction angle crisp parameter, denoted by θi = ( θi,1 , θi,2 , • • • , θi,mi ), is calculated using Eq.(6).θi,j = For the sender node n i , we define the residual energy of its neighbor node n j as e i,j and the random variable e i = (e i,1 , e i,2 , • • • , e i,mi ) stands for the residual energy of each its neighbor nodes.Based on the random variable, the residual energy crisp parameter, ẽi = (ẽ i,1 , ẽi,2 , • • • , ẽi,mi ), is obtained by Eq. (7).ẽi = e i,j e * ∀n j ∈ N i (7)

Crisps Classification
Each crisp parameter is mapped to a corresponding linguistic item, according to the crisps classification as shown in Table 2.The ranges in this table are empirically obtained based on massive simulation results.For the node n i , we define transmission distance linguistic item of each its neighbor nodes as Similarly, the direction angle linguistic item and the residual energy linguistic item of n i 's neighbor nodes are defined as θi = θi,1 , θi,2 For instance, if di,j is equal to 0.9 within the range 67 100 ∼ 1 , then di,j is Far.  4 and some of our own experimental experience.Now, an example involving transmission distance attribute is used to illustrate how to obtain the transmission distance membership function which is depicted in Fig. 5. Here, Close, Medium and Far are the left boundary item, the intermediate boundary item and the right boundary item, respectively.Thus, Close, Medium and Far transmission distance membership functions should have a similar shape to l 1 , l 3 and l 2 , respectively.Considering the roles of nodes, there are some differences.For example, when the value of transmission distance crisp parameter is within the range (0 ∼ 0.29), the graph of the Close transmission distance membership function is designed as a slanted line rather than a horizontal line.

1) Transmission Distance Membership Function
A fuzzy linguistic variable is utilized to define the "transmission distance", which is denoted by T with three items set V (T ) = {Close, M edium, F ar}.Each item is shaped by a fuzzy set as follows.
The Medium transmission distance membership function is defined by where µ T C (x) represents the Medium transmission distance membership function and is formulated by Eq. (9). Similarly, is the Far membership function and is formulated by Eq. (10).
2) Direction Angle Membership Function The "direction angle" is defined as a fuzzy linguistic variable, denoted by D with five items V (D) = {ExtraSmall, Small, M edium, Large, SuperLarge}.Each item correspondingly represents a fuzzy set as follows.The ExtraSmall set is defined by , where µ D ES (x) represents the ExtraSmall membership function as given in Eq. (11).
defines the Small fuzzy set where µ D S (x), formulated by Eq. ( 12), is the Small membership function.
The Medium fuzzy set is defined by represents the Medium direction angle membership function as shown in Eq. (13).
The Large fuzzy set is defined by where µ D L (x) stands for the Large membership function as formulated in Eq. (14).
3) Residual Energy Membership Function A fuzzy linguistic variable, denoted by R with three items set V (R) = {Low, M edium, High}, is used to define the "residual energy".Each item is modeled by a fuzzy set as follow.R L = x, µ R L (x) | x ∈ [0, 1] defines the Low fuzzy set where µ R L (x) given in Eq. ( 16) represents the Low membership function.
The Medium fuzzy set is defined by where µ R M (x) stands for the Medium residual energy membership function shown in Eq. (17). Similarly, defines the High fuzzy set where µ R H (x) formulated by Eq. ( 18) corresponds to the High membership function.) is calculated using Eq.(20).Finally, the control parameters vector of the node n i , denoted by i , is obtained using Eq. ( 21) where the value of m is equal to 11.
Before illustrating how to design each entry in A * (h i,d ), we first explain the meaning and effect of each entry in A * (h i,d ).Considering a node n i located at yth tier (h i,d = y), f m,n (h i,d ) can be also written as f m,n (y).The value of f m,n (y) denotes the relative importance between the mth criterion and the nth criterion, as shown in Table 3.The relative importance is measured according to a numerical scale from 1 to 9 [25].For instance, when h i,d is 2 and the value of f 1,5 (2) is equal to 7, from point of view of n i , Medium residual energy is strongly more important than Close transmission distance.As a result, the value of w 5 i will be greater than that of w 1 i according to the Eq. ( 21).This means that the neighbor with more residual energy is more likely to become a potential forwarder compared to the neighbor close to n i .Now we explain how to design each entry in A * (h i,d ), which consists of two main steps.i) Sorting the 11 subcriteria involving in A * (h i,d ) based on the roles of the node n i .ii) Assigning a value to each entry according to Table 3. Considering a node n i located at 2th tier, h i,d is equal to 2. The design ideas of each entry in A * (2) are as follows.Firstly, for n i , the importance among 11 sub-criteria can be sorted as DES = DS > DM = RH > RM > RL > DL > DSL = TC = TM = TF.The importance among DES, DS, DM, and RH is sorted as DES = DS > DM = RH for the purpose of forwarding packets toward the sink.In order to achieve a longer network lifetime, the importance of remaining 7 sub-criteria (plus RH) is sorted as RH > RM > RL > DL> DSL = TC = TM = TF.As n i pays more attention to residual energy of its neighbors, the neighbor with more residual energy is more likely to relay This turn leads to longer network lifetime.Additionally, note that DSL = TC = TM = TF since these sub-criteria have a very small function.Secondly, since DES = DS, this means that ExtraSmall direction angle and Small direction angle are equally important.Thus, the value of f 7,8 (2) is set to 1 according to Table 3.As DS > DM, Small direction angle is more important than Medium direction angle.Consequently, the value of f 8,9 (2) should be greater than 1.It is set to 3 which is empirically obtained based on our simulation experience.Similarly, the remaining entries in A * (2) can be obtained.

Competency Value
For the sender node n i , the competency value is expressed as a random variable formulated by Eq. (22) where ℘ i,j denotes the competency value of n i 's neighbor node n j .Before explaining the competency value, we first introduce the fuzzy rules used for this model, as listed in Table 4 where TD denotes the transmission distance, DA stands for the direction angle and RE represents the residual energy.The fuzzy rules are designed to merge TD, DA and RE attributes.The TSK interface, which directly outputs a value with no need for the defuzzification process utilized for traditional fuzzy model, is exploited to evaluate the competency value of nodes according to the fuzzy rules given in Table 4.The rule combined with the TSK interface system has the form: representing competency value, is a number between 0 and 1 instead of a fuzzy linguistic term.For example, if di,j is Far, ëi,j is High and θi,j is Small, then F t di,j , θi,j , ëi,j = θi,j .Note that the value of ℘ i,j is equal to F t di,j , θi,j , ëi,j and the t is 36 here.

Routing Zone
To route packets toward the sink and deal with the problem given in Fig. 7 (a) arising from the randomness of node distribution, each node n i defines a Routing Zone, as shown in Fig. 7 (b), denoted by C i = {c 1 , c 2 , c 3 , c 4 } where c i = (x i , y i ) stands for the coordinate of a corner of C i .Note that ω i = 2 * φ and ι i = d i,d .Here ω i represents the width of n i 's zone and ι i denotes the length of n i 's zone.In the network initialization phase, each node n i calculates the coordinates of the four corners of the C i using Eq.(23).

Forwarders Selection
The nodes with multiple potential forwarders can reduce packet delay.However, these nodes have a high chance  of generating redundant packets, which causes unnecessary energy consumption [4].A novel approach combined with RZ is proposed to control the number of forwarders.In this approach, each node has one of the two actions, forward and drop.For the sender node n i , the action of each its neighbor node is defined as a random variable ) where i,j represents the action of n i 's neighbor node n j .Only the node whose i,j is forward has qualification to become a forwarder of n i .The procedures for computing the action of each n i 's neighbor node are outlined in Algorithm 1 where n j ∈ C i means n j locates within the C i .The key idea of this algorithm is as follows.The neighbor n j of n i should be selected as a potential forwarder when ℘i,j is greater than the threshold of competency value, n j locates within C i and the current number of forwarders of n i is fewer than the maximum threshold of forwarders of n i .Owing to FLORA locally making decisions according to the information sensed from neighbor nodes, the threshold of competency value and the maximum threshold of forwarders for n i are respectively formulated by 1 mi and 4 √ m i + 1 which are associate with the number of neighbors.

Input:
The size of n i 's neighbors: m i ; The normalized competency value of each The size of n i 's forwarders: f i , and f i ← 0; Output: 1: Sort ℘i in descending order; 2: for each ℘i,j ∈ ℘i do

end if 9: end for
In the network initialization phase, the sink first broadcasts a beacon containing its h d,d where the h d,d is set to 0, and then each node n i that hears the beacon updates its h i,d based on Algorithm 2. In addition, each node calculates its forwarder set based on the information of its neighbor nodes, as outlined in Algorithm 3. To reduce unnecessary network load and prolong the network lifetime, each time a node losing 5 percent of its energy updates its forwarder set according to Algorithm 4.

Algorithm 2 Procedures for Computing the Number of Hops to the Sink h i,d
Input: h j,d ; Output: 1: for each n i that hears the beacon sent by n j do 2: n i broadcasts a beacon packet that contains its h i,d ; 5: end if 6: end for Algorithm 3 Procedures for Initializing the Forwarder Set Input: The number of hops to the sink: h i,d ; Output: 1: for each node n i ∈ N do 2: Compute  Get the di,j using Eq.(4);

8:
Map di,j , θi,j and ẽi,j into corresponding di,j , θi,j and ëi,j respectively by considering crisps classifi- cation listed in Table 2

Forwarders Coordination
Coordination between forwarders is an effective scheme to decrease the number of duplicate packets.Our coordination scheme between forwarders is simplified as follows.Before transmitting the data packet, the sender node n i continuously sends preamble packets containing the ID of its forwarders until receiving an ACK packet.The nodes that successfully receive the preamble packet and match with one of the IDs will send back an ACK packet to n i while other nodes will discard the preamble packet.When n i receives multiple ACKs, it selects the node with maximum ℘ i,j among the nodes that have sent back an ACK as the final relay node.Calculate the ẽi,j using Eq.(7); Map ẽi,j into ëi,j based on Table 2; 5: Calculate the ℘ i,j based on Table 4; 6: end for 7: Compute the i,j using Algorithm.1; 8: for each n j ∈ N i do

ANALYSIS
In this section, the performance of FLORA is analyzed from two aspects.i) The feasibility of the protocol.ii) The impact of localization errors on the routing performance.Other aspects, such as energy cost and the average number of redundant packets, have been analyzed in our previous works [2] [26].

The Feasibility of the Protocol
We used Arduino Mega 2560 as the sensor node.Each node is equipped with a XBee S2C 802.15.4 radio frequency module for wireless communication as shown in Fig. 9 (a).This module allows users to adjust the transmission power among 5 levels from the lowest power level 0 to the highest power level 4. In order to verify the feasibility of our protocol, nodes are deployed in an area, as shown in Fig. 8, and the sink node locates at (0, 2).In this scenario, for each node, the power level and the communication range are set to the lowest power level and 5m, respectively.In addition, these nodes have the same duty cycles.Here, the active period is set to 3s and meanwhile the sleep period is 1s.The nodes located at (6, 8) and (10, 3) individually generate a data packet in each 5s.The results of evaluating the average waiting times (AWT) and the average number of overhead packets (AxOP) that are explained in 6.1.2varying the number of data packets are depicted in Fig. 9 (b).From Fig. 9 (b), we can conclude the existence of slight fluctuations as the number of generated data packets increases due to environmental influence and good performance achieved by FLORA.

The Impact of Localization Errors On the Routing Performance
In this subsection, the impact of localization errors on the routing performance is briefly analyzed from two aspects.i) Error model.ii) The probability of null relaying zone in the presence of localization errors.Extensive evaluations of how localization errors impact routing performance are presented in Section 6.2.

Error Model
To study the impact of localization errors on the routing performance, we introduce Gaussian errors into the x and y coordinates on the actual position of a node.We assume that the location errors on x-axis and y-axis for each node are modeled by two independent Gaussian distributions with zero mean and different standard deviations.For simplicity, we assume that the node n j locates at the origin of coordinates, as shown in Fig. 10 (a), and that the sender n i and the sink n d have no location errors.However, the location information of each node has errors in the simulation.The real and measured location of n j can be expressed as (x j , y j ) and (x j , y j ) respectively.Note that x j = x j + ε a and y j = y j + ε b , where ε a ∼ N 0, σ 2 1 and ε b ∼ N 0, σ 2 2 .Therefore, the probability density function of (x j , y j ) is presented by Eq. (24).
We define r and d as the radius of error region and the distance from n j to the line l i , respectively, as shown in Fig. 10 (b).The probability density of d, denoted by f (d), is formulated by Eq. (25) where A and B are the part of error region above the line l i and the overall error region, respectively.
Therefore, the probability that n j actually located within the region z 3 is measured inside the region z 2 , denoted by p, is computed by Eq. ( 26) where φ denotes the communication range of n i .The definition of the region of z 2 and z 3 refers to Fig. 10 (c).

The Probability of null relaying zone in the Presence of Localization Errors
We define the relaying zone of n i as the overlapping region between its routing zone and its communication range.There are two cases which cause null relaying zone.i) Nodes that are actually within the region z 3 are measured inside the region z 2 and no nodes are within the region z 4 .ii) Nodes that actually locate within the region z 2 are considered within the region of z 1 or z 2 after localization.The definition of the region z i (i = 1, 2, 3, 4) refers to Fig. 10 (c).Here, we do not consider the case that nodes located inside/outside the communication range of n i are measured outside/inside the communication range of n i .We assume that there are n nodes within the region of z 3 and z 4 after all nodes are randomly deployed in a specific area.Hence, the number of nodes located in the region of z 1 and z 2 is equal to m i − n, where m i is the size of n i ' neighbors.The probability that there are n nodes within the region of z 3 and z 4 after nodes deployment is formulated by Eq. (27).
Note that the sum of the area of z 1 , z 2 , z 3 , and z 4 is equal to πφ 2 and s zi is the area of z i .s zi is calculated by Eq. ( 28) where θ = arccos r φ .
We denote E i as the number of nodes within the region z i after nodes deployment.Due to positioning errors, the actual number of nodes within the region z i is denoted by E i .When E 3 + E 4 = n, the probability, E 3 + E 4 = 0, is equal to the probability that all of n nodes are within the region z 3 and these nodes are measured within the region z 2 owing to positioning errors, which is computed by Eq. (29).
Similarly, when E 1 + E 2 = m i − n, the probability, E 3 + E 4 = 0, is equal to the probability that there are k nodes within the region z 2 and each of them does not locate within the region z 3 after localization, which is calculated by Eq. (30).
Finally, the probability of null relaying zone in the presence of localization errors is formulated by Eq. (31).

PERFORMANCE EVALUATION
This section is devoted to the performance evaluation of our proposed routing protocol FLORA.Extensive experimental simulations have been performed.Before reporting the simulation results, we first introduce the simulation setup.

Simulation Setup
In this paper, we evaluated the performance of FLORA with a simulator used in [26], [27].Our source code is available online in the link: https://github.com/howbani/FLORA.

Simulation Settings
When the simulation starts, the nodes whose initial energy is 0.5 Joules are randomly deployed in a 400m × 400m sensing field and the sink node starting with unlimited energy is positioned in the center of the field.All nodes run BOX-MAC, have the same duty cycles and consume the energy according to the First Order Radio Model as in [28].We use the same interference model as ORR [4].The maximum error ratio of each link and the maximum retransmission times of each node are set to 0.2 and 3, respectively.To study the impact of localization errors on the performance of our protocol, we set the maximum location errors to 6m which is typically GPS positioning errors [19].We assume that the network generates a data packet from a random sensor node to the sink in each 0.1s.The size of the data packet is set to 1024bits.The default simulation parameters are listed in Table 5.

Evaluation Metrics
The following evaluation metrics are used to evaluate the simulation results.i) Energy Consumption (EC): The total energy consumption required to deliver data packets from the sources to the sink.ii) Average Number of Overhead Packets (AxOP): When the sender broadcasts a to its forwarders, all its awaken forwarders will receive the packet.However, after coordination, one of these forwarders is selected to relay the packet while the other forwarders will abort the received packet.The aborted packet is regarded as redundant packets.AxOP is the ratio of the redundant packet's count plus the control packet's count to the number of delivered packets.iii) Average Waiting Times (AWT): When all forwarders of the sender are at the sleep state, it has to wait until one of its forwarders wakes up and successfully receives the data packet.AWT is the ratio of the total waiting times to the number of delivered packets.iv) Packet Delivery Ratio (PDR): The ratio of the number of packets successfully received at sink to the number of packets generated by randomly selected source nodes.v) Network Lifetime (NL): The time (in seconds) from the simulation starting moment to the moment that the first node completely depletes its energy.

Representative Approach for Comparison
In order to thoroughly evaluate the performance of our protocol, namely FLORA, we select two different protocols for comparison, Opportunistic Routing based on Residual Energy, namely ORR [4], and Fuzzy Multiobjective Routing Algorithm, namely FMO [16].ORR is a opportunistic routing protocol for asynchronous duty-cycled wireless sensor networks.FMO is a fuzzy-based multiple routing algorithm.Further details on these two protocols can be found in the Section 2. In our simulation of ORR, the α parameter is set to 1.0.The authors of ORR evaluated the performance of ORR by varying α from 0 to 4 and pointed out that α greater than 1.0 has small impacts on the performance.In our implementation of FMO, the value of α, β, γ and ∆ are set to 0.2, 0.2, 0.9 and 0.2 respectively, which are the optimal parameter values as reported by the authors of FMO.

Simulation Results
The performance of the network is evaluated by varying two different evaluation scenarios, the communication ranges and the wake-up intervals.The simulation results in different scenarios are reported individually in the following two subsections and the concluded result is the average of 100 independent runs of the same configurations to mitigate the impacts of randomness and to guarantee the accuracy of simulation results.

Scenario 1: Varying the Communication Ranges
In this scenario, the performance of the network is evaluated by varying the communication ranges from 50m to 100m.Other parameters for this scenario are listed in Table 5.
(a) Energy Consumption: The results of evaluating the energy consumption varying the communication ranges are depicted in Fig. 11 (a).The energy consumption of the three routing protocols simultaneously decreases as the communication range increases since greater communication ranges results in fewer number of hops to the sink.This in turn reduces the number of nodes that packets traverse.Consequently, the total energy consumption reduces.Although ORR has more than FMO in the AxOP (see Fig. 11 (b)), the energy consumption in ORR is comparable to FMO for the two reasons.On the one hand, the delivery ratio of ORR is greater than that of FMO (see Fig. 11 (d)).Lower delivery ratio incurs more packet retransmissions, which inevitably causes more energy consumption.On the other hand, in order to maximum network lifetime, the packets in FMO will traverse a longer path to reach the sink, which causes more energy consumption.Compared to ORR and FMO, FLORA achieves better energy saving due to the following two reasons.First, each node, in FLORA, calculates its forwarder set according to the information locally sensed from neighbor nodes.However, ORR and FMO need to collect the information of the entire network to compute its forwarder set.This incurs a rise in the number of control packets, which results in a big amount of energy.Second, FLORA realizes that the roles of nodes have positive impacts on the network performance.In FLORA, the nodes close to the sink pay more attention to the energy of neighbors than transmission distance factor, which leads to less energy consumption.As a result, FLORA achieves better energy saving than ORR and FMO.
(b) Average Number of Overhead Packets: Fig. 11 (b) shows the evaluation results of the average number of over-head packets varying the communication ranges.Several observations are concluded.i) When the communication range is lower than 70m, the AxOP in ORR increases as the communication range becomes larger since greater communication range increases the number of candidate nodes.This inevitably increases the number of redundant packets.However, when the communication is greater than 70m, the AxOP in ORR decreases as the communication range increases since greater communication range leads to fewer number of hops to the sink, which in turn reduces the number of overhead packets.Compared to ORR, FLORA achieves better performance due to the following reasons.In FLORA, each node updates its forwarder set according to the information locally sensed from neighbors.However, ORR first need to collect the information from the entire network to compute its optimal number of forwarders n max , and then distributes the information to each node.This undoubtedly increases the number of control packets.In addition, it is inappropriate to use a global n max to control number of forwarders by virtue of nodes with different number of neighbors.In FLORA, each node individually calculates its maximum threshold of forwarders based on the number of neighbors and only the nodes whose action is forward have qualification to relay packets.This effectively limits the number of forwarders and reduces the number of duplicate packets.iii) The AxOP in FMO gets smaller as the communication range increases owing to the decline in the number of hops to the sink and the rise in the delivery ratio (see Fig. 11 (d)).
(c) Average Waiting Times: The comparison of ORR, FMO and FLORA for evaluating the average waiting times over the communication ranges is plotted in Fig. 11 (c).The average waiting times of the three protocols get smaller as the communication range increases for the following two reasons.On the one hand, the increment of communication range will reduce the number of hops to the sink.Fewer hops mean that the number of nodes that the packets traverse decreases, which reduces the waiting times.On the other hand, the increment of the delivery ratio (see Fig. 11  (d)) leads to a rise in the number of delivered packets.Compared to FMO, FLORA and ORR achieve better performance since each node in FLORA and ORR selects multiple potential forwarders.A sender with multiple forwarders can use different paths to forward packets to the destination, which effectively reduces the waiting times.Nevertheless, this also leads to a rise in the AxOP (see Fig. 11 (b)).Even though ORR has more than FLORA in the AxOP, FLORA is approximately similar to ORR with a minor difference in the AWT.The key reason is that FLORA considers the location characteristics of nodes during the routing process.In FLORA, the nodes far from the sink forward packets to the nodes close to the sink as soon as possible, which results in the reduction of waiting times.
(d) Packet Delivery Ratio: The results of evaluating packet delivery ratio varying the communication ranges are shown in Fig. 11 (d), which indicate that FLORA outperforms ORR and FMO since the delivery ratio is related with link quality and the number of forwarders.Different from FMO, each node in FLORA has multiple forwarders.This means that the sender does not need to wait for a specific node to wake up and to forward packets, which increases the number of delivered packets.In addition, ORR and FMO need to send a lot of control packets for collecting the entire network information to calculate the forwarder set.This causes more packets loss due to collision.
(e) Network Lifetime: Fig. 12 presents the results of evaluating the network lifetime varying the communication ranges.From Fig. 12, we can conclude that the network lifetime of the three protocols grows as the communication range gets larger owing to the increment in the number of neighbor nodes of the sink and the rise in the delivery ratio.Compared to ORR and FMO, FLORA achieves longer network lifetime due to the following reasons.During the process of forwarders selection, ORR collects global topological information prior to compute its optimal number of forwarders, and meanwhile FMO computes its minimum weight path from the sources to the sink according to the information collected from the whole network.This incurs a large number of control packets and consumes more energy.Different from ORR and FMO, FLORA updates its forwarder set based on the local information.During the routing process, FLORA realizes positive impacts of the roles of nodes on the network performance.In FLORA, the nodes with two hops to the sink assign a greater weight to residual energy factor, which results in a longer network lifetime.In addition, in FLORA, only nodes whose action is forward have qualification to relay packets.This effectively reduces the number of redundant packets, which in turn results in less energy consumption.Consequently, FLORA achieves longer network lifetime than ORR and FMO.

Scenario 2: Varying the Wake-Up Intervals
In this scenario, the performance of the network is evaluated by varying the wake-up intervals.The sleep period is set to 1s and while the active period varies from 1s to 5s.Other parameters for this scenario are the same with the simulation parameters listed in Table 5.
(a) Energy Consumption: The comparison of ORR, FMO with FLORA for evaluating the energy consumption over the active period is presented in Fig. 13 (a).The energy consumption of three protocols slightly grows as the active period gets longer.Longer active period makes nodes awake for a long time, which inevitably leads to a rise in the total energy consumption.FLORA achieves better energy saving than ORR and FMO for the following reasons.In FLORA, each node computes its forwarder set according to the local information.This reduces the number of control packets, which in turn incurs a decline in the energy consumption.Furthermore, FLORA considers the location characteristics of nodes during the routing process.In FLORA, the nodes with fewer hops assign a lower weight to the transmission distance factor, which further reduces the energy consumption for transmitting and receiving packets.(b) Average Number of Overhead Packets: The results of evaluating the average number of overhead packets varying the active period are plotted in Fig. 13 (b).The average number of overhead packets of FLORA and ORR increases as the active period becomes longer.The longer active period undoubtedly increases the probability of multiple receivers, which in turn generates more redundant packets.Compared to ORR, FLORA outperforms ORR for the same reasons explained in 6.2.1 (b).Unlike ORR, each node in FMO only has a forwarder instead of a set of forwarders.Therefore, the increasing active period has a small impact on FMO.
(c) Average Waiting Times: Fig. 13 (c) shows the results of evaluating the average waiting times over the active period.The average waiting times of the three protocols decrease as the active period increases since the waiting times not only depend on number of candidate nodes but also on active period.Longer active period increases the probability that when the sender is awake, one of its forwarders is also awake, which reduces the waiting times.Although the AxOP in FLORA is fewer than that of ORR (see Fig. 13 (b)), the AWT in FLORA is comparable to ORR.The main reason is that FLORA realizes positive impacts of the roles of nodes during routing process.In FLORA, the nodes far from the sink assign a greater weight to transmission distance factor since these nodes have enough energy.Greater transmission distance will result in fewer hops, which in turn incurs less waiting times.
(d) Packet Delivery Ratio: The results of evaluating packet delivery ratio varying the wake-up intervals are depicted in Fig. 13 (d).The delivery ratio of the three protocols slightly grows with the increment of active period since longer active period increases the probability that when the sender is awake, one of its forwarders is also awake.This in turn increases the number of delivered packets.In terms of delivery ratio, FLORA outperforms ORR and FMO for the same reasons explained in 6.2.1 (d).
(e) Network Lifetime: Fig. 14 depicts the results of evaluating network lifetime varying the active period, which indicates that the network lifetime of the three protocols decreases as the active period increases due to the rise in the energy consumption (see Fig. 13 (a)).Compared to ORR and FMO, FLORA achieves longer network lifetime for the same reasons explained in 6.2.1 (e).

CONCLUSION
In this paper, we propose FLORA, which is a distributed, fuzzy logic based, and opportunistic routing protocol for asynchronous duty cycled WSNs.Our proposed FLORA realizes positive impacts of the roles of nodes on the network performance and takes the roles of nodes into consideration during the routing process.The simulation results demonstrated FLORA achieves better performance compared to its counterparts in terms of energy consumption, overhead packets, waiting times, packet delivery ratio and network lifetime.Furthermore, the main idea of our work can apply to Mobile ad-hoc Network (MANET) and Vehicular ad-hoc Networks (VANETs) by constructing appropriate membership functions and modifying entries in the pairwise comparison matrix.
Fig. 1.The solid line betweenn i and n j indicates that n i and n j can communicate directly with each other.h 1,d , h 2,d , h 3,d , h 4,d , and h 5,d are 1.h 6,d , h 7,d , h 8,d , h 9,d , and h 10,d are 2.The 1th tier consists of n 1 , n 2 , n 3 , n 4 , and n 5 .The 2th tier is formed from n 6 , n 7 , n 8 , n 9 , and n 10 .

Fig. 2 .
Fig. 2. Structure diagram of the fuzzy logic proposed for FLORA.

Fig. 3 .
Fig. 3. (a) shows the transmission distance d i,j from the current sender node n i to its neighbor node n j .(b) shows the direction angle ϑ i,j from n i to n j with respect to the location of the sink n d .

Fig. 4 .Fig. 5 .
Fig. 4. (a) shows the graph of triangular membership function where l 1 and l 2 are used to describe a left boundary item and a right boundary item respectively.(b) shows the graph of trapezoidal membership function.Here, l 3 is used for describing intermediate items.

1 ]
defines the Close fuzzy set, where µ T C (x) represents the Close membership function and µ T C (x) is formulated by Eq. (8).
.00901 • x + 0.6, 0 ≤ x < 0.0111 −0.20929 • x + 0.70232, 0.0111 ≤ x < 0.25 −1.71429 • x + 1.07857, 0.25 ≤ x < 0.6 0.05, otherwise • x − 1.875, 0.5 ≤ x < 0.7 0.5 • x + 0.4, 0.7 ≤ x ≤ 1.0 0, otherwise(18)4.1.4Modified AHP Method (MAHP)A modified AHP method named MAHP is designed to accomplish the location characteristics of nodes by assigning different control parameters to nodes from different tiers.The nodes in the same tier have same control parameters.Different from the AHP method, the MAHP constructs a dynamic pairwise comparison matrix given in Eq.(19).Here, each entry is a function related with the number of hops to the sink,f m,n (h i,d ) * f n,m (h i,d ) = 1 and f m,m (h i,d ) = 1.Each function f m,n (h i,d ) (1 ≤ m < n ≤ 11) is drawn inFig.6 where f m,n (hops) denotes the entry f m,n (h i,d ).We include eleven sub-criteria in A * (h i,d ) where each column contains eleven rows representing Close transmission distance (TC), Medium transmission distance (TM), Far transmission distance (TF), Low residual energy (RL), Medium residual energy (RM), High residual energy (RH), ExtraSmall direction angle (DES), Small direction angle (DS), Medium direction angle (DM), Large direction angle (DL), and SuperLarge direction angle (DSL).Each entry āi,j (h i,d ) in the normalized pairwise comparison matrix Ā * (h i,d ) derived from A * (h i,d

Fig. 6 .
Fig. 6.The part of entries in A * h i,d .

Fig. 7 .
Fig. 7. (a) shows the problem arising from the randomness of node distribution.Here n i is a direct neighbor of n d .n k , n j and n d are neighbors of n i .If ϑ i,j < 2 225 , which means θi,j is ExtraSmall, n i may forward packets to n j instead of n d .In fact, n i should directly forward packets to n d .(b) shows the routing zone for n i .

4 :
for each n j ∈ N i do 5:

Algorithm 4
Procedures for Updating Forwarder Set at Node n i Input: e i = (e i,1 , e i,2 , • • • , e i,mi ); Output: 1: F i ← ∅; 2: for each n j ∈ N i do 3:

9 :
if i,j = f orward do 10:Add n j to F i ;

Fig. 10 .
Fig. 10.(a) shows location errors model.(b) presents a simplified and enlarged version of (a).(c) depicts the region z i .

TABLE 1 NOTATIONS
1.The solid line between n i and n j indicates that n i and n j can communicate directly with each other.h 1,d , h 2,d , h 3,d , h 4,d , and h 5,d are 1.h 6,d , h 7,d , h 8,d , h 9,d , and h 10,d are 2.The 1th tier consists of n 1 , n 2 , n 3 , n 4 , and n 5 .The 2th tier is formed from n 6 , n 7 , n 8 , n 9 , and n 10 .

TABLE 2
are used to describe different fuzzy linguistic terms, such as triangular, trapezoidal and singleton functions.In this paper, the triangular membership function and the trapezoidal membership function are employed to describe boundary items and intermediate items in a fuzzy set respectively.The most widely used graphs of the triangular and trapezoidal membership functions are shown in Fig. 4. The membership functions for boundary items and intermediate items used in this paper are obtained based on the graph shown in Fig.

TABLE 3 The
Definition of Relative Importance

; 9 :
Compute the ℘ i,j by considering fuzzy rules listed in