|
Algorithm 1 Algorithm for forwarding data packets |
| Node i receives from node j
|
| Obtain and
|
| Calculate distance relative to
|
| Calculate corresponding to distance and
|
| SWITCH
|
| CASE 1: |
|
|
| if node i is the preferable forwarder node of node j
then
|
|
| send ack |
| end if
|
| Hold for next data packet |
| END CASE |
| CASE 2: |
|
|
| if node j is the preferable forwarder node of node i
then
|
|
| up-to-date entry neighbor_tablemaking use of item () |
| end if
|
| END CASE |
| CASE 3: |
|
|
| Move to the next step |
| END CASE |
| END SWITCH |
| if selected node i is not the preferable forwarder node of
then
|
|
| Upgrade using item () |
| Drop
|
| end if
|
| if node i is the preferable forwarder node of
then
|
|
| Obtain source ID, packet ID from
|
| if (source ID, packet ID) within the queue then
|
|
| Drop
|
| end if
|
| if the node is within the forwarding area then
|
|
| Move to the next step |
| else
|
|
| Hold for the next
|
| end if
|
| end if
|
| Find the next in
|
| if
is empty then
|
|
| Drop
|
| end if
|
| Upgrade the depth in with
|
| Add (source ID, packet ID) into the queue |