You are on page 1of 2

Error Detection

Error detection protocols are used to find transmission errors. If an error is found the
protocol you are using will decide how to fix it.

Parity Check

Parity is a character error detection method. The parity check adds an extra bit to every
character or byte transmitted. Seven bits are used for each ASCII character and the eighth
bit in the byte is used to check the accuracy of the transmission. The eighth bit is the
parity bit. Both sending and receiving devices must agree on which parity checking
method will be used. The two most common methods are called odd and even parity.

If the agreed method is even parity, then the sending device counts the number of 1’s in a
character and adds a parity bit of 1 or 0 to make the total an even number of 1’s. The
receiving device does the same calculation, including counting the parity bit, and if it also
gets an even number of 1’s then the data sent is assumed to be correct.

Agreed Parity Data Byte Added Reason


Method (7 bit) Parity bit
Even 1000001 0 Data byte + parity bit = an even number of 1s
1000011 1
Odd 1000001 0 Data byte + parity bit = an odd number of 1s
1000011 1

Parity is unreliable because it only detects about half the errors that can occur when a
byte is transmitted. A common transmission error is bit swapping. If one of the 1’s in the
data byte shown above is swapped with one of the 0’s, then the parity would not change
and the error would not be detected. For this reason, parity is rarely used for error
detection in modern communication links.

Despite this, the word ‘parity’ is still widely used in communication systems. A common
abbreviation used to describe a data byte prepared for transmission is ‘8N1’ – which
means 8 data bits, no parity and 1 stop bit.

Checksum

Checksum is the first and simplest of the block error detection methods. Block methods
rely on dividing a message up into blocks or ‘packets’ of bytes and testing the accuracy
of each block, rather than each individual byte. This speeds up the data flow.

Checksum is a more reliable error detection method than the parity check.
In the above figure, the transmitting computer sends its calculated checks um as the last
byte of the data block. The receiving computer performs exactly the same calculation on
all bytes it receives and compares its block checksum with the one sent by the other
computer. If the two values are different then an error has been detected.

While the checksum method will detect over 90% of transmission errors, it does not
reveal which byte or bytes in the block are faulty. This means that the entire block will
have to be retransmitted to fix the error.

Checksum is not a reliable error detection method for long message blocks, so it is not
longer used in modern communication protocols.

Cyclic Redundancy Check

CRC, like checksum, is a block error detection method. CRC cannot reveal which byte or
bytes in a block are faulty.

The transmitted data is treated as one large binary or hexadecimal sum rather than as
separate sums for each packet. The sum is then divided by a constant and the remainder
after this division is sent to the receiver. The receiver than works out the sum of the
transmitted data, divides it by the same constant and compares the remainder with the
data transmitted. Any mismatch signals an error.

The transmitting computer performs the CRC calculation and places the result, as either a
16-bit or 32-bit value, at the end of each block. The receiving computer performs the
same calculation and compares the answer with the one it receives.

CRC has a far greater reliability than checksum. The 16-bit CRC method will detect
99.998% of all possible errors. The 32-bit CRC method is even more reliable. It will
detect 99.99999977% of all possible errors. CRC is the preferred error detection method
in many communication protocols.

Dealing with Errors

There are several ways to correct detected transmission errors.


 Retransmission – the simplest and most common method, the character or block
is resent.
 Forward error-checking uses Hamming codes, statistical calculations that work
out the redundant data sent with a message that will allow it to be reconstructed if
error are found. The extra bits may considerably increase the size of the data.
 Symbol substitution doesn’t correct the error. Instead it uses a symbol or marker
in place of a character containing the error. This works well for text are there are
only a few errors and it is easy to determine what the correct message should have
been. It is not easy to use when numbers are involved.

You might also like