3.4.6+Data+integrity

= **__Data Integrity__** = Due to interferences data can be altered in the process of transmission. To ensure that this is not the case there are two main ways of checking the data integrity.

**Parity checking** There are two types of parity, **even** and **odd**.
 * Even parity: if the number of bits set to 1 in a piece of data transmitted is odd, then the parity bit will be set to 1 to make the number of bits set to 1 even. Otherwise, when the number of bits set to 1 is already even, the parity bit is set to 0. This way the receiving device can spot an error if it detects that the number of transmitted bits is odd. If there is an error detected, a new set of data can be requested.
 * Odd parity: the same as in even parity only that the number of bits set to 1 is odd.

Example:
 * Data ||= Number of ones ||= Parity bit (even parity) ||= Parity bit (odd parity) ||
 * 00101110 ||= 4 ||= 0 ||= 1 ||
 * 10101101 ||= 5 ||= 1 ||= 0 ||
 * 11110110 ||= 6 ||= 0 ||= 1 ||
 * 11111110 ||= 7 ||= 1 ||= 0 ||
 * 00010011 ||= 3 ||= 1 ||= 0 ||

Checksums sums, which are calculated by applying an algorithm to the data sent. From each set of data a certain checksum is generated that way. The data sent is then sent together with the checksum and the receiving device can calculate the checksum from the data received using the same algorithm the sending device used. If the checksums are the same, it means that there was most probably no error while transmitting. If the checksums aren't the same then the receiving device knows that an error occurred during the transmission.
 * Checksums ( =** **has****h sums)**
 * For example a block character check, which is one type of check sum, a certain block character check is placed after a fixed number of blocks. For example:
 * H || e || l || l || CHECK || o || h || o || w || CHECK || a ||

Last update: 31. January 2011 Written by: Jocbe

Sources:
 * "7.8. Checksums." Wireshark · Go Deep. Web. 31 Jan. 2011. .
 * Jones, Richard. Computer Science Java Enabled. Victoria: IBID Press, 2004.