{'fraction_non_alphanumeric': 0.02197961101872605, 'fraction_numerical': 0.002458245969199624, 'mean_word_length': 4.7657357232180075, '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}}
An Efficient Routing Algorithm using TTL for Data Aggregation in WSN

Wireless Sensor Networks (WSNs) are event driven networks that use overlapping paths from events to maximize the data aggregation. But this will weaken ability of WSNs instead of improving the network lifetime. There should be a interchange between data aggregation maximization and energy balance. In this paper a efficient algorithm for data aggregation is proposed. The algorithm maximizes the data aggregation points by building and updating hop-tree with shortest paths based on events and nodes local states, which can maximize data aggregation according to data correlation, well balance node energy consumption and route data in a reliable way. The algorithm maximizes the possible data aggregation points by building and updating a Hop-Tree. For building and maintaining Hop-Tree the local state of nodes is considered to gain better data aggregation in wireless sensor networks. Finding best path for forwarding aggregated data Time-To-Live (TTL) mechanism is used to limit the Hop-Tree update range to avoid overoverlapping of paths according to the correlation of events. It designs a path that balance the data loads on the nodes of Hop-Tree to further balance the energy consumption.


Introduction
Wireless sensor network (WSN) is a group of sensors nodes for monitoring the physical conditions of the environment like temperature, sound, pollution levels, pressure, etc. [1], [2]. These networks have been used in different applications such as environmental or physical monitoring, land security, manufacturing systems, critical organization systems, etc. WSNs are event-driven networks that usually generate a large amount of information that needs to be moved across the networks in multihop fashion toward a sink node, as shown in Figure1. As sensor nodes are energy constrained devices. The energy consumption is generally related with the amount of gathered data.

Figure 1: Wireless Sensor Network
Data aggregation defined as a process of aggregating the data from multiple sensor nodes to eliminate redundant transmission and provide fused information to the sink or base station. The goal of data aggregation is to gather and aggregate data in an efficient manner so that lifetime of the network increases by decreasing the number of messages or a packet to be sent to sink or base station [7], intern decreasing the communication costs and energy consumption.
Thus, energy preservation is major key issue in WSN [1]. Due to high density of sensor nodes in WSN and there is a large amount of redundant data will be collected and transmitted in network nearby sensor nodes when sensing event. In order to reduce the energy consumption data fusion and in-network data aggregation techniques are used. Innetwork data aggregation can be used to decrease the communication cost by eliminating the redundant information and forwarding only aggregated information which extends the network lifetime. Routing data is important task in the data gathering process. How to route data to achieve effective data aggregation is important in WSN [1].
In event-driven WSNs, a fixed routing structure is not suitable for data aggregation because it does not take advantage of the correlation between data to reduce data redundancy, resulting in large data load. It is important to dynamically build routes overlapping as much as possible according to the events for efficient data aggregation. Under normal circumstances, the closer the nodes are apart, the more correlated data they collect and the higher the degree of data aggregation is the less and the lower. So, when the events are far apart, over-overlapping of routes will not gain benefit from data aggregation because of the low data correlation which prevents high degree aggregation, but also results in uneven energy consumption which leads to unstable network structure. A good routing protocol for data aggregation should overlap routes according to data correlation and local state and balance the energy consumption for the whole network in order to enhance the monitoring ability of WSNs. In this paper a Novel algorithm for data aggregation is proposed. Our algorithm constructs an routing tree with shortest paths based on events, nodes local states and Time-to-Live mechanism which can maximize data aggregation according to data correlation, well balance node energy consumption and route data in a reliable way.
The remainder of the paper is organized as follows: Section 2 introduces some related work. Section 3 details of algorithm. Finally, Section 4 presents our conclusion and future work.

Related Work
A main component for in-network data aggregation is the design of a data aggregation routing protocol. These data aggregation routing algorithms uses Tree and cluster based approach. Shortest Path Tree (SPT) [8] algorithm based on tree structure, in which routing tree is constructed in a distributed manner. Each node that detects an event transmits its collected information to sink node using the shortest path from itself to sink node. Data aggregation occurs whenever paths overlap. Center at nearest (CNS) [10] algorithm, each node detects an event transmits its information to particular node called as aggregator, by using shortest path. The aggregator is the closest node to the sink node. Tiny Aggregation Service (TAG) [11] uses tree based approach. In the TAG algorithm, parent nodes notify their children about the waiting time for gathering all the data before transmitting it to sink node. The TAG algorithm needs number of message exchange to construct and maintain the tree.
The Low-Energy Adaptive Clustering Hierarchy (LEACH) algorithm, based on cluster in WSN is exploited to perform data aggregation. In this algorithm, cluster-head can act as aggregation nodes. They can directly communicate with the sink node. The cluster-heads are randomly elected in each round of the algorithm. Hybrid Energy-Efficient Distributed Clustering (HEED) [5] algorithm also uses cluster base approach in which it periodically selects cluster heads according to a hybrid of their residual energy and a node degree, balancing load among cluster heads to increase the lifetime of WSN.
Data correlation is important while clustering or building tree, but the entire algorithm discussed above do not consider the data correlation. The Information Fusion-based Role Assignment (InFRA) [12] algorithm builds a cluster for each event including only those nodes that were able to detect it. Then, cluster-heads collects and removes the duplicate data within the cluster and send the collected data toward the sink node. The main aim of InFRA algorithm building the shortest path tree that maximizes information fusion. Woo-Sung Jung et al. [13] proposed a clustering technique based on the status of the network to improve the data aggregation and energy efficiency. Leandro A. Villas et al. proposed the Dynamic and Scalable Tree (DST) [14] algorithm, which reduces the number of working nodes according to the correlation requirement of applications and maximizes the overlap of routes regardless of the order of event occurrence.
The optimal data aggregation problem is equivalent to Steiner Tree Problem. The DRINA [1] is cluster-based approach. Its aim to find an approximate Steiner tree with reduced number of messages for setting routing tree maximizes number of overlapping routes, high aggregation rate, reliable data aggregation and also transmission. DRINA has some aspects, such as it does not consider the correlation of events, some data to be transmitted along longer path, which increases the energy consumption.
Thus, new algorithm is proposed for data aggregation which considers the correlation of events, utilizes the local state of the node to build hop-tree, update hop-tree for data aggregation and balancing energy consumption. It finds the shortest path for sending aggregated data towards sink node.

Proposed Algorithm
The main goal of proposed algorithm for data aggregation is to build a routing tree according to local states and event correlation while maximizing data aggregation and balancing energy consumption to extend the network lifetime. State of a node u is calculated as follows: State(u)= α*E R /E max + β*M R /M max + γ *1/(L+1) Where α+ β+ γ=1 Where E R = residual energy of a node E max = maximum energy of a node M R = residual memory of a node M max = maximum memory of a node L = link packet loss rate of u.
In proposed algorithm each node considers the following roles in routing tree creation:  Collaborator: A node detects an event and forwards the gathered data to a coordinator node.  Coordinator: A node responsible for gathering all the data sent by collaborator nodes. After receiving data aggregate them and sending the aggregate data toward the sink node.  Sink: A node receiving data from a set of coordinator and collaborator nodes.  Relay: A node that forwards data toward the sink node.
The proposed algorithm divided in 5 phase : Hop-Tree Configuration, Cluster Formation, Route Establishment and Hop Tree Update, Route Repair Mechanism.

Phase 1 Hop Tree Configuration
In this phase Hop Tree is constructed with the shortest paths in hops that connect all source nodes to sink node. This phase is started from sink node by sending Hop Configuration Message (HCM) to all sensor nodes in network. Each node considers one parameter HTT (Hop-To-Tree) that includes the minimum number of hops from the node to the Hop-Tree. The value of HTT for a node might be changed when the Hop-Tree updates because of some new events. HCM has three fields ID, HTT and State, where ID is the identifier of a node that started or retransmitted the HCM message, HTT is the distance by which an HCM message has passed, and State records the State of the sender. At the beginning HTT of the Sink is 1 and all other node set the HTT as infinity. Sink node forwards HCM message to all its neighbors. On receiving HCM message, each node verifies its HTT with the HTT in the HCM message. If HTT in the HCM message is less than the HTT of node that it has stored and if the value of First Sending is true then the node updates the value of NextHop with the value of the ID field of HCM message, HTT of node as well as ID , HTT and State of HCM messag. If there are several nodes which are next hop candidates, a node with better State will win. Otherwise, the node will take Before the first event occurs, there is no established route and the HopToTree variable stores the smallest distance to the sink. On the occurrence of first event, HTT will still be the smallest distance; until a new route will be established. After the first event, the HTT stores the smaller distance to the sink or the distance to the closest already established route.

Phase 2 Cluster Formation
When an event occurs, cluster is formed with the nodes that detect the event. For the cluster group coordinator (leader) will be selected by applying election algorithm.
For this election all event sensing nodes are eligible. Any node that has detected the event sets its role Coordinator, sends MCC message. The node with the shortest path to the Hop-Tree will become the Coordinator. If there are several nodes have the smallest HTT value, the one with the best state will be the final Coordinator. At the end of election only one node will be declared as a Coordinator and remaining nodes will be Collaborators. The coordinator collects all the information from collaborator and sends them to sink.

Phase 3 Route Establishment and Hop Tree Update
After cluster formation the elected leader i.e coordinator starts establishing the router for sending event information.
The coordinator sends Route establishment message ( REM) to its NextHop node. When the NextHop node receives a REM message, it checks its residual energy with the threshold energy if it is less HTT of next hop set to 0 and it retransmits the message to its NextHop and starts the hop tree updating process. These steps are repeated until find out the sink node or a node belonging to a routing structure already established. The routes are created by choosing the next best neighbor at each hop.

Phase 4 Data Transmit-Retransmit
After route establishment the actual data transmit and retransmit process will be start.

Phase 5 Route Repair Mechanisms
The route created to send collected data towards the sink is unique and efficient. Any failure of nodes will cause disruption in data transmission. Some fault-tolerant algorithms for WSNs have been proposed. Some algorithms based on periodic flooding mechanism to repair route and find new routes to send data towards sink node .In proposed algorithm, node sends data to its next hop and runs timer for arrival of acknowledgement from its next hop also a node buffers the data. If node receives acknowledgement from its next hop then it release buffer. Otherwise node determines best alternate next hop and retransmits the data from its buffer. Node chooses a best alternative neighbor which has lower HTT level and better state as its next hop.

Conclusion
In this paper, data aggregation routing algorithm for WSNs is proposed. Aggregation routing algorithm plays an important role in event-based wireless sensor networks. Proposed algorithm utilizes TTL to limit the update scope for the Hop-Tree, making the paths for the events with high correlation overlap as early as possible to maximize the degree of data aggregation and it save data transmission energy. TTL is dynamically determined for data correlation. If the energy of nodes on the path, which is proposed to be overlapped by the latter path, is low, algorithm will build a new path to avoid overlapping with the paths in poor state, in order to balance the data load.