# La-CTP: Loop-Aware Routing for Energy-Harvesting Wireless Sensor Networks
## 3 Overview of CTP  
There have been a lot of WSN routing protocols proposed in literature in recent years; of them, CTP is one of the most important routing protocol widely considered in both real-world WSN deployments and academic studies. CTP is a tree-structured protocol which collects data from wireless sensing nodes in a many-to-one way, and it has been one part of the protocol stack of TinyOS ([[http://tinyos.stanford.edu/tinyos-wiki](http://tinyos.stanford.edu/tinyos-wiki)]([http://tinyos.stanford.edu/tinyos-wiki](http://tinyos.stanford.edu/tinyos-wiki))) (an operating system for tiny wireless embedded system). CTP aims at providing reliability, robustness, efficiency, and hardware independence in delivering sensory data. To see how CTP might work, we will next introduce its architecture and some major schemes involved.  
CTP includes three collaborative components: the Link Estimator, the Forwarding Engine, and the Routing Engine. Figure 2 shows the architecture of CTP. The **Link Estimator** is responsible for estimating the single-hop ETX value [38] from the local node to its neighbor. ETX (expected transmission count) is a metric measuring the quality of two-way link. Such estimations are performed according to the beaconing scheme that controls a beacon timer. The **Routing Engine** uses the estimated ETX values and the network-level information (including the feedback from the Forwarding Engine), aimed at deciding which neighbor is more desirable to serve as the forwarder or the parent node. The **Forwarding Engine** maintains a packet queue and decides when and how to send the locally-generated or the passing-by packets. The critical function of the Forwarding Engine is to detect packet duplicates and routing loops.  
In short, the three components of CTP form a closed-loop control of information flow: CTP dynamically updates its routing information according to the link and network states collected at runtime. The implementation of CTP involves three supportive techniques, which are critical for it to achieve the performance goals, and they are as follows.  
Figure 2: Brief description of the architecture of CTP.  
1. _Agile Link Estimation_: to estimate the radio link quality, CTP uses the four-bit link estimator which profiles the dynamics of the physical, the data-link, and the routing layers. Especially, CTP updates such estimations as quickly as every five packet receptions in order to ensure the accuracy.
2. _Datapath Validation_: topology changes often lead to transient loops in network, which in turn cause significant packet drops, wasting the precious network resources. In detail, CTP uses ETX as the metric for measuring both the single link and the path to the sink. The ETX value of a path is the sum of the ETX values of all the links along this path. Before a node forwards a packet, it will examine whether the ETX value of the passing-by packet is smaller than its local ETX; if true, CTP thinks that routing loops have happened to the previous-hop node.
3. _Adaptive Beaconing_: by exchanging control beacons in a series of time intervals, CTP updates stale routing structure. The adaptive beaconing scheme, improved on the basis of Trickle [21], breaks through the traditional trade-off between the fast recovery of connection and the low cost, and it can control when to reset the timer interval of sending beacons, according to the routing cost gradient that is maintained locally by each node.  
CTP is a well-engineered routing protocol for WSNs, synergistically integrating the 4-bit link estimator, the Trickle beaconing scheme, and the ETX-based routing gradient computation. In recent, CTP has developed into one of the most successful routing protocols for collecting data from academic and industrial wireless networks [39; 40], and it has also become the de facto standard for data collection in WSN applications [41; 42; 43].