|
Algorithm 1 SARF Algorithm |
-
1:
/* Initialization
-
2:
▹ Number of consecutive transmission failures
-
3:
▹ Number of consecutive transmission successes
-
4:
▹ Available rates
-
5:
▹ Select the lowest transmission rate in set R
-
6:
▹ Set transmission rate to the lowest value
-
7:
/* End Initialization
-
8:
while true do
-
9:
if Request of a new transmission then
-
10:
if Previous attempt was failed then
-
11:
Perform transmission attempt at the lowest rate
-
12:
else
-
13:
Perform transmission attempt at the current rate
-
14:
if Success then
-
15:
▹ Reset # of consecutive failures
-
16:
▹ Increase counter of consecutive successes
-
17:
if
then ▹ If success threshold reached
-
18:
if
then ▹ If highest rate not reached
-
19:
;
-
20:
▹ Increase rate
-
21:
end if
-
22:
end if
-
23:
else
-
24:
/* (If failure)
-
25:
▹ Reset # of consecutive successes
-
26:
▹ Increase consecutive failures
-
27:
if
then ▹ If failure threshold reached
-
28:
if
then ▹ If lowest rate not reached
-
29:
-
30:
▹ Decrease rate
-
31:
end if
-
32:
end if
-
33:
end if
-
34:
end if
-
35:
end if
-
36:
end while
|