## 3 RRP Description
### Reconfigurable Routing  
The network starts its task with data transmission in this phase. Initially, each node forwards the sensed data to the BS by randomly selecting an ID from its next hop set in the RT. As time goes by, if the residual energy of a node reaches a threshold, it immediately sends an SOS message to the BS for reconfiguration. The SOS message includes two fields: message type and the ID of the dying node. The threshold, denoted by \(E_{\textit{threshold}}\) is set by the following equation:  
\[E_{\textit{threshold}}=p\times E_{\textit{init}} \tag{1}\]  
where \(E_{\textit{init}}\) is the initial energy of a node and \(p\) is a percentile that can be appropriately set by the network designer according to specific traffic load and application. When the BS receives this SOS message, it begins reconfiguring the network by first figuring out those nodes affected by the dying node (DN). The affected nodes can be classified into two categories: maintenance nodes (MNs) and adjustment nodes (ANs). MNs are those nodes whose reconfiguration can be done by modifying their RT. However, for the ANs, adjusting the orientation and communication radius is needed for their reconfiguration. Both MNs and ANs are the predecessors of the DN. The difference is that the MNs can contact the BS through other nodes except the DN. However, the DN is the only choice for ANs to communicate with the BS. Taking the example of Figure 6, \(S_{\textit{d}}\) is a MN and \(S_{\textit{6}}\) is an AN when \(S_{\textit{7}}\) is dying. After the classification, the BS reconfigures the DN, MNs and ANs as follows:  
For the DN, the BS sends it a death notification message directly. This message contains the type of reconfiguration and the ID of the DN. Then the DN establishes a bi-directional path with the BS. If the DN is a CH, then the bi-directional path has already been set up by its CCR; otherwise, if the DN is a GS, then this can be done by re-orienting the DN's active transmitter and adjusting its communication radius to reach the BS. Finally, the DN is isolated from others, and it directly transmits the packets to the BS. For MNs, the BS sends each of them a message for routing maintenance, as the path to the DN becomes invalid. This message includes three fields: message type, ID of the intended MN, and maintenance information. The message type tells the node this is a message for routing maintenance. The maintenance information specifies the ID of the DN. Upon receipt, each MN eliminates the ID of the DN in the next hop set of its RT to exclude this path. For ANs, the adjustment of orientation and communication radius is essential because the DN is their only successor for uplink communication. To depict this scheme, some useful denotations are introduced in Table 2. Note that we define a circle area for each AN as \(A_{\mathit{AN}}\), which is the circle centrally located at the AN with a radius of communication range. When a GS satisfies the connectivity requirement, this means there is at least one path available for it to reach the BS. Figure 7 shows the pseudo-code of reconfiguring the AN. To minimize energy consumption, at first, the BS tries to find a living CH in the AN's circle area \(A_{\mathit{AN}}\). If such a CH exists, then the orientation of AN should be adjusted to the direction of the found CH. If there are more than one qualified CHs, then one of them is chosen randomly. Otherwise, if no such CH is available, then the BS turns to find a GS that satisfies the connectivity requirement of the reconfiguration of AN. If there are two or more candidates, then the one with the smallest number of hops to the BS is selected. However, if none of the qualified CH or GS is found, then the BS regards this AN as an uplink cluster head (UCH) whose orientation should be fixed directly to BS itself for relaying data. When the plan of reconfiguration is ready, the BS directly sends the AN a message including information of the message type, ID of the