|
Algorithm 3 Pseudocode for an exceptional case handling process at an intermediate node i
|
-
1:
n ← number of paths ▹ number of paths calculated by Algorithm 1
-
2:
← original packet to construct the number of paths at node i
-
3:
← modified packet to handle the exception
-
4:
← received packet from the neighbor node j
-
5:
h ← number of overhearings (default = 0)
-
6:
-
7:
StartTimer(T) ▹ when this timer expires, the timer of all neighbors is considered to have expired
-
8:
whileT.expired() == FALSE do ▹ overhearing the transmission of the neighbors
-
9:
if Receive() == TRUE then ▹ when receiving the packet from the neighbor nodes
-
10:
h = h + 1
-
11:
if
then ▹ a sufficient paths are constructed
-
12:
Exit() ▹ quit the exception handling process
-
13:
end if
-
14:
end if
-
15:
end while
-
16:
-
17:
ifh = 0 then ▹ no paths were constructed
-
18:
Send()
-
19:
end if
-
20:
ifh < n
then ▹ Some paths were constructed and the number of paths is insufficient by .
-
21:
.SetNumberofPaths() ▹ set the number of paths, , to construct n paths
-
22:
Send () ▹ modified packet is retransmitted
-
23:
end if
|