2.2 Methods of Error Detection
2.2 Methods of Error Detection
• In all these cases, the byte has clearly been corrupted, but the bytes have retained even parity.
Therefore, no error would be flagged in spite of the obvious errors in transmission.
• Clearly it will be necessary to have other ways to complement parity when it comes to error checking to
ensure errors are never missed.
Parity blocks.
• In this method, a block of data is sent and the number of 1-bits are totalled horizontally and vertically.
Example: In this example, nine bytes of data have been transmitted. Agreement has been made that even
parity will be used.
• Another byte, known as the parity byte, has also been sent. This byte consists entirely of the parity bits
produced by the vertical parity check. The parity byte also indicates the end of 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.
The checksum process is as follows:
» when a block of data is about to be transmitted, the checksum is calculated from the block of data
» the calculation is done using an agreed algorithm (this algorithm has been agreed by sender and
receiver)
» the checksum is then transmitted with the block of data
» at the receiving end, the checksum is recalculated by the computer using the block of data (the agreed
algorithm is used to find the checksum)
» the re-calculated checksum is then compared to the checksum sent with the data block
» if the two checksums are the same, then no transmission errors have occurred; otherwise a request is made
to re-send the block of data.
Echo check
• With echo check, the sending computer transmits the data to the receiver,
» a copy of the data is sent back 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.
Check digits
• A check digit is the final digit included in a code; it is calculated from all the other digits in the code.
• Check digits are used for barcodes on products, such as International Standard Book Numbers (ISBN) and
Vehicle Identification Numbers (VIN).
• Check digits are used to identify errors in data entry caused by mis-typing or mis-scanning a barcode.
They can usually detect the following types of error:
» an incorrect digit entered, for example 5327 entered instead of 5307
» transposition errors where two numbers have changed order, for example 5037 instead of 5307
» omitted or extra digits, for example 537 instead of 5307 or 53107 instead of 5307
» phonetic errors, for example 13 (thirteen), instead of 30 (thirty).
• Two common methods used to calculate chech digits are:
» ISBN 13
» Modulo-11
ISBN 13
Calculation 1 – Generation of the check digit from the other 12 digits in a number
The following algorithm generates the check digit from the 12 other digits:
1 add all the odd numbered digits together
2 add all the even numbered digits together and multiply the result by 3
3 add the results from 1 and 2 together and divide by 10
4 take the remainder, if it is zero then use this value, otherwise subtract the remainder from 10 to find the
check digit.
Using the ISBN 9 7 8 0 3 4 0 9 8 3 8 2
Calculation 2 – Re-calculation of the check digit from the thirteen-digit number (which now includes the
check digit)
• To check that an ISBN 13-digit code is correct, including its check digit, a similar process is followed:
1 add all the odd numbered digits together, including the check digit
2 add all the even number of digits together and multiply the result by 3
3 add the results from 1 and 2 together and divide by 10
4 the number is correct if the remainder is zero.
Using the ISBN 9 7 8 0 3 4 0 9 8 3 8 2 9 (including its check digit) :
1 9 + 8 + 3 + 0 + 8 + 8 + 9 = 45
2 3 × (7 + 0 + 4 + 9 + 3 + 2) = 75
3 (45 + 75)/10 = 120/10 = 12 remainder 0
4 remainder is 0, therefore number is correct.
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 (this is the time interval allowed to elapse before an
acknowledgement is received)
» the receiving device receives an error detection code as part of the data transmission; this is used to
detect whether the received data contains any transmission errors
» if no error is detected, a positive acknowledgement is sent back to the sending device
» however, if an error is detected, the receiving device now sends a negative acknowledgement to the
sending device and requests re-transmission of the data
» a time-out is used by the sending device by waiting a pre-determined amount of time ….
» ... and if no acknowledgement of any type has been received by the sending device within this time limit,
it automatically re-sends the data until a positive acknowledgement is received ….
» ... or until a pre-determined number of re-transmissions has taken place
» ARQ is often used by mobile phone networks to guarantee data integrity.