SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
James F. Kurose, Keith W. Ross
Chapter:
The Link Layer: Links,access Networks, And Lans
Exercise:
Problems
Question:4 | ISBN:9780132856201 | Edition: 6

Question

Consider the previous problem, but instead suppose these 10 bytes contain

a. the binary representation of the numbers 1 through 10.

b. the ASCII representation of the letters B through K (uppercase).

c. the ASCII representation of the letters b through k (lowercase).

Compute the Internet checksum for this data.

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

The following steps are used to calculate the the Internet checksum for this data:

  • Take 16- bits integers and perform addition operation in setp 1.
  • Next, convert 1’s complement of final sum value in step 2.
  • This is final binary value is called the Internet checksum.

a)

The binary representation of the numbers 1 through 10:

Decimal to Binary

Numbers Binary
1 00000001
2 00000010
3 00000011
4 00000100
5 00000101
6 00000110
7 00000111
8 00001000
9 00001001
10 00001010

 

Now, calculate the Checksum by using above step 1 and step 2:

setp 1:

  • In above table contains 10 binary digits. Thuse divide five 16-bit integers categories and add it.

So, sum is 0001 1001 0001 1110

setp 2: Now, convert 1's complement for check sum result. 1's complement means convert 0's to 1's and 1's t0 0's.

0001 1001 0001 1110=>1110 0110 1110 0001

So, the Internet checksum for the binary representation of the numbers 1 through 10  is 1110 0110 1110 0001

b)

The ASCII representation of the letters B through K (uppercase) :

Upper characters to ASCII values
Letters ASCII
B 66
C 67
D 68
E 69
F 70
G 71
H 72
I 73
J 74
K 75

 

Now, convert ASCII values to binary representation:

ASCII value to Binary
ASCII Value Binary                                                    
66 01000010
67 01000011
68 01000100
69 01000101
70 01000110
71 01000111
72 01001000
73 01001001
74 01001010
75 01001011

Now calculate the checksum by using above step 1 and step2:

setp 1:

  • In above table contains 10 binary digits. Thuse divide five 16-bit integers categories and add it.

The sum is =01011111 01100011

setp 2: Now, convert 1's complement for check sum result. 1's complement means convert 0's to 1's and 1's t0 0's.

     01011111 01100011\rightarrow 10100000 10011100

So, the Internet checksum for the ASCII representation of the letters B through K (uppercase)  is 10100000 10011100

c)

The ASCII representation of the letters b through k (lowercase):

Lower charters to ASCII values
Letters ASCII
a 98
b 99
c 100
d 101
e 102
f 103
g 104
h 105
i 106
j 107

Now, convert ASCII values to binary representation:

ASCII value to Binary
ASCII Value Binary                    
98 01100010
99 01100011
100 01100100
101 01100101
102 01100110
103 01100111
104 01101000
105 01101001
106 01101010
107 01101011

Now calculate the checksum by using above step 1 and step2:

setp 1:

  • In above table contains 10 binary digits. Thuse divide five 16-bit integers categories and add it.

The sum is 11111111 11111011

setp 2: Now, convert 1's complement for check sum result. 1's complement means convert 0's to 1's and 1's t0 0's.

11111111 11111011\rightarrow 00000000 00000100

So, the Internet checksum for the ASCII representation of the letters b through k (lowercase) is 00000000 00000100

0 0

Discussions

Powered by Lun

LUNLUN=1+1> 1 lun carry> 0 > 1/0> Hence, the solution is undefine.

Post the discussion to improve the above solution.