Question: Need a JAVA program Consider a stream R of bits to send. An n-bit Internet Checksum of the stream S is computed as follows: 1)

Need a JAVA program Consider a stream R of bits to send. An n-bit Internet Checksum of the stream S is computed as follows: 1) Break the stream R of bits in n-bit words w1, w2, ..., and wm. 2) Compute the n-bit word S = w1 + w2, if there is a carry then set S = S + 1 3) Compute S = S + w3, if there is a carry then set S = S + 1 ........ n) Compute S = S + wn, if there is a carry then set S = S + 1 Finally, the Internet Checksum = ~S (one-complement of S) Example: suppose you must send the stream R = 01011100 01111010 00011010. To compute a 8-bit checksum, 1) Break the stream R of bits in 8-bit words w1, w2, ..., and wm. In this case, we will obtain: w1 = 01011100 and w2 = 01111010 w3 = 00011010 Go to Step 2.... Compute the n-bit word S = w1 + w2, if there is a carry then set S = S + 1 ..... How to check that your checksum is right?: if you add all words wi and the checksum, the sum should be equal to 111....1 (all ones).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!