HW 5

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

CSCI 356 Computer Networking Name:_____________________

Homework 5

 Solve this homework individually. This is not a group assignment.


 Cite your sources. As usual, you are allowed to discuss strategies and general questions with other
students, and you may consult public literature (books, articles, web sites) for information. However, any
work you turn in must be your own. Cite each source of information you consult (except for me, the
course text, and the lecture notes).
 Turn in a hardcopy.

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:

NGET 500 bytes HTTP request headers size


NOK 500 bytes HTTP response headers size
NBODY 4500 bytes HTTP response body size
MSSTCP 1200 bytes TCP maximum segment size
NTCP 20 bytes TCP header size
NIP 20 bytes IP header size
NNET 60 bytes Network-layer (ethernet, etc.) headers
RTTmin 25 ms Minimum achievable round trip time, excluding processing, queueing, etc.
BW 1 Mbps Bandwidth of bottleneck link
Question 1. Complete the timeline showing the packets involved in this HTTP request and response, up to the
point when the last part of the response data arrives at host A. You can ignore packets involved in closing the
TCP channel. Label each packet with four things: flags (SYN, ACK, SYN+ACK, or NONE), seqno, ackno,
and TCP payload size. The first two packets are already shown. For example, the second packet has SYN and
ACK flags, seqno=187, ackno=392, and payloadlength=0. Be sure to account for the sizes of all headers,
including http, tcp, ip, and network, if needed. Assume there is no packet loss or packet reordering within
the network. State any other assumptions that you need to make.
Question 2. Using your timeline, calculate the total response time, measured from the start of the connection to
the point when the last part of the response data arrives at host A. This is the time the user is waiting for the web
page to appear in their browser. You should account for packet transmission time, packet propagation time, and
TCP congestion control (sliding windows). Also account for sizes of all headers (HTTP, TCP, IP, and network)
where appropriate. If you make any assumptions about queuing in the network, say so. You may make
reasonable simplifying assumptions so long as you state them.

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 6. Roughly how long did you spend on this assignment?

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).

You might also like