Algorithm 1 IoB-DTN protocol. |
-
1:
At each sensor reading period
-
2:
Generate a packet p with the readings
-
3:
if Buffer management provides a slot then
-
4:
Store in the buffer [ copies of p are stored]
-
5:
end if
-
6:
-
7:
When duty cycle is over
-
8:
the list of neighbors
-
9:
if a base station is in
then
-
10:
Send all packets in buffer
-
11:
else
-
12:
for all packet in buffer do
-
13:
if N (number of copies) > 1 then
-
14:
Send
-
15:
end if
-
16:
end for
-
17:
end if
-
18:
Wait for next duty cycle
-
19:
-
20:
On reception of packet
-
21:
self position in
-
22:
-
23:
if Buffer management provides a slot and
then
-
24:
Store
-
25:
Send ACK for receiving copies of p
-
26:
else
-
27:
Packet is rejected, no ACK is sent
-
28:
end if
-
29:
-
30:
On reception of an ACK of p and
-
31:
if sender node is a base station then
-
32:
Delete p from buffer
-
33:
else
-
34:
Update the number of copies of
-
35:
end if
|