HW 5
HW 5
HW 5
Homework 5
Note: TCP and UDP is the bulk of the second exam, with some DNS as well. Of those topics, TCP is the most
complex. TCP is full of surprises, so I expect it to be a challenge. For the exam, you should be familiar with
each one of these terms (what it means, how it is used in TCP, what tradeoffs it might entail, etc.):
Handshaking, SYN and FIN flags
TCP header, checksum, sender and receiver IP address, sender and receiver port number
The 4-tuple used to identify a connection
Packetization, sender queue, receiver queue, initial sequence numbers
Sequence number, acknowledgement number
Cumulative ACK, Piggybacked ACK
Delayed ACK
Congestion control, flow control
Receiver window, advertised window, congestion window, send window
Slow start, congestion avoidance, fast recovery, timeouts
Karn’s algorithm, RTT Probing, Exponential Weighted Moving Average (EWMA),
Exponential Backoff
Bandwidth Delay Product, Additive Increase Multiplicative Decrease (AIMD)
Triple-duplicate ACK
Congestion collapse, buffer bloat
Nagle's Algorithm
TCP Calculations
Host A uses TCP to connect to host B and sends an HTTP GET request. Host B accepts the TCP connection
and receives the request, and then sends an HTTP 200 OK response with some HTTP body. The following
parameters describe the conversation and the network path between A and B:
Question 3. Suppose the response data is much larger (e.g. NBODY=500MB), such that TCP reaches steady-state
behavior and the time spent in TCP connection establishment and slow start is negligible. If we want to saturate
the bottleneck link (near 100% utilization), what is the maximum end-to-end loss rate we can tolerate on this
network path? Use the analytic approximation (relating bandwidth, RTT, and loss rate) that we derived in class
and that is also given in the book.
Question 4. Processes A and B are exchanging data over a TCP connection. A has received all bytes up to
and including byte 7999 from B, B has received all bytes up to and including byte 4999 from A, and there
are no outstanding segments in the network. All segments sent between A and B have 20 byte TCP headers,
20 byte IP headers, and 60 bytes of other network-level headers. MSSTCP is 1200 bytes, as before.
Suppose the following events then occur:
(1) A sends B a TCP segment with a 100 byte payload;
(2) Upon receiving that, B responds with a segment with a 40 byte payload…
(3) … followed soon after by another segment with a 30 byte payload;
(4) Upon receiving (2) and (3), A responds with a segment with a 50 byte payload.
(a) Give the value of the sequence number and acknowledgement number fields for each segment.
(1) (A B): Seqno = ______________ Ackno = ______________
(2) (B A): Seqno = ______________ Ackno = ______________
(3) (B A): Seqno = ______________ Ackno = ______________
(4) (A B): Seqno = ______________ Ackno = ______________
(b) Suppose segment (2) is lost on its way to A, but segment (3) arrives at A on time. Must A resend packet
(1)? Why or why not?
(c) Again, suppose (2) is lost, but (3) arrives. Without knowing anything about A and B’s congestion
window sizes except what is evident from the above scenario, is it guaranteed that A will still be able to
send the final 50-byte payload immediately? Why or why not?
(d) Again, suppose (2) is lost, but (3) arrives. Suppose A does immediately send the final 50-byte payload.
What would A use in that final segment's sequence number and acknowledgement number fields?
(4') (A B): Seqno = ______________ Ackno = ______________
Question 5. Consider the following graphs showing a sender's TCP behavior over time. The first graph shows
the evolution of the sender's congestion window. The second graph shows the time each outgoing segment is
sent and its sequence number (blue diamonds), and the time each ACK is received along with its
acknowledgement number (red circles). Assume the receive window is large. Assume the MSS is 1 KB, all data
segments carry MSS bytes, and there is always data ready in the send queue to be sent from the application.
45
40
Congestion Window Size (KB)
35
30
25
20
15
10
0
0 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400
Time (ms)
80
70
60
Sequence Number (KB)
50
40
30
20
10
0
0 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400
Time (ms)
(a) What is the (approximate) RTT of this network path? Illustrate your answer by annotating one of
the graphs, as if the sender had performed an RTT probe around t=600ms.
(b) What is the approximate maximum rate (in bits per second, or bytes per second) at which the
sender appears able to transmit on it’s local network link. Illustrate your answer by annotating one of
the graphs.
(c) Does the bottleneck link for this network path appear to be close to the sender, close to the
receiver, or somewhere in the middle of the network? How can you tell?
(d) Which portion of the graph represents the slow start phase? Illustrate it on the graph.
(e) Which portion represents the congestion avoidance phase? Illustrate it on the graph.
(f) What was the initial ssthresh? Illustrate how you can tell by annotating the graph.
(g) What is happening around time t=900ms? Be specific: what likely happened to cause the apparent
change in the sender's behavior? What is the sender doing just before and just after t=900ms?
(h) Does the sender appear to be using TCP Reno, TCP Tahoe, or TCP Vegas? How can you tell?
Discussion Log
Question 7. What sources did you consult? Please submit a discussion log indicating the names of any students
you discussed the assignment with and (briefly) the nature of your discussion, along with a list of any public
sources you consulted (aside from the textbook).