How is the CRC generated at the sender side
Introduction
Cyclic redundancy check (CRC) is a type of error-detection method that is widely used in modern computer networks. A
Key points
Some critical points regarding CRC's calculation procedure are as follows:
- The actual input data is represented as a single, long binary bit stream (dividend), also defined as
that is divided by a second binary integer (divisor) known as . Here, represents data bits, is CRC bits, and is known as a generator. The most significant bit of the must be .
The binary numbers (dividend and divisor) are regarded as binary polynomials. For example, the binary of the given polynomial is obtained as:
Expand the polynomial based on the highest power term included. Add
In this fashion, we get the binary of the polynomial.
- The checksum value is the remainder obtained by
. - The division is the foundation of CRC. The polynomial division is different from the integer division. The CRC calculation's underlying arithmetic is based on the XOR.
Calculation
CRC calculation is carried out in two steps as follows:
- CRC generation at the sender side
- CRC verification on the receiver side
For this answer, we'll only discuss step 1.
CRC generation at the sender side
While generating CRC at the sender side, we must keep the following points in mind:
- Find the length of the divisor
. - Adjoin
times 0 bit to the original message to get the format of the dividend. - Perform binary division.
- The remainder is equal to CRC.
Example
Given the polynomial
The binary of the polynomial
The binary of the other polynomial
Append
The following slides depict the calculation of CRC in detail:
The calculated CRC is equal to
Note: CRC is equal to
least significant bits.
Free Resources