2.2 Error Detection Parity Check
2.2 Error Detection Parity Check
frames or packets, i.e. bit streams of data, are transmitted or transferred from sender to receiver with
certain accuracy. Using or providing error control at this data link layer is an optimization, it was never
a requirement. Error control is basically process in data link layer of detecting or identifying and re-
transmitting data frames that might be lost or corrupted during transmission.
Ways of doing Error Control: There are basically two ways of doing Error control as given below:
1. Error Detection : Error detection, as the name suggests, simply means detection or identification
of errors. These errors may occur due to noise or any other impairments during transmission from
transmitter to the receiver, in communication system. It is a class of techniques for detecting
garbled i.e. unclear and distorted data or messages.
There are many reasons such as noise, cross-talk etc., which may help data to get corrupted during
transmission. The upper layers work on some generalized view of network architecture and are not aware
of actual hardware data processing. Hence, the upper layers expect error-free transmission between the
systems. Most of the applications would not function expectedly if they receive erroneous data.
Applications such as voice and video may not be that affected and with some errors they may still
function well.
Data-link layer uses some error control mechanism to ensure that frames (data bit streams) are transmitted
with certain level of accuracy. But to understand how errors is controlled, it is essential to know what
types of errors may occur.
Types of Errors
A parity bit is a check bit, which is added to a block of data for error detection purposes. It is used to
validate the integrity of the data. The value of the parity bit is assigned either 0 or 1 that makes the number
of 1s in the message block either even or odd depending upon the type of parity. Parity check is suitable for
single bit error detection only.
Sender's End − While creating a frame, the sender counts the number of 1s in it and adds the parity bit in
following way
In case of even parity − If number of 1s is even, parity bit value is 0. If number of 1s is odd, parity
bit value is 1.
In case of odd parity − If number of 1s is odd, parity bit value is 0. If number of 1s is even, parity
bit value is 1.
Receiver's End − On receiving a frame, the receiver counts the number of 1s in it. In case of even parity
check, if the count of 1s is even, the frame is accepted, otherwise it is rejected. In case of odd parity
check, if the count of 1s is odd, the frame is accepted, otherwise it is rejected.
Example
Suppose that a sender wants to send the data 1001101 using even parity check method. It will add
the parity bit as shown below.
The receiver will decide whether error has occurred by counting whether the total number of 1s is
even. When the above frame is received, three cases may occur namely, no error, single bit error
detection and failure to detect multiple bits error. This is illustrated as follows
Disadvantages
Single Parity check is not able to detect even no. of bit error.
For example, the Data to be transmitted is 101010. Codeword transmitted to the receiver is
1010101 (we have used even parity).
Let’s assume that during transmission, two of the bits of code word flipped to 1111101.
On receiving the code word, the receiver finds the no. of ones to be even and hence no
error, which is a wrong assumption.
Two-dimensional 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.