Scheduling Transmission of Bulk Data in Sensor Networks using a Dynamic TDMA Protocol Volker Turau and Christoph Weyer Institute of Telematics, Hamburg University of Technology Schwarzenbergstrasse 95, 21073 Hamburg, Germany Email:
[email protected]
Abstract Sensor networks are increasingly used in applications where sensors periodically measure data with high rates. The reliable transport of high volumes of sampled data through a multi-hop network with limited resources requires sophisticated protocols. This paper presents a novel protocol for this task that uses minimal energy, provides high throughput, and requires only small amounts of additional buffer. The protocol is based on a dynamic TDMA scheme and is robust against omission failures.
be. In order for this installation to work reliably for a longer duration the consumption of energy during the transmission must be minimized. The first step is to reduce the amount of data to transmit. This can be done by preprocessing the data in the nodes (e. g., by applying a fast Fourier transform) or by applying some kind of data compression. This paper focuses on another aspect, the energy efficient transmission of bulk data in multi-hop networks to a sink, i. e., the many-toone routing problem and in particular an efficient scheduling scheme. The proposed solution is based on a dynamic TDMA scheme that is robust against omission failures.
1. Introduction
2. Reliable Data Forwarding
The handling of large amounts of data in wireless sensor networks resulting from very high sampling rates is a challenging task. The difficulties derive from the tight resources available in these networks, in particular the limited storage space to buffer intermediate packets and the bounded energy reserve. This paper presents a novel protocol for this task that uses minimal energy by eliminating idle listening, provides high throughput, and requires only small amounts of additional buffer space. The presented work is inspired by an application measuring water pressure in tideland area. A battery powered wireless sensor network installed in a tideland area takes samples at frequencies of about 10 Hz. This data is then routed towards a sink, which transmits the data via GSM to a central location. During flood tide the sensor nodes including their transceivers are under water, thus it is impossible to transmit the data during these periods of length of about 6 - 8 hours. Within this time, the data is stored in the EEPROM of each node. When all nodes have regained the capability to use the wireless communication channel during the next ebb tide, they have to send the bulk of data within this period to the sink. The faster this data transport can be accomplished, the higher the sampling frequency can
This work considers multi-hop networks where each node has accumulated a large amount of data, grouped into equally sized data packets stored in a queue. The task is to route these data packets in minimal time and with minimal energy consumption to a dedicated node without loss of data. During this data-forwarding phase, all data is send via a routing tree, which is periodically created by the sink. Each node has only a limited amount of memory space beyond that occupied by the data sampled by its sensors, i. e., buffering of intermediate packets is limited. After a node has forwarded all its data, it transits into a mode where the node only records measurements. It remains in this mode until the next forwarding phase. This paper only considers this forwarding phase. The protocol is based on a TDMA scheme. This allows every node to turn on its transceiver exactly when needed, i. e., idle listening and collisions are avoided completely. At every time, only a single node uses the wireless channel. In elaborate schemes, more than one node may use the same time slot. This would result in fewer rounds during data forwarding, but would require a more complex algorithm. The main benefit would be a decrease in the number of rounds, leading to a smaller delay at the sink. The number of slots
during which an individual node needs to send or receive data would be unchanged. But since such an algorithm requires more communication (i. e., control messages) the overall energy consumption would increase [5]. The algorithm proposed exploits the tree-based topology that allows for a distributed algorithm and adaptive local schedules. The simplest reliable forwarding strategy on a tree structure works as follows: Every node sends in its assigned slot a packet to its parent. If a parent acknowledges this packet, then this data is in its EEPROM and the sending node can remove it from its storage. This strategy has two aggravating disadvantages. First, it does not recognize the limitation of available buffer space and secondly, the throughput is very low since the time slot of a node that has forwarded all data packets is no longer used. A remedy against the first shortcoming works as follows: After a node accepts a packet from a child, it checks its available memory; in case its buffer is full, it advises the child with the acknowledgment to suspend sending for a specific number of slots. While this approach solves the problem of limited buffers, the throughput is even further reduced. To increase the throughput the number of time slots used per round for sending packets must be increased. Towards this, end nodes that have forwarded all data packets hand over their sending slots to their parents. From this point on the parent has more time slots per round at its disposal. This reduces the number of rounds for a given load considerably, but further improvements are possible by better distributing free time slots. The problem is that in a bottom-up fashion nodes have more slots to forward data, but the parents of these nodes still operate with only a single slot, leading to blocked nodes. The main contribution of this paper is an intelligent slot distribution scheme for an efficient reliable data transport.
3. The Slot Distribution Algorithm As discussed above a routing tree rooted in the sink is established periodically (see [5] for details). This step includes a time synchronization procedure such as proposed in [3]. During this process each node is assigned a unique time slot within a range of n consecutive time slots, n being the number of nodes. A sequence of these n slots is called a round. The simplicity of the protocol stems from the following simple communication scheme: nodes can only send packets to their parents, which respond with an acknowledgment within the same slot. The presented slot distribution scheme works as follows: A node only retains every second slot it is getting from its children, the other half is forwarded to the parent, which proceeds in the same way. This way slots are more equally distributed over the active part of the routing tree leading to fewer blocked nodes. Another advantage of this distribution scheme is its pure local
nature with limited communication overhead. This section describes the details of the data forwarding and slot distribution process. At first the data structures and their interfaces are presented. Each node has a unique identifier and maintains a queue buffer to store the raw data in packets to be forwarded to the sink. Furthermore, each node maintains information about its children and their state. A child is active if itself or one of its successors still has data to forward. In case the last child of a node is deactivated, the node informs its parent with the last data packet sent, that it is no longer active. The following routines are used to maintain the state of the children. hasActiveChild deactivateChild (id ) Initially all nodes are active. It is assumed that every node has at least one data packet to forward. The set of time slots, during which a node can send packets is maintained in the variable sendSlots. To avoid idle listening, each node also maintains the set of sending time slots of each child. For this purpose the following routines are defined. getSenderInSlot(slot) add (Slots, id ) The latter routine assigns all slots in the set Slots to the child with identifier id . Initially, each child has a single time slot. The number of time slots a node has to skip is stored in the variable slotsToSkip, initially set to 0. To avoid idle listening in case a child of a node skips some slots, each node also maintains the status of each child with this respect. For this purpose the following routines are defined. getSlotsToSkip(id ) decrementSlotsToSkip(id ) setSlotsToSkip(id , slotsToSkip) To support the passing of time slots to predecessor nodes, the variables slotsToForward and newSendSlots are used. The former variable contains the set of slots that will be forwarded to the parent with the next packet. The latter contains the slots that the node can use in future rounds, but only if the parent node acknowledges the receipt of this information. In this case the time slots in this set are moved to the set sendSlots. Both sets are initially empty. Using periodically adjusted timers, nodes wake up at the beginning of time slots during which they or one of their children can send data. In the first case, the node checks if this slot can be skipped and decreases the corresponding variable. In the other case, the node inspects its buffer. Only if there are data packets to be send, the node switches on its transceiver, sends the next data packet to its parent, and waits until the end of the current time slot for an acknowledgment. Upon receiving an acknowledgment, the node switches off its transceiver again and adjusts its state. If the current time slot is among its listen slots the node first checks if its child that is assigned to this slot has to
skip further slots. In this case, the corresponding counter is decremented. Otherwise, the node turns on its transceiver until a timeout happens or a packet is received. If the latter happens, the node appends the data packet to its buffer, adjusts its state, and sends an acknowledgment to the originator. After that step, the node turns off its transceiver again. The complete code is shown in Algorithm 1. Algorithm 1 Overall algorithm Entering slot s do if s ∈ sendSlots then if slotsToSkip > 0 then slotsToSkip = slotsToSkip − 1 else if buffer .size > 0 then Switch on transceiver SEND PACKET Wait for acknowledgment Switch off transceiver if received acknowledgment a then HANDLE ACKNOWLEDGMENT (a) end if end if else if s ∈ listenSlots then senderId = getSenderInSlot(s) if getSlotsToSkip(senderId ) > 0 then decrementSlotsToSkip(senderId ) else Switch on transceiver Wait for packet if received packet p then HANDLE PACKET (p) end if Switch off transceiver end if end if Each packet carries besides the identifiers of sender and receiver the following information: A flag indicating whether this is the last packet a node will send, a list of time slots that the node forwards, a set of time slots which the node will use in future for sending, and the actual data packet. An acknowledgment carries besides the identifiers of sender and receiver the following information: A flag indicating whether the buffer of the node is full and the number of time slots the child must skip. The code for sending a packet is shown in Algorithm 2. If a node sends its last packet, it adds the set of time slots currently used for sending to the set of slots to forward and includes this set in the packet. In this case, no new slots during which the parent is supposed to listen are send. If the current packet is not the last packet to send, the sets slotsToForward and newSendSlots are included in the packet. The code for handling received packets is shown in Al-
Algorithm 2 Sending Packets procedure SEND PACKET data = buffer .head if !hasActiveChild && buffer .size == 1 then slotsToForward .add (sendSlots) S END Packet(true, slotsToForward , ∅, data) else S END Packet(f alse, slotsToForward , newSendSlots, data) end if end procedure
gorithm 3. Upon receiving a packet, the data is appended to the buffer and the new sending slots of the originator are added to the corresponding set listenSlots. The packet also includes a set of time slots that can be used in future rounds for sending. Nodes at depth 1 add these slots to their set of send slots, the reason is that the sink having unlimited energy resources is always listening. Other nodes will evenly distribute these time slots to the sets slotsToForward and newSendSlots. This is controlled via the flag forwardNextSlot which initially is set to true. In case the sender has signaled that it will send no further packets, this child is deactivated. In case the number of data packets in the buffer exceeds the given limit, the child will be advised to skip sending during some time slots. Ideally, the node should resume sending packets once the fill level of the buffer drops below the limit. Without any additional communication between the two nodes, it is only possible to estimate the ideal number of slots to skip. The remaining task is to send an acknowledgment including the filling state of the buffer and the number of slots the node must skip. It remains to describe the code for the handling of acknowledgments. The receipt of an acknowledgment is evidence that the parent received the packet. Therefore, the data packet at the head of the buffer can be removed and the set holding the time slots to be forwarded can be cleared. If the buffer is now empty and no active child exists, the set holding the time slots for sending can also be cleared. Otherwise, the new listen slots can now be used, thus they are added to the set sendSlots. The last thing to adjust is the number of slots to skip as indicated in the acknowledgment. The complete code is shown in Algorithm 4.
4. Reliability Issues The protocol as presented in the previous section is not reliable in the presence of lossy links. This section discusses the extensions needed to achieve reliability. The loss of a packet does not pose a real problem, since the execution of procedure SEND PACKET does not change the state of a node. The loss of an acknowledgment poses a bigger
Algorithm 3 Handling Packets procedure HANDLE PACKET(p) buffer .add (p.getData) listenSlots.add (p.getNewListenSlots, p.sender ) if depth of node is 1 then sendSlots.add (p.getForwardedSlots) else for all s ∈ p.getForwardedSlots do if forwardNextSlot then slotsToForward .add (s) else newSendSlots.add (s) end if forwardNextSlot = !forwardNextSlot end for end if if p.lastPacket then deactivateChild (p.sender ) end if if buffer .size > MAXBUF then slotsToSkip = buffer .size − MAXBUF if !p.lastPacket then setSlotsToSkip(p.sender , slotsToSkip) end if S END Acknowledgment(true, slotsT oSkip) else S END Acknowledgment(f alse, 0) end if end procedure
problem. First of all, it leads to packet duplication. To avoid duplicate data packets in the buffer of a node, a node keeps a list with the hash values of the last received data packet of each child. This way duplicates in the buffer can be avoided. A sending node cannot distinguish whether a packet or an acknowledgment was lost. The procedure SEND PACKET always includes the data packet at the head of the buffer in the next packet sent. Since the sets slotsToForward and newSendSlots can change between two consecutive attempts to send the same data packet, procedure SEND PACKET must be prepared to cope with this problem. A severe situation that can arise is that two nodes may be assigned to the same time slot for sending. Consider first the case that an acknowledgment, which does not belong to the last packet sent by a node, is lost. In case that packet included a set of slots to forward, it is necessary to guarantee that these slots are allocated to the sets slotsToForward and newSendSlots in the same order as before. This is a problem if the node has received free slots from another child in the mean time. Since the allocation is controlled by the variable forwardNextSlot, it is sufficient to assure that at the beginning of the distribution process this variable has
Algorithm 4 Handling Acknowledgments procedure HANDLE ACKNOWLEDGMENT(a) buffer .removeHead slotsToForward .clear if !hasActiveChild && buffer .size == 0 then sendSlots.clear else sendSlots.add (newSendSlots) newSendSlots.clear if a.bufferIsFull then slotsToSkip = a.getSlotsToSkip end if end if end procedure
the same value as at the start of the previous distribution for that child. Otherwise two nodes would use the same time slot for sending, this could lead to collisions. The solution is to store the last value of this variable for each child together with one of the time slots to distribute. With this information, it is possible to detect duplicate packets and to apply the same distribution pattern. It remains to discuss, what happens if the acknowledgment for the last packet of a node gets lost. In this case, the packet includes all send slots of the originating node. Hence, it is possible that parent and child will use the same time slot for sending. A possible solution is as follows. The last packet of a node is sent at most three times, then the node keeps the data packet in its buffer and changes into state sleeping. New measurements arriving during this step are scheduled for the next phase. Furthermore, nodes that do not receive a packet from a child for three consecutive rounds consider this node as dead, and reuse the send slots of this child. Thus, if a node receives a packet with the last data of a node, then the new slots are used only three rounds later. In case this is also the last packet of the receiving node, it is necessary to delay sending this packet.
5. Evaluation To analyze the throughput of the data-forwarding phase, the proposed algorithm has been simulated with the same parameters as in the tideland application. During the flood tide, each of the 40 nodes stores its sampled data in packets. Depending on the duration of the flood tide, this results in up to 500 packets that need to be forwarded within the next ebb tide. Hence, a time window of 8 hours is available. Each slot lasts 100 ms, leading to rounds of length 4 s. The buffer limit is set to 1,000 packets. Due to space limitations, we focus on a single aspect: the number of packets send per round. Two different variants are compared: (1) forwarded slots remain with the parent node, and (2) every
second slot remains with the parent. As a comparison, the simple forwarding strategy that does not forward slots at all needs 20,000 rounds for this application. The simulations use random trees. The results are averaged over 2,000 runs. The first variant needs 10,870 rounds, while the second requires only 4,167 rounds. Compared with the simple algorithm an improvement almost by a factor of 5 is achieved. The results of the simulation imply that all packets are forwarded within 12.07 respectively 6.63 hours using the two variants. Hence, the second variant meets the requirements of the tideland application. Figure 1 depicts a histogram of packets send per round. In the first variant between 1 and 14 packets are send in 84% of all rounds, while in the second variant more than 14 packets are sent in about 90% of all rounds. We conjecture that with a more intelligent forwarding strategy a higher throughput can be achieved. 1800
Variant 1 Variant 2
1600
frequency of occurrence
1400 1200 1000 800
cluster-heads to manage radio consumption within clusters has been proposed in [1]. However, the solution does not scale well and does not fully consider inter-cluster communication. Flexible Power Scheduling (FPS) is a distributed power management protocol for sensor networks that reduces radio power consumption [2]. Parent nodes act as arbitrators picking non-conflicting transmission slots for children. This approach does not completely eliminate collisions. While our work is designed for many-to-one applications, FPS deals with arbitrary topologies. Yao et al. present a protocol called Multi-Flow Power Scheduling (MPS) [6]. Since MPS creates a global static schedule, it does not scale well to large networks. DuraNet is a distributed slot-free power scheduling algorithm for fixed, low bandwidth, many to one data collection sensor network applications [4]. It reduces energy consumption by avoiding collisions and overhearing while nodes are sleeping most of the time. Nodes allocate schedules for each link based on contention in a schedule formation phase. While DuraNet does not need a global time, it is much more complex and is not suitable for the problem under consideration. Other issues relevant for transmitting bulk data such as wear-leveling of EEPROM storage are discussed in [5].
7. Conclusion
600 400 200 0 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 number of packets sent per round
Figure 1. Histogram of packets send per round for two variants of the protocol.
This paper presented a novel protocol for the reliable transportation of the high volumes of sampled data through a multi-hop network with limited resources towards a sink. Simulations indicate that the protocol performs well, but there are still some aspects to be further explored such as the blocking function. A preliminary implementation is currently under test in a real deployment.
References A minor disadvantage of the protocol is that the buffer may grow beyond the limit (in the simulation the limit was exceeded up to 10%). The reason is that a node accepts all packets addressed to it. Even so, the sending node is immediately informed to skip rounds, other children may still send packets. Nevertheless, the simulations indicate that the overflow is moderate. More aggressively blocking nodes weakens the overflow but does not completely avoid it. An alternative is to reject all packets once the buffer limit has been reached. This approach has the disadvantage that many packets are sent without avail, increasing the energy consumption.
6. Related Work Energy-efficient MAC and routing protocols have been explored before. A centralized energy management using
[1] K. Arisha, M. Youssef, and M. Younis. Energy-aware TDMA based MAC for sensor networks. In Proc. IEEE IMPACT, 2002. [2] B. Hohlt, L. Doherty, and E. Brewer. Flexible power scheduling for sensor networks. In IPSN ’04: Proc. 3rd Int. Symp. on Information processing in sensor networks, pages 205–214, New York, NY, USA, 2004. ACM Press. [3] M. Maroti, B. Kusy, G. Simon, and A. Ledeczi. The flooding time synchronization protocol. In Proc. SENSYS ’04, 2004. [4] D. M. Terence Tong and A. Woo. Duranet: Energyefficient durable slot-free power scheduling. Technical Report UCB/CSD-04-1323, Univ. of California, Berkeley, 2004. [5] V. Turau and C. Weyer. Long-term Reliable Data Gathering Using Wireless Sensor Networks. In INSS ’07: Proc. 4th Int. Conf. on Networked Sensing Systems, 2007. [6] Y. Yao, S. N. Alam, J. Gehrke, and S. D. Servetto. Network Scheduling for Data Archiving Applications in Sensor Networks. In Proc. 3rd Int. Workshop on Data Management for Sensor Networks (DMSN), Seoul, Korea, 2006.