# CRC-Based Reliable WiFi Backscatter Communication for Supply Chain Management
## 3 CRCScatter Decoder Design
### CRC Reverse Decoder
#### 3.2.3 How to Reverse the Original Data?  
The MAC frame can be divided into three parts: the MAC header \(K\), the CRC32 sequence \(R\), and the original data \(a\). The transmitter calculates the CRC32 sequence based on the MAC header and the original data. There is a constraint relationship between these parts. The MAC header and CRC32 sequence are known at the receiver because they have not been modified by the tag. The primary challenge is calculating the unknown original data based on known data and constraints. As previously discussed, the tag length should not exceed 32 bits to ensure uniqueness. Therefore, the modified bits by the tag do not exceed 32 bits. We assume that the length of the frame body is 32 bits, indicating the original data length is 32 bits.  
Since the unknown original data are limited, we can list all of the possible original data sequences. For each possible sequence, we calculate the CRC value using the MAC header and the possible sequence and compare the value with the CRC32 sequence from the received packet. We continue this process until we find the original data sequence that matches the CRC32 sequence. This brute-force search for the unknown original data is impractical due to the exponential growth of the average number of enumerations with the length of unknown original data. Therefore, a brute-force search cannot satisfy the requirements of immediate communication and the high tag data transmission rate simultaneously.  
Fortunately, the original data can be obtained by reversing the unknown data bits based on CRC algorithms. To accomplish this, the initial and final values of the CRC register \(r^{\prime}\) and \(r\) are computed using CRC algorithms, respectively. The IEEE 802.11b protocol specifies that the initial value \(r^{\prime}\) for forwarding calculation is INITXOR, while the final value \(r\) can be obtained from the FCS field. Then, the original data can be calculated using the method of reversing unknown data bits. Finally, the original packet can be obtained by replacing backscatter data in the backscatter packet with calculated original data. Algorithm 3 presents the procedure for reversing the original data from the backscatter MAC frame.  
The CRC reverse decoder offers an efficient method for decoding transmission tag data up to 32 bits in length. Functionally, the CRC reverse decoder serves as a receiver for a traditional backscatter system that receives the original packet. The CRCScatter system reduces hardware requirements through the use of the CRC reverse decoding method. This design for decoding relies on the presence of a bit sequence within the packet that constrains  
Figure 5: Equation relations in CRC calculation. Because the CRC algorithm and the CRC reverse algorithm are different only in the calculation direction, the functions in (**a**,**b**) should hold simultaneously.  
the transmitted data. Because the CRC reverse decoder only utilizes the constraints of the FCS field, the maximum length of tag data is limited to 32 bits. If the tag data exceed this limit, the reversed original data at the decoder will not satisfy the uniqueness of the solutions. The length can be extended if more constraints are applied to the packets.  
```
MAC header \(K\), CRC32 sequence \(R\)
```
0: original data \(a\) \(r\gets R\oplus\) FINALXOR \(r^{\prime}\gets crc(\text{INITXOR},K)\) \(a\leftarrow crc\_reverse(r,r^{\prime})\) ```
**Algorithm 3** Calculation in CRC reverse decoder  
In terms of time complexity, the original data-decoding method based on CRC algorithms requires two CRC algorithms to traverse the entire MAC frame. Even when the tag data is less than 32 bits, the algorithm still needs to calculate the entire original data, while the tag only modifies some of the data bits. Therefore, given the length of frame body, the time for calculating the original data is related to the packet length rather than the tag data length.