# A Reliable Handoff Mechanism for Mobile Industrial Wireless Sensor Networks
## 4 Trigger Condition
### Triggering Metrics  
The combination of several vital metrics can guarantee more accurate handoff triggering. In this paper, we focus on three aspects for the evaluation of triggering time.  
**Metric 1.** Moving State (**MS**)  
Figure 3: Normal case and worst case where \(M\)N is moving away from its parent. (**a**) The normal case; (**b**) The worst case.  
Moving state is one of the metrics vital for the determination of the handoff triggering. The node extracts the RSSI value in each of the received packets and records them with a current timestamp. Next, the variation rate of the RSSI value is noted to evaluate the general state of movement in all ends of the superframe. In TDMA, we use slot as time unit and we stamp each RSSI value with the absolute slot number (ASN) which denoted by \(s_{x}\). Thus a collection of observed data in \(W\) is \(\{r(s_{0}),r(s_{1}),...,r(s_{m})\}\), where \(r(s_{x})\) is the RSSI value extracted by a packet in the \(s_{x}\)th slot and \(m\) is the number measurements. Each node receives at least one packet including acknowledgement within one superframe, thus \((s_{m}-s_{0})/L\geq W\). Finally, the movement is evaluated by means of establishing a unary linear regression model where signal strength and corresponding time construct the linear relationship. We use \(k\) to denote the variation rate of signal strength, which is expressed as  
\[k=\frac{\left|\sum\limits_{i=0}^{m}(s_{i}-\bar{s})(r(s_{i})-\bar{r})\right|}{ \sum\limits_{i=0}^{m}(s_{i}-\bar{s})^{2}} \tag{3}\]  
where \(\bar{s}\) and \(\bar{r}\) refer to their mean values respectively.  
**Metric 2.** Channel Condition (**CC**)  
Monitoring the condition of the current channel is the second metric to trigger the handoff. Though RSSI is generally able to evaluate the state of movement, it is easily fluctuated, especially in industrial environments because of the effects of reflection, diffraction and absorption produced by metallic obstacles. Therefore, we use signal-to-noise ratio (SNR) to deduce the condition of channel for the potential causal relationship between SNR and transmission performance. The value of SNR can be derived by simply subtracting the noise floor (dBm) from the received signal. The measurement of SNR decreases the effect of noise on late triggering, and it is also easily and freely obtained with every received packet.  
**Metric 3.** Packet Delivery (**PD**)  
The lower bound of the current link quality is that the packet delivery reaches unacceptable level. The above two metrics are evaluated to predict at what time handoff is triggered. However, handoff needs to be triggered immediately when the packet delivery of the current link is below a certain level. Therefore, the required number of packet transmissions (RNP) is a good choice for the evaluation of packet delivery, which is estimated in transmitter. It computes the RNP by counting all transmissions and retransmissions of each transmitted packet over \(W\). Thus, RNP is calculated as  
\[\text{RNP}=\frac{N_{t}}{N_{s}} \tag{4}\]  
where \(N_{t}\) is the total number of transmissions and retransmissions and \(N_{s}\) is the number of successfully transmitted packets. Based on TDMA protocol, the receiver should acknowledge each data packet transmitted by transmitter. These replied acknowledgements are counted as \(N_{s}\).