|
Algorithm 2 Pseudocode for the receiver-based transport competition process at neighbor node j
|
-
1:
Input: ← received packet from the intermediate node i
-
2:
-
3:
← the packet to transmit at node j
-
4:
h ← the number of overhearing (default = 0)
-
5:
-
6:
n = GetNumberofPaths() ▹ extract the number of paths n from the packet
-
7:
StartTimer(T) ▹ timer for waiting according to distance from j to destination
-
8:
while TRUE do
-
9:
if
T.expired() == TRUE then ▹ waiting timer expiration
-
10:
= bifurcation_decision_process, ▹ calculate the number of path (Algorithm 1)
-
11:
.SetNumberofPaths() ▹ set the number of paths to satisfy the
-
12:
Send() ▹ send a packet
-
13:
Exit() ▹ quit the competition process
-
14:
end if
-
15:
if Receive() == TRUE then ▹ when receive the packet from other competitor
-
16:
h = h + 1
-
17:
if
h ≥ n
then ▹ already enough number of paths are constructed
-
18:
T.Stop() ▹ stop timer to transmit the packet
-
19:
Drop() ▹ drop the packet
-
20:
Exit() ▹ quit the competition process
-
21:
end if
-
22:
end if
-
23:
end while
|