|
Algorithm 5 Cooperative communication. |
-
1:
Child u sending data to Parent
-
2:
if Beacon or ACK not received from within t
then
-
3:
sender waits for the beacon from its sibling
-
4:
end if
-
5:
if Child u receives a beacon from its sibling s
then
-
6:
sends its data packet with relay indicator
-
7:
else
-
8:
Child u waits for another t time
-
9:
if child gets beacon from neighbor n
then
-
10:
check the from beacon
-
11:
if
≤
then
-
12:
sends data to neighbor n
-
13:
change parent of u to n
-
14:
else
-
15:
waits for beacon from another neighbor n
-
16:
end if
-
17:
end if
-
18:
end if
|