Error control mechanism may involve Error detection and correction

When data is sent from one device to another, the system cannot guarantee that the data received by the device is identical to the data sent by the other device. An error occurs when the message received at the receiver’s end differs from the message transmitted.

Many factors, including noise, cross-talk, and others, can cause data to be damaged during transmission. The upper layers are unaware of actual hardware data processing and work on a generalized understanding of network architecture. As a result, the upper levels anticipate error-free communication between the systems. Most apps would not work as expected if they were given incorrect data.

Voice and video applications may be unaffected, and even if they have some errors, they may still function well. To ensure that frames (data bit streams) are sent with a given level of accuracy, the data-link layer employs several error control mechanisms.

However, in order to comprehend how errors are managed, it is necessary to first grasp the various types of errors that can occur.

Errors can be classified into three categories:

- Single-Bit Error
- Burst Error

Table of Contents

# Single-Bit Error:

In a frame, there is only one bit, anywhere though, which is corrupt.

# Burst Error:

The frame contains more than 1 consecutive bit corrupted.

Error Detecting Techniques:

The most popular Error Detecting Techniques are:

- Single parity check
- Two-dimensional parity check
- Checksum
- Cyclic redundancy check

## Single Parity Check

Single parity checking is a simple and affordable approach for detecting errors. A redundant bit, also known as a parity bit, is attached to the end of the data unit in this technique to make the number of 1s even. As a result, the total number of bits transferred would be nine. If the number of 1s bits is odd, parity bit 1 is inserted at the end of the data unit; if the number of 1s bits is even, parity bit 0 is appended. The parity bit is derived from the received data bits and compared to the received parity bit at the receiving end. Even-parity checking is a technique that yields a total number of 1s that is even.

### Drawbacks Of Single Parity Check

- It is only capable of detecting single-bit errors, which are extremely rare.
- It is unable to detect mistakes if two bits are changed.

## Two-Dimensional Parity Check

Two-Dimensional Parity Check, which organizes data in the form of a table, can enhance performance. For each row, parity check bits are computed, which is identical to a single-parity check. A block of bits is separated into rows in a Two-Dimensional Parity check, and the redundant row of bits is added to the entire block. The parity bits are compared with the parity bits computed from the received data at the receiving end.

### Drawbacks Of Two-Dimensional Parity Check

- The 2D Parity checker will not be able to detect the problem if two bits in one data unit are corrupted and two bits in the same place in another data unit are similarly corrupted.
- In some circumstances, this approach will not be able to detect 4-bit or more errors.

## Checksum

The checksum is a mechanism for detecting errors. It can be used on any type of data. Rather than the data-link layer, the checksum is usually utilized at the network and transport layers.

Each m bit of data is broken into k segments at the sender. To get the sum, the segments are summed using 1’s complement arithmetic at the sender end. To get the sum, all segments obtained are summed at the receiver’s end using the arithmetic 1’s complement.

The obtained data is acceptable if the value is 0.

The received data is discarded if the value is non-zero.

## Cyclic Redundancy Check (CRC)

The CRC error technique is a redundancy error approach that is used to determine the error.

The steps in CRC error detection are as follows:

- In the CRC technique, the data unit is appended with a string of n 0s, where n is less than the number of bits in a preset number, known as division, which is n+1 bits.
- Second, the newly expanded data is divided by a divisor using a binary division procedure.

CRC residual refers to the remainder created by this division. - Finally, the CRC remainder takes the place of the 0s appended to the end of the original data.

The receiver receives the newly created unit. - The data is sent to the recipient, followed by the CRC remainder. This entire unit will be treated as a single unit by the receiver, and it will be split by the same divisor that was used to calculate the CRC remainder.

The data is approved if the outcome of this division is zero, indicating that there is no error.

If the result of this division is more than zero, the data contains an error.

As a result, the information is discarded.

### CRC Generator

A modulo-2 division is used by a CRC generator. To begin, three zeroes are attached to the end of the data because the divisor’s length is 4 and we know that the length of the string 0s to be appended is always one less than the divisor’s length. The string now becomes 11100000, and the result is divided by the divisor 1001. The CRC residual is the remainder created by binary division. The CRC remainder’s produced value is 111.

The added string of 0s at the end of the data unit is replaced by the CRC remainder, and the final string is 11100111, which is transferred across the network.

### CRC Checker

The CRC checker’s functioning is similar to that of the CRC generator. The modulo-2 division is performed by the CRC checker when the string 11100111 is received at the receiving end. The same divisor is used to divide a string, i.e. 1001. The remainder of zero is generated by the CRC checker in this situation. As a result, the information is accepted.

# Error Correction

Correction of errors is more difficult than detection of errors.

When data is sent from the sender to the receiver, error correction codes are employed to detect and correct problems.

It can be accomplished in one of two ways:

## Backward Error Correction

Backward Error Correction (BEC): If the receiver detects an error in the data received, it instructs the sender to retransmit the data.

## Forward Error Correction

Forward Error Correction: If the receiver detects an error in the data received, the error correction codes automatically repair the problem.