Methods of Error Detection

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

2.

2 - Methods of error detection


2.2.1 - The need to check for errors
Errors can occur during data transmission due to:
Interference (all types of cable can suffer from electrical interference, which can cause data
to be corrupted or even lost)
Problems during packet switching (can lead to data loss - or possible to gain data)
Skewing of data (occurs during parallel data transmission and can cause data corruption if
the bits arrive out of synchronisation)

2.2.2 - Parity checks, checksum, and ecocheck


Parity checks:
Parity checking is one method used to check whether data has been changed or corrupted
following data transmission. This method is based on the number of 1-bits in a byte of data.
The parity can be either called even (that is, an even number of 1-bits in the byte) or odd
(that is an odd number of 1-bits in the byte). One of the bits in the byte is reserved for a
parity bit. Before data is transferred, an agreement is made between sender and receiver
regarding which type of parity is being used. The parity bit is set according to which party is
being used.

Even parity
11001100 - first 1 is the parity bit

Odd parity
01100001 - first 0 is the parity bit

If a bye has been transmitted from A to B and if even parity is used from the sender’s byte
and odd parity was received by the receiver an error would be flagged. If even parity had
been agreed between sender and receiver, then a change in parity in the receiver byte
indicates that a transmission error has occurred.

Even though a byte has been corrupted, it may still retain the parity (even/odd).
It is difficult to identify the exact position of the corrupted bit and byte.

If two of the bits change value following data transmission, it may be impossible to locate the
error using parity checking and no error would be flagged.

How to check where the error has occurred:


Nine bytes of data have been transmitted. Even parity is being used. Another byte, known as
the parity byte that consists of all the parity bits produced by the vertical parity check has
also been sent. Parity byte indicates end of data block. Necessary to check the parity of
each byte horizontally (byte 1 to 9) and vertically (bits 1 to 8) each row where the parity has
been changed should be flagged.

At the intersection of the row and column, is the position of the incorrect bit value. If it is 1
change it to 0 and if it's 0 change to 1.

If this isn't corrected an error message would be relayed back to the sender asking them to
re-transmit the block of data
Checksum:
A Checksum is a method used to check if data has been changed or corrupted following
data transmission. Data is sent in blocks, and an additional value, called the checksum, is
sent at the end of the block of data.

Checksum process:
When a block of data is about to be transmitted, checksum is calculated from block of data.

Calculation is done using an agreed algorithm (agreed by sender and receiver).

Checksum is then transmitted with the block of data.

At the receiving end checksum is re-calculated by the computer using the block of data.
Re-calculated checksum then used to compare checksum sent with the data block.

If two checksums are the same, no transmission errors have occurred, otherwise a request
is made to re-send block of data

Echocheck:
Echo check is an error detection method.

Echocheck process:
Sender sends the data to another device (Receiver).
The receiver re-sends the data to the sender.
The returned data is compared with the original data by the sender’s computer.
If there are no differences, then the data was sent without error.
If the two sets of data are different, then an error occurred at some stage during the data
transmission.

Drawbacks of echocheck:
It is difficult to predict whether an error had occurred while sending the data (from sender to
receiver) or while checking the data (data from the receiver to the sender). Hence this
method is not reliable.

2.2.3 - Check digits


A check digit is the final digit included in a code, calculated from all the other digits in the
code. They are used for barcodes on products such as International Standard Book
Numbers (ISBN) and Vehicle Identification Numbers (VIN)

Check digits are used in identifying errors in data entry caused by mis-typing or
mis-scanning a barcode. They can usually detect the following types of errors:
- Incorrect digit entered
- Transposition errors where two numbers have changed order
- Omitted or extra digits
- Phonetic errors, for example 13 (thirteen) and 30 (thirty)
Common methods to generate a check digit:
- ISBN 13
- Modulo-11
ISBN 13:
Check digit in this is the 13th digit in the number.

Generation of check digit from other 12 digits in a number:


Add all the odd numbered digits
Add all the even numbered digits and multiply the result by 3
Add results from 1 and 2 and divide by 10
If the remainder is zero then use this value, otherwise subtract remainder from 10

Re-calculation from the 13th digit:


Add all the odd numbered digits together, including the check digit
Add all the even numbers and multiply by 3
Add results from 1 and 2 and divide by 10
Number is correct if remainder is zero

Modulo-11:
Generation of the check digit from the other digits in the number:
Each digit given a weight of 8, 7, 6, 5, 3 or 2 starting from the left (weightings start from 9
because check digit going to be the 8th digit because 7 digit number)
Digit is multiplied by its weighting and then each value is added to make a total
Total is divided by 11
Remainder subtracted from 11 to find the check digit

Re-calculation of the check digit from the 8th digit in the number:
Each digit in the number is now given a weighting of 8, 7, 6, 5, 4, 3, 2, 1
Digit is multiplied by its weighting and then each value is added to make a total
Total is divided by 11
Number is correct if remainder is zero

2.2.4 - Automatic repeat requests (ARQs):


ARQ uses positive and negative acknowledgements (messages sent to the receiver
indicating that data has/has not been received correctly) and timeout is the time interval
allowed to elapse before the acknowledgement

Receiving device receives an error detection code as part of the transmission (typically a
cyclic redundancy check) used to detect whether the received data contains any
transmission errors

If no error, a positive acknowledgment is sent

If an error is detected, a negative acknowledgment is sent stating that the data has to be
re-sent

A time out is used by sending devices by waiting a predetermined amount of time. No


acknowledgment of any type has been received by the sending device within this time limit,
automatically resends the data until a positive acknowledgment is received or until a
predetermined number of retransmissions has taken place. ARQ is often used by mobile
phone networks to ensure integrity.

You might also like