Error Detection and Correction Types of Errors Detection

  • Slides: 33
Download presentation
Error Detection and Correction • Types of Errors • Detection • Correction

Error Detection and Correction • Types of Errors • Detection • Correction

Basic concepts « Networks must be able to transfer data from one device to

Basic concepts « Networks must be able to transfer data from one device to another with complete accuracy. « Data can be corrupted during transmission. « For reliable communication, errors must be detected and corrected. « Error detection and correction are implemented either at the data link layer or the transport layer of the OSI model.

Types of Errors

Types of Errors

Single-bit error • Only one bit of given data unit is changed from 1

Single-bit error • Only one bit of given data unit is changed from 1 to 0 or 0 to 1.

 • Single bit errors are the least likely type of errors in serial

• 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. • If (parallel transmission) then one wire is so noisy.

Burst error • The term burst error means that two or more bits in

Burst error • The term burst error means that two or more bits in the data unit have changed from 1 to 0 or from 0 to 1.

Ø Burst errors does not necessarily mean that the errors occur in consecutive bits,

Ø Burst errors 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. Some bits in between may not have been corrupted. Ø 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.

Error detection means to decide whether the received data is correct or not without

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 means adding extra bits for detecting errors at the destination.

Redundancy

Redundancy

Four types of redundancy checks are used in data communications

Four types of redundancy checks are used in data communications

Vertical Redundancy Check VRC Vertical Redundancy Check (VRC) • Append a single bit at

Vertical Redundancy Check VRC Vertical Redundancy Check (VRC) • Append a single bit at the end of data block such that the number of ones is even • Even Parity (odd parity is similar) 0110011 0110001 01100011 • VRC is also known as Parity Check Performance: • It can detect single bit error • It can detect burst errors only if the total number of errors is odd.

Vertical Redundancy Check VRC

Vertical Redundancy Check VRC

Longitudinal Redundancy Check (LRC) Organize data into a table and create a parity for

Longitudinal Redundancy Check (LRC) Organize data into a table and create a parity for each column 11100111 11011101 00111001 10101001 1010 11100111 1101 00111001 10101010 LRC Original Data

Performance âLRC increases the likelihood of detecting burst errors. âIf two bits in one

Performance âLRC 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.

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

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

CRC generator Ø uses modular-2 division. Binary division in CRC Generator

CRC generator Ø uses modular-2 division. Binary division in CRC Generator

Cyclic Redundancy Check • Given a k-bit frame or message, the transmitter generates an

Cyclic Redundancy Check • 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 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 error.

Binary division in CRC checker

Binary division in CRC checker

Checksum • Checksum ~ used by the higher layer protocols ~ is based on

Checksum • Checksum ~ used by the higher layer protocols ~ is based on the concept of redundancy(VRC, LRC, CRC …. )

Checksum Generator

Checksum Generator

At the sender ØThe unit is divided into K sections, each of n bits.

At the sender ØThe unit is divided into K sections, each of n bits. ØSection 1 and 2 are added together using one’s 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

At the receiver Ø The unit is divided into k sections, each of n

At the receiver Ø The unit is divided into k sections, each of n bits. Ø All sections are added together using one’s complement to get the sum. Ø The sum is complemented. Ø If the result is zero, the data are accepted: otherwise, they are rejected.

Example (At a sender ) • Original data : 10101001 00111001 -------11100010 Sum 00011101

Example (At a sender ) • Original data : 10101001 00111001 -------11100010 Sum 00011101 Checksum (1’s Complement) 10101001 00111001 00011101 sending data

 • Example ( At a receiver) Received data : 10101001 00111001 00011101 -------1111

• Example ( At a receiver) Received data : 10101001 00111001 00011101 -------1111 Sum 0000 Complement

Performance âThe checksum detects all errors involving an odd number of bits. âIt detects

Performance âThe checksum detects all errors involving an odd number of bits. âIt detects most errors involving an even number of bits. âIf 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 and the receiver will not detect a problem.

Error Correction It can be handled in two ways: 1) receiver can be retransmit

Error Correction It can be handled in two ways: 1) receiver can be retransmit the entire data unit. 2) The receiver can use an error-correcting code, which automatically correct certain errors.

Single-bit error correction To correct an error, the receiver reverses the value of the

Single-bit error correction To correct an error, the receiver reverses the value of the altered bit. To do so, it must know which bit is in error. Number of redundancy bits needed • Let data bits = m Redundancy bits = r Total message sent = m+r The value of r must satisfy the following relation: 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

Hamming Code • developed by R. W. Hamming • It applied to data units

Hamming Code • developed by R. W. Hamming • It applied to data units of any length uses the data & redundancy bits. • 7 bit data require 4 bit redundancy placed in 1, 2, 4, 8 positions of redundancy bits in Hamming code

 • each r bit is the VRC bit for one combination of data

• each r bit is the VRC bit for one combination of data bits r 1 r 2 r 4 r 8 = = bits 1, 3, 5, 7, 9, 11 bits 2, 3, 6, 7, 10, 11 bits 4, 5, 6, 7 bits 8, 9, 10, 11

Calculating the r values Calculating even parity bit

Calculating the r values Calculating even parity bit

Error Detection and Correction

Error Detection and Correction

Error detection using Hamming Code

Error detection using Hamming Code

Ø Multiple-Bit Error Correction • redundancy bits calculated on overlapping sets of data units

Ø 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