## 4 Network Performance
### Ctp  
The analysis of the network performance after deploying the CTP-based WSN application is presented for the data collected from November 2013 to April 2014 (see Figure 4). This dataset has more than 475,000 packets, including sensor data packets and summary packets. During this period, the ASWP testbed had 52 motes deployed in Sites 1 through 5 as described in Section 3. Duplicate packets received at the sink node are identified using the sequence number defined in the CTP header and the additional health information implemented for this version of the WSN application. It was found that only 0.2% of the packets received at the WSN gateway are duplicates, showing that CTP is effective in detecting and removing duplicate packets. This functionality in CTP identifies duplicates in the same collection tree using a small cache and saving the origin node's identifier, the CTP sequence number, and the Time Has Lived (THL) fields from transmitted packets. In this way, the routing protocol only considers 1-hop duplicates and avoids discarding looping packets. Each node tracks the number of duplicates detected and removed, which is reported in the instrumentation information received in summary packets. Based on this information, the 1-hop duplicate rate at the  
Figure 8: Daily average node packets received, packets forwarded, packets retransmitted and packets dropped per node during XMesh evaluation periods P1 and P2. network level obtained for this time period of six months is 1.5%. Overall, the control of duplicate packets in CTP is effective, especially considering that most duplicates are detected in their first hop and thus unnecessary transmissions are avoided. A significant improvement is observed in the PRR and PSR during this six-month period, in which CTP achieved 79% PRR and 96% PSR; however, network partitions remain an important challenge. Knowing that nodes may leave and enter the WSN as their batteries are depleted and replaced (or in the event of hardware failures and repairs), there are different situations in which the routing protocol is found not able to reestablish a path to the base station. Figure 9 shows the behavior of the PRR at the network level when using CTP. It can be seen that after December 2013, the PRR has a significant reduction, which was caused by a major network partition when an important relay node stopped working. This situation was solved in early January 2014, by replacing and relocating different relay nodes in Site 1. The high PSR is also consistent with these observations, indicating that overall the WSN does not have problems forwarding data packets and therefore, the reduction in the PRR may be related to routing problems at specific nodes. For further analyzing the behavior of data traffic, the network-level cost of transmissions was computed according to Equation (5) given below. The intuition behind this indicator is to compute the average number of transmissions required in the network for the successful delivery of one packet to the base station, based on node health statistics. Figure 10 shows the cost of transmissions along time, ranging between 3 and 4 most of the time. The curve shows increments during November/December 2013 and January/February 2014 which correspond to maintenance activities that increased the number of connected nodes in the network. Furthermore, after January 2014, most maintenance activities are focused on nodes located farther than Site 1, introducing a higher number of forwarded packets and retransmissions, thus increasing the cost of transmissions at the network level. \[\textit{Cost of }\tau x=\frac{\textit{generated}_{\textit{pkts}}+\textit{ forwarded}_{\textit{pkts}}+\textit{reTransmissions}}{\textit{generated}_{\textit{pkts}}} \tag{5}\]  
Control traffic is also instrumented in the CTP-based application. Figure 11 presents the total network-level transmissions and receptions of control packets.