Error Detection and Correction Prof Choong Seon HONG

  • Slides: 39
Download presentation
Error Detection and Correction Prof. Choong Seon HONG Kyung Hee University 1

Error Detection and Correction Prof. Choong Seon HONG Kyung Hee University 1

9장 Error Detection and Correction 9. 1 Types of Errors 9. 2 Detection 9.

9장 Error Detection and Correction 9. 1 Types of Errors 9. 2 Detection 9. 3 Error Correction Kyung Hee University 2

Error Detection and Correction n Data can be corrupted during transmission. For reliable communication,

Error Detection and Correction n Data can be corrupted during transmission. For reliable communication, error must be detected and corrected n are implemented either at the data link layer or the transport layer of the OSI model Kyung Hee University 3

9. 1 Type of Errors Kyung Hee University 4

9. 1 Type of Errors Kyung Hee University 4

Type of Errors(cont’d) q. Single-Bit Error ~ is when only one bit in the

Type of Errors(cont’d) q. Single-Bit Error ~ is when only one bit in the data unit has changed ASCII STX - ASCII LF) Kyung Hee University (ex : 5

Type of Errors(cont’d) q. Multiple-Bit Error ~ is when two or more nonconsecutive bits

Type of Errors(cont’d) q. Multiple-Bit Error ~ is when two or more nonconsecutive bits in the data unit have changed(ex : ASCII B - ASCII LF) Kyung Hee University 6

Type of Errors(cont’d) q. Burst Error ~ means that two or more consecutive bits

Type of Errors(cont’d) q. Burst Error ~ means that two or more consecutive bits in the data unit have changed Kyung Hee University 7

9. 2 Detection q Error detection uses the concept of redundancy, which means adding

9. 2 Detection q Error detection uses the concept of redundancy, which means adding extra bits for detecting errors at the destination Kyung Hee University 8

Detection(cont’d) q. Redundancy Kyung Hee University 9

Detection(cont’d) q. Redundancy Kyung Hee University 9

Detection(cont’d) q. Detection methods v. VRC(Vertical Redundancy Check) v. LRC(Longitudinal Redundancy) v. CRC(Cyclic redundancy

Detection(cont’d) q. Detection methods v. VRC(Vertical Redundancy Check) v. LRC(Longitudinal Redundancy) v. CRC(Cyclic redundancy Check) v. Checksum Kyung Hee University 10

Detection(cont’d) q. VRC(Vertical Redundancy Check) v. A parity bit is added to every data

Detection(cont’d) q. VRC(Vertical Redundancy Check) v. A parity bit is added to every data unit so that the total number of 1 s(including the parity bit) becomes even for even-parity check or odd for odd-parity check v. VRC can detect all single-bit errors. It can detect multiplebit or burst errors only the total number of errors is odd. Kyung Hee University 11

Detection(cont’d) q. Even parity VRC concept Kyung Hee University 12

Detection(cont’d) q. Even parity VRC concept Kyung Hee University 12

Detection(cont’d) q. LRC(Longitudinal Redundancy Check) v. Parity bits of all the positions are assembled

Detection(cont’d) q. LRC(Longitudinal Redundancy Check) v. Parity bits of all the positions are assembled into a new data unit, which is added to the end of the data block Kyung Hee University 13

Detection(cont’d) q. CRC(Cyclic Redundancy Check) ~ is based on binary division. Kyung Hee University

Detection(cont’d) q. CRC(Cyclic Redundancy Check) ~ is based on binary division. Kyung Hee University 14

Detection(cont’d) q. CRC generator ~ uses modular-2 division. Binary Division in a CRC Generator

Detection(cont’d) q. CRC generator ~ uses modular-2 division. Binary Division in a CRC Generator Kyung Hee University 15

Detection(cont’d) Binary Division in a CRC Checker Kyung Hee University 16

Detection(cont’d) Binary Division in a CRC Checker Kyung Hee University 16

Detection(cont’d) q. Polynomials v. CRC generator(divisor) is most often represented not as a string

Detection(cont’d) q. Polynomials v. CRC generator(divisor) is most often represented not as a string of 1 s and 0 s, but as an algebraic polynomial. Kyung Hee University 17

Detection(cont’d) q. A polynomial representing a divisor Kyung Hee University 18

Detection(cont’d) q. A polynomial representing a divisor Kyung Hee University 18

Detection(cont’d) q. Standard polynomials Kyung Hee University 19

Detection(cont’d) q. Standard polynomials Kyung Hee University 19

Detection(cont’d) q. Checksum ~ used by the higher layer protocols ~ is based on

Detection(cont’d) q. Checksum ~ used by the higher layer protocols ~ is based on the concept of redundancy(VRC, LRC, CRC …. ) Kyung Hee University 20

Detection(cont’d) q. Checksum Generator Kyung Hee University 21

Detection(cont’d) q. Checksum Generator Kyung Hee University 21

Detection(cont’d) q. To create the checksum the sender does the following: v. The unit

Detection(cont’d) q. To create the checksum the sender does the following: v. The unit is divided into K sections, each of n bits. v. Section 1 and 2 are added together using one’s complement. v. Section 3 is added to the result of the previous step. v. Section 4 is added to the result of the previous step. v. The process repeats until section k is added to the result of the previous step. v. The final result is complemented to make the checksum. Kyung Hee University 22

Detection(cont’d) qdata unit and checksum Kyung Hee University 23

Detection(cont’d) qdata unit and checksum Kyung Hee University 23

Detection(cont’d) Kyung Hee University 24

Detection(cont’d) Kyung Hee University 24

Detection(cont’d) q 예제 9. 7 ( at a sender) Original data : 10101001 00111001

Detection(cont’d) q 예제 9. 7 ( at a sender) Original data : 10101001 00111001 -------11100010 Sum 00011101 Checksum 10101001 00111001 00011101 전송 Kyung Hee University 25

Detection(cont’d) q 예제 9. 8 ( at a receiver) Received data : 10101001 00111001

Detection(cont’d) q 예제 9. 8 ( at a receiver) Received data : 10101001 00111001 00011101 -------1111 Sum 0000 Complement Kyung Hee University 26

9. 3 Error Correction ~ can be handled in two ways when an error

9. 3 Error Correction ~ can be handled in two ways when an error is discovered, the receiver can have the sender retransmit the entire data unit. a receiver can use an error-correcting code, which automatically corrects certain errors. Kyung Hee University 27

Error Correction(cont’d) q. Single-Bit Error Correction v parity bit v The secret of error

Error Correction(cont’d) q. Single-Bit Error Correction v parity bit v The secret of error correction is to locate the invalid bit or bits v For ASCII code, it needs a three-bit redundancy code(000 -111) Kyung Hee University 28

Error Correction(cont’d) q. Redundancy Bits ~ to calculate the number of redundancy bits (R)

Error Correction(cont’d) q. Redundancy Bits ~ to calculate the number of redundancy bits (R) required to correct a given number of data bit (M) Kyung Hee University 29

Error Correction(cont’d) q. If the total number of bits in a transmittable unit is

Error Correction(cont’d) q. If the total number of bits in a transmittable unit is m+r, then r must be able to indicate at least m+r+1 different states 2 r m + r + 1 ex) For value of m is 7(ASCII), the smallest r value that can satisfy this equation is 4 24 7 + 4 + 1 Kyung Hee University 30

Error Correction(cont’d) q. Relationship between data and redundancy bits Number of Data Bits (m)

Error Correction(cont’d) q. Relationship between data and redundancy bits Number of Data Bits (m) Number of Redundancy Bits (r) Total Bits (m+r) 1 2 3 4 5 6 7 2 3 3 3 4 4 4 3 5 6 7 9 10 11 Kyung Hee University 31

Error Correction(cont’d) q. Hamming Code ~ developed by R. W. Hamming qpositions of redundancy

Error Correction(cont’d) q. Hamming Code ~ developed by R. W. Hamming qpositions of redundancy bits in Hamming code Kyung Hee University 32

Error Correction(cont’d) qeach r bit is the VRC bit for one combination of data

Error Correction(cont’d) qeach r bit is the VRC bit for one combination of data bits r 1 = bits 1, 3, 5, 7, 9, 11 r 2 = bits 2, 3, 6, 7, 10, 11 r 4 = bits 4, 5, 6, 7 r 8 = bits 8, 9, 10, 11 Kyung Hee University 33

Error Correction(cont’d) q. Redundancy bits calculation(cont’d) Kyung Hee University 34

Error Correction(cont’d) q. Redundancy bits calculation(cont’d) Kyung Hee University 34

Error Correction(cont’d) q. Redundancy bits calculation Kyung Hee University 35

Error Correction(cont’d) q. Redundancy bits calculation Kyung Hee University 35

Error Correction(cont’d) q. Calculating the r values Calculating Even Parity Kyung Hee University 36

Error Correction(cont’d) q. Calculating the r values Calculating Even Parity Kyung Hee University 36

Error Correction(cont’d) q. Error Detection and Correction Kyung Hee University 37

Error Correction(cont’d) q. Error Detection and Correction Kyung Hee University 37

Error Correction(cont’d) q. Error detection using Hamming Code Kyung Hee University 38

Error Correction(cont’d) q. Error detection using Hamming Code Kyung Hee University 38

Error Correction(cont’d) q. Multiple-Bit Error Correction v redundancy bits calculated on overlapping sets of

Error Correction(cont’d) q. Multiple-Bit Error Correction v redundancy bits calculated on overlapping sets of data units can also be used to correct multiple-bit errors. Ex) to correct double-bit errors, we must take into consideration that two bits can be a combination of any two bits in the entire sequence Kyung Hee University 39