Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

UDP and TCP use 1s complement for their checksums. Suppose you have the followin

ID: 3679263 • Letter: U

Question

UDP and TCP use 1s complement for their checksums. Suppose you have the following three 8-bit bytes: 11011011, 01011001, 01100110. What is the 1’s complement of the sum of these 8-bit bytes? (Note that although UDP and TCP use 16-bit words in computing the checksum, for this problem you are being asked to consider 8-bit sums.) Show all work. Why is it that UDP takes the 1’s complement of the sum; that is, why not just use the sum? With the 1s complement scheme, how does the receiver detect errors? Is it possible that a 1-bit error will go undetected? How about a 2-bit error?

Explanation / Answer

Note, wrap around if overflow

   1 1 0 1 1 0 1 1

+ 0 1 0 1 1 0 0 1

=0 0 1 1 0 1 0 0,

   0 0 1 1 0 1 0 0

+ 0 1 1 0 0 1 1 0

=1 0 0 1 1 0 1 0

To detect errors, the receiver adds the four words (the three original words and the checksum). If the sum contains a zero, the receiver knows there has been an error. All one - bit errors will be detected, but two - bit errors can be undetected (e.g., if the last digit of the first word is converted to a 0 and the last digit of the second word is converted to a 1).