Algorithm 1. Forwarder_Set_Selection (S = Source, D = Destination) |
//When any source node S want to send a packet towards D, it will execute this algorithm// |
Notations
NBL: Neighbor list
REP_Count: Count of replies received by the source node
SID: Identity of the source node
RES: Energy residual of the node
PRR: Packet Reception Ratio
FL(S): Forwarder List of source node S
|
Input |
Source Node S, SID, RES, and Location corresponding to the node S |
Process |
START
|
Let NBL (S) be the neighbor list of node S
Let REP_Count (node): = 0
-
For count: = 1 to 5 repeat
Broadcast “Hello_Packet” as {SID, Coordinates (x, y), RES} from S;
-
IF (reply == True and node !Ɛ NBL(S))
Add the replying node to the neighbor list NBL(S) with following values updated
{Node_ID, Location, Energy};
Else IF (reply == True and node Ɛ NBL(S))
REP_Count (node) = REP_Count (node) + 1;
Else
count = count + 1;
endIF
count = count + 1;
endFor
-
For each node in NBL (S) repeat
Calculate PRR (node);
IF PRR (node) >= 0.2
Add node to forwarder set (FL(S));
endIF
endFor
Forwarder Set FL(S) is formed;
|
END
|
Output: Creation of forwarder list consisting of neighbor nodes of the source node S. |