Top Banner
1 Error Detection and correction
67
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Error Controller

1

Error Detection and correction

Page 2: Error Controller

2

• Sachin P Namboodiri.

• Sai Santhosh.

• Sooraj Sasikumar.

• Sree Lekshmi.S

• Sruthi.P.

• Suraj Surendran.

• Vinay Kumar.

• Vidya Vijayan Pulickal.

Page 3: Error Controller

3

Data Errors

• When data is transmitted over a cable or a channel, there is always a chance that some of the bits will be changed (corrupted) due to noise, signal distortion or attenuation.

• If error do occur then some of the transmitted bits will either change from 0 to 1 or from 1 to 0.

Page 4: Error Controller

4

Types of errors

Page 5: Error Controller

5

• Single bit-error only one bit in the data unit has changed.

Page 6: Error Controller

6

• Burst errors change a number of bits in succession. They are often caused by faults in electrical equipment or by interference.

Page 7: Error Controller

7

Error Detection

• Transmission errors are inevitable, resulting in the change of one or more bits in the transmitted frame.

• Some notations:– Pb : probability of a single bit error

(bit error rate)– P1 : probability that a frame arrives with no bit

errors.– P2 : probability that a frame arrives with one

or more undetcted bit errors.

Page 8: Error Controller

8

Error Detection

– P3 : probability that a frame arrives with one or more detected errors but no undetected bit errors.

– F : number of bits in a frame.

• If no error detection scheme is used, P3=0, and:

– P1= (1-Pb) F

– P2= 1-P1

• Clearly longer frame and higher Pb leads to lower P1.

Page 9: Error Controller

9

Error Detection

• An illustrative example– A defined specification for ISDN connections

is that the bit error rate on a 64Kbps channel should be less than 10-6 on atleast 90% of observed 1 minute intervals.

– Suppose we want that at most one frame with an undetected bit error per day on a continuously used 64Kbps channel, with a frame length of 1000 bits

Page 10: Error Controller

10

• No of frames transmitted per day is (64K/1000)*60*60*24= 5.5x106

• Desired frame error rate P2 = 1/(5.5x106)= 0.18x10-6

• But if we assume Pb=10-6 , then

– P1 =(0.999999)1000 = 0.999

– Therefore, P2 = 10-3 , Which is about three orders of magnitude too large to meet our requirements.

• This necessiates the use of error detection

Page 11: Error Controller

11

Error Detection

• Error detection uses the concept of redundancy, which means adding extra bits for detecting errors at the destination.

• EDC=Error Detection and correction bits (redundancy)

• D=Data protected by error checking.• Error Detection may not be 100% reliable!

– It may miss some errors, but rarely.– Larger the EDC field yields better detection

and correction.

Page 12: Error Controller

12

Page 13: Error Controller

13

Hamming Distance

• The Hamming distance between two code words is the number of bits in which two code words differ.

• The minimum Hamming distance for a code is the smallest Hamming distance between all pairs of words in the code.

This pair of bytes has a Hamming distance of 3:

Page 14: Error Controller

14

• The minimum Hamming distance for a code, D(min), determines its error detecting and error correcting capability.

• For any code word, X, to be interpreted as a different valid code word, Y, at least D(min) single-bit errors must occur in X.

• Thus, to detect k (or fewer) single-bit errors, the code must have a Hamming distance of D(min) = k + 1.

Page 15: Error Controller

15

• Example:

Page 16: Error Controller

16

Parity Check

• The simplest error detection scheme.– Appends a parity bit to the end of a block of

data.– Odd number of bit errors can be detected.– If an even number of bits are inverted due to

error, an undetected error occurs.– This is a drawback.

Page 17: Error Controller

17

• Mechanism is as follows:– Blocks of data from the source are subjected

to a check bit or Parity bit generator form.– a parity of 1 is added to the block if it contains

an odd number of 1’s and 0 is added if it contains an even number of 1’s.

– At the receiving end the parity bit is computed from the received data bits and compared with the received parity bit.

– If it does not match then there is an error.

Page 18: Error Controller

18

Even-parity checking scheme

Page 19: Error Controller

19

Block Parity testing

Page 20: Error Controller

20

• For each group of 8 bits a parity bit could be added(in this case even parity)

• Similarly we have to calculate parity on column also…

Page 21: Error Controller

21

• Finally we get…

Page 22: Error Controller

22

• Now if an error occurs, we will know which character and which column it has occurred.

Not only have we detected the error, but also corrected it..

Page 23: Error Controller

23

Checksum Testing

• Another way of checking for errors is to use a checksum. This is a number calculated from the data and sent along with the data.

• If any errors occur during transmission then checksum for the received data will differ from transmitted checksum

Page 24: Error Controller

24

Note:

• The sender follows these steps:The sender follows these steps:

• The unit is divided into k sections, each of n bits.The unit is divided into k sections, each of n bits.

• All sections are added using one’s complement All sections are added using one’s complement to get the sum.to get the sum.

• The sum is complemented and becomes the The sum is complemented and becomes the checksum.checksum.

• The checksum is sent with the data.The checksum is sent with the data.

Page 25: Error Controller

25

Note:

• The receiver follows these steps:The receiver follows these steps:

• The unit is divided into k sections, each of n bits.The unit is divided into k sections, each of n bits.

• All sections are added using one’s complement All sections are added using one’s complement to get the sum.to get the sum.

• The sum is complemented.The sum is complemented.

• If the result is zero, the data are accepted: If the result is zero, the data are accepted: otherwise, rejected.otherwise, rejected.

Page 26: Error Controller

26

ExampleExample

• Suppose the following block of 16 bits is to be sent using a checksum of 8 bits.

• 10101001 00111001

• The numbers are added using one’s complement

• 10101001

• 00111001 ------------Sum 11100010

• Checksum 00011101

• The pattern sent is 10101001 00111001 00011101

Page 27: Error Controller

27

• Now suppose the receiver receives the pattern sent in Example 7 and there is no error.

• 10101001 00111001 00011101

• When the receiver adds the three sections, it will get all 1s, which, after complementing, is all 0s and shows that there is no error.

10101001

00111001

00011101

Sum 11111111

Complement 00000000 means that the pattern is OK.

Page 28: Error Controller

28

Now suppose there is a burst error of length 5 that affects 4 bits.

10101111 11111001 00011101

When the receiver adds the three sections, it gets

10101111

11111001

00011101

Partial Sum 1 11000101

Carry 1

Sum 11000110

Complement 00111001 the pattern is corrupted.

Page 29: Error Controller

29

Cyclic Redundancy Check

• A cyclic redundancy check (CRC) is a more sophisticated type of checksum. If a CRC is used, it is unlikely that any errors will go undetected.

• Although the technique may sound little complicated, in practice calculating a CRC is easy and can be implemented in hardware.

Page 30: Error Controller

30

• In CRC, If a k bit message is to be transmitted, the transmitter generates an r-bit sequence, known as Frame Check Sequence (FCS) so that the (k+r) bits are actually being transmitted.

• Now this r-bit FCS is generated by dividing the original number, appended by r zeros, by a predetermined number called Generator polynomial( r+1 bits).

• The remainder of this division process generates the r-bit FCS.

Page 31: Error Controller

31

• On receiving the packet, the receiver divides the (k+r) bit frame by the same predetermined number and if it produces no remainder, it can be assumed that no error has occurred during the transmission.

Page 32: Error Controller

32

Page 33: Error Controller

33

• Suppose we want to transmit the information string: 1111101.

• The receiver and sender decide to use the (arbitrary) polynomial pattern, 1101.

• The information string is shifted left by one position less than the number of positions in the divisor.

• The remainder is found through modulo 2 division (at right) and added to the information string: 1111101000 + 111 = 1111101111.

Page 34: Error Controller

34

• If no bits are lost or corrupted, dividing the received information string by the agreed upon pattern will give a remainder of zero.

• We see this is so in the calculation at the right.

• Real applications use longer polynomials to cover larger information strings.

Page 35: Error Controller

35

• Polynomials– CRC generator(divisor) is most often

represented not as a string of 1s and 0s, but as an algebraic polynomial.

Page 36: Error Controller

36

• A polynomial representing a divisor

Page 37: Error Controller

37

• Standard polynomials

Page 38: Error Controller

38

Next is the wonder u are awaiting!

Page 39: Error Controller

39

Wow!!!!

Page 40: Error Controller

40

• Error detection is usually done in ________ layer of OSI.

Page 41: Error Controller

41

• Datalink Layer………

Page 42: Error Controller

42

• Explain different types of Errors?

Page 43: Error Controller

43

• Single bit-error only one bit in the data unit has changed.

• Burst errors change a number of bits in succession. They are often caused by faults in electrical equipment or by interference.

Page 44: Error Controller

44

• The number of bits position in which code words differ is called the __________ distance

Page 45: Error Controller

45

• Hamming Distance ………

Page 46: Error Controller

46

• To detect K single bit errors, the codes must have a hamming distance of

D(min)= _________

Page 47: Error Controller

47

• K+1………………………

Page 48: Error Controller

48

Problems

Page 49: Error Controller

49

• For P = 110011 and M = 11100011, find the FCS???

Page 50: Error Controller

50

Page 51: Error Controller

51

• Given

Message M = 1010001101 (10 bits)

Pattern P = 110101 (6 bits)

Find FCS???

Page 52: Error Controller

52

Page 53: Error Controller

53

• Using CRC-CCITT polynomial, generate FCS for a message consisting of a one followed by 15 0’s???

• CRC-CCITT =X16 + X12 + X5 +1

Page 54: Error Controller

54

Page 55: Error Controller

55

• Encode the data bit sequence 10010011011 using the generator polynomial X4 +X+1??

Page 56: Error Controller

56

• Divide X10 + X7 + X4 + X3 + X + 1 by X4 + X + 1. The remainder is X3 + X2. The CRC bits are 1100. The string 100100110111100 is sent.

Page 57: Error Controller

57

• Two communicating devices are using a single-bit even parity check for error detection. The transmitter sends the byte 10101010 and, because of channel noise, the receiver gets the byte 10011010.

• Will the receiver detect the error? Why or why not?

Page 58: Error Controller

58

• an even number of bit change is present , so an undetected error occurs.

Page 59: Error Controller

59

• M(x)=X9+X7+X3+X2+1,

P(x)=X5+X4+X2+1,

Find FCS

Page 60: Error Controller

60

• R(x)=X3+X2+X

Page 61: Error Controller

61

• Calculate the hamming pair-wise distance among the following code words-

00000

10101

01010

Page 62: Error Controller

62

Page 63: Error Controller

63

• Suppose the data send is

100100 and the divisor is 1101.Find the CRC.

Page 64: Error Controller

64

• 001…………….

Page 65: Error Controller

65

• If the data received is 110100011 and the divisor is 1001.Using CRC method check whether any error present or not??

Page 66: Error Controller

66

• Yes……………

Page 67: Error Controller

67

Thank You…