Data Link Layer

Error Detection

When a data is transmitted from one system (Source) to another system, the system does not guarantee whether the data received by the other System (destination) is Correct.

 

Error:

 Error is situation when the message (data) received at the receiver side is not identical to the message transmitted by the Sender.

Error Detection​

To prevent such Errors, Error Detection Code are edit as extra data (Bit) to the digital message. This help in detecting any error that may have occurred during transmission of the message.

Types of error:

Untitled Diagram 80
Single bit error:

single bit error is a situation where a single bit error is received on the receiver side.

Untitled Diagram 81
 Multiple Bit Error:

 Multiple Bit Error is a type of errors, where more than one bit in a data transmission is affected. 

Untitled Diagram 82
Burst Error:

Burst Error, when several consecutive bits are flipped mistakenly in digital transmission, Burst error there are error causes a sequence of consecutive incorrect values.

Untitled Diagram 84

 the various technique for error detection include:

  • Simple Parity Check
  • 2 Dimensional
  • Checksum
  • Cycle Redundancy Check(CRC)

Simple Parity Check:

Most of errors result in changing of a bit from 0’s to 1’s or 1’s to 0’s, one of the simplest error detection Code which is used in common called as Parity Bit

 

In Parity Bit we look for numbers of 1’s as total, The total number of Bit either be Odd or even

Untitled Diagram 85

There are two types of priority Bit:

 

1) Even parity Bit:

If in a message string number of 1’s are even then it is called even parity bit

 Example: 101000 has even parity bit since there are two number of 1’s

2) Odd Parity Bit:

If in a message string number of ones are Odd, this is called odd parity bit 

Example: 10101  has 3 1’s Which mean it is odd parity bit

Drawback of Single Bit Error:
  • It can identify single-piece error which are extremely rare.
  • Single bit error can not detect if bits are interchanged

CheckSum

The checksum is one of the error detecting technique, we are trying to identify the error, it is not for correcting the Error, For Correcting we need to use the hamming code, helpful for detecting the Error.

checksum:

At Sender End:

the data is divided into segments (subparts) in any number of bits, them perform 1’s complement to others segments, if there is any carry bit, then also perform 1’s complement with it. the last complements result is called Sum.

then the SUM is further complement which is called CHECKSUM. 


At Receiver End:

the Received data (Segments) is complement with one another as perform in sender side, the last sum is add with checksum and the result will perform 1’s complement. 

if the result is 0 then no error

else Error

Steps to Perform Error Detection:
  1. In check some error detection scheme the data is divided into segment each of m Bit.
  2. In the Sender Side the segments are adding using complement to get the sum, Later the sum is complementary to get the check some.
  3. Now checksum segment is sent along with the data segment.
  4. At receiver Side all received segments are added using 1’s complement arithmetic to get the sum then the sum is complemented.
  5. If the result is 0 data accepted otherwise rejected
 
Sender End:

 

Example:

We have data 10011001111000100010010010000100

in checksum:

1st break the data into segment as in figure:

Untitled Diagram 86

2nd Step: complement the segment 1 and 2 we get 1   01111011, we also get a carry bit, 

now we again complement the result with  carry bit.

Untitled Diagram 87

3ed step:

now complement the result of step 2 with segment 3

Untitled Diagram 88

4th step:

complement the 3rd step result with segment 4

in this we get a carry bit, so we complement the result with carry bit.

Untitled Diagram 89

5th step:

after complement all the segments we get sum 

now to get the Checksum we need to perform complement once again.

Untitled Diagram 90

Now send the (Data + checksum)  as Data

Untitled Diagram 91
Receiver End:
All segments are complements (steps same as sender end).
Untitled Diagram 93 1

Here at last the Sum is add with Checksum. and then complemented

If:  after complemented result is 0 then it has no Error

Else: Error 

Untitled Diagram 92

Advantage and Disadvantages of Checksum

Advantage : 
The checksum identifies every one of the mistakes including an odd number of bit along with the even number of bits.

Disadvantage : 
The fundamental issue is that the mistake goes undetected assuming at least one bit of a subunit (segments) is harmed and the comparing bit of a subunit are harmed and the relating bits of (opposite) value in second subunit are likewise harmed. This is on the grounds that the amount of those segments stays unaltered.