|
Algorithm 1 The modified CSMA/CA mechanism |
-
Require:
, packet duration ;
-
Ensure:
Transmission success/failure.
-
1:
Listen to the channel;
-
2:
if (Beacon not received) then
-
3:
Wait for beacon;
-
4:
else
-
5:
;
-
6:
= ;
-
7:
if
then
-
8:
;
-
9:
if
then
-
10:
Stop due to channel access failure;
-
11:
else
-
12:
go to step 1;
-
13:
end if
-
14:
else
-
15:
Access channel after duration;
-
16:
if (channel busy) then
-
17:
Switch to power saving mode for duration;
-
18:
;
-
19:
if
then
-
20:
Stop due to channel access failure;
-
21:
else
-
22:
go to step 5;
-
23:
end if
-
24:
else
-
25:
Start transmission and wait for ACK;
-
26:
if (ACK is not received) then
-
27:
;
-
28:
if
then
-
29:
Wait for next retransmission period and go to step 5;
-
30:
else
-
31:
Stop due to transmission failure;
-
32:
end if
-
33:
end if
-
34:
end if
-
35:
end if
-
36:
end if
|