APPLYING A HYBRID POLLING APPROACH BY SOFTWARE IMPLEMENTATION TO EXTEND THE LIFETIME OF A WIRELESS SENSOR NETWORK

: Wireless Sensor Networks are networks suitable for data collection in harsh environments, where it would be difficult or costly the deployment of wired infrastructure. In spite of these advantages, such networks often rely on batteries to operate, which may lead to a serious limitation on the networks lifetime. Bearing this in mind, in this article is proposed and tested a hybrid polling approach that reduces the number of frames transmitted by the router node. Thus, the router node lifetime can be extended significantly and hence the network lifetime. The proposed technique becomes progressively more advantageous, when compared to classical polling technique, as the number of network nodes increases. The experimental results obtained using a network with four nodes indicate a network lifetime increase of about 32.14%. Importantly, the sensor network lifetime extension increases the economic viability of the technology and thus makes it more accessible to potential users.


Introduction
The Wireless Sensor Networks (WSN) are networks of low cost, low power and appropriate for collecting data in harsh environments, difficult to access areas and researches, where the deployment and maintenance of wired infrastructure is not feasible or economically viable, volcano monitoring (Werner-Allenet al., 2005), fire detecting systems (Kaur et al., 2014)] and study of water consumption (Yano et al., 2014) are examples of WSN utilization. Although the independence of a wired infrastructure is a major attraction of WSNs, this can also constitute an important limiting factor regarding the lifetime of the network, since it is usually powered by batteries.
As the nodes of WSNs have restricted range of operation is usual that the data collector's nodes End Devices (ED) would depend on routers nodes (RT) to transmit information to a Central Base (BC) (Zahmati et al., 2007). However, a RT node may be dead by the depletion of its battery, as a result many EDs are unable to send their data to the central base, due to the interruption of a RT node. Thus, it becomes evident the importance of prolonging the lifetime of the RT node in order to avoid the formation of orphans nodes (Shanti and Sahoo, 2011). To prolong the lifetime of the network is, therefore, necessary to save the router node energy. Among the factors that contribute to energy waste in WSNs stand out (Yeet al., 2004;Rezaei and Mobininejad, 2012): • Time of idle listening (which is the time that the node is waiting for data to be received); • Retransmissions due to packet collisions; • Overhearing (when a node receives frames destined to other nodes) • Overload by excessive control frames such as Request To Send (RTS), Clear To Send (CTS) and Acknowledgement (ACK); • Over-emitting (occurs when it is transmitting to a node that is not ready to receive it) A solution that reduces energy waste of these five factors is the use of Time Division Multiple Access (TDMA) (Kabara and Calle, 2011), where the time is divided into slots, therefore is possible to establish some slots of activity and put the node to sleep during periods (slots time) of inactivity, reducing energy waste during the time of idle listening (factor 1).
One way to work with TDMA is using polling, especially for implementation in low cost hardware (Kabara and Calle, 2011).
Polling is a method of controlling access to a communication channel shared by multiple terminals (Nannicini and Pecorella, 1999). In polling, the control is centralized, i.e., there is a coordinator who will make requests for data from terminals. Each terminal will, therefore, have its share of time to receive the request and make a transmission to the coordinator. This time allocation where each terminal has its right time to make their transmissions (Anandamurugan and Venkatesh, 2010), makes this solution free of collisions (factor 2).
With the use of polling with TDMA, since each ED will have an appropriate time (slot time) for communication, can be in sleep state in the rest of the time, not interfering with other transmissions and, likewise, not suffering from overhearing (factor 3), it is only necessary to put the nodes in active state before the beginning of its transmissions time (factor 5).
Using the data frame as a sign of receiving the polling becomes unnecessary ACK signal (Andrade et al., 2012). Through the adoption of TDMA, collisions are reduced (see the paragraphs above) and therefore control packets, like RTS and CTS, can be eliminated, reducing the effects due to factor 4.
Even though the TDMA with polling can reduce the energy waste of these five factors, the problem of short lifetime of router nodes still persists (Chukwuka and Arshad, 2013;Baby and Jacob, 2013), then a question that motivates this research is: Is there a way to prolong the lifetime of router nodes longer?
The hypothesis for this question is the use of a technique based on hub polling associated with classical polling making possible achieve better results in prolonging the lifetime of router nodes than using only classical polling technique.
In this study is proposed and tested a technique called Hybrid Polling Approach, which provides reduced consumption of energy, using a modification of a solution of polling with TDMA in the literature (Yangand Sikdar, 2007). The most significant improvement is provided in particular regarding to the first factor, which involves an idle listening time. It is observed that the power consumption during idle listening time is comparable to the consumption during transmission and reception (Stine and Veciana, 2002;Pantazis et al., 2009) and therefore is clear the importance of its decrease.
Following this introduction will be described in section 2 the Hybrid Polling Approach (HPA), that is the purpose of this work and here in after referred only by HPA, section 3 deals with the experimental system used in the validation of the proposal investigated over this work, in section 4, we present the results and discussion of them and finally the section 5 presents the conclusion of this work, as well as prospects for its continuation.

Hybrid Polling Approach
Firstly, the HPA will be described in this section and then, the Calculation of Energy Consumption per Cycle Transmission from both HPA and classical polling will be presented.

Detailing the Hybrid Polling Approach
The Hybrid Polling Approach (HPA) has this name because of the use of two techniques of polling, the hub polling and the roll-call polling (Takagi, 1991).
Roll-call polling-In this technique, the coordinator makes calls to all stations sequentially in accordance with a table of stations, i.e., the coordinator makes a request for a particular station and after receiving the response of that, switches to the next station. This form of control is suitable for networks of tree and star topology, as shown in Fig. 1, where the circles represent stations in a network of computers.
Hub polling-In this technique, the coordinator makes a call only for the first station and this will make the passing of the request for the second station of the sequence and so on until it reaches the last station, which will pass the control to the coordinator, ending the cycle. The hub polling is appropriate for ring topology networks and it tends to have higher performance, in terms of cycle time, than the roll-call polling for large networks, so it allows a greater flow of data. In Fig. 2, the circles represent the stations in a computer network and the arrow indicates the direction and consequently the order that the stations are called.
The HPA uses the hub polling as the first option. The hub polling gives to HPA a better performance compared to the classical polling or roll-call polling, but requires the formation of a ring of EDs for their full operation. When is not possible to take advantage of the hub polling due to the breakdown of the ring, the HPA uses roll-call polling or polling classic to ensure, even in these adverse situations, regular network operation. Figure 3 illustrates a typical situation of communication in the HPA, where the RT also does the role of coordinator. The RT starts the communication with ED1 and this will make the passing of the request to ED2 and so on until ED5 didn´t reach ED6, where there is a breakdown of the ring. At this time the HPA uses roll-call polling to finish the cycle by calling the ED6, this is the reason why HPA uses both techniques the hub polling and the roll-call polling to have data of the whole network.  Fig. 4 by the arrow marked "POLL". The answer to the polling send to ED1 will be the frame with data "DATA1". As the ED2 is supposedly in line of sight with ED1, it will also receive the frame "DATA1" sent to RT. The frame "DATA1", also received by ED2, is the signal for ED2 transmits its data to the RT, i.e., ED2 does not need a specific polling to send its data. Simply send its frame "DATA2" following the frame "DATA1", so RT will not need to send a "POLL" frame to ED2.
The same strategy will apply to other EDs at the network. Thus, the RT and ED3 will receive the data frame of ED2, represented in Fig. 4 by the arrow labeled "DATA2". "DATA2" is the signal to ED3 sends its data in the same way that ED2 proceeded. The last ED of Fig.  4 is the ED4, which, after receiving "DATA3" send "DATA4" to RT. After receiving data from ED4, RT aggregates data from ED1, ED2, ED3 and ED4 and then sends all of this data in only one frame to BC, ending the cycle, after this, RT can start its sleep period.
The larger the number of nodes more significant will be the energy savings of RT in HPA, compared to the classical polling, since only one poll will be sent per cycle. It is expected that this will provide a smaller amount of energy used per cycle, resulting in a longer lifetime of RT in HPA than in classical polling.

Calculation of Energy Consumption PER Cycle Transmission
The implementation of the HPA can bring the reduction of energy consumption per transmission cycle of the RT node, providing the prolongation of the lifetime of the entire network. The energy consumed by the RT node for transmission cycle can be expressed in both cases, classical polling Fig. 5 (a) and HPA Fig. 5 (b), by Equations (1) and (2) which terms are described on Table1.
However, due to the waveform of the voltage applied to the sensor device Figs. 5 (a) and (b), the integral in (1) can be rewritten as:

Material and Methods
The previous section described the HPA. In this section, the experimental system used for the validation of the technique proposed in this article will be described.
The sensors used for these tests were RFBee v.1.1 (Fabiano and Demanboro, 2014) and the embedded software for these sensors was made through changes in libraries of Radiuino platform (Gomes and de Novaes, 2015).
The Radiuino is licensed under the GNU Library or Lesser General Public License version 2.0 (LGPLv2) (GNU, 2012), which is an enabler for the development of software in comparison to proprietary platforms, since it can be used, modified and distributed freely.
The RT was powered by two AAA rechargeable batteries of 900 mAh and each ED was powered by two AA rechargeable batteries of 2500 mAh. The recharge time in this experiment was at least 15 h to AAA and 16 h for the AA, as specified on the label from both batteries. The choice of batteries of smaller capacity for RT was due to the need to shorten the duration of the experiment, which is determined by the exhaustion of the battery charge (Park et al., 2005).
In this experiment, all nodes are receiving mode during the idle state (Woo and Culler, 2001).
The battery´s voltage value and RSSI-Received Signal Strength Indicator (Giacomin and Vasconcelos, 2006;Procopio et al., 2013) were the data captured and transmitted in these experiments. Figure 6 shows the site plan of the experiment, which was conducted in closed environment and without temperature control (Park et al., 2005). The red square is the ED1 node, the beige is ED2, the orange is ED3, the green is RT and the black is BC.
The radios were configured to work in maximum power of 10 dBm and the frequency of 915 MHz.
The comparison of results between the HPA and the classical polling is assumed that all EDs always have data to transmit and that all EDs have line of sight to its predecessor and the its successor in polling. Therefore, in this comparative test, the HPA will only use the rollcall polling in cases of frame loss. It is known that, for systems of radio communication, frame loss are inevitable (Young and Ling, 2009) and in these tests the frame loss was less than 0.09 % of frame transmissions.
The same sleep time of 1.5 s in the RT node was adopted for both performance tests of HPA and the classical polling.
An oscilloscope Agilent Model 54621A (Chen, 2005) Fig. 7 was used to measure the voltage at the RFBee that serves as RT node, for estimation the energy expended by RT node per transmission cycle. Because the voltage between the power supply and GND terminals of RFBee is always the same as the voltage on batteries, the current intensity was measured indirectly through the use of a 5 Ω resistor in series with the RFBee, providing low power consumption in the current measurement. The voltage measured at the resistor, the calculated current and the typical current given by the manufacturer is shown in Table 2.

Results and Discussion
This section presents and discusses the obtained results of a WSN comparing specifically the performance of polling classic and HPA. This section is divided into four parts: Activity periods of RT node by transmission cycle; estimation of energy used by RT node transmission cycle; lifetime of RT node and number of frames transmitted.

Activity Periods of RT Node by Transmission Cycle
This part shows which technique has shorter activity period and consequently, shorter idle time and less waste of energy. Figure 8 shows the activity period of RT node, measured with the aid of an oscilloscope, with the HPA in red, classic polling in blue and the difference between them in yellow. It can be seen that the implementation of the HPA allowed a significant reduction of activity period of RT node compared to the implementation of the Classical Polling.
As can be observed when inspecting Fig. 8, the difference between the periods of activity of the RT node becomes more significant, as it increases the number of EDs and can be quantified by the slope of the line in yellow, with about 65.6 ms per node collector (65.6 ms / ED).

Estimation of Energy Used by RT Node Transmission Cycle
The energy consumed by RT node in one transmission cycle was calculated from Equation (2) and by measurements of current and voltage of the RT node. The graph shown in Figure 9 presents the estimate of the energy used by the RT node transmission cycle. The line in blue shows the curve of the classic polling, the line in red shows the HPA and the line in yellow shows the difference between them. The slope of the curve in yellow indicates that the consumption of classical technique is higher about 3.81 mJ per ED (3.81 mJ / ED). The error bars reflect the influence of the voltage change from the start of the experiment until the battery depletion.

Lifetime of RT Node
The comparison of lifetime of routers according to the classical polling and the HPA is shown in Figures 10  (a) and (b), using three and four EDs respectively. The graphs shown in Figure 10 illustrate the voltage in Volts against time in days of operation, where the blue line is the polling classic and the red line is the HPA.
In the experiment in a network with three EDs in the classical polling the battery depletion occurred in five and a half days of operation, while in the HPA, the battery depletion occurred in more than six days of operation Fig. 10 (a). In the experiment on a network with four EDs in classical polling, the RT node remained in operation for just over four days and almost five and a half days for the HPA Fig. 10 (b) until the end of charge of battery.
The HPA showed an increase of 12.14% in the lifetime of the router and hence of the network, when compared to the classical polling, in a network with three EDs and about 32.14% for a network with four EDs. Thus, for this network with three EDs the increasing of the lifetime of the RT node was inferior to the experiment with four EDs. As described before, the difference in energy used per cycle increases as the number of EDs increases in the network and this is reflected in the lifetime of the network.

Number of Frames Transmitted
This part presents a comparison between HPA and classic polling in number of frames transmitted until battery depletion. Figure 11 shows the number of frames transmitted from RT to BC for the HPA (red bars) and the classic polling (blue bars), there was also an increase in the difference in performance with increasing the amount of three to four EDs in the network, confirming the improved performance of HPA with network growth.
In polling classic for three EDs, the HPA exceeded by 26.35% the polling classic, until reaching the battery depletion. In the experiment with four EDs, the HPA outperformed the classical polling by 44.79%. Figure 12 shows the number of frames transmitted in the experiment with four EDs in which the frames transmitted by the RT node are divided between polling, in blue and aggregate data sent to BC in green and the frames transmitted by data collectors nodes ED1, ED2, ED3 and ED4 are represented by columns of red, brown, beige and yellow, respectively. Also in Fig. 12, there is a much greater amount of polling frames sent in the experiment with classical polling than with HPA, this difference causes a greater consumption of energy per cycle in the classical polling and result in classical polling a shorter lifetime compared to HPA.

Conclusion
In this study, we developed and implemented a Hybrid Polling Approach (HPA) aimed at prolonging the lifetime of router nodes in WSN. The hybrid feature is to automatically select which technique of polling for communication between router and data collector's nodes. Specifically, the technique may be the hub-polling or rollcall polling, the first being the default choice, since there sight between all network nodes to form a ring. Otherwise, it will use the roll-call polling. Observe that the choice rests with the standard hub-polling because this will reduce the number of polling frames transmitted by the router node, which will have direct impact on its energy consumption and, therefore, in its lifetime.
Quantitatively, the HPA saves 65.6 ms of time and 3.81 mJ of energy per data collector node added in the WSN when compared to the classical polling, so the efficiency becomes more significant as it increases the number of network devices.
All this has a direct impact on the lifetime of the WSN, having been found, increases of 12.14 and 32.14%, respectively, for networks with three and four EDs, reiterating the superiority of the proposed technique increases as the number of EDs. With respect to the number of frames transmitted on the same experiments with three and four EDs, there were increases of 26.35 and 44.79%, respectively, when the HPA was compared to the classical polling.
As suggestions for future work, one can highlight the performance evaluation technique for networks with a larger number of nodes and with different periods of activity of RTs. Since this technique can be used with advantages in any cluster where there is sight between data collector nodes, a self-organized ring of data collector nodes will be also a next step of this research.