Skip to main content
. 2018 Aug 27;18(9):2819. doi: 10.3390/s18092819
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 pN0 in the buffer [N0 copies of p are stored]

  • 5:

    end if

  • 6:

     

  • 7:

    When duty cycle is over

  • 8:

    L the list of neighbors

  • 9:

    if a base station is in L then

  • 10:

     Send all packets in buffer

  • 11:

    else

  • 12:

    for all packet pN in buffer do

  • 13:

      if N (number of copies) > 1 then

  • 14:

       Send pNL

  • 15:

      end if

  • 16:

    end for

  • 17:

    end if

  • 18:

    Wait for next duty cycle

  • 19:

     

  • 20:

    On reception of packet pNL

  • 21:

    pos self position in L

  • 22:

    NN2pos+1

  • 23:

    if Buffer management provides a slot and N1 then

  • 24:

     Store pN

  • 25:

     Send ACK for receiving N 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 N

  • 31:

    if sender node is a base station then

  • 32:

     Delete p from buffer

  • 33:

    else

  • 34:

     Update the number of copies of p:NNN

  • 35:

    end if