Starting from:

$29

CS 118 : Homework 4

CS 118 : Homework 4
Problem 1
Host A and B are communicating over a TCP connection, and Host B has already received from A all bytes
up through byte 326. Suppose Host A then sends two segments to Host B back-to-back. The first and second
segments contain 80 and 40 bytes of data, respectively. In the first segment, the sequence number is 327,
the source port number is 40200, and the destination port number is 80. Host B sends an acknowledgment
whenever it receives a segment from Host A. Fill in the blanks for questions (a) – (c) directly; work out the
diagram in the box for question (d).
(a) In the second segment sent from Host A to B, the sequence number is , source port number is
, and destination port number is .
(b) If the first segment arrives before the second segment, in the acknowledgment of the first arriving
segment, the ACK number is , the source port number is , and the destination port
number is .
(c) If the second segment arrives before the first segment, in the acknowledgment of the first arriving
segment, the ACK number is .
(d) Suppose the two segments sent by A arrive in order at B. The first acknowledgment is lost and the
second acknowledgment arrives after A’s timeout intervals for both the first and the second packets.
Draw a timing diagram in the box below, showing these segments and acknowledgments until A receives all the acknowledgments of re-transmitted packets. Assume no additional packet loss. For each
segment in your diagram, provide the sequence number and the number of bytes of data; for each
acknowledgment that you add, provide the ACK number.
Write your solution to Problem 1 in this box
Page 1 of 5
CS 118 Spring 2020 : Homework 4
Problem 2
One of the three functions of a sliding window scheme is the orderly delivery of packets which arrive out of
sequence. In Go-back-N, the receiver drops packets which arrives out of order. Assume the receiver sends
an ACK for every packet it receives.
(a) In Go-back-N, what is the required buffer size (receiver’s window size, RWS) at the receiver if sender’s
window size (SWS) = 23? What the answer will be in Selective Repeat?
(b) In sliding window with SWS = RWS = 5, the minimum required SeqNumSize (the number of available
sequence numbers) is 10. Calculate the minimum required SeqNumSize for
(i) a sliding window scheme with SWS = 6 and RWS = 3
(ii) a Go-back-N scheme with SWS = 6
Write your solution to Problem 2 in this box
Page 2 of 5
CS 118 Spring 2020 : Homework 4
Problem 3
Suppose that three measured SampleRTT values are 106 ms, 120 ms, and 150 ms. Compute the EstimatedRTT after each of these SampleRTT values is obtained, assuming that the value of EstimatedRTT was
100 ms just before the first of these three samples were obtained. Compute also the DevRTT after each
sample is obtained, assuming the value of DevRTT was 5 ms just before the first of these three samples
was obtained. Last, compute the TCP TimeoutInterval after each of these samples is obtained. Round your
calculation results to two decimals (e.g., 123.45).
Write your solution to Problem 3 in this box
Page 3 of 5
CS 118 Spring 2020 : Homework 4
Problem 4
Compare Go-Back-N, Selective Repeat, and TCP (no delayed ACK). Assume that timeout values for all
three protocols are sufficiently long, such that 10 consecutive data segments and their corresponding ACKs
can be received (if not lost in the channel) by the receiving host (Host B) and the sending host (Host A),
respectively. Suppose Host A sends 10 data segments to Host B, and the 6th segment (sent from A) is lost.
In the end, all 10 data segments have been correctly received by Host B.
(a) How many segments has Host A sent in total and how many ACKs has Host B sent in total? What
are their sequence numbers? Answer this question for all three protocols.
(b) If the timeout values for all three protocols are very long (e.g., longer than several RTTs), then which
protocol successfully delivers all 10 data segments in shortest time interval?
Write your solution to Problem 4 in this box
Page 4 of 5
CS 118 Spring 2020 : Homework 4
Problem 5
As we have discussed in the class, a timer is a useful component in various protocol designs: because a
communicating end cannot see what is going on either inside the network or at the other end, when needed
it sets up an ”alarm”, and takes some action when the alarm goes off.
(a) Does HTTP (not considering the underlying TCP) use any timers? If so, please briefly describe how
each is used. If not, please explain why it does not need one.
(b) Does DNS use any timers? If so, please briefly describe how each is used. If not, please explain why it
does not need one.
(c) Does TCP use any timer? If so, please briefly describe how each is used. If not, please explain why it
does not need one.
(d) Does UDP use any timer? If so, please briefly describe how each is used. If not, please explain why it
does not need one.
Write your solution to Problem 5 in this box
Page 5 of 5

More products