Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
Types of error
2.1.
Single-bit error
2.2.
Multiple-bit error
2.3.
Burst error
3.
Error Detection
3.1.
1. Single parity check
3.2.
2. Two-Dimensional Parity Check
3.2.1.
Drawbacks Of 2D Parity Check
3.3.
3. Checksum method
3.4.
4. Cyclic Redundancy Check
4.
Error Correction  
5.
Frequently Asked Questions
5.1.
Mention the types of errors associated with computer networks.
5.2.
List the steps followed in the checksum generator?
5.3.
What is redundancy?
6.
Conclusion
Last Updated: Mar 27, 2024

Error Detection and Correction

Master Python: Predicting weather forecasts
Speaker
Ashwin Goyal
Product Manager @
Computer Networks

Introduction

An error is a mistake, inaccuracy, or deviation from a code of behavior. In computer networks, an error occurs when the message received at the receiver end is not identical to the message transmitted. During transmission of information from the sender to receiver, many reasons such as noise or crosstalk can cause digital signals to introduce errors in the binary bits traveling from sender to receiver, i.e., a 0 bit may change to 1, or a 1 bit may change to 0. 

Most applications would not run as expected after receiving data with errors. Applications such as voice and video may not be that affected, and with some mistakes, they may still serve well.

(Also see, OSI Model and TCP/IP Model)

Types of error

In Computer Networks, the errors can be classified into three types-

  • Single-bit error
  • Multiple-bits error
  • Burst error

Single-bit error

Single-bit errors occur when only a single bit is changed from 0 to 1, or 1 to 0, while data transmission.

Single Bit Error

Multiple-bit error

Multiple-bit errors occur when two or more bits of a data sequence are changed during data transmission.

Multiple-bit error

Burst error

Burst errors occur when more than one consecutive bit of a data sequence changes during data transmission. They can occur due to physical damage like a scratch on a disc or a stroke of lightning in the case of wireless channels.

Burst error

Also see,  Personal Area Network

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Error Detection

Error-detecting codes are added to a digital message to detect the errors during signal transmission.

The Data-link layer uses some error control mechanism to ensure that frames (data bit streams) are transmitted with a certain level of accuracy. 

Some popular approaches used for error detection are:

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

1. Single parity check

Single Parity Check is the error detection technique in which an extra bit called a parity bit is transmitted along with the original data bits, which checks if any error has occurred during the transmission.

Single Parity Check

It involves the following steps: 

  • Step 1: The total number of 1's in the data unit to be transmitted is counted on the sender side. The total is made even in case of even parity or odd in case of odd parity. This is achieved by including an extra bit, i.e., a parity bit.
  • Step 2:  The newly formed codeword (Original data + parity bit) is sent to the receiver.
  • Step 3: After receiving the transmitted codeword, the receiver counts the total number of 1's.

Then, the following cases are possible-

  • If a total number of 1's is even and even parity is used, the receiver assumes no error.
  • If an unlimited number of 1's is even and odd parity is used, the receiver takes that error.
  • If an unlimited number of 1's is odd and odd parity is used, the receiver assumes no error.
  • If a total number of 1's is odd and even parity is used, the receiver assumes that error occurred.

2. Two-Dimensional Parity Check

The Two-Dimensional Parity Check organizes the data in a table. Parity bits are computed for each row, equivalent to the single-parity check. A block of bits is split into rows, and the redundant row of bits is added to the whole block. The parity bits are matched with the parity bits computed from the received data at the receiving end.

Drawbacks Of 2D Parity Check

  • Suppose two bits in one data unit are corrupted, and two in the same position in another data unit are also corrupted. In that case, the 2D Parity checker will not detect the error.
  • This technique cannot detect the 4-bit errors or more in some cases.

3. Checksum method

The checksum error detection scheme divides the data into k sections each of m bits. The sections are added using 1's complement arithmetic to get the sum on the sender's side, which, in turn,  is complemented to obtain the checksum. This segment is sent along with the data segments. The received segments are added using 1's complement arithmetic to get the sum on the receiver's side. The sum is complemented. The received data is accepted if the result is zero, otherwise discarded.

4. Cyclic Redundancy Check

The Cyclic Redundancy Check method involves binary division of the sent data bits. Cyclic redundancy bits are a sequence of redundant bits added at the end of the data bits. The resultant data unit becomes divisible by a second binary number. The approaching data unit is divided by the same number. If there is no remainder at this step, the data unit is assumed to be correct and accepted; otherwise, the data unit has been damaged during transmission. 

Error Correction  

Error-correcting codes are added to a digital message to detect and correct the errors during data transmission from the sender to the receiver.

We can perform error correction in the following ways:

  1. Backward Correction: In this correction, the receiver, after discovering the error, requests the sender to retransmit the entire data code.
  2. Forward Correction: The error-correcting codes can automatically correct the errors. In this correction, the receiver uses the error-correcting codes. 
     

You can also read about the network models in computer network.

Frequently Asked Questions

Mention the types of errors associated with computer networks.

There are three types of errors associated with computer networks:  
Single-bit error
Multiple-bits error
Burst error

List the steps followed in the checksum generator?

The sender follows these steps – 
a) The units are divided into k segments, of n bits each.
b) All segments are added together using 2's complement to get the sum. 
c) The sum is complemented and becomes the checksum.
d) The checksum is transmitted with the data.

What is redundancy?

Redundancy is an error detecting mechanism in which a shorter group of bits or extra bits may be added at the destination of each unit.

Conclusion

In this blog, we learned about the various types of errors in Computer Networks and their detection techniques. We also got a heads-up about the different Error Correction methods that can be used to correct the detected errors in the transmitted message. 

Recommended Readings:


Check out the official Coding Ninjas Blog site and visit our Library for more. 

Do check out The Interview guide for Product Based Companies as well as some of the Popular Interview Problems from Top companies like Amazon, Adobe, Google, etc. on Coding Ninjas Studio.

Also check out some of the Guided Paths on topics such as Data Structure and Algorithms, Competitive Programming, Operating Systems, Computer Networks, etc. as well as some Contests, Test Series, Interview Bundles, and some Interview Experiences curated by top Industry Experts only on Coding Ninjas Studio.

Happy Learning!

Live masterclass