Chapter9(Error Detection and Correction)

Embed Size (px)

DESCRIPTION

komunikasi data

Citation preview

Error Detection and Correction

Prof. Choong Seon HONGError Detection and Correction#Kyung Hee University

9 Error Detection and Correction9.1 Types of Errors9.2 Detection9.3 Error Correction#Kyung Hee University

Error Detection and CorrectionData can be corrupted during transmission. For reliable communication, error must be detected and correctedare implemented either at the data link layer or the transport layer of the OSI model#Kyung Hee University

9.1 Type of Errors

#Kyung Hee University

Type of Errors(contd)Single-Bit Error~ is when only one bit in the data unit has changed (ex : ASCII STX - ASCII LF)

#Kyung Hee University

Type of Errors(contd)Multiple-Bit Error~ is when two or more nonconsecutive bits in the data unit have changed(ex : ASCII B - ASCII LF)

#Kyung Hee University

Type of Errors(contd)Burst Error~ means that two or more consecutive bits in the data unit have changed

#Kyung Hee University

9.2 Detection Error detection uses the concept of redundancy, which means adding extra bits for detecting errors at the destination#Kyung Hee University

Detection(contd)Redundancy

#Kyung Hee University

Detection(contd)Detection methodsVRC(Vertical Redundancy Check)LRC(Longitudinal Redundancy)CRC(Cyclical redundancy Check)Checksum

#Kyung Hee University

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

Detection(contd)Even parity VRC concept

#Kyung Hee University

Contoh VRC1110111 1101111 1110010 1101100 1100100 w o r l d11101110 11011110 11100100 11011000 11001001 Data ditransmisikanReceiver11111110 11011110 11101100 11011000 11001001

Data errorTransmiter6644476544#Kyung Hee University

Detection(contd)LRC(Longitudinal Redundancy Check)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

Detection(contd)CRC(Cyclic Redundancy Check)~ is based on binary division.

#Kyung Hee University

Detection(contd)CRC generator~ uses modular-2 division.

Binary Divisionin aCRC Generator

#Kyung Hee University

Detection(contd)Binary Divisionin aCRC Checker

#Kyung Hee University

Detection(contd)PolynomialsCRC generator(divisor) is most often represented not as a string of 1s and 0s, but as an algebraic polynomial.

#Kyung Hee University

Detection(contd)A polynomial representing a divisor

#Kyung Hee University

Detection(contd)Standard polynomials

#Kyung Hee University

Detection(contd)Checksum~ used by the higher layer protocols~ is based on the concept of redundancy(VRC, LRC, CRC .)#Kyung Hee University

Detection(contd)Checksum Generator

#Kyung Hee University

4+9=1313-9=44-4=0#Kyung Hee University

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

Detection(contd)data unit and checksum

#Kyung Hee University

Detection(contd)

#Kyung Hee University

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

Error Correction(contd)Single-Bit Error Correctionparity bitThe secret of error correction is to locate the invalid bit or bits For ASCII code, it needs a three-bit redundancy code(000-111)#Kyung Hee University

Error Correction(contd)Redundancy Bits~ to calculate the number of redundancy bits (R) required to correct a given number of data bit (M)

#Kyung Hee University

Error Correction(contd)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 2r 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

Error Correction(contd)Relationship between data and redundancy bitsNumber of Data Bits(m)Number of Redundancy Bits(r)Total Bits(m+r)12345672333444356791011#Kyung Hee University

Error Correction(contd)Hamming Code~ developed by R.W.Hammingpositions of redundancy bits in Hamming code

#Kyung Hee University

Error Correction(contd)each r bit is the VRC bit for one combination of data bitsr1 = bits 1, 3, 5, 7, 9, 11r2 = bits 2, 3, 6, 7, 10, 11r4 = bits 4, 5, 6, 7r8 = bits 8, 9, 10, 11#Kyung Hee University

Error Correction(contd)Redundancy bits calculation(contd)

#Kyung Hee University

Error Correction(contd)Redundancy bits calculation

#Kyung Hee University

Error Correction(contd)Calculating the r valuesCalculating Even Parity

#Kyung Hee University

Error Correction(contd)Error Detection and Correction

#Kyung Hee University

Error Correction(contd)Error detection using Hamming Code

#Kyung Hee University

Error Correction(contd)Multiple-Bit Error Correction 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

SoalDiketahui 3 buah data 001100100011000110011Ditanya:Berapa data yang akan dikirimkan jika menggunakan metode deteksi kesalahan parity ganjil1.VRC 2.LRC 3.Checksum#Kyung Hee University

Jawaban

Data yang dikirimkan dg metode VRC Ganjil ( 1) (2) (3)00110010 00011001 01100111Cara LRC Data Yang dikirimkan dg metode LRC Ganjil(1)(2)(3)(LRC)0011001 0001100 0110011 1011001

0011001 (1)0001100 (2)0110011 (3)1011001 (LRC)

#Kyung Hee University

ChecksumSender

Data yang dikirimkan dengan metode Checksum(1)(2)(3)(Checksum)0011001 0001100 0110011 0100111

Receiver

0011001 (1)0001100 (2)0110011 (3)1011000 ( sum) 0100111 (Checksum)

0011001 (1)0001100 (2)0110011 (3)0100111 (Checksum)1111111 ( sum)0000000 (Benar)

#Kyung Hee University

Soal CRC1)Diketahui data 111011001 Pembagi 1011 (Soal absen Ganjil) 11011 (absen Genap)2) Diketahui data X7+X6+X5+X+1 Pembagi X2+x+1Berapa data yang akan dikirimkan jika menggunakan metode deteksi kesalahan CRC

#Kyung Hee University

Jawaban Soal Ganjil

CRC GeneratorCRC CheckerData Yang dikirim 111011001110DataCRC#Kyung Hee University

Soal No 2

CRC Generator#Kyung Hee University