# 2 CA-R2: A Hybrid MAC Protocol for Machine-Type Communications
## 4 The 2 CA-R\({}^{2}\) Hybrid MAC Protocol
### Collision Resolution Interval  
In the CRI, time is slotted using short-length slots or \"minislots\". The central station is in charge of examining all minislots and providing appropriate feedback depending on the detected event. This feedback can be one of the following four messages: \(\hat{\mathrm{N}}\) (estimated value of \(N\)), C (collision), E (empty), and NC (no collision). Let us denote with \(f_{t}\) the feedback message corresponding to minislot \(t\). During a CRI, each station keeps a state variable \(r_{t}\) that can take on the following values: \(\mathrm{T_{x}}\) and \(\mathrm{W}\); further, it is updated according to the feedback messages. Each station also makes use of variable \(s\) to store its reserved transmission slot and variable \(N\) to keep track of the number of stations that are estimated to remain in contention. When a station has a packet to transmit, it sets its state variable \(r_{t}\) to \(\mathrm{T_{x}}\) meaning that it must wait for the next CRI. As a consequence, a station that became active after the start of a CRI must wait until the central station announces the start of a new CRI. Such a station also sets \(s\) to 0 and \(N\) to 1. The beginning of a CRI is signaled by the central station with a RESERVATION_BEGIN broadcast message. A station with \(r_{t}\) set to \(\mathrm{T_{x}}\) will send an RREQ in the first minislot of the CRI. The RREQ will be successful only if \(r_{t}=\mathrm{T_{x}}\) and \(f_{t}=\mathrm{NC}\). The CRI will last only one minislot if only one station sends an RREQ (i.e., this is equivalent to immediate random access). However, if two or more stations transmit, a collision will occur and a conflict resolution procedure will begin (i.e., controlled access is enforced). The CRI evolves according to the following rules:  
1. If (\(r_{t}=\mathrm{T_{x}}\) and \(f_{t}=\mathrm{NC}\)), then \(s=s+1\). This rule corresponds to a case where a station transmitted a reservation request which was successful. This rule implies that such a station stores its reservation position in variable \(s\) and leaves contention. Variable \(s\) will not be changed any further during the remainder of the contention period. 2. If (\(r_{t}=\mathrm{T_{x}}\) and \(f_{t}=\hat{\mathrm{N}}\)), then \(N=\hat{\mathrm{N}}\). This rule is triggered when a station transmitted in minislot \(t\) and the first collision of a CRI occurs. In this case, the central station returns the estimated value of the collision multiplicity (i.e., \(\hat{\mathrm{N}}\)), which is copied into the local variable \(N\), and this value is used to compute probability \(p=p(N)\). In turn, \(r_{t+1}\) maintains the value \(\mathrm{T_{x}}\) with probability \(p\) or \(r_{t+1}=\mathrm{W}\) with probability \(1-p\). 3. If (\(r_{t}=\mathrm{T_{x}}\) and \(f_{t}=\mathrm{C}\)), then \(r_{t+1}\) maintains the value \(\mathrm{T_{x}}\) with probability \(p\) or \(r_{t+1}=\mathrm{W}\) with probability \(1-p\). This rule determines what to do when a station transmitted and a collision is detected in the medium. The following two cases are possible: if \(t\) is either the first minislot of a phase or the one that follows after an E feedback message, the station uses the current value of \(N\) to calculate \(p=p(N)\). Otherwise, the station uses \(p=0.5\). If (\(r_{t}=\mathrm{W}\) and \(f_{t}=\mathrm{E}\)), then \(r_{t+1}=\mathrm{T_{x}}\). The station was in the waiting group and no one transmitted. Therefore, it sets its state to \(\mathrm{T_{x}}\) in order to transmit in the following minislot. 5. If (\(r_{t}=\mathrm{W}\) and \(f_{t}=\mathrm{NC}\)), then \(r_{t+1}=\mathrm{T_{x}}\,s=s+1\) and \(N=N-1\). The station was in the waiting group and someone else achieved a successful reservation. Therefore, it enters contention, increases the reservation position, and decreases by one the number of contending stations. 6. If (\(r_{t}=\mathrm{W}\) and \(f_{t}=\mathrm{C}\)), then \(r_{t+1}\) remains in state \(\mathrm{W}\). The station was in the waiting group and there was a collision in the medium.