| Algorithm 1. Event-Driven CH Handover |
| For each current CH C in the wireless sensor network Check whether the current upstream of C remains valid. If the current route of C is disconnected, invoke CH-HELP(C) to repair the route. Set handoverFlag = false. If E(C) < Etrigger and there exists a member node n ϵ M(C,t) such that E(n) ≥ E(C) + ∆E, set handoverFlag = true and mark the handover as energy-triggered. If Sself(C,t) < Sthreshold, set handoverFlag = true and mark the handover as stability-triggered. If handoverFlag = true, broadcast a “Handover Evaluation Start” packet to cluster members. Candidate member nodes enter local backoff competition according to the backoff rule. Compute each candidate backoff according to the priority rule in Equation (13). If no candidate responds or no candidate backoff timer expires within the allowed competition window, cancel the role-transfer attempt and keep C as the current CH. Otherwise, if candidate m expires first and no CH_DECLARE packet has been received, m announces itself as the new CH. m inherits the old CH’s upstream information. Validate the inherited upstream within Tinherit If the inherited upstream is invalid, set Sup(m) = 0 and invoke CH-HELP(m). End if End if End for End Algorithm |