## 4 Protocol Description
### Routing Mechanism Details
A node increases its power according to formula (2) until one of the following conditions is satisfied:  
(1) It finds a node as a forwarding choice in \"_safe_\" state according to the height and delay estimate. (2) If \(p=p_{\_}{max}\); in this case, it finds the new neighbor as a forwarding choice by the height and delay estimate in a priority from \"_safe_\", \"_lowsafe_\" to \"_infire_\"; otherwise, no eligible new neighbor can be found. Figure 2: New neighbor discovery to solve routing “hole”. In the new neighbor discovery, sensor \(i\) will broadcast out a Routing Request (RTR) message. In this process, sensor \(i\) piggybacks _height_, _slack_ and the newly adapted power _p\({}_{i}\)_ in RTR message. For a node \(j\) that hears the message, if the estimated end-to-end delay is no more than _slack_ and its height is lower than _height(i, sink)_, as well as its state is \"_safe_\", then \(j\) is selected as a new neighbor. If sensor \(j\) hears the RTR with _p\({}_{max}\)_, and if its height is lower than _height_ (_i_, _sink_), then \(j\) is selected a new neighbor when \(j\) is not in \"_unsafe_\" state. The new neighbor will reply to node \(i\) with the same power that node \(i\) is using, after a random backoff to avoid collisions. The forwarding choices send reply message with _p\({}_{i}\)_ only as necessary for reaching node \(i\), otherwise reverting to their previous power level. Upon receiving the reply, node \(i\) inserts the new neighbors into its neighbor table. During RTR and reply message exchange, we could calculate the delay between \(i\) and its new neighbor \(j\) as follows:  
\[{Ave\_delay(i,j)={}_{Round\_trip\_time/2}} \tag{3}\]  
For meeting real-time requirements, the forwarding choices should satisfy that: \"_slack_\" is no less t than the average delay between \(i\) and \(j\) plus the delay estimate at node \(j\), _i.e._,  
\[{slack(i)\geq{}\ Ave\_delay(i,j)+delay(sink,j)} \tag{4}\]  
If there is more than one new neighbor found, a best forwarding node is selected by the priority of state from \"_safe_\", \"_lowsafe_\" to \"_infre_\". If there is still a tie, the best relay is selected by the node with higher residual energy and lower ID number. For a node that works in a larger transmission range could still be adapted to decrease the transmission power to improve energy efficiency and network capacity, while delay deadline is loose. So we define when a node detects a good connectivity with safe neighborhood that is larger than a predefined threshold, _i.e._, \(|{Neighbor_{safe}}|>{N\_threshold}\), power decrease process is invoked. We defined a function to find appropriate transmission range by decreasing transmission power as follows:  
\[p=p_{cur\_i}\text{, }\iota=1\text{, }2\text{, }3\ldots\text{.}k\text{-}1 \tag{5}\]  
In formula (5), _cur_ is the current number of transmission power level among \(k\) levels. _t'_ is the count of decrement. A node is eligible for power decrease until:  
(1) The minimum power has been reached. (2) There are two consecutive power levels such that at the lower level the required delay is not met but at the higher power level the required delay is met. (3) There are two consecutive power levels such that at the lower level the required safe neighborhood connectivity _N_threshold_ is not met but at the higher power level it is.