Carleton College CS 107, Explorations in Computer Science
Assignment:
Work through Laboratory 15, part 1, and turn in Exercises 1-3,
subject to the changes and clarifications below.
This applet seems to get easily confused if you stop and start
again. Whenever you are ready to send a message, first click the
Reload button in your web browser to reset the applet.
Here are some clarifications and rewrites for Exercise 1:
- Question 3: Each packet contains two lines. The first
line is the packet header, and the second line is the
packet data. Each character or blank in a packet counts for
one character, and all DAT packets except the last carry 10
characters in the packet data. The last one carries less, since there
may be less than 10 characters remaining in the message. ACK packets
have no characters at all in the packet data, though they still have
some in the packet header. For the example message, count how many
characters are sent in total, including packet headers and packet
data for all DAT and ACK packets.
- Question 4.5: Explain in your own words what overhead means. How
does overhead affect the speed at which your message is
transmitted?
- Question 5: You may make some simplifying assumptions here, if you
wish (such as all packet headers contain 10 characters, or something
like that). State whatever assumptions you make.
- Question 6: How would changing the size of the data portion of the
packets affect the overhead? Could changing the size of the packets to
improve overhead backfire? Under what conditions?
Here are some clarifications and rewrites for Exercise 2:
- Question 5: Now try deleting some ACK packets. What happens
- Question 6: Why don't any NAK packets appear? How can you make the
applet produce NAK packets?
- Question 7: The applet doesn't let you do this, but what if a NAK
packet gets damaged? How should the sender handle it?
Here are some clarifications and rewrites for Exercise 3:
- Question 1-3: Calculate the checksum as TCP/IP for the first
packet in the sample message, the one that has the data "A very
lon". Using the "Text Translator into ASCII" applet from Lab 3b, type
in the characters from the data packet, and click on translate
text. Write down the ASCII codes (in decimal) that you see.
- Questions 4-5: Add up all the codes above, then find the remainder
when you divide by 256. Show your work. This should be the same as the
checksum in the packet. Is it?
- Question 6: Now suppose that the packet was damaged so that
instead the data read "A verX lon". Re-compute the checksum. What do
you get?
- Question 7: Give an example of a corrupted version of the data "A
very lon" that will still have the same checksum as the undamaged
version. A corrupted packet could corrupt more than one character
at once.