## 2 End-to-End QoS in WSNs
### Availability and End-to-end Reliability  
In this paper, reliability expresses the probability of a successful packet delivery from a source to the destination. As the delivery time has usually a limit after which a packet becomes useless, the reliability  
Figure 3: Sleep schedules in a low duty cycle network. A node forwards data during the active period of a neighbor node.  
Figure 2: Quality of service (QoS) parameters in WSNs. The shown network QoS profile emphasizes reliability, availability, data accuracy, and energy-efficiency.  
is evaluated together with latency. Alert and control messages are the types of WSN traffic that require high reliability and low latencies.  
As the wireless connections are unreliable, it is essential to know how reliably the sensor readings can be collected. In monitoring networks, it is important to find the longest (worst) time between received updates. This cannot be calculated from the average reliability, as a network may function correctly for a long time and then experience a momentarily failure e.g. due to a link break. To express the time required to recover from errors, we use availability as a second metric. The availability is expressed in nines notation, e.g. the availability of two nines means that information has been received from a node 99% of the time.  
We define the availability as a probability that data is received from a node within certain time interval \(I\) as  
\[availability=\frac{|\{1\leq i\leq N-1:a_{i}-a_{i-1}\leq I\}|}{N-1}, \tag{1}\]  
where \(a_{i}\) is the arrival time of the \(i\)th sample, \(N\) is the number of received samples. Thus, a node is considered available when sensor values are received from it over the time of observation.  
An example of the availability when a node generates traffic at constant 50 s intervals is shown in Figure 4.?From (1) it follows that the measured availability resembles the cumulative distribution function (cdf) of the process that generates traffic at a source node. Therefore, when errors do not occur, the average reception interval is 50 s. Due to variation in end-to-end latencies, the cdf spreads slightly and the availability reaches 100% at 60 s. When packet errors occur, variation around the average reception interval increases and reaching high availability requires a large reception interval. Packet losses increase the time between receptions increases and consequently decrease the availability. In the example, 99% availability is reached only after 180 s reception interval.  
In practice, the availability can be used to evaluate the applicability of the network for a certain purpose. For example, in a WSN that is targeted at intruder detection may not be unavailable for a long time or otherwise an alert can be received too late. Thus, an availability (e.g. 99.99%) must be associated with a time interval, e.g. one minute. In a measurement network the interval may be even ten minutes as the observed phenomena changes slowly.  
Figure 4: Availability metric expressing the probability that an update is received from a node within certain time interval. Packet drops and network errors decrease the availability.  
The availability can be measured in any network by instructing nodes to send periodic keep-alive messages. The simulations in this paper use a typical measurement WSN, in which the availability is naturally calculated from the periodic updates.