• Tidak ada hasil yang ditemukan

Error Detection and Correction - Department of EEE, IUB

N/A
N/A
Protected

Academic year: 2023

Membagikan "Error Detection and Correction - Department of EEE, IUB"

Copied!
36
0
0

Teks penuh

(1)

LECTURE-7B

Error Detection Error Detection

and Correction

(2)

Introduction

™ Networks must be able to transfer data from one device to another with complete accuracy

another with complete accuracy.

™ Data can be corrupted during transmission.

™ An error occurs when a bit is altered between transmission and reception (1 is transmitted and 0 is received, and visa versa)

™ For reliable communication, errors must be detected and corrected

corrected.

™ Error detection and correction are implemented either at the data link layer or the transport layer of the OSI model.y p y

(3)

Types of Errors

(4)

ƒ The term single‐bit error means that only 1 bit of a given data

Single‐Bit Error

g y g

unit (such as a byte, character, or packet) is changed from 1 to 0 or from 0 to 1.

ƒ Single bit errors are the least likely type of errors in serial data

ƒ Single bit errors are the least likely type of errors in serial data transmission because the noise must have a very short duration which is very rare.

H thi ki d f h i ll l

ƒ However this kind of errors can happen in parallel transmission.

ƒ Example: If data is sent at 1Mbps then each bit lasts only 1/1,000,000 sec. or 1 μs.

ƒ For a single‐bit error to occur, the noise must have a duration of only 1 μs, which is very rare.

of only 1 μs, which is very rare.

(5)

Burst Error

ƒ A burst error means that 2 or more bits in the data unit have changed

ƒ A burst error does not necessarily mean that the errors occur in consecutive bits.

ƒ The length of the burst is measured from the first corrupted bit to the last corrupted bit.

ƒ Burst error is most likely to happen in serial transmission since the duration of noise is normally longer than the duration of a bit.

ƒ The number of bits affected depends on the data rate and duration of noise.

ƒ Example:Example: If data is sent at rate = 1Kbps then a noise of 1/100 secIf data is sent at rate 1Kbps then a noise of 1/100 sec can affect 10 bits.(1/100*1000)

ƒ If same data is sent at rate = 1Mbps then a noise of 1/100 sec can affect 10 000 bits (1/100*106)

affect 10,000 bits.(1/100 10 )

(6)

Multiple‐bit Error and Burst Error

(7)

Error Detection

ƒ Error detection means to decide whether the received data is

ƒ Error detection means to decide whether the received data is correct or not without having a copy of the original message.

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

ƒ These redundant bits are added by the sender and removed by the receiver.

ƒ Their presence allows the receiver to detect or correct corrupted bits

bits.

(8)

Error Detection Methods

(9)

Vertical Redundancy Check (VRC) 

ƒ It can detect single bit error

ƒ It can detect single bit error

ƒ It can detect burst errors only if the total number of errors is odd.

ƒ a parity bit (extra bit) is added to every data unit so that the total number of 1s is even or odd (for odd‐parity).

(10)

Performance of Simple Parity Check

Example:p

ƒ We have an even‐parity data unit where the total number of 1s, including the parity bit, is 6: 1000111011.

ƒ If any 3 bits changed, the resulting parity will be odd and the errorIf any 3 bits changed, the resulting parity will be odd and the error will be detected:

1111111011: “ 9 ones”

0110111011: “7 ones”

0110111011: 7 ones 1100010011: “ 5 ones”

The same holds true for any odd number of errors

b h d

ƒ Suppose 2 bits are changed:

1110111011: ”8 ones”

1100011011: ”6 ones”

The number of 1s in the data unit is still even

ƒ The same holds true for any even number of errors The parity checker cannot detect errors when number of bits changed is even.

checker cannot detect errors when number of bits changed is even.

The change cancel each other and the data unit will pass a parity check even though the data unit is damaged

(11)

Longitudinal Redundancy Check (LRC)

ƒ LCR increases the likelihood of detecting burst errors.

ƒ If two bits in one data units are damaged and two bits in exactly the same positions in another data unit are also damaged, the LRC checker will not detect an error.

(12)

Two‐dimensional Parity

ƒ Calculate the parity bit for each data unit, then organize them into table (rows and columns)

ƒ Calculate the parity bit for each column and create a new row

ƒ Calculate the parity bit for each column and create a new row (column parity)

ƒ A redundant row of bits is added to the whole block.

(13)

Example

• Suppose the following block is sent:Suppose the following block is sent:

10101001 00111001 11011101 11100111 10101010

• However, it is hit by a burst noise of length 8, and some bits t d

are corrupted.

10100011 10001001 11011101 11100111 10101010

• When the receiver checks the parity bits, some of the bits dop y , not follow the even‐parity rule and the whole block is discarded.( see next slide)

(14)

Two‐dimensional Parity Performance

ƒ Increases the likelihood of detecting burst errors.

ƒ The two‐dimensional parity check can detect up to three errors that occur anywhere in the table.

ƒ However errors affecting 4 bits may not be detectedHowever, errors affecting 4 bits may not be detected.

ƒ If 2 bits in one data unit are damaged and two bits in exactly the same position in anther data unite are also damaged.

The error will not be detected.

(15)
(16)

Cyclic Redundancy Check (CRC)

Gi k bit f th t itt t

ƒ Given a k‐bit frame or message, the transmitter generates an n‐

bit sequence, known as a frame check sequence (FCS), so that the resulting frame, consisting of (k+n) bits, is exactly divisible by

d i d b

some predetermined number.

ƒ The receiver then divides the incoming frame by the same number and, if there is no remainder, assumes that there was no number and, if there is no remainder, assumes that there was no error.

(17)
(18)

Division in the CRC Sender and Receiver

0 0 1

CRC

(19)

A polynomial

ƒ The divisor in CRC generator is most often represented not as string of 1s and 0s, but as an algebraic polynomial.

ƒ The polynomial is used for two reasons: it is Short and Can be used to prove the concept mathematically.

ƒ A polynomial should be selected to have the following :

¾ It should not be divisible by x.( i.e the )

coefficient of term X0 should be 1)

¾ It should be divisible by x+1.

¾ The first condition : guarantees that all the

¾ The first condition : guarantees that all the burst errors of a length equal to the degree of the polynomial are detected.

¾ The Second condition : guarantees that all

¾ The Second condition : guarantees that all the burst errors affecting an odd number of bits are detected.

(20)

CRC Performance

ƒ CRC is very effective error detection method:

ƒ CRC Can detect all burst errors that affect an odd number of

ƒ CRC Can detect all burst errors that affect an odd number of bits.

ƒ CRC Can detect all burst errors of length less than or equal to the degree of the polynomial

ƒ CRC can detect, with very high probability, burst errors of length greater than the degree of the polynomial

length greater than the degree of the polynomial.

(21)

Checksum

ƒ Like parity checks and CRC, the checksum based on redundancy.

ƒ The checksum is used in the Internet by several protocols notThe checksum is used in the Internet by several protocols not at the data link layer (Checksum used for example in network layer ).

(22)

Checksum

At the Sender

Th i i di id d i k

At the Receiver

Th i i di id d i k

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

ƒ All sections are added

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

ƒ All sections are added All sections are added

together using one’s complement to get the sum.

Th i l d

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

Th i l d

ƒ The sum is complemented and becomes the checksum.

ƒ The checksum is sent with

ƒ The sum is complemented.

ƒ If the result is zero, the data are accepted: otherwise, they The checksum is sent with

the data

are accepted: otherwise, they are rejected.

(23)

Example

At the Sender At the Receiver

(24)

Example

(25)

Performance

ƒ The checksum detects all errors involving an odd number of bit

bits.

ƒ It detects most errors involving an even number of bits.

ƒ If one or more bits of a segment are damaged and theIf one or more bits of a segment are damaged and the corresponding bit or bits of opposite value in a second segment are also damaged, the sums of those columns will not change

d th i ill t d t t bl

and the receiver will not detect a problem.

(26)

Error Correction

¾ Retransmission: when error is discovered, the, receiver can have the sender retransmit the data unit.

¾ F d E C ti

¾ Forward Error Correction

¾ Burst Error Correction

(27)

Forward Error Correction 

ƒ A receiver can use an error‐correcting code, whichg , automatically corrects certain errors.

ƒ Error‐correcting codes are more sophisticated than error

d t ti d d i d d bit

detection codes and require more redundancy bits.

ƒ Example for a single bit error:

ƒ Error Detection: one bit (error or no error)Error Detection: one bit (error or no error)

ƒ Error Correction: must know which bit is in error ( need more than one bit).

(28)

Forward Error Correction 

Example

ƒ To correct a single‐bit error in an ASCII character (7‐bit) the errorTo correct a single bit error in an ASCII character (7 bit), the error correction must distinguish between: no error, error in position1 …., error in position 7( 8 states)

ƒ It require more redundancy bits to show the 8 states

ƒ It require more redundancy bits to show the 8 states.

ƒ 3‐bit redundancy code: can indicate the location of 8 different possibilities.

B t t k if i th d d bit Additi l

ƒ But can not know if an error occur in the redundancy bits. Additional bits are required to cover all possible error location( including redundancy bits).

N b f d d bi d d

ƒ Number of redundancy bits needed Let data bits = m

Redundancy bits =y r

∴Total message sent = m+r

The value of r must satisfy the relation: 2r m+r+1

(29)

Hamming code

Positions of redundancy bits:

ƒ The key to the Hamming Code is the use of extra parity bits to

ll th id tifi ti f i l C t th d d

allow the identification of a single error Create the code word as follows:

ƒ Mark all bit positions that are powers of two as parity bits.p p p y (positions 1, 2, 4, 8, 16, 32, 64, etc.)

ƒ All other bit positions are for the data to be encoded.

( i i 3 5 6 7 9 10 11 12 13 14 15 17 ) (positions 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, etc.)

ƒ The key to the Hamming Code is the use of extra parity bits to allow the identification of a single error Positions of allow the identification of a single error Positions of redundancy bits:

(30)
(31)

Redundancy bit Calculation

ƒ Each parity bit calculates the even parity for some of the bits inp y p y the code word. The position of the parity bit determines the sequence of bits that it alternately checks and skips.

ƒ Position 1( r1): check 1 bit, skip 1 bit, check 1 bit, skip 1 bit, etc.Position 1( r1): check 1 bit, skip 1 bit, check 1 bit, skip 1 bit, etc.

(1, 3, 5, 7, 9, 11, 13, 15,...)

ƒ Position 2 (r2): check 2 bits, skip 2 bits, check 2 bits, skip 2 bits, etc.

(2, 3, 6, 7, 10, 11, 14, 15,...) ( , , , , , , , , )

ƒ Position 4 (r4): check 4 bits, skip 4 bits, etc (4, 5, 6, 7, 12, 13, 14, 15,...)

ƒ Position 8(r8): check 8 bits, skip 8 bits, etc.

(8‐15, 24‐31, 40‐47,...)

ƒ Set a parity bit to 1 if the total number of ones in the positions it checks is odd. Set a parity bit to 0 if the total number of ones in the positions it checks is even.

(32)

Redundancy bit Calculation

(33)

Example of Hamming Code

(34)

Error Detection and Correction Using Hamming 

Code

(35)

Burst Error Correction

ƒ Hamming code cannot correct a burst error directly, it isg y, possible to rearrange the data and then apply the code.

ƒ Organize N units in a column and then send the first bit for

h f ll d b th d bit f h d

each, followed by the second bit of each , and so on.

ƒ If a burst error of M bits occurs (M<N) then the error dose not corrupt M bits of one single unit, its corrupts only 1 bit of ap g , p y unit.

ƒ With Hamming, we can then correct the corrupted bit in each i

unit.

(36)

Burst Error Correction

Referensi

Dokumen terkait

II of this study describes the data and the time series properties (such as, unit root test, co- integration test and error correction model) employed to assess the

(efficacy of grammar, attitude to error correction, important of grammar, importance of grammatical accuracy, attitude to grammar instruction). Faktor- faktor

The second section is regarding to students’ belief in grammar instruction and error

Computer Science Department of The University of Auckland CITR at Tamaki Campus http://www.citr.auckland.ac.nz CITR-TR-89 May 2001 Correction of a Minor Error in the Implementation

Journal of Physics: Conference Series PAPER • OPEN ACCESS Application of Vector Error Correction Model VECM and Impulse Response Function for Daily Stock Prices To cite this article:

From the result that is shown in Table 1, it is observed that Levenshtein distance could effectively correct a spelling error with a single substitution: 1 “abandon” substitution of

II-8 ERROR CORRECTION AND FEEDBACK IN SPEAKING : A COMPARATIVE STUDY OF TEACHER LECTURER AND STUDENT PREFERENCES IN RESPONDING STUDENTS’ ERRORS IN SPEAKING AT ENGLISH EDUCATION STUDY

Example:- '5', 'X‘  Character constant have integer values known as ASCII value.Example:-printf"%d", 'a'Would print the number 97, the ASCII value of the letter a, the statement 