Error Detection in Computer network
Error
A condition when the receiver’s information does not match with the sender’s information. During transmission, digital signals suffer from noise that can introduce errors in the binary bits travelling from sender to receiver. That means a 0 bit may change to 1 or a 1 bit may change to 0.
OR
Error detection is a technique that is used to check if any error occurred in the data during the transmission.
Error Detecting Codes (Implemented either at Data link layer or Transport Layer of OSI Model)
Whenever a message is transmitted, it may get scrambled by noise or data may get corrupted. To avoid this, we use error-detecting codes which are additional data added to a given digital message to help us detect if any error has occurred during transmission of the message.
Some popular techniques for error detection are:-
1. Parity check (Single, Two-dimensional)
2. Cyclic redundancy check (CRC)
1. Parity Check -
Single Parity Check
In this technique,
-> One extra bit called as parity bit is sent along with the original data bits.
-> Parity bit helps to check if any error occurred in the data during the transmission.
-> 1 is added to the block if it contains odd number of 1’s, and
-> 0 is added if it contains even number of 1’s
OR
-> Parity checking is the simple mechanism and inexpensive to detect the errors.
-> In this technique, a redundant bit is also known as a parity bit which is appended at the end of the data unit so that the number of 1s becomes even. Therefore, the total number of transmitted bits would be 9 bits.
-> If the number of 1s bits is odd, then parity bit 1 is appended and if the number of 1s bits is even, then parity bit 0 is appended at the end of the data unit.
-> At the receiving end, the parity bit is calculated from the received data bits and compared with the received parity bit.
This technique generates the total number of 1s even, so it is known as even-parity checking.
Error
A condition when the receiver’s information does not match with the sender’s information. During transmission, digital signals suffer from noise that can introduce errors in the binary bits travelling from sender to receiver. That means a 0 bit may change to 1 or a 1 bit may change to 0.
OR
Error detection is a technique that is used to check if any error occurred in the data during the transmission.
Error Detecting Codes (Implemented either at Data link layer or Transport Layer of OSI Model)
Whenever a message is transmitted, it may get scrambled by noise or data may get corrupted. To avoid this, we use error-detecting codes which are additional data added to a given digital message to help us detect if any error has occurred during transmission of the message.
Some popular techniques for error detection are:-
1. Parity check (Single, Two-dimensional)
2. Cyclic redundancy check (CRC)
1. Parity Check -
Single Parity Check
In this technique,
-> One extra bit called as parity bit is sent along with the original data bits.
-> Parity bit helps to check if any error occurred in the data during the transmission.
-> 1 is added to the block if it contains odd number of 1’s, and
-> 0 is added if it contains even number of 1’s
OR
-> Parity checking is the simple mechanism and inexpensive to detect the errors.
-> In this technique, a redundant bit is also known as a parity bit which is appended at the end of the data unit so that the number of 1s becomes even. Therefore, the total number of transmitted bits would be 9 bits.
-> If the number of 1s bits is odd, then parity bit 1 is appended and if the number of 1s bits is even, then parity bit 0 is appended at the end of the data unit.
-> At the receiving end, the parity bit is calculated from the received data bits and compared with the received parity bit.
This technique generates the total number of 1s even, so it is known as even-parity checking.
Drawbacks Of Single Parity Checking
-> It can only detect single-bit errors which are very rare.
-> If two bits are interchanged, then it cannot detect the errors.
Two-dimensional Parity check
Parity check bits are calculated for each row, which is equivalent to a simple parity check bit. Parity check bits are also calculated for all columns, then both are sent along with the data. At the receiving end these are compared with the parity bits calculated on the received data.
2. Cyclic redundancy check (CRC) -
-> Unlike checksum scheme, which is based on addition, CRC is based on binary division.
-> In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are appended to the end of data unit so that the resulting data unit becomes exactly divisible by a second, predetermined binary number.
-> At the destination, the incoming data unit is divided by the same number. If at this step there is no remainder, the data unit is assumed to be correct and is therefore accepted.
-> A remainder indicates that the data unit has been damaged in transit and therefore must be rejected.
Example: