## 3 ZigBee and TUTWSN Technologies
### Tutwsn  
TUTWSN consists of network protocols, sensor applications, hardware platforms, and tools and services for accessing sensor data from connected external networks [27, 28]. In this section, only MAC and routing layers are presented. Also, the differences between TUTWSN and ZigBee relevant to this research are discussed.  
In TUTWSN, each cluster operates on its own frequency referred to as a cluster channel. A cluster head advertises its presence by sending network beacons using a common network channel. This way, instead of scanning through every possible cluster channel, a node can detect clusters rapidly by listening to the network channel.  
The superframe structure is similar to the IEEE 802.15.4. However, instead of using carrier sensing, CAP and CFP are divided into fixed time-slots as shown in Figure 6. Each time slot is further divide into two subslots, first subslot is for data frame and the following subslot is for acknowledgment. The use of contention free slots is preferred as it eliminates collisions and thus increases reliability [29]. The ALOHA based CAP is used only for joining a cluster and requesting reservations on CFP.  
The use of contention free slots makes TUTWSN energy-efficient as contention is minimized. However, it also potentially increases forwarding delays on the presence of link errors, as a node must probably wait to the next active period for new transmission attempt. In CSMA-based protocols, like ZigBee, a node may try a new transmission immediately after a failed attempt.  
In this paper, we use the following simple scheme for slot reservation. Each cluster member is always assigned with one slot per active period. If a node has queued frames, it asks for an additional slot by setting a flag in its data transmission. The cluster head assigns a slot during the ongoing access cycle and indicates the slot in the acknowledgment frame. The benefit of the scheme is that it divides bandwidth flexibly among the members according to the actual traffic requirements. Thus, the results obtained with the TUTWSN are near optimal when considering the practical implementations of TDMA-based slot assignment.  
TUTWSN utilizes cost-based routing [30] that is commonly used in WSNs due to its simplicity and suitability to data centric networks. In the cost-based routing, each node is assigned with a cost that is calculated based on the distance to the sink. Thus, by forwarding data toward a neighbor that has a lower cost, a packet eventually reaches the sink. The routing exploits the notion that the traffic in a typical measurement WSN is highly asymmetric, as most of the traffic is routed from a node to a sink. For  
Figure 6: Superframe structure in TUTWSN MAC. CAP and CFP are divided into fixed time slots comprising two subslots, one for data frame and another for acknowledgment.  
example, in a measurement network sink collects sensor values and may act as a gateway to Internet.  
In TUTWSN, node initially searches its neighbors with a network scan. When a new neighbor is found, a node sends a cost request to it. A node selects the next hop and sets its cost based on the received replies. Additionally, nodes periodically recalculate the cost and broadcast an advertisement to their neighbors. This way, nodes can react to the changes in the network conditions as cost changes.