# Implementation of a Fast Link Rate Adaptation Algorithm for WLAN Systems
## 3 The Link Adaptation Firmware
### Overall Flow
The ARF phase terminates and the APBLA phase is initiated on the condition that the variation of the SNR offset for the following 200 packets is below 35% of the SNR offset 200 packets before, which is expressed in Equation (7). This 35% is associated with the time point where the mismatch of the channel SNR is compensated for such that APBLA exhibits better performance over ARF. In this paper, the percentage value is empirically set after extensive simulation so that the throughput of APBLA is maximized. \[Offset_{TMP_{k}}-Offset_{TMP_{k-200}}<0.35\cdot Offset_{TMP_{k-200}} \tag{7}\]  
What is meant by meeting this condition is that over the past 200 packets the difference between the MCS determined by PBLA and that determined by ARF is not significant and hence the channel SNR mismatch is not considerable. Thus if the condition above is satisfied, the APBLA phase sets in to conduct fine mismatch compensation. In the APBLA phase, the MCS is decided by means of APBLA. This algorithm introduced in Section 2 can be represented by the state diagram shown in Figure 9. A0 state is defined as the state when the SNR offset is incremented and the APBLA algorithm is executed to determine the MCS. N0 state is defined as the state when the SNR offset is decremented and the APBLA algorithm is executed to determine the MCS. With the basic APBLA the MCS is determined always through the APBLA algorithm as shown above and simply two cases exist, namely, in case of ACK, the SNR offset steps up and in case of NACK, the SNR offset steps down. However, in reality, with the current target system in case a NACK occurs, no channel coefficients are received for link adaptation. Accordingly, an MCS-determining mechanism is needed when a no ACK or NACK occurs and a link adaptation mechanism is proposed as a state diagram in Figure 10. In A0 state, the SNR offset is increased and APBLA is conducted to decide the MCS. In N0 state, the MCS is maintained. In N1 state, both the SNR offset is decreased and the MCS index is stepped down by one. In N2 state, the MCS is maintained. In N3 state, the MCS  
Figure 8.0 State diagram of the basic adaptive preamble-based link adaptation (APBLA). value is stepped down by one. Regardless of the current state, if an ACK occurs, then the state transitions to A0 state. Additionally, if the current MCS value is 0 when the MCS value is to be decremented, the current MCS value is held unchanged as 0. For instance, if the current MCS value is 1, the state is A0, and thereafter four consecutive NACKs come in, then basically state transitions occur to N0 through N2 to N3, reflecting in principle an MCS index drop by two steps and an SNR offset drop by one step. However, when the MCS value is 0, no way exists to lower the MCS anymore and hence the value stays at 0. The SNR offset step-up or step-down is implemented in the form of multiplying the existing SNR offset by the update step as explained earlier in this subsection. The reason the current form of APBLA behaves as such is elaborated as follows. When an actual test was carried out under a wireless test environment, the channel SNR varied too quickly and hence despite the correct prediction of APBLA based on the channel SNR at that time, NACKs were received too frequently. As a provision against this problem, the SNR offset is not reduced for a NACK immediately after an ACK. Furthermore, the SNR offset decrement is executed only once even for consecutive NACKs since the SNR offset is to be updated only once for each APBLA action. Thus, if consecutive NACKs occur, then N2 and N3 states are repeated over and again and the MCS drop takes place once every two NACKs. If an ACK occurs with the previous packet in the APBLA phase, the state enters A0 state and the MCS is determined according to the proposed APBLA algorithm which will be executed as follows. First, as was drawn in Figure 8, by using the coef2 snr function, the channel information is converted to the SNR per subcarrier.