English

CRC

Posted on Apr 1, 2024 by
87

What Is CRC?

In the realm of data communication, the Cyclic Redundancy Check (CRC) serves as a widely adopted method for detecting transmission errors. This technique involves the transmitting end employing a specific algorithm to calculate a check code for the data within a data frame. The check code is then appended to the data frame and sent to the receiving end. At the receiving end, the integrity and accuracy of the received data are verified by reiterating the calculation process using the identical algorithm.

How Is CRC Calculation Implemented?

In the field of data communication, CRC plays a vital role in ensuring reliable transmission. At the transmit end, CRC appends an R-bit check code to the K-bit data, forming a new frame that is transmitted to the receive end. Upon receiving the frame, the receive end verifies the correctness of the data by comparing it with the received data and check code.

标签

The check code is designed to ensure that the newly generated frame is divisible by a specific number, referred to as the selected divisor for modulo-2 division, agreed upon by both ends. The receive end performs a division operation on the received frame using the selected divisor. As a result, if there are no remainders, it indicates error-free transmission. Conversely, the presence of a remainder signifies an error during frame transmission.

In this process, an R-bit check code is appended to the K-bit data, resulting in a total code length of N bits. This coding scheme is known as (N, K) code. For a given (N, K) code, it can be demonstrated that there exists a polynomial, g(x), where the highest power is N-K=R. This polynomial, referred to as the generator polynomial, serves as the basis for generating the R-bit check code. The algorithm relies on GF(2) polynomial arithmetic, as illustrated in the accompanying diagram.

标签

The choice of the generator polynomial, g(x), determines the error detection capabilities of the CRC. To utilize an R-bit check code, the power of the generator polynomial must be R. Below are some commonly used standard polynomials for CRC.

标签

To obtain and validate check codes using the divisor in modulo-2 division, the following steps are followed:

  • Prior to communication, the transmit and receive ends agree on a divisor, denoted as P, which represents the value of a polynomial. The length of P should be R+1 bits.

  • At the transmit end, R zeros are appended to the original K-bit data. This effectively shifts the original data leftwards by R bits.

  • Subsequently, a modulo-2 division operation (XOR operation) is performed on the (K+R)-bit number obtained after zero addition, using P as the divisor. The division is cyclic until the remainder order is less than R. This remainder serves as the check code. If the check code length is smaller than R bits, it is padded with zeros to ensure a length of R bits.

  • The transmit end attaches the R-bit check code to the original data and transmits the complete package to the receive end.

  • Upon receiving the data, the receive end divides the data by P using modulo-2 division. If no remainder is obtained, it indicates error-free transmission. Conversely, the presence of a remainder indicates an error during data transmission.

How to Fix CRC Errors?

If an interface on a network device encounters occasional CRC error packets, no action is needed. However, if CRC errors persistently occur on the interface, it suggests a potential issue with the transmission medium. This could be due to a faulty twisted pair or optical fiber connection, or a malfunctioning optical module. In such cases, replacing the interface, optical module, or cable should be considered to rectify the problem.

Tags

You might be interested in

See profile for undefined.
FS Official
AI Firewall
See profile for undefined.
FS Official
VPN
See profile for undefined.
FS Official
VPC