| Algorithm 3. Node Help (Node-HELP) |
| When node n detects that its connection to the CH is broken or its CH cannot reach the BS Record the current state of n as “Disconnected” Increment Node-HELP call count and cumulative statistics Node n broadcasts a Node-HELP Request packet with radius Rc1 For each alive CH node ch within communication range If (ch has a valid route to BS AND ch.Upstream_ID ≠ −1) ch replies with a control packet to node n Calculate link stability: Score = LinkStability(n, ch) End if End for If node n receives one or more replies from candidate CHs Select best_CH with the highest stability score If n was previously associated with an old CH Remove n from the old CH’s member list End if Update n.CH_ID = best_CH.ID and set n.is_member = True Add n to the best_CH member list Update the state of n to “Reconnected” Else Maintain the state of n as “Disconnected” and set n.CH_ID = 0 End if End Algorithm |