Skip to Content

What Is a Cyclic Redundancy Check (CRC) in Networking?

What Is a Cyclic Redundancy Check?

A cyclic redundancy check (CRC) is a mathematical technique that provides a way to detect errors in transmitted data by appending a special code, called a checksum, to the original information. This checksum is then recalculated at the receiving end to verify the integrity of the data. CRC plays a vital role in identifying and correcting potential data corruption in networking, where reliable data transfer is paramount. It’s also used in data storage systems, including hard drives and flash memory, to verify the accuracy of stored data. CRC is crucial in protocols like Modbus, controller area network (CAN), and many others where reliable data transfer is essential.

How Does CRC Work?

CRC is based on treating the data to be transmitted as a polynomial. The sender and receiver agree on a fixed divisor polynomial, often referred to as the generator polynomial. The data is augmented with a checksum, which is the remainder of the polynomial division of the original data by the generator polynomial. At the sender's end, the CRC checksum is calculated and appended to the data before transmission. At the receiver's end, the received data along with the checksum is divided by the same generator polynomial. If the remainder is zero, the data is assumed to be error-free; otherwise, an error is detected.

The use of CRC polynomials and cyclic codes might sound complex, but the concept is simpler than it seems. These polynomials are essentially mathematical representations that help in the error-detection process. Cyclic codes, in the context of CRC, refer to codes where cyclic shifts of any valid codeword result in another valid codeword.

To better understand, consider a simplified example of error correction using a basic checksum. Imagine sending a binary number and adding an extra bit that represents the parity or sum of the original bits. If the received data does not match the expected parity, an error is detected.

CRC is a more sophisticated version of this process. Instead of a simple sum, the CRC polynomial performs a more intricate calculation, introducing greater redundancy and enhancing the error-detection capability. This increased complexity is crucial for handling more subtle errors and providing a more robust error-checking mechanism.

Test Drive FlashArray

Experience how Pure Storage dramatically simplifies block and file in a self service environment.

Try Now

Why Use CRC?

CRC is particularly effective in detecting errors that might alter the order of bits in a message. This is very important in scenarios where maintaining the exact sequence of bits is essential for interpreting the data correctly.

One of the key advantages of CRC is its simplicity in implementation, especially in binary hardware. The algorithm involves straightforward bitwise operations, making it efficient for hardware-based error checking.

CRC is not only simple to implement but also easy to analyse mathematically. This makes it an attractive choice for designers and engineers who need to understand and optimise the error-checking capabilities of their systems. The mathematical properties of CRC facilitate a deeper insight into its performance characteristics, aiding in the fine-tuning of parameters for specific applications.

In real-world communication channels, noise is an inevitable companion. CRC is particularly robust in detecting common errors introduced by noise during data transmission. Its cyclic nature and reliance on polynomial division enable it to effectively identify errors caused by random fluctuations or disturbances in the signal.

Choosing the Right Polynomial

At the heart of CRC is the polynomial used in the generation and verification of the checksum. The choice of polynomial significantly influences the error-detection capabilities of CRC. The polynomial acts as a divisor in polynomial division, determining the structure of the checksum.

Choosing the right polynomial involves considering several factors. The degree of the polynomial, for example, affects the length of the checksum and, consequently, the error-detection capabilities. Balancing the desire for a longer checksum (enhanced error detection) with the computational cost is a crucial consideration.

Other factors include the mathematical properties of the polynomial, such as its irreducibility. An irreducible polynomial ensures that the CRC algorithm can detect a wide range of errors. Additionally, some applications may require specific properties, such as burst error detection, which can be influenced by the polynomial choice.

Several standard polynomials are commonly used in CRC calculations. The choice of polynomial depends on the specific requirements of the application. For instance, the CRC-32 polynomial (0x04C11DB7) is frequently employed in network communication protocols, while the CRC-16 polynomial (0x8005) finds application in storage systems. The CRC-CCITT polynomial (0x1021) is well-known for its use in telecommunications.

Each polynomial brings unique characteristics, and selecting the appropriate one involves careful consideration of the application's requirements and the desired trade-offs between error-detection capabilities and computational efficiency.

Optimizing CRC Performance

CRC is a powerful error-checking algorithm, but there are ways to enhance its performance, including:

  • Table-based precomputation, which precomputes CRC values and stores them in a table for commonly used inputs. This reduces the need for repetitive calculations, significantly improving overall performance.
  • Parallelization, which leverages parallel processing to distribute CRC calculations across multiple cores or processors. This can substantially reduce the time required for CRC checks, especially in scenarios with large data sets.
  • Bitwise operations such as XOR and shifts, which are often more efficient than traditional arithmetic operations.

To reduce operational complexity, it’s very important to select the right CRC polynomial. Some polynomials offer better error-detection capabilities with minimal computational overhead. You can also tailor the CRC word size to match the system's architecture to enhance performance.

When optimizing CRC performance, there are some trade-offs to consider, including:

1. Memory usage vs. computation

Precomputed tables can reduce computation but may increase memory usage. Gauge the trade-off between memory utilization and computational efficiency based on system constraints.

2. Complexity vs. speed

More complex CRC polynomials may offer better error detection but can be computationally expensive. Strike a balance between complexity and speed, aligning optimisation efforts with specific use cases.

Conclusion

CRC has extensive use in real-world applications, including networking protocols, storage systems, and communication protocols. CRC excels at detecting errors during data transmission, and its ability to identify both burst and random errors ensures that the received data matches the transmitted data. CRC acts as a safeguard against data corruption in storage systems. By detecting errors early on, CRC helps maintain the integrity and resiliency of stored information, which is critical for long-term data reliability.

While CRC instills confidence in the reliability of data transfer and storage, it does come with computational overhead, so be sure to evaluate the trade-off between the benefits of error checking and the resources expended in CRC calculations.

Also, remember that CRC only plays one role in the bigger picture of modern data protection. Pure Storage’s comprehensive modern data protection solution allows you to restore data when it matters most, secure your business from attacks, run your business without disruption, take control of your environment, and guarantee a clean storage environment.

08/2024
Maximizing SAP HANA Performance and Reliability with Pure Storage
A reference architecture for SAP bundled application suites on SAP HANA with Pure Storage.
Reference Architecture
27 pages

Browse key resources and events

EVENT
Discover the Pure Storage Platform at VMware Explore

Unlock the full potential of your VMware hybrid cloud environment.

Book a Meeting
EVENT
Experience the Pure Storage Platform at Oracle CloudWorld

Maximise the potential of your Oracle database with the world’s most advanced data storage platform.

Book a Meeting
RESOURCE
The Future of Storage: New Principles for the AI Age

Learn how new challenges like AI are transforming data storage needs, requiring new thinking and a modern approach to succeed.

Get the Ebook
RESOURCE
Stop Buying Storage, Embrace Platforms Instead

Explore the needs, components, and selection process for enterprise storage platforms.

Read the Report
CONTACT US
Meet with an Expert

Let’s talk. Book a 1:1 meeting with one of our experts to discuss your specific needs.

Questions, Comments?

Have a question or comment about Pure products or certifications?  We’re here to help.

Schedule a Demo

Schedule a live demo and see for yourself how Pure can help transform your data into powerful outcomes. 

Call Sales: +44 8002088116

Mediapr@purestorage.com

 

Pure Storage, Inc.

2555 Augustine Dr.

Santa Clara, CA 95054

800-379-7873 (general info)

info@purestorage.com

CLOSE
Your Browser Is No Longer Supported!

Older browsers often represent security risks. In order to deliver the best possible experience when using our site, please update to any of these latest browsers.