Evaluating Simulation and Development of Algorithms of Energy Consumption Reduction Based on Wireless Sensor Networks

Today, wireless sensor networks have been used in many applications according to their benefits such as simple and inexpensive implementation, low power consumption and high scalability. Designing sustainable wireless sensor networks is a very challenging issue. It is expected that sensors with limit energy to work automatically for a long time. However, replacement of broken batteries may be impossible with high costs or even in hard environments. On the other hand, unlike other networks, wireless sensor networks are designed for specific small-scale applications such as medical monitoring systems and large scale such as environmental monitoring. In this context, many researches have been conducted to propose a wide range of solutions for the problem of energy saving. In this paper, a routing algorithm has been designed to generate the best route between sensor nodes and local aggregate nodes for achieving proper traffic distribution and thus balancing the energy consumption of the middle nodes. Creating such a balance will help to increase the lifetime of the network and it will improve the energy consumption pattern in wireless sensor networks with limited power sources. On the other hand, it is attempted to increase the possibility of load distribution at low-density points using the possibility of changing the range of nodes. The simulation results show a 20% improvement in the lifetime of the network using the proposed algorithm compared to some of the proposed energy sensitive routing algorithms in recent years.


INTRODUCTION
Scalability, coverage, latency time, quality of service, security, and mobility are that main needs of wireless sensor networks used in various applications, including environmental monitoring, public security, and medical care and military and industrial applications. In these applications, the sensor is expected to work automatically for a long period of time, whether week or month. However, these networks suffer from limitation of network lifetime according to the limited resources of battery available in the sensors. In the last few years, several methods have been proposed to save energy in wireless sensor networks, and still many researches are conducting on how to optimize energy consumption for wireless sensor networks with limited energy resources.
The network under investigation includes a number of wireless operator and sensor nodes that are distributed across the considered environment in a random and uniform way. The environment under consideration is considered as a * a square with the dimensions of a personal or local network and the number of nodes in it does not exceed 100 nodes. The reader should note that assuming hierarchical routing capability in wireless sensor networks, the above assumption does not create any limit in the overall network dimensions. The number of aggregate nodes in the implementation environment is considered 1 and the routing algorithm operates in a way that transmits the information generated by the nodes appropriately to the aggregate node. As a result, the type of traffic considered in this article is from multi-point to one-point type. Various experiments during the simulation as well as logical arguments indicate that the location of aggregate node is better to be close to the center of the implementation environment, because it will be possible to moderate the traffic load across the network under investigation desirably. It is more desirable. For our network model to be closer to reality a little, the location of the aggregation node in a square with dimensions * is randomly selected in the middle of the main implementation environment. Such an assumption will be possible in terms of real implementation conditions to some extent (Rault, 2014). The common unit disk model has been used to model the wireless telecommunications link that operates under IEEE802.15.4. In this model, it is assumed that a node can only exchange with nodes that are in a circular environment within the radius of its telecommunication range. Thus, the set of neighbors of node includes the nodes that are located in this disk (Jung et al, 2011).
Log-normal shadowing model has been used to calculate the received signal strength at the destination node in order to model the physical layer and the effect of decreasing the received power caused by the distance between nodes and environmental factors such as fading and shadowing. The received signal strength index or RSSI on the link (i, j) caused by the above model is calculated using the famous formula 12.
On the other hand, this index is used to decide for correctly or incorrectly receiving of the packet in the physical layer so that if the received signal strength is below the low level of receiver antenna sensitivity, the packet will be lost and otherwise considered safe. (Naeem et al, 2013).
Access to the telecommunication channel through the protocol access to the telecommunication channel is performed via CSMA protocol with exponential waiting times. In this algorithm, four attempts are performed to send each packet, and the waiting time exponentially increases in each attempt in case of occupying channel. The model of wireless telecommunication channel and the way of access to channel are carefully implemented in the simulator software used to be investigated the effect of environmental conditions and delay caused by channel access and packet loss caused by the expiration of the number of attempts to access the channel on the behavior of the proposed algorithms (Yan et al, 2012). It should be noted that all nodes are considered homogeneous according to transmitting and receiving antenna power and as a result the telecommunication range. Of course, in the section of Error! Reference source not found, a mechanism has been proposed for the development of telecommunication range to achieve better routing performance, which is discussed in detail in the same chapter. According to the above, it can be said that the model used in this paper has been well designed considering match with the real implementation conditions and it is more complete than most of the models used in the articles.

A REVIEW OF LITERATURE
In this section, we will examine some of the prominent, new and high-frequent algorithms in the routing section using the energy criterion in order to the reader have a better understanding of the background of activities carried out in this topic, and better understand the difference between the method presented in this thesis and the previous one. As it was mentioned in the previous section, balanced load routing algorithms can be analyzed from two perspectives. The first is the way of finding parent nodes and generating routing graphs, and the second is the way of distributing traffic among nodes. The algorithms presented in this section have been studied from both perspectives above. Geographic algorithms are the most important algorithms of this group that searches the paths leading to the aggregate node using the parameters and information of neighboring nodes locally. They are looking for the supplier. According to the random distribution of sensor nodes in different environments in terms of environmental conditions, the use of geographical routing will cause the proper use of these networks. Geographic routing has advantages such as scalability, routing based on local information, and compatibility with the dynamics of the network topology.
The TPGF algorithm is one of the geographic algorithms. The algorithm uses a greedy forwarding method in which the node sends its packets to the neighbor closest to the aggregate node. In this algorithm, the only criterion of distance from the aggregate node is considered and no attention is paid to the residual energy of the nodes. Thus, the energy of the node near the aggregate node is rapidly discharged by connecting a large number of nodes and eventually the lifetime of the network reduces.
The MMSPEED algorithm, which is a multi-class and multi-path version of SPEED algorithm, is one of the most popular and high-frequent algorithms of quality guarantee in wireless networks. This algorithm is able to provide soft and hard guarantee in both delay and reliability. Delay guarantee is performed by classifying the neighbors based on the speed for approaching the aggregate node. Entering packets require a minimum speed to reach their destination based on the residual time until their expiration, and the forwarding node sends the packet to the desirable neighbor if it finds a speed more than the required speed of packet among its neighbors, otherwise, it discards the packet.
The speed required for the delay sensitive package x is calculated using Formula 1: In this case, the numerator of the geographical distance between the origin and destination of the packet and its denominator is the expiration time of the packet. The speed provided by each parent is estimated by the formula similar to the formula above. The only difference is that the numerator of the geographic distance of the forwarding node is with each parent, and its denominator is the measured delay on the link among them. Link delay can be estimated by measuring the round trip time or RTT of the packet and verifying it in the data link layer.
Reliability is guaranteed in this algorithm through copying reliability sensitive packets on different links. In this algorithm, estimating the probability of reaching the packet to destination is performed from the error rate of the local links between the forwarding node and the neighboring nodes. In other words, it is optimistically assumed that all communication links have the error rate as the error rate of neighbor links until the packets reach their destination. This is naturally inaccurate because the environmental and noise conditions can be different for a node with a node a little further away. However, the MMSPEED algorithm estimates the end-to-end reliability provided by each of the neighbors through Formula 2 below.
RP , = 1 − e , (1 − e , ) , , ) (3) The way of calculating ei, j or link error rate (i, j) is not explained in this algorithm. One of the major disadvantages of this algorithm other than the cases mentioned above is its insensitivity to the energy of the nodes in selecting the next step for the packages. This issue may lead to uneven distribution of traffic across the network and reduce its lifespan.
The SDSCR algorithm is another algorithm in this group that uses the geographic method for forwarding packets to the destination. This algorithm divides the nodes into multiple layers based on the signal strength received from the aggregate or upstream nodes, and each node selects its next step among the higher layer nodes. This algorithm divides the packages into different classes in terms of the amount of time remaining until the expiration date for distinction in service quality (which is the only delay type selected) and then prioritizes them in order of priority (Carrano, 2014). This algorithm divides the global tolerable delay determined by the application into the number of estimated steps remaining to the destination for detecting expiration time of packets, and thus obtains a local tolerable delay, and considers it as an estimate of expiration time of packets. In the SDSCR algorithm, each node estimates a speed of sending aggregate node for each neighbor from the tolerable delay and the measured delay on its links to the neighbors and sends the packages to a node that provides the most speed (Misra, 2011).
The InRout algorithm uses another machine learning method i.e, Q-learning, for gradual scoring of routes. In this way, packets are sent to the aggregate node via various paths, and the aggregate node sends a feedback to the originating node for each packet it receives correctly. Thus, the nodes along this route increase the score of this route and it allocates more probability for its selection in subsequent selections. Thus, this algorithm identifies only the most reliable routes and, as mentioned earlier, high traffic overhead is applied to the network due to the need for end-to-end and multiple feedbacks, which causes the energy consumption in network nodes and reduces network lifetime. The InRout algorithm proposes a very simple mechanism for delay guarantee that it is the transition of delay sensitive packets on the routes with the least step. It is also not mentioned if there are two routes with equal number of steps on which one the packet should be sent.
The VBS algorithm has extended the lifespan of the network by utilizing the sleep and wake technique and backbone design in wireless sensor networks. In this algorithm, only the nodes selected as the backbone send their data to the base station. Since most of the power consumption in the sensor networks is related to the radio unit, the algorithm to reduce the power consumption has used the sleep and wake mechanism for the radio unit of nodes which does not send their information. Also, the sampling of backbone nodes is periodically changed to balance energy consumption across the entire network and cover the entire existing area. This algorithm focuses on power consumption and extending network life and does not provide any guarantees on load balancing in the network (Dohler, 2009).
The Self-organized energy conscious clustering (SECC) algorithm is a self-organizing protocol in wireless sensor networks. In this algorithm, each node forms balance clusters of routing through the energy ratio of the node and the average distance of the node with its neighbors, the density of the cluster through dividing the number of nodes in the cluster divided by the ratio factor of the nodes and finally the energy of the clusters' knowledge obtained by sum energy of the nodes and the energy of their neighbors using ratio factor. After the network starts to work by sending and receiving information from the nodes, the energy consumption of the nodes increases (Li et al, 2013). The algorithm removes the nodes with residual energy less than the threshold voltage Eth by knowing the residual energy of the nodes for increasing network lifetime, and clusters the network based on node parameters (node energy, nodes distance and density) and cluster parameters (Cluster density and sensors in the cluster) as mentioned above (Bala and Doja, 2012). However, by removing the low residual energy node that has occurred due to inadequate distribution of network traffic, the required information of network is removed. Therefore, considering just lifetime is not enough, and an appropriate algorithm has to consider the needs of other applications in addition to extend network lifetime.

Evaluation of the simulation environment
One of the simulation environments used to implement the proposed algorithms is the OMNET++ environment. It is one of the most widely used software with open access in the simulation of computer and telecommunication networks. OMNET ++ software contains the physical layer and the data link based on IEEE802.15.4 as a default module, but since the programming language is C++, implementing complex mathematical algorithms such as optimization problem used in it is a bit difficult. Therefore, a new simulation environment in MATLAB software was generated to use the matrix environment and robust mathematical instructions contained in this software for facilitating the implementation of algorithms (Manap, 2013). The generated simulation environment is an event-driven program in which for each event on the network such as generating, sending or receiving packages, a time tag is considered, and the core of the program, the events are defined and implemented in order of time tags and various functions and collects the results in the output matrices. On the other hand, the competition mechanism for channel has been designed according to the proposed CSMA protocol in IEE802.15.4 with exponential waiting times and a maximum of 4 attempts per package and implemented in specific functions. The network layer algorithm has been designed based on the default UDDR protocol and the proposed modifications in this paper.

Simulation Parameters
The simulation environment is a square with dimension of 500 x500 m with 40 to 80 nodes. The dimensions of the simulation environment and the number of nodes have been selected based on conditions similar to a residential or industrial environment. The telecommunication range of the nodes is considered 100 meters which is achievable and common for existing zigbee technologies in internal environmental conditions. The number of nodes and their telecommunication range has been selected in such a way that creates at least 5degree graphs. Figure 1 is an example of a graph generated by the PBTR algorithm. The purpose of the simulations is to investigate the performance of the PBTR algorithm plus the proposed traffic distribution algorithm, UDDR and Anisi. In these conditions, the generated traffic is generated alternatively. The traffic generation rate of each node in this case varies from 1 to 10 packages per minute. The simulation parameters are shown in the table.

Simulation scenarios
As it was mentioned in the previous section, simulations are to measure the performance of the PBTR algorithm. Three different scenarios have been designed to simulate the PBTR algorithm as follows: A) The results of performance of the PBTR algorithm is compared with the number of different sensor nodes.
B) The results of performance of the PBTR algorithm are compared according to the number of different nodes and with the same traffic generation rate λ= 6 pkt/min.
C) The performance of the proposed algorithm is simulated under the conditions of average density of nodes and variable traffic load from 1 to 10 packets per minute In order to investigate the effect of traffic load.
The simulation results of the above three different scenarios for investigating the performance of the PBTR algorithm are as follows.

Performance of PBTR algorithm according to the number of nodes
In this scenario, the performance of the PBTR algorithm is simulated and compared with the UDDR and Anisi algorithms considering the traffic generation rate of all nodes equal to 6pkt/min. Figure 2 shows the lifetime of algorithms against increasing number of nodes. This diagram clearly proves our claim. As it can be seen, the proposed algorithm is able to achieve more parent nodes by increasing its range of communication, as a result, the selection of parent with lower power consumption which ultimately leads to more energy balancing between the nodes. So that it shows an increase in lifetime of approximately 20% compared to the UDDR algorithm based on this algorithm.  Figure 2, the packet delivery rate to destination is about 90% that it is accompanied with a 10% increase compared with the UDDR algorithm. This proposed algorithm is a proof of improving lifetime of the network with a high percentage of packet delivery to destination and reducing re-sending packets. According to the size of the network in the simulation, the 50 nodes in the network is an optimal value for packet delivery to destination. In the more nodes because of the waiting time for packet delivery by the nodes, the packets may be lost due to the longer waiting time than the packet production rate by node. In this scenario, the performance of the PBTR algorithm is stimulated and compared with the UDDR and Anisi algorithms. In this scenario, we consider the total number of nodes in the network to be 60 and the number of nodes generating information with a traffic generation rate equal to 6pkt/min between 10 and 60 nodes. The figure diagram shows the lifetime of the algorithms against the number of different nodes generating traffic. As you can see, the proposed algorithm offers an increase in network lifetime compared to other comparative algorithms by balancing the load of nodes generating traffic packets among other nodes.  Performance of PBTR algorithm according to variable traffic generation rate In this scenario, the performance of the PBTR algorithm is stimulated and compared with the UDDR and Anisi algorithms. In this scenario, we consider the total number of nodes in the network to be 60 with variable traffic generation rate between 1pkt/min to 10pkt/min. Figure 5 shows the lifetime of the algorithms against the variable traffic generation rate by the nodes. As you can see, even by the increase of traffic generation rate available on the network, the proposed UDDR algorithm is capable of achieving a 20% lifespan compared to the UDDR algorithm considering the power consumption changes (Kim, 2012). The figure shows the percentage of traffic packer delivery in the algorithms against increasing the traffic generation rate by nodes. As you can see in the diagram, the proposed PBTR algorithm has delivered 90% of the packets to aggregate node safely because of the light algorithm during processing to select the preferred parent even by increasing the traffic generation rate. It is also associated with a 20% increase in packet delivery safely compared to the UDDR algorithm (Zhao, 2009).

CONCLUSION
Wireless sensor networks have recently attracted the attention of many researchers. These networks are predicted to penetrate in all pillars of human life according to their many applications in the future years, but the most important challenge facing sensor networks is the increase of their lifespan. Many routing algorithms have been proposed for wireless sensor networks. However, due to the lack of attention to traffic patterns and the amount of energy remained in each node, they cannot utilize the energy available in the network efficiently, and sometimes reduce the lifetime of the network relying on a particular node because of the algorithmic conditions.
In this paper, a balanced load routing tree algorithm has been proposed for routing information in wireless receiver network. The PBTR algorithm has been specifically designed to solve the problem of load balancing and reducing power consumption in wireless sensor networks. For this purpose, a theoretical game approach is considered where the nodes in the network appear in both child and parent roles. In the role of the child, the nodes are selfish players who choose their parent with a lower energy consumption rate for gaining profit, while the nodes in parental role with cooperative communication among themselves reduce the traffic load on other parents which are in two-mutant distance and in one level and suffer from over loading. The algorithm has been evaluated in the following scenarios. In the first scenario, we investigated the lifetime and percentage of packet delivery safely to the middle aggregate node for the PBTR algorithm considering the number of nodes in the network that are all generating traffic load. The results show a 20% increase in network lifetime and a 15% increase in packet delivery by the middle aggregate node. Thus PBTR algorithm has showed a proper efficiency for high-density and low-density networks.
In the second scenario, we investigated the lifetime and percentage of packet delivery to the middle aggregate node for the PBTR algorithm in a network with the number of constant nodes but the number of nodes generating traffic packets. The results show an increase in the lifetime of the network and a 20% increase of healthy delivery of packets by the middle aggregate node. Thus, the PBTR algorithm is suitable for event sensitive networks because in this type of networks, only a few nodes generate traffic load and the rest of the nodes appear in the role of relay. Also, in this algorithm, all nodes place themselves in routing tree using increasing communication range and reduce the loss of packets due to non-connection of node to the routing tree. This algorithm improves efficiency in addition to increase life in these event sensitive networks by packet delivery more than 90% to the aggregation node safely.
In the third scenario, we investigated the lifetime and percentage of packet delivery to the middle aggregate node for the PBTR algorithm in a network with the number of constant nodes but the generating different traffic. The results show a 20% increase in network lifetime and a 25% increase in packet delivery by the aggregate node compared to the UDDR algorithm. This increase is due to light processes for selecting parent node and balancing load between parent nodes. Thus, PBTR algorithm has a very good efficiency in low traffic networks with average 90% packet delivery safely to the middle aggregate node in high traffic networks. The PBTR algorithm with resource management through energy balancing has been able to significantly improve the network lifetime index, while the packet delivery index has a significant increase. According to the work conducted and the capabilities of the PBTR protocol, the combination of PBTR algorithm with service quality classes can be used for all stages of PBTR implementation including selection of parent nodes associated with service quality classes. It is recommended to implement and simulate the PBTR algorithm in OMNET ++ environment.