Error detection and correction are techniques used in data communication to ensure the integrity and reliability of transmitted data.
Suppose A is sending some data to B via some transmission media. This data may be corrupted during transmission. This simple means that a 0 bit may change to 1 or a 1 bit may change to 0.
Let’s take an example. Suppose A sent ‘101’ to B. This message is corrupted during transmission and B receives ‘100’. Now B does not have a copy of the original message sent by A and it has no way of detecting this error. Error detection is, thus, a method to find errors in the data received by the receiver without having a copy of the original message. In this case, B should have a method to detect the error that occured during transmission of the message from A.
Error correction methods go one step further than error detection. They help identify and correct errors without the need for data retransmission. In the above example, B should not only know an error occured, it should also be able to correct it without asking A to transmit the data again.
Error correction and detection is implemented either in the data link layer or the transport layer of the TCP/IP protocol.
Types of Errors:
Before looking into error detection and correction methods, let’s understand the two types of errors that can occur data transmission:
Single-bit Errors:
In a single bit error, only one bit changes. This can occur due to various factors, such as electrical noise or interference.
The effect this error has depends on the type of communication occuring. For example, in case of a phone or video call, this error won’t affect the quality of the communication. However, in case of text messages, this error can affect the interpretation of the entire original message.
Burst Errors:
Burst errors occur when more than 1 bit is corrupted during transmission. They are often caused by factors like signal attenuation or environmental interference. Burst errors pose significant challenges to error correction mechanisms, especially if the error spans a substantial number of bits.
In burst errors, the length of error is measured from the first corrupted bit to the last corrupted bit. As in the image below, there are 4 bits that have changed. But, in this case the length of error is 9 bits.
Error Detection:
Error detection is a method to find errors in the data received by the receiver without a copy of the original message. Error detection works on the basis of redundancy. Redundancy is nothing but adding extra bits to the message being sent by the sender. These extra bits are called redundant bits.
Common error detection methods used are Vertical Redundancy Check (VRC), Longitudnal Redundancy Check (LRC), checksum, Cyclic Redundancy Check (CRC).
Error Correction Techniques:
Error correction methods help identify and correct errors without the need for data retransmission. Two common techniques are Hamming code and Forward Error Correction (FEC).