Research Article
Trust-Aware and Low Energy Consumption Security Topology Protocol of Wireless Sensor Network
Algorithm 1
The pseudocode of elected cluster head.
| () if round=1 | | () Bs_str = Receive_Str(msg form BS) //radio strength from BS | | () endif | | () if (().energy > 0 && ().type! = “”) | | () ().state = “”; | | () broadcast _MSG within range ; | | () Receive (confirmation message of neighbor node within the range of ); | | () calculate ; | | () broadcast PCH_MSG within range ; | | () receive PCH_MSG from others | | () ( received, own) | | () endif | | () if (((). == ) | | () ().state = “”; | | () endif | | () if (().state == “”) | | () broadcast MC_MSG within range ; | | () waitfor JOIN_MC_MSG; | | () endif |
|