An integral part of transferring data over a network is ensuring data reliability and minimizing transmission errors. This is carried out using mechanisms such as the following:
Cyclic Redundancy Check (CRC)
Vertical Redundancy Check (VRC)
Checksums
Among these, CRC is a powerful and easy-to-implement mechanism that ensures that data packets aren't corrupted and their integrity is maintained.
Ensuring data reliability using a CRC involves the following:
Generating a CRC.
Appending the CRC to a data packet.
Forwarding the modified data packet.
Verifying the CRC at the destination.
The data packet can be deemed free from transmission errors if the CRC is successfully verified.
The generation and verification of the CRC function are based on a mathematical operation known as modulo-2 polynomial division. The modulo-2 polynomial division is similar to regular division that we perform with decimal numbers. However, we take the XOR of the two digits instead of subtracting it at every step.
An example of a modulo-2 polynomial division is illustrated below.
In the case of CRC, the
Generating the CRC requires the following steps:
Find the length of the divisor
Append
Perform this modulo-2 polynomial division:
The remainder of the division is the CRC.
Send the original data packet after appending it with the CRC.
Verifying the CRC once a data packet is received requires the following steps:
Perform this modulo-2 polynomial division:
Calculate the remainder. Check if the remainder is zero.
If the remainder is zero, the data packet suffered no transmission error.
If the remainder is non-zero, the data packet suffered some transmission error.
Suppose we'd like to send the data packet
Before sending out the data packet, we need to generate its CRC using the previously detailed steps. It results in the following calculation:
After the calculation above, the original data packet is now appended with the remainder
The receiver takes this data packet and verifies its CRC to ensure the packet suffered zero transmission errors using the steps mentioned above. This results in the following calculation:
As the remainder is zero, the packet was indeed sent reliably.
Free Resources