MG-leach: an enhanced leach protocol for wireless sensor network

A wireless sensor network is made up of a large number of small sensor nodes with limited energy resources, which is a real problem for this network. In this article, we will study the ingestion of node energy in these networks at the routing level. In addition, we are modifying one of the most popular routing algorithms for data communication in the WSN: LEACH (Adaptive Hierarchy with Low Power Consumption). The modified version of the LEACH base version "MG_LEACH" uses an intermediate cluster header to transmit data, extend the network lifetime and send more data than the original protocol. Our proposed algorithm is simulated using MATLAB to verify the effectiveness of improving the lifetime of this network. The results of the simulation confirmed that the system was working better than the LEACH basic system and that the network life had been improved.


INTRODUCTION
Energy-efficient wireless sensor networks [1][2][3] as shown in Figure 1 are required for real-time embedded systems [4,5] and applications using the Internet of Things [6,7], but it is associated with many constraints, such as a computing power and limited battery, as well as an insufficient storage capacity. It is therefore essential to manage resources with caution. A problem of major importance for a WSN is to maximize network lifetime, which is related to the amount of energy stored in each node [8]. In most applications, the sensor nodes are equipped with small irreplaceable batteries of limited power capacity [9,10]. In this context, various researches have been devoted to optimizing the energy consumption of the sensor node in order to increase the lifetime of the network [11], namely that it is composed of four main units, such as the calculation or processing, communication, perception and control of energy as shown in Figure 2. The limited power of the sensor nodes requires the design of a communication protocol that saves energy. Most of the communication protocols proposed improve energy efficiency. This can be exploited at the network layer to improve this energy efficiency and bandwidth requirements [13,14]. Data aggregation is also an imperative paradigm for condensing data. As a result, the energy of the network is spent efficiently without losing the accuracy of the final aggregated data. There are many protocols like DD [15], SPIN [16], SAR [17], TEEN [18], LEACH [19], the network lifetime achieved by FSEP-PSORM could be increased by nearly 38%, 45%, and 60% more than that obtained by PEGASIS, LEACH and stable election protocol clustering (SEP), respectively [20]. GAEEP shows that outperform in the field of total energy consumption with various cycles and network lifetime, number of active nodes compared to the number of rounds and packet distribution or packet drop rate, also able to balance cluster headload [21], The LEACH Protocol is mainly used for homogeneous sensor networks with the same initial energy, and SEP is used for heterogeneous sensor networks with different initial energies [22] etc. In this article, we choose to use the Lower Energy Adapting Cluster Hierarchy (LEACH) protocol Figure 3. In addition, it uses the concept of rounds (period) in which nodes are organized into clusters and uses cluster heads as permanent active nodes at each turn. This protocol therefore reduces energy consumption [23]. In fact, several improvements have been made to this protocol in order to further extend the lifetime of the network and simultaneously send a maximum of packets using the position of the cluster heads and the base station.

RELATED WORK 2.1. Leach protocol
The LEACH protocol assumes the equality of the residual energies of the sensors at the beginning of the operation of the network. The service life of the network is then segmented in rounds characterized by a choice of CH. Each cycle has two phases: the set-up phase and the steady state phase. The set-up phase is composed of three sub-phases: announcement, organization of the group and finally planning.

Announcement phase
Before launching this phase, we want to shed light on CH. The number K of CH is constant during all turns, Its estimated optimal percentage should be between 5% and 15% of the total number of nodes, otherwise it will cause a great dissipation of energy in the network.
In fact, if the number of CH is very high, we will have a large number of CH nodes devoted to very expensive tasks in energy resources. However, we will have considerable energy dissipation in the network. Moreover, if the number of CH is very small, they will manage large groups. As a result, they will quickly run out due to the important task they are supposed to perform. This phase begins with the announcement of the new cycle by the local decision of a node that can become a CH with a certain probability Pi (t) at the beginning of the cycle of r + 1, which begins at time t. Each node has a random number between 0 and 1.
If this number is less than Pi (t), the node will become CH during the turn r + 1. Pi (t) is calculated as a function of K and the turn r, given by formula (1), where N is the total number of nodes in the network. If we have N nodes and K CHs, then it will take N / K rounds during which a node must be elected only once as much as CH before the round is reset to 0. So the probability of becoming CH for each node i is: With Ci (t): the node eligibility to be CH at time t. Where Ci (t) is equal to 0 if the node i has already been CH during one of the previous rounds, and is equal to 1 otherwise. Therefore, only nodes that have not yet been CH are likely to have sufficient residual energy relative to others that they can be selected. Figure.

Organization phase
After a node is elected CH, it must inform the other sensor nodes of its new rank in the current round. For this, an "ADV" warning message containing the identifier of the CH is broadcast to all other nodes using the CSMA MAC protocol to avoid collisions between the CHs. Broadcasting ensures that all nodes have received the message. Moreover, it ensures that the nodes belong to the CH that requires the minimum energy for communication. The decision is therefore based on the amplitude of the received signalby the CH with the strongest signal, that is to say the nearest will be chosen. In the event of signal equality, ordinary nodes randomly select their CH. Each member informs his / her CH of his decision. Once the CH has received the request, it sends an acknowledgment message "Join-REQ".

Planning phase
After group formation, each CH acts as a local command center to coordinate data transmissions within its group. It creates a TDMA scheduler and assigns each member node a time slot during which it can transmit its data. The set of slots assigned to the nodes of a group is called frame. The duration of each frame differs according to the number of members of the group. In addition, to minimize interference between transmissions in adjacent groups, each CH randomly chooses a code from a list of CDMA propagation codes. It then transmits it to its members for use in their transmissions, hence the next phase is that of transmission

Transmission phase
In this second phase, the data transfer will take place to the BS. Using the TDMA scheduler, members emit their captured data during their own slots. This allows them to turn off their communication interfaces outside of their slots to save their energy. These data are then aggregated by the CHs that merge and compress them, and send the final result to Sink. After a predetermined time, the network will move to a new round. This process is repeated until all nodes in the network are elected CH once, all through the previous rounds. In this case, the round is reset to 0.
In this work, we implement an energy model that covers both transmission and reception communications. This is a radio model used in the simulation of the LEACH and MG-EACH protocols shown in formulas (2), (3) and (4). Thus, to transmit a message of size S (bits) over a distance D (meters), the transmitter consumes:

ETx = { S * E elec + S * E el * D² ; D < D threshold S * E elec + S * E el * D 4 ; D ≥ D threshold
(2) With : Eelec=50*10-9J , Eel=9.67*10-12J , Emc=1.3*10-15J D threshold ≈ 86 The energy consumed at the reception level is calculated as follows: Among the disadvantages of LEACH protocol is the reduction of the energy of the nodes, this decrease is due to the use of a single jump communication instead of a multi-hop communication.
Even if the lifetime of the network is more than other protocols such as plane multipath routing, it still has some drawbacks. The cluster-head communicates directly with the sink which causes some problems. Firstly, if the sink is far from the cluster-head, it will be impossible to communicate with it. Secondly, even if the sink is reachable by the cluster-head, the necessary energy to transmit data will be very high. Thus, the energy consumption of the network will increase. Therefore, the liftime of the network will be affected.

PROPOSED PROTOCOL
Our contribution, in this paper, is an improved Leach protocol called MG-LEACH [1]. In fact, In MG-LEACH, deployed nodes are divided in to Sub Groups (G1….Gk) depending upon their locations. Number of groups are mainly depends upon Node density. These groups are created by the Base-Station at the time of deployment and after every "x" rounds. This is an additional step used in our proposed algorithm before setup phase and steady state phase and known as Set building phase.MG-LEACH consists of three steps, the build phase is used at deployment time and after each "x" rounds per BS, and the remaining two are the same as those used in LEACH such as the Installation Phaseand steady state phase.
At the beginning of setup phase, each node chose a random number from 'zero' to 'one' and compares it to a threshold Pi(T) , which is calculated as follow: x [ ]  ] ² is the node's energy devided by initial energy to select the node having highest level of residual energy.
At the time of random node deployments, each node is equipped with a GPS module that sends the location information of that node directly to the BS. The BS will use the information provided for each phase of construction of the set. As it has been done only once and therefore it does not consume too much energy.
Set up phase and steady state phase is same as used in LEACH and works in every group separately. These groups do not work simultaneously but on alternate basis e.g. one at a time as per set duty cycle by BS. If Network comprised by Sub Group G1 is working Nodes of Sub Group G2 will be in sleep state. The duty cycle is set by BS at the time of Setbuilding phase. Minimum group of nodes construct at the time of deployment is two but mainly depends upon node density in the entire network.
We have simulated the MG-LEACH and find it much more efficient than LEACH. We have checked the performance by taking different initial energy of deployed nodes also with different value of p. MG-LEACH is performed much better than LEACH as increased Network lifetime considerably. We can use this proposed algorithm with any variant based on LEACH in which set threshold has been modified either by addressing the shortcomings in the form of considering residual energy as well as other parameters.

SIMULATIONS AND RESULTS
In this section, we are going to use a simulation to evaluate and analyze our protocol. We simulate MG-LEACH along with LEACH algorithm in MATLAB to set up a comparative analysis both for LEACH and MG-LEACH. For the experiment, the random network of 300 Nodes is used. The Base-Station was placed in centre Location with dimension (x=100, y=100). The bandwidth of the channel was set to 1 Mbps. Each data message was 4000 bytes long with header packet which is 25 bytes long. The radio electronics energy was set to 50 nJ/bit and the radio transmitter energy Ejs Set t0 100pJ/bit/m² for distances less than 87m and 0.0013pJ/bit/m4 for distances greater than 87m. The energy for performing Computations to aggregate data was set to 5 nJ/bit/signal. In order to get improved and quite accurate comments of the algorithm, we establish the same simulation scene 30 times and the taken result is the average of the contain outputs. For energy model, we assume that each node begins with equal energy and an unlimited amount of data to send to the base station. Once a node runs out of energy, considered as dead node and can no longer transmit or receive data. The valve of x used in set building phase is taken as 20.Initial energy for each node used in simulation is set to 0.5 Joule, while the experiment is repeated with 2 Joule both for LEACH and proposed MG-LEACH.
The main objective of MG-LEACH is to prolong the network life time by utilizing redundant nodes deployed in WSN. As the proposed algorithm is based upon the frame work of LEACH so the team round is used for each of the consecutive periods in which the sensor nodes perform: a predefined constant work. For example, in each round, every sensor node forwards 4000 bits of data to its cluster-head. We provide a summary chart which illustrates the values of FND(First Node Dies) HND (Half Node Dies) and LND (Last Node Dies) metrics visually. Figure 5 illustrates the simulation result that demonstrate relative behavior of both discussed algorithms with parameters values n =300, p= 0.1 and E0=0.5 J. It demonstrates Alive Nodes that is taken at y-axis for different time stamps (Rounds) that is taken on x-axis. Figure 6 and Figure 7 illustrates the Pictographic representation of Comparative Analysis of LEACH and. MG-LEACH for distribution of the alive sensor nodes with respect to the number of rounds for each algorithm when the define parameters set to n =300, p= 0.05, E0=0.5 J and n=300, p= 0.05, E0=2 J respectively.

CONCLUSION
In this paper, after conducting a research on LEACH protocol, we came up with an improved protocol called MG-LEACH. In fact, the key objective of proposed this protocol is to prolong the lifetime of the wireless sensor network by utilizing the correlated nature of data inside the clusters. MG-LEACH is based upon the framework of LEACH protocol so we also illustrated in detail the shortcoming associated with it, in addition the performance analysis of LEACH has been performed. It also covers comparative analysis of energy efficient MAC and Routing protocols used in Wireless Sensor Network.
We have implemented our basic idea upon the frame work of LEACH protocol and comparative performance analysis has also been performed both for MG-LEACH and LEACH protocol. The proposed routing algorithm has been simulated using MATLAB to verify the efficiency in enhancing network life time. A critical evaluation of routing algorithm is conducted to determine the relevance and applicability in increasing network life time. Simulation results confirmed that it has performed better than LEACH and enhanced network lifetime. The future research is needed on the security of this improved protocol.