Question

In: Computer Science

UDP and TCP use 1s complement for their checksums. Suppose you have the following three 8-bit...

UDP and TCP use 1s complement for their checksums. Suppose you have the following three 8-bit bytes: 01010011, 01100110, 01110100.

a) What is the 1s 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.)

b) Why is it that UDP takes the 1s complement of the sum; that is, why not just use the sum?

c) 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?

Solutions

Expert Solution

The given binary-words are 01010011, 01100110, 01110100

(a) the sum is...

Add the first two binary-words...

0 1 0 1 0 0 1 1

+ 0 1 1 0 0 1 1 0   

---------------------------------

1 0 1 1 1 0 0 1

Add the result to the third binary-word...

1 0 1 1 1 0 0 1

+ 0 1 1 1 0 1 0 0   

---------------------------------

1 0 0 1 0 1 1 0 1

Carry 1....

Add the carry to the last significant digit of the sum

0 0 1 0 1 1 0 1

+ 1

----------------------------------

0 0 1 0 1 1 1 0

Invert all bits of the result i.e 1's to 0's and 0's to 1's to find the 1's compliment...

1's compliment of the sum is... 1 1 0 1 0 0 0 1

(b)

Reason why UDP takes 1's compliment of the sum is...

--> 1's compliment of the sum gives the checksum of UDP , but the only sum doesn't give the checksum of UDP.

(c)

To detect the errors , receiver adds four words including the checksum , result should be all bits 1. If it has a single zero then receiver knows that there is an error...

1-bit error will never go undetected, but 2-bit error can go undetected , like if the last digit of the 1st word is converted to 0 and the last digit of the 2nd word is converted to 1.


Related Solutions

List three applications that use UDP and three applications that use TCP and explain why those...
List three applications that use UDP and three applications that use TCP and explain why those applications use the selected Transport layer protocol.
What is the difference between TCP and UDP? Why would you use one over the other?...
What is the difference between TCP and UDP? Why would you use one over the other? Why have other nations enjoyed faster broadband speeds, greater availability, and lower prices? What advantages could broadband offer to underserved areas of the world? Is Internet access important for economic development? Why or why not?
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Represent -34 and +67 in the following way: a) 8 bit 1's complement representation.
Represent -34 and +67 in the following way: a) 8 bit 1's complement representation.
Discuss how demultiplexing is carried out using TCP and UDP. (8 marks) Please make a table,...
Discuss how demultiplexing is carried out using TCP and UDP. Please make a table, one side FULLY explaining how demultiplexing is carried out using TCP and the other side FULLY explaining how demultiplexing is carried out using UDP.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT