Javatpoint Logo
Javatpoint Logo

CRC in Computer Network

What is Flooding?

In the Computer networks, CRC is known as a Cyclic Redundancy check. It is used to identify errors in data transmission or storage. It is an error-detecting code that is frequently used in network communication and data storage.

CRC can accurately detect common error types like single-bit errors and some burst errors. Cyclic Redundancy check is a widely used method in networking protocols like Ethernet that helps us to maintain the integrity of data while it is being transmitted. A receiver can ask for a retransmission of the data if an error is found to make sure it is received properly or not.

Although CRC is a relatively straightforward and effective error-checking technique, it can only identify errors. More sophisticated methods, like Forward Error Correction (FEC), are used for error correction.

How does It Work?

In a computer network, the Cyclic Redundancy Check (CRC)first generate a short binary sequence that is called as CRC code. It is created by performing a mathematical operation on the data being transmitted. Let's see in detail how it works:

  • Data division: In CRC, a series of bits is used to represent the data that is transmitted. So, a specific polynomial is used as a divisor so we can create the CRC code. The polynomial code that is used to create CRC code is known as Generator polynomial.
  • Appending Zeros: The data is finished off with a string of zeros, typically equal to the number of bits in the generator polynomial minus one. The generated CRC code will be placed in between these zeros.
  • CRC Calculation: The generator polynomial is used as the divisor in a division operation on the extended data by the sender. Binary XOR (exclusive OR) operations are used to perform this division operation.
  • CRC Code Generation: The CRC code is created using the remainder of the division operation. The original data is then supplemented with this CRC code.
  • Transmission: The entire message, including the CRC code and the original data, is sent across the network.
  • Receiver Calculation: The same CRC calculation is also done at the receiving end by the receiver. It divides the received data by the same generator polynomial, taking into account the CRC code.
  • Error detection: If the CRC code generated by the receiver and the one that was received with the data match, it is likely that there were no errors in the transmission of the data. If the calculated CRC code and the received CRC code do not match, a transmission error takes place.
  • Response to Errors: In the event that an error is discovered, the receiver may ask for a retransmission of the data to guarantee proper reception.

The mathematical characteristics of the generator polynomial are crucial to CRC's efficiency. It was carefully selected to increase the possibility of spotting errors, particularly the frequent kinds that can happen during data transmission.

In summary, CRC creates a checksum (CRC code) from the data using a mathematical algorithm. This checksum is sent with the data and is recalculated to look for errors at the receiver's end. The data is regarded as error-free if the calculated checksum agrees with the received one; otherwise, an error is found.

Why do We Use CRC in Computer Networks?

Computer networks and data storage systems employ the Cyclic Redundancy Check (CRC) for a number of significant reasons:

1. Error Detection

CRC is primarily used for error detection during data transmission and storage. Common types of errors, such as single-bit or burst errors, which may happen as a result of electrical noise, signal interference, or other factors during data transfer, can be quickly and effectively identified in this way.

2. Data Integrity

In networking and data storage applications, ensuring data integrity is essential. Data recipients can confirm that the data they receive is the same as what was sent by using CRC. If mistakes are found, they can ask for retransmission or take other suitable steps to guarantee data accuracy.

3. Efficiency

CRC is suitable for real-time error detection in high-speed data transmission systems like Ethernet because it is computationally efficient and can be calculated relatively quickly. Its effectiveness guarantees a short processing time for data.

4. Low Overhead

When compared to other error-detection techniques, like adding redundant data bits (parity bits), the CRC code is relatively short. This indicates that CRC offers robust error detection capabilities while adding little overhead to the transmitted data.

5. Widespread Adoption

Ethernet, Wi-Fi, Bluetooth, and many other networking protocols and data storage systems all use CRC. Their widespread use ensures the compatibility and interoperability of various systems and devices.

6. Simplicity

CRC implementation is fairly simple, and hardware or software components for CRC computation are easily accessible. Its popularity and simplicity in application across many systems can be attributed to this simplicity.

7. Versatility

CRC can be adapted to a variety of applications and error detection needs by choosing from a variety of generator polynomials.

8. Real-Time Detection

Because CRC checks are carried out in real time, errors can be identified as soon as data is received. For network protocols to respond quickly to any errors and guarantee data integrity, immediate feedback is essential.

In conclusion, the CRC error-detection method is popular and effective in computer networks and data storage because it strikes a balance between simplicity, speed, and effectiveness in identifying errors, assisting in ensuring the integrity and reliability of transmitted or stored data.

Example

Let's take an example of how CRC is used in computer networks:

Let's say a network cable connects two computers, Computer A (the sender) and Computer B (the receiver), and Computer A wishes to send a message to Computer B.

Data Preparation (Computer A, Sender):

  • Let's say that Computer A has a message to send that begins with the word "HELLO."
  • The binary representation of the message looks like this: "01001000 01000101 01001100 01001100 01001111" (each group of eight bits corresponds to an ASCII character).

CRC Calculation (Computer A, Sender):

  • For error checking, Computer A adds a CRC code to the message.
  • It chooses a particular CRC polynomial, such as CRC-32, to serve as the divisor.
  • The CRC polynomial is used as the divisor in a binary division operation on the extended data (message + CRC) by Computer A.
  • The CRC code is created from the remainder of this division.

CRC data (Sender: Computer A):

  • The CRC code has been added to the initial "HELLO" message. Say the calculated CRC code is "1101."
  • The information that must be sent is now "01001000 01000101 01001100 01001100 01001111 1101."

Transmission (Computer A is the sender, and computer B is the receiver):

  • Over the network, Computer A transmits the data, along with the message and CRC code, to Computer B.

Calculation for the receiver (Receiver - Computer B):

  • The data is received by computer B, which separates the message from the CRC code.
  • It also divides the received message by two to calculate a CRC code using the same CRC polynomial (previously decided upon with Computer A).

Receiver error detection (computer B):

  • The message is most likely error-free if the CRC code generated by Computer B matches the one obtained from Computer A.
  • If the calculated CRC code and the received CRC code do not match, a transmission error takes place, and the message is regarded as corrupted.

Response to Errors (Receiver - Computer B):

Computer B can ask Computer A to resend the message if an error is found (mismatch in CRC codes), ensuring that the correct data is received.

Limitation of CRC

Despite being a popular and successful method for error detection in computer networks and data storage systems, the cyclic redundancy check (CRC) does have some restrictions:

  • Errors Cannot Be Fixed: CRC can only find errors; it cannot fix them. If errors are found, the typical CRC process will demand that the data be sent again in order to correct the errors. Other error-checking techniques can correct errors, like Reed-Solomon codes.
  • Limited Error Detection: Although CRC is proficient at finding many different kinds of errors, it might miss some of them, particularly if they follow certain patterns that are consistent with the characteristics of the CRC polynomial. The CRC may be unable to identify some complex error patterns.
  • Fixed Length CRC: The generator polynomial selected will determine the CRC code's length. This means that in order to ensure adequate error detection for various applications or data sizes, you may need to use various generator polynomials. Weaker error detection abilities may result from selecting the wrong generator polynomial.
  • Collision Possibility: On occasion, two distinct data sets will generate the same CRC code. This is referred to as a collision. The characteristics of good generator polynomials make this extremely unlikely, but it is theoretically possible.
  • Burst Error Proneness: Although CRC can detect some burst errors (consecutive bits in error), its success in detecting lengthy burst errors depends on the polynomial used.
  • Implementation Complexity: Although the fundamental idea behind CRC is fairly straightforward, it can be challenging to implement effectively in hardware or software, especially for high-speed data transmission systems. This complexity may slow down the system.
  • Dependence on Generator Polynomial: The choice of a suitable generator polynomial has a significant impact on the accuracy of error detection offered by CRC. A good polynomial selection could lead to more error detection.






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA