# 2 CA-R2: A Hybrid MAC Protocol for Machine-Type Communications
## 3 The 2C Algorithm and Its Adaptable Version
### The Adaptive-2C Algorithm
Since switching from transmitting to waiting is controlled by a probability, an empty slot may occur because all contending stations may have decided to switch to the waiting state. As it will be explained in an upcoming example, it is necessary to distinguish between an empty slot and a successful transmission. Therefore, instead of using an NC message for both cases, in the case of an empty slot, the central station will broadcast an E (empty) message, forcing all stations to switch back to the transmit state, and a collision will happen. Since all active stations will be involved in such a collision, this situation is identical to the one at the beginning of the current phase, and it will be treated as such. That is, after such a collision, they will use the adaptive value of \(p\) (i.e., \(p=p(\hat{N})\) computed by using (1)), and afterwards they will use \(p=1/2\) if needed. This is a consideration that was tacitly assumed in [18], but due to its importance for achieving high performance, we emphasize it here. * At the system start, there is not enough history to be used in order to compute an estimate for the number of contending stations at the beginning of a CRI. Therefore, depending on the predictor order, a certain number of CRIs have to be completed in order to generate enough data to be used in the prediction. In the meantime, the system has to evolve using the rules of the standard 2C algorithm (i.e., \(p=1/2\) in all cases). Figure 3 shows a possible evolution of a CRI where channel access is controlled by the Adaptive-2C protocol with updates per phase. This case is similar to the one previously described, that is, at the beginning of a CRI, four out of seven stations contend for the transmission medium (see Figure 1). Let us assume that the system has been in operation for some time so that a prediction algorithm has enough data to operate. The following description illustrates several cases of interest, which are included in Figure 3 (the reader is referred to Table 2 for a list of symbols). * First slot. In the example, stations A, B, C, and D simultaneously transmit, and by using a prediction method, the central station estimates the number of stations that collided (i.e., \(\hat{N}\)). This value is returned as its feedback message at the end of the first slot. Ideally, \(\hat{N}\) should equal 4 in this case. * Second slot. With the received feedback, the contending stations calculate \(p=p(\hat{N})\). According to this probability, only one of them (i.e., C) remains in transmission, whereas the rest move to the waiting cell. Therefore, station C successfully transmits and the central station returns an NC message at the end of this slot. This event marks the end of phase 4 (note that it started with a collision of multiplicity 4 and ended with a successful transmission). It can be seen that at the end of this slot, the estimated number of stations that remain in contention can be updated as \(\hat{N}-1\). * Third slot. All stations in the waiting cell move to the transmitting cell so that a collision is observed in the medium and the central station returns a C message. * Fourth slot. Each station uses its local estimate for the number of stations that remain in contention (i.e., \(\hat{N}-1\)) and computes the probability of continuing in the transmitting state (i.e., \(p=p(\hat{N}-1)\)). In the example, only one of the stations (i.e., D) remains in transmission, and the rest of them move to the waiting cell. Therefore, a second successful transmission is achieved and the central station returns an NC feedback message. Such an event signals the end of phase 3. At the end of this slot, the estimated number of stations in contention becomes \(\hat{N}-2\). * Fifth slot. The stations in the waiting cell (i.e., A and B) move to the transmitting cell, causing another collision. The central station returns a C message. * Sixth slot. By using \(p=p(\hat{N}-2)\), the stations decide whether to continue transmitting or not.