|
Algorithm 1 PEAFC-CL |
|
Upon Timer |
| BS: broadcast “” frame in network |
|
foreach sensor node
do
|
| Reset to 0 |
| Upon receiving a beacon frame from BS |
| Compute
|
| send “” frame (contain: , , ) |
| end |
| Upon receiving a Probe request frame from
|
| BS compute: , , , , ,
|
|
If
< current time <
then
|
| BS broadcast “” (contain: , , , , , ) |
| foreach sensor node
do
|
| ← Random (0, ) |
| If
<
then
|
| Be cluster head ←
|
|
|
| else
|
| Be cluster head ←
|
|
|
| end
|
| end
|
|
else if
< current time <
then
|
| foreach CH node do
|
| Broadcast “” message |
| Upon receivingh a “” message |
| if
then
|
| Record information contained in “” |
| Add to CH Member node list |
| else
|
| Discard “” |
| end
|
| end
|
| foreach CM node do
|
| Upon receivingh a “” message |
| Compute: ,
|
| If
and
then
|
|
|
| Broadcast “” message |
| end if
|
| end
|
| end |