|
|
Algorithm 2 Adaptive Link Maintenance and Reinforcement Algorithm-Run at RN |
|
| 1: |
R(u,v) ← ø; |
▹ u,v ∈ G
|
| 2: |
while
true
do
|
|
| 3: |
while
state == Stand-by
do
|
|
| 4: |
if Receive a MREQ from v
then
|
|
| 5: |
Obtain position information of u and v; |
|
| 6: |
Move to mid(u,v); |
|
| 7: |
Send a CHG-NEXT-HOP to u; |
|
| 8: |
State = Relaying; |
|
| 9: |
end if
|
|
| 10: |
end while
|
|
| 11: |
while
State == Relayingdo
|
|
| 12: |
Pause for time(talm); |
|
| 13: |
Obtain R(u,v) from v; |
|
| 14: |
if
R(u,v) < Rreq
then
|
|
| 15: |
Move to mid(u,v); |
|
| 16: |
else
|
|
| 17: |
Stop at present position; |
|
| 18: |
Send a CHG-NEXT-HOP to u; |
|
| 19: |
State = Stand-by; |
|
| 20: |
end if
|
|
| 21: |
end while
|
|
| 22: |
end while |
|
|