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?
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.
Find the decimal equivalents for the following 8-bit two’s complement numbers. a. 0010 0100 Decimal Equivalent...
Find the decimal equivalents for the following 8-bit two’s complement numbers. a. 0010 0100 Decimal Equivalent ___________ b. 1010 1001 Decimal Equivalent ___________ c. 1100 0011 Decimal Equivalent ___________ d. 0101 0101 Decimal Equivalent ___________
1. What is the two’s complement of: 00110101 2. Carry out the following calculation using 8-bit...
1. What is the two’s complement of: 00110101 2. Carry out the following calculation using 8-bit signed arithmetic (convert to 8-bit binary sequences) and use two’s complement for the negative number, give the result as both an 8-bit binary sequence and in base 10: 127 – 74. 3. What does shifting a binary sequence to left by 3 places correspond to (from the arithmetic standpoint)
Suppose you have an 8-bit A/D converter that has a full-scale input range of ︎2V to...
Suppose you have an 8-bit A/D converter that has a full-scale input range of ︎2V to ︎6V. When a particular voltage is applied, the computer records the hex number B3. Assuming a perfect calibration, answer the following questions: - What output voltage does this value correspond to? - What is the digitization (quantization) error in the voltage? - By how much percent would this error change if 12 bits were used to approximate the output instead of 8 bits? PLEASE...
1. Consider running real-time traffic, like VoIP, over a TCP or UDP socket. Why might you...
1. Consider running real-time traffic, like VoIP, over a TCP or UDP socket. Why might you prefer to run such an application using a UDP transport layer? 2. Consider running real-time traffic, like VoIP, over a TCP or UDP socket. Suppose you chose to use TCP for your application; what would you need to do to ensure that the robust transport algorithm does not harm real-time performance?
Binary How is 00001001 (base 2) represented in 8-bit two’s complement notation? Convert 0.3828125 to binary...
Binary How is 00001001 (base 2) represented in 8-bit two’s complement notation? Convert 0.3828125 to binary with 4 bits to the right of the binary point. How is 00110100 (base 2) represented in 8-bit one's complement.  
Write -127 as 8 bit signed binary number both using 2'complement and sign/magnitude notation.
Write -127 as 8 bit signed binary number both using 2'complement and sign/magnitude notation.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT