Skip to main content
. 2021 Apr 2;21(7):2485. doi: 10.3390/s21072485
Algorithm 1: TDMA resource sharing
Initialize slots array, slot time t, guard time G, and inter-frame spacing I
Label: Start A Super Frame
   Set number of control slots, Tc
   Calculate the total number of data slots, T, based on Equation (12)
   Calculate frame_time Tf based on Equation (13) & super_frame_time Ts based on Equation (14)
Label: Distribute Slots Based on QoS
for i in Size (Users)
   Allocate Slots based on Traffic Class (TC) according to Equation (11)
   if Users [i] TC is AC_VO_
     User.time_slots =nvot
   else if Users [i] TC is AC_VI_
     User.time_slots =nvit
   else
     User.time_slots = t
   end
   end
End
Broadcast control Frame for Duration Tc, containing Sync Information
Label:Start Transmitting Data Frame
for t in slots_array,
   Select user, u, for transmission
   Transmit user u Data
   Wait for a Guard Time
end
End
Wait for a time equal to inter-frame gap G
Label: Start A Management Frame
  • Send Beacon Packet in First Management Frame Slot with transmit power, MAC address, and IP address of the AP

  • Wait for the Beacons Response in the Uplink Time Slot

  • Add users with a response to Users array

  • Remove from Users already associated users with no ACK

End
If current_time >= Ts
   Goto Start A Super Frame
else
   Goto Transmit Data Frame
end
End