2. Error detection¶
In digital electronics, extra data can be added to the information sent over a noisy channel, to detect if the transmission of information has been correct or if an error has occurred.
The error detection adds a small information overload with extra bits called redundancy.
When transmitting data over the Internet or mobile data network, if an error occurs and is detected, the computer will ask again to resend the information until the correct version arrives without errors.
Parity bits¶
The simplest system to add redundancy to detect errors is the parity bit. This bit has a value that makes the number of total bits to one always even.
For example, if the data sent has 3 bits to one, the parity bit will also be one so that the total number of bits to one is 4 (even number).
In the following figure you can see several examples of correct parity bits, sent along with their information byte.
If the final parity is odd, that means that some of the information bits have changed during transmission and therefore an error has occurred.
This system recognizes the change of a single bit of information. If changes occur in two bits at a time, the parity control system will not be able to recognize the error.
Checksum¶
The checksum, also called checksum, is a data added to the information data that aims to detect transmission errors more accuracy than a single parity bit.
There are several versions:
- Add the value of all bytes of information transmitted. It is the simplest version to perform and the least capable of detecting errors.
- Cyclic redundancy codes or CRC. They are codes that usually have a length of 16 or 32 bits and are capable of detecting more errors than a simple sum. On the other hand, its calculation is more complex.
- Advanced hash functions, such as SHA. They are codes that usually have a length of more than 128 bits (16 bytes) and are very expensive to calculate. On the other hand, they are the most powerful and are used to detect random errors and also errors introduced on purpose by a cybercriminal.
These checksums are widely used in remote communication lines and in digital media such as CD-ROM or USB flash drives.
Exercises¶
What is error detection for?
What is the extra information added to detect data transmission errors called?
Of the following data received, which ones have errors and why?
Write the parity bit corresponding to the following binary numbers:
0 1 0 1 0 1 0 1 1 1 1 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 0
What is a checksum code?
List three different types of checksums.
Write two examples of systems that use the checksum code.