CSE3300: Computer Networking
Homework 4
Due Date: October 28, 2019. Submission through HuskyCT.
1. Checksum (10 points). UDP and TCP use 1s complement for their checksums. Suppose you have the following three 8-bit sequences: 01010101,01110000,01001100. What is the checksum over the three bit sequences? (Note that although UDP and TCP use 16-bit words in computing the checksum. In this problem, for simplicity, we consider 8-bit summands.) Show all work. How does the receiver detect errors using checksum? Is it possible that a 1-bit error will go undetected? How about a two-bit error?
2. Principle of reliable data transfer (10 points). Use an example to show that the receiver in Fig. 1, when operating with the sender in rdt2.1 (in slides) can lead the sender and receiver to enter a deadlock state, where each is waiting for an event that will never occur. To illustrate the example, draw a time sequence graph that shows the sender on the left-hand side and the receiver on the right-hand side, mark time flow from the top to the bottom.
3. Go-Back-N and Selective Repeat (9 points). Does Go-Back-N or Selective Repeat use bandwidth more efficiently? Give an example to justify your answer. (Hint: you can show a time sequence graph for Go-Back-N and the corresponding time sequence graph for Selective Repeat to illustrate the points.)
4. TCP congestion control. (20 points) Consider Fig. 2, which plots TCP window size as a function of time. Answer the following ques- tions. For all the questions, please briefly justify your answer.
a. Identify the intervals of time when TCP slow start is operating. 1
rdt_rcv(rcvpkt) && (corrupt(rcvpkt)||has_seq1(rcvpkt))
sndpkt = make_pkt(NAK, chksum) udt_send(sndpkt)
Wait for 0 from below
Wait for 1 from below
rdt_rcv(rcvpkt) && (corrupt(rcvpkt)||has_seq0(rcvpkt))
sndpkt = make_pkt(NAK, chksum) udt_send(sndpkt)
rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && has_seq0(rcvpkt)
extract(rcvpkt,data) deliver_data(data)
sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt)
rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) && has_seq1(rcvpkt)
extract(rcvpkt,data) deliver_data(data)
sndpkt = make_pkt(ACK, chksum) udt_send(sndpkt)
Figure 1: An incorrect receiver protocol for rdt2.1.
b. Identify the intervals of time when TCP congestion avoidance is
operating.
c. After the 16th transmission round, is segment loss detected by a triple duplicate ACK or a timeout?
d. After the 22nd transmission round, is segment loss detected by a triple duplicate ACK or a timeout?
e. What is the initial value of ssthresh at the first transmission round?
f. What is the value of ssthresh at the 18th transmission round?
g. What is the value of ssthresh at the 24th transmission round?
h. Duringwhattransmissionroundisthe70thsegmenttransmitted?
i. Assuming a packet loss is detected after the 26th round by the receipt of a triple duplicate ACK, what will be the value of the congestion-window size and ssthresh?
j. Calculate the average throughput for this TCP flow. Assume that RTT is 100 ms and each TCP segment is 1460 bytes.
2
45
40
35
30
25
20
15
10
5 0
1 3
5 7
9
11 13 15 17 19 21 23 25
Transmission round
Figure 2: Evolution of TCP congestion window over time.
5. TCP in action. (24 points) Work on TCP wireshark lab (posted in HuskyCT), problems 1-6.
6. TCP sequence numbers and ACK numbers. (27 points) Hosts A and B are communicating over a TCP connection, and Host B has already received from A all bytes up through byte 126. Suppose Host A then sends two segments back-to-back to Host B, with 800 and 400 bytes of data in the first and second segments, respectively. In the first segment, the sequence number is 127 (for simplicity, we assume the sequence number starts from 0, although it typically starts with a random number in practice), the source port number is 50002, and the destination port number is 80. Host B sends an ACK to A whenever it receives a segment from A.
a. (9 points) In the second segment from A to B, what is the se- quence number, source port number, and destination port num- ber?
b. (9 points) Suppose the first segment arrives at B earlier than the second segment. In the ACK for the first arriving segment
3
Congestion window size (segments)
from B to A, what is the ACK number, source port number, and destination port number?
c. (3 points) Now suppose the second segment arrives at B earlier than the first segment (i.e., the two segments arrive out of order). In the ACK for the first arriving segment from B to A, what is the ACK number?
d. (3 points) Now suppose the first segment is lost and the second segment arrives at B. In the ACK for the arriving segment from B to A, what is the ACK number?
4
Reviews
There are no reviews yet.