{'fraction_non_alphanumeric': 0.021633221204036653, 'fraction_numerical': 0.0041758496694119015, 'mean_word_length': 4.761109254928166, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A version of LEACH Adapted to the Lognormal Shadowing Model

. The most protocols designed for wireless sensor networks (WSNs) have been developed for an ideal environment represented by unit disc graph model (UDG) in which the data is considered as successfully received if the communicating nodes are within the transmission range of each other. Howev-er, these protocols do not take into account the fluctuations of radio signal that can happen in realistic environment. This paper aims to adapt LEACH protocol for realistic environment since LEACH is considered as the best cluster-based routing protocol in terms of energy consumption for WSNs. We have carried out an evaluation of LEACH based on two models; lognormal shadowing model (LNS) in which the probability of reception without error is calculated according to the Euclidian distance separating the communicating nodes and probabilistic model in which the probability of reception is generated randomly. In both models, if the probability of successful reception is lower than a predefined threshold, a multi-hop communication is incorporated for forwarding data between cluster-heads (CHs) towards the base station instead of direct communication as in original version of LEACH. The main aims of this contribution are minimizing energy consumption and guaranteeing reliable data delivery to the base station. The simulation results show that our proposed algorithm outperforms the original LEACH for both models in terms of energy consumption and ratio of successful received packets.


Introduction
WSNs are composed of hundreds and thousands of small devices called "sensor nodes" distributed over a monitoring area for sensing data and sending it to a remote base station directly or via a multi-hop communication scheme depending on the application designed [1]. This novel technology has allowed the appearance of many applications such as; military, security, medical, environment monitoring, etc, due to the low cost of sensor nodes. Moreover, with this technology our way of life has been revolutionized since it allowed us to interact with the surrounded environment.
Routing process is a fundamental operation in wireless sensor networks. It consists in establishing path to transmit a message from a source node to a remote base station according to the main routing schemes: hierarchical, location-based, data-centric and QoS-aware [2]. However, cluster-based routing in wireless sensor network is considered as the perfect solutions for minimizing energy consumption [3,4]. In this scheme, the network is divided into clusters wherein each cluster contains a number of members which sense data from its environment and send it to its corresponding clusterhead (CH). The latter is responsible for gathering data received from its members. If the distance between the source node and the destination node will increase, the energy consumption also increases, thereby a cluster-based routing scheme is recommended. Among the protocols proposed, LEACH (Low Energy Adaptive Clustering Hierarchy) [5] is considered as the best cluster-based protocol for saving energy. Nevertheless, the performance of these protocols may degrade in non-ideal environments.
In this paper, we used the lognormal shadowing model [6] and the probabilistic model to simulate a non-ideal environment, and we evaluated the performance of LEACH with these both models. Then, we proposed an improved version of LEACH to overcome the limitations of the original version. The proposed version involves a CH-to-CH routing scheme to guarantee reliable delivery. This routing scheme is used if the probability of reception of packets without error between cluster-heads and the base station is lower than a predefined threshold. Moreover, this scheme also permits to minimize energy consumption. The rest of paper is organized as follow; in section 2, we give an overview on LEACH protocol and discuss some works that improve LEACH related to our requirements. Section 3 presents our improved version of LEACH to be adapted in realistic environment, and in section 4, we illustrate performance of LEACH and the proposed contribution in non-ideal environment. Finally, in section 5, we conclude our paper.

Related Work
Since LEACH protocol is considered among the best cluster-based routing protocols in terms of energy efficiency, a lot of researches have been enhancing this protocol to reduce its limitations. In the following, we present briefly LEACH protocol and some variants of it. LEACH [5] is a cluster-based routing protocol that aims to minimize energy consumption and thereby increasing network lifetime. In LEACH, the network is divided into clusters and each cluster is headed by a cluster-head which is elected by itself by generating a random number between 0 and 1. If the number generated is lower than a predefined threshold, the concerned node becomes a CH for the current round. The threshold is computed by each sensor node according to the equation (1).
where p is the percentage of cluster-heads, r is the current round, G is the set of nodes that have not been selected as cluster-heads in the last (1/p) rounds.
LEACH is performed in two phases: setup phase and steady phase. In setup phase, each CH broadcasts an advertisement message to construct its cluster, and each non-CH that receives this message joins the adequate cluster based on the RSSI (Received Signal Strength Indication) of the message received. Once the clusters are formed, a TDMA (Time Division Multiple Access) schedules are assigned to member nodes in each cluster. In steady phase, each member transmits its sensed data to its corresponding CH in its scheduled time-slot, and then the CH aggregates all data received from its members and sends it to the remote base station directly. To avoid interference between cluster-heads, each CH chooses a CDMA (Coding Division Multiple Access) code that is different from other clusters to communicate with the base station.
In [7], the authors have proposed a multihop routing scheme with lower energy adaptive clustering hierarchy called MR-LEACH. In this scheme, the CHs are responsible to aggregate data sensed by their members and act as relay nodes for remote CHs from the base station. MR-LEACH increases network lifetime since it uses a multihop routing scheme. This protocol is performed in three phases: cluster formation at lowest level, cluster discovery at different levels and scheduling. At the beginning of each round, cluster formation phase is lunched to construct a table in which each node maintains the information about its neighbors (node identifier, residual energy and node status) by using a 'Hello' message. Then, CHs broadcast a HEAD-MSG message in its vicinity and each non-CH chooses its respective CH among those in its neighborhood based on the strength of RSSI. In cluster discovery, the base station broadcasts its identifier (ID). Each CH that receives this broadcasted message records the identifier of the base station and replies by a beacon signal with its ID. CHs that are closest to the base station are in level one i.e. they could reach the base station by single hop. Then, BS broadcasts again a control message, the CHs that are at level two reply to this message forwarded by CHs of level one and the BS would record cluster-head's ID and its level. Similarly, this process is repeated until no new CH is discovered. After that, the BS will form a cluster of CHs. In scheduling phase; after cluster formation, a TDMA scheduling is used for communication between CHs at different levels.
In [8], the authors proposed MH-LEACH which uses a new scheme for multihop communication to minimize energy consumption. MH-LEACH is carried out in two phases to establish paths towards the base station. In the first phase, the cluster-heads are selected as in the original version of LEACH protocol, and then each CH broadcasts an announcement message within its vicinity. Each non-CH that receives this message chooses the closest one based on the RSSI of the message received. Moreover, the base station performs the same process. In the second phase; each CH sends its initial route to reach the base station and the latter send back the route to the CH to confirm that there is a route between the considered CH and the base station. Therefore, a routing table is created by each CH that contains a list of available routes to the base station and the shortest one is used.
In [9], the authors proposed an improved version of LEACH in which a multihop scheme is used and the election of the cluster-heads is done according to its residual energy. In this protocol, a multihop routing scheme for intra-cluster communication and a chain structure routing scheme for inter-cluster communication. The proposed protocol is performed in three phases: cluster formation, data delivery and update of clusters. At the beginning of the first phase, each node generates a random number between 0 and 1 and compares it with a predefined threshold to which the energy factor is added as illustrated by the equation (2).
where E n is the residual energy and E Average is the average residual energy of all nodes.
Each CH sets H to 0, where H is the number of hops from CH, and broadcasts a message containing (H=0, ID) in its vicinity. Each non-CH that receives this message joins the cluster to which it belongs the transmitter CH and sets its own CH to the CH of the message received and H to H+1, and PID with the ID of its parent. Then, this node also broadcasts a message containing (H j ,ID). If a node receives more than one message it compares its own H with H of the sending nodes and it updates its H with the lowest one among those received. For intra-cluster communication, each node sends its packet to its parent and this latter sends it to its parent until reach the CH, and in inter-cluster communication, CH transmits data in chain structure. The concerned CH chooses the closest CH from it as the next hop and this process is repeated until reach the base station. In update of clusters, at the end of a round the remaining energy of CH may not be sufficient for the next round so the CH must be replaced by the node with the greatest residual energy.
In [10], an enhanced version of LEACH is proposed whose aims are saving energy by using a CH-to-CH multihop scheme and creating a backup path between clusterheads to achieve fault-tolerance in the presence of failures. At the beginning, the base station broadcasts a HELLO message and each CH that receives this message calculates the RSSI. If RSSI is higher than a predefined threshold, this CH is closest to the base station and if not the CH is away from it and therefore it needs a relay node to reach the base station. The relay node is one of the CHs that are closest to the base station and it is selected based on the RSSI of a message exchanged between CHs and a variable called C red which is a random number comprised between 0 and 1. If each of these parameters is higher than a threshold, this CH is considered as perfect relay node. However, the failure of one CH on the multihop path can affect the entire path and then the information cannot reach the base station, in this case a backup path is incorporated to this multihop path to ensure fault-tolerance and reliable delivery.

Contribution
Before presenting our contribution, we give a brief description of the lognormal model and probabilistic model. Then, we evaluate the performance of LEACH protocol with the both models to point out its weaknesses over an ideal environment.

Lognormal Shadowing Model
The lognormal shadowing model [6] is considered as a realistic model. It takes into account the fluctuations of radio signal caused by several factors such as noise, the presence of obstacles, weather conditions, etc... to evaluate the link quality between communicating nodes. The link quality is used to determine the probability of successful reception between communicating nodes in order to know if the message is received or it is corrupted by the destination node. Since this probability implied several factors, it may be difficult to obtain an accurate evaluation for all these factors which are themselves prone to errors. Therefore, we assume that signal strength gradually decreases according to the distance; thereby the probability of reception without errors can be computed according to the distance separating two nodes. We used the fluctuation of the signal model described in [11] as presented by the equation (3).
where  is the attenuation factor that depends on the environment and x is the distance separating the two communicating nodes. R c is the transmission range and if the distance between two nodes is equal to R c , the probability of successful reception is 0.5.

Probabilistic Model
In this model, the probability of reception without errors is generated randomly between each two communicating nodes. This model is used to illustrate the link quality. Moreover, the probability of successful reception is independent of the distance separating the communicating nodes but it depends on the factors which exist in the environment such as the presence or the absence of obstacles. Fig. 1 shows that node A can communicate with the node B but it cannot communicate with the node C although the distance that separates it with the node C is lower than that of the node B.

Proposed Scheme
In WSNs, LEACH is considered one of the best protocols in terms of energy efficiency. Several proposed protocols compare its effectiveness to LEACH and a lot of improved versions of LEACH have been proposed to reduce its limitations but they cannot guarantee its functionalities in a realistic environment. Our proposed algorithm aims to minimize energy consumption and ensures reliable delivery to the base station in a realistic environment based on lognormal shadowing model and probabilistic model. We have proposed a multihop scheme instead of direct communication scheme between clusterheads and the base station to overcome the limitations of LEACH, such as when a CH aggregates data received from its members it computes the probability of reception without error of its packet to the base station. If this probability is higher than a predefined threshold, the packet is received correctly via direct communication by the base station and if not it means that the communication link is unreliable and in this case a multihop communication scheme will be incorporated to ensure the successful reception of packets by the base station. The proposed routing schemes are performed according to the following algorithms: Algorithm 1: Routing scheme based on LNS model -CH S : Set of clusterheads -BS: Base station whose coordinates (x b , y b ) -d: Euclidean distance between CH(x,y) and BS -CH D : Set of clusterheads that can send data directly to the BS -CH R : Set of clusterheads that use relay nodes to reach the BS

Simulation Results
Several simulations have been carried out to illustrate the performance of our contribution using TOSSIM simulator [12], and compared them with the original version of LEACH in terms of energy consumption and the ratio of successful received packets at the base station. For that, we used a network that contains respectively 20, 40, 60, 80 and 100 stationary nodes, which are randomly deployed on a 100m x 100m square area and the initial energy of each node is equal to 2 joules. The simulations were performed in 600 seconds, and we used a threshold p= 0.7 for probability of reception without error in LNS model. We used this threshold to avoid on the one hand the ideal model whose threshold is 0.5 and the other to avoid a highly disturbed environment.
Moreover, for probabilistic model, we used a threshold of p=0.5 i.e. a clusterhead generates a random number comprise between 0 and 1 and if this number is higher than 0.5 we assume that this clusterhead can communicate directly with the base station. Table I summarize simulation parameters.   Fig. 2 shows that the ratio of successful packets received at base station with a probability of p=0.7 in improved LEACH is higher than in original LEACH and also the ratio is higher with probabilistic model compared with LEACH. In improved LEACH the unreliability of links between a clusterhead and the base station can be treated by a multihop communication by against, in original LEACH the packet will be lost due to the unreliable links.

Conclusion
In this paper, we have evaluated LEACH protocol in a realistic environment represented by lognormal shadowing model and a probabilistic model. However, results obtained illustrated that the performance of LEACH degrades in this kind of environment. Therefore, we have proposed an improved version of LEACH to overcome its weaknesses with realistic environment. The proposed scheme aims to find an op- The simulation results showed that our contribution outperforms the original version of LEACH in terms of energy consumption and ratio of successful packets received at the base station. Moreover, our contribution deals with fault tolerance in LEACH, ensures reliable delivery and minimizes energy consumption.