## 2 Principal component aggregation in wireless sensor networks
### Data aggregation
#### Aggregation primitives  
Once the routing tree is set up and the nodes synchronized, data can be aggregated from the leaves to the root. Each node adds its contribution to a _partial state record_\(X\) which is propagated along the routing tree. Partial state records are merged when two (or more) of them arrive at the same node. When the partial state record is eventually delivered by the root node to the base station, the desired result is  
Figure 1: A multi-hop network where all the sensor nodes are connected to the base station by means of a routing tree. Note that as the radio range usually allows a node to communicate with several others, different routing trees can be obtained. The black node represents the root node.  
returned by means of an evaluator function. An aggregation service requires then the definition of three primitives [10, 11]:  
* an initializer \(init\) which transforms a sensor measurement into a partial state record,
* an aggregation operator \(f\) which merges partial state records, and
* an evaluator \(e\) which returns, on the basis of the root partial state record, the result required by the application.  
Note that when partial state records are scalars or vectors, the three operators defined above may be seen as functions. Partial state records may however be any data structure which, following the notations of [10], are represented using the symbols \(\langle.\rangle\).  
We illustrate the aggregation principle by the following example. Suppose that we are interested in computing the Euclidean norm of the vector containing the WSN measurements at a given epoch. Rather than by directly sending all the \(p\) measurements to the base station for computation, an aggregation service (Figure 3) can obtain the same result in an online manner once the following primitives are implemented :  
\[init(x) = \langle x^{2}\rangle\] \[f(\langle X\rangle,\langle Y\rangle) = \langle X+Y\rangle\] \[e(\langle X\rangle) = \sqrt{X}\]  
In this example the partial state records \(X\) and \(Y\) are scalars of the form  
\[X=\sum_{i\in I}x_{i}^{2}\]  
Figure 2: Activities carried out by sensors in the routing tree _(adapted from [13])_. Transmissions are synchronized for optimizing energy savings. The last stage involves all sensors and allows unsynchronized operations (for sensor discovery e.g.).  
where \(I\subset\{1,\ldots,p\}\).  
It is worth noting that in-network aggregation does not only reduce the amount of packets transmitted but also increases the network lifetime. The energy consumption of the processing unit of a sensor node is at least one order of magnitude lower than the one of the wireless radio [6, 25, 26]. According to the analysis [27] of the main wireless sensor platforms available today on the market, sending one bit of data is equivalent to \(2000\) CPU cycles in terms of energy. For a packet length of 30 bytes (average TinyOS packet length), this corresponds to \(480000\) CPU cycles. It follows that, with respect to transmission costs, the energy consumption of simple aggregation operators is negligible. There is therefore a large variety of in-network processing algorithms that can lead to energy savings by reducing the number of packet transmissions.