(4) (10 pts) Both UDP and TCP use checksum to detect errors in the packet. (a) C
ID: 2248074 • Letter: #
Question
(4) (10 pts) Both UDP and TCP use checksum to detect errors in the packet. (a) Consider four types are sent out: 10010010 (byte 1), 01010011, 00001101, 00101100 (byte 4). Compute the checksum (using the 1's complement summation discussed in class) of the four bytes as given below 10010010 (byte 1) 01010011 00001101 00101100 (byte 4) Check Sum (b) Suppose the last bit in bytes 3 and 4 are inverted. Can this pattern be detected? (c) Checksum is based on addition. We can also use division to detect errors. An example of such a technique is the following: Treat the entire four bytes as an integer and divide it by 256. We then take the remainder as the checksum. The receiver will repeat the same division and get a remainder and compare it with the checksum. Will the error pattern given in (b) be detected? Explain. (c) If division is so much more powerful, why not use it to replace the addition-based checksum scheme?Explanation / Answer
Answer:-a) Adding the given four bytes of binary data we get result as 00011110 with a carry 1, adding the carry to the LSB we get 00011111. Taking one's complement we get checksum value as 11100000.
b) Changing last bit of byte3 and byte4 will make no change in checksum. If no change in checksum means no error, so we will get data with error.
c) Check sum using division is more accurate than checksum using addition. We use addition method because its a fast method of checking than division method, division method is slow but more accurate than addition method and can detect error even if 1, 2, 3, … bit changes.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.