Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question: The following code can be used to compute the checksum of a set of 16-bit binary numbers u_short_cksum(u_short buf, int count) f register w.ong.sum=0;

image text in transcribed

Question: The following code can be used to compute the checksum of a set of 16-bit binary numbers u_short_cksum(u_short "buf, int count) f register w.ong.sum=0; while (count- sumt-"buftt if (sum & 0xFFFF0000) { sum&=0xFFFF; sum+t; return (sum&0xFFFF); (i) Provide comments for each line in the above code explaining what the line does. Why should the variables be unsigned? Why is the buf short and the sum long? Implement the code on a platform of your choice. Make necessary changes in the code to make it compatible with the compiler you would be using. Run the code to calculate both UDP checksum (from Credit Hw #2) and TCP checksum by inputting all the data needed and verify your hand calculations. Question: The following code can be used to compute the checksum of a set of 16-bit binary numbers u_short_cksum(u_short "buf, int count) f register w.ong.sum=0; while (count- sumt-"buftt if (sum & 0xFFFF0000) { sum&=0xFFFF; sum+t; return (sum&0xFFFF); (i) Provide comments for each line in the above code explaining what the line does. Why should the variables be unsigned? Why is the buf short and the sum long? Implement the code on a platform of your choice. Make necessary changes in the code to make it compatible with the compiler you would be using. Run the code to calculate both UDP checksum (from Credit Hw #2) and TCP checksum by inputting all the data needed and verify your hand calculations

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

=+5. Develop an upbeat closing.

Answered: 1 week ago

Question

2. (1 point) Given AABC, tan A b b

Answered: 1 week ago

Question

Was there an effort to involve the appropriate people?

Answered: 1 week ago

Question

18. If you have power, then people will dislike and fear you.

Answered: 1 week ago