In a parity word, the sender divides a message into blocks of the same length. They then compute the bitwise XOR of all blocks and append that to the message, potentially flipping the bits. An alternative interpretation of the algorithm is that the sender appends parity bits such that the first parity bits is for the first bit of each block, the second for the second bit of each block, etc. The internet checksum implemented in IP and TCP is a variant that differs from a parity word in that instead of the bitwise XOR, binary addition with carries is used. As the two protocols are very similar, we discuss them together.
Note: Checksum is sometimes used to refer to any bits appended to the message for error detection. At other times, it is used to refer specially to the internet checksum. In this document, we will always refer to the latter as the internet checksum to avoid confusion.
The concrete algorithm works as follows: