## 3 Aloha Protocols
### Framed Slotted Aloha and Dynamic Framed Slotted Aloha  
In Framed Slotted Aloha (FSA), the time is divided into a variable number of frames and each frame consists of several slots [16; 25; 26; 27; 28]. All tags need to transmit data into a fixed length frame, but each tag must choose only one slot in a frame to transmit data. This protocol significantly reduces the probability of collision since tags can only respond once in a frame. Before the onset of communication, the reader generates a random time that is less than the fixed frame size, to select just one slot in a frame. If a collision occurs, the involved tags will once again choose a slot in which to respond in the next frame. The main inconvenience of FSA is slot wastage when the number of tags is small and the size of the frame is significantly larger [29; 30]. To ameliorate this disadvantage, the Dynamic Frame Slotted Aloha (DFSA) protocol was developed [16; 31; 32]. DFSA is capable of changing frame size according to an estimate of the number of tags. At the beginning of each frame, the reader informs the tags of the frame length. Every tag selects a random number \([0,F-1]\), where \(F\) denotes the frame size and all tags respond within the number of slots. At the end of the frame, the reader estimates the number of colliding tags, then adjusts \(F\) accordingly. There are certain disadvantages to tag estimation, such as: increased computational costs in the identification process and errors that degrade the protocol's efficiency. Examples of these two protocols are shown in Figure 10.  
The Q protocol is used in the EPCglobal Generation-2 (Gen-2) standard [18; 33]. The Q protocol is a DFSA-type protocol that modifies frame size using feedback from the last frame accomplished [34]. The Q algorithm can jump into the following frame without finishing the current one [34]. Figure 10: Example of FSA and DFSA. Figure 9: An example of SA. The Q algorithm operates with two basic parameters: \(Q\), and a constant \(c\) that can be modified depending on the situation [24; 25]. The \(Q\). variable is an integer ranging from 0 to 15. This protocol works with three types of commands:  
* Query command, transmitted by the reader to all tags in the interrogation area, in order to force all tags to choose a slot number (SN) from \([0,2^{Q}-1]\). This command initiates the identification process by providing a new value of \(Q\). * QueryAdiust is the command used to instruct all tags to increase, decrease, or maintain the \(Q\) value unchanged and to reselect their SN. \(Q_{new}\) denotes the last calculated \(Q\). Accordingly, \(Q\) could be increased by \(c\), decreased by \(c\), or left unchanged, according to the algorithm. * QueryRep is used in order to notify all tags to decrease their SN by 1. The procedure of the Q protocol appears in the flow chart in Figure 11. If it is time to initiate a new inventory round, the reader will transmit a Query command. If the tags receive _Query_ or _QueryAdiust_, they need to choose SN from \([0,2^{Q}-1]\). If they receive a _QueryRep_, all unidentified tags decrease their SN counter by 1. Only tags with SN = 0 will generate a 16-bit random number (RN16) and will respond with an RN16 to the reader. There are three possibilities, depending on the tags' response:  
* Successful reply. If only one tag responds and the reader successfully received RN16. Subsequently, the reader sends the ACK and only the tag that successfully responded recognizes the ACK and reports its EPC to the reader. * Collided reply. If more than one tag transmits RN16, a collision occurs. Then, the tags will increase \(Q_{new}\) by the constant \(c\). Typical values for \(c\) are 0.1\(<<\)\(<\)0.5. The value of \(c\) is adjusted according to the type of application. Higher values of \(c\) will provide more aggressive frame adjustments. * No reply. When no tags respond in the slot, the reader decreases \(Q_{new}\) by \(c\).