Transport Layer Numerical
Transport Layer Numerical
CS 306:Computer Networks
a. What is the maximum window size (in segments) that this TCP
connection can achieve?
b. What is the average window size (in segments) and average
throughput (in bps) of this TCP connection?
c. How long would it take for this TCP connection to reach its
maximum window again after recovering from a packet loss?
Q8. In this problem, we consider the delay introduced by the TCP
slow-start phase. Consider a client and a Web server directly
connected by one link of rate R. Suppose the client wants to
retrieve an object whose size is exactly equal to 15 S, where S is
the maximum segment size (MSS). Denote the round-trip time
between client and server as RTT (assumed to be constant).
Ignoring protocol headers, determine the time to retrieve the
object (including TCP connection establishment) when
a. 4 S/R>S/R+RTT>2S/R
b. S/R+RTT>4 S/R
c. S/R>RTT.
Solutions
For Tutorial: Transport Layer
Q1.a
Here we have a window size of N=4. Suppose the receiver has received packet k-1,
and has ACKed that and all other preceding packets. If all of these ACK's have been
received by sender, then sender's window is [k, k+N-1]. Suppose next that none of
the ACKs have been received at the sender. In this second case, the sender's window
contains k-1 and the N packets up to and including k-1. The sender's window is thus
[k-N,k-1]. By these arguments, the senders window is of size 3 and begins
somewhere in the range [k-N,k].
Q1.b
If the receiver is waiting for packet k, then it has received (and ACKed) packet k-1
and the N-1 packets before that. If none of those N ACKs have been yet received by
the sender, then ACK messages with values of [k-N,k-1] may still be propagating
back.Because the sender has sent packets [k-N, k-1], it must be the case that the
sender has already received an ACK for k-N-1. Once the receiver has sent an ACK
for k-N-1 it will never send an ACK that is less that k-N-1. Thus the range of inflight ACK
values can range from k-N-1 to k-1.
Q2.a
There are 4,294,967,2 296 32 = possible sequence numbers.
The sequence number does not increment by one with each segment. Rather, it
increments by the number of bytes of data sent. So the size of the MSS is
irrelevant.
The maximum size file that can be sent from A to B is simply the number of bytes
representable by Gbytes 4.19232.
Q2(Cont)...
Q3.
a) In the second segment from Host A to B, the sequence number is 207, source port
number is 302 and destination port number is 80.
b) If the first segment arrives before the second, in the acknowledgement of the first
arriving segment, the acknowledgement number is 207, the source port number is 80
and the destination port number is 302.
c) If the second segment arrives before the first segment, in the acknowledgement of the
first arriving segment, the acknowledgement number is 127, indicating that it is still
waiting for bytes 127 and onwards.
Q3.d
Q4
Since the link capacity is only 100 Mbps, so host A’s sending rate can be at most
100Mbps. Still, host A sends data into the receive buffer faster than Host B can remove
data from the buffer. The receive buffer fills up at a rate of roughly 40Mbps. When the
buffer is full, Host B signals to Host A to stop sending data by setting RcvWindow = 0.
Host A then stops sending until it receives a TCP segment with RcvWindow > 0. Host A
will thus repeatedly stop and start sending as a function of the RcvWindow values it
receives from Host B. On average, the long-term rate at which Host A sends data to Host
B as part of this connection is no more than 60Mbps.
Q5
DevRTT = (1- beta) * DevRTT + beta * | SampleRTT - EstimatedRTT |
EstimatedRTT = (1-alpha) * EstimatedRTT + alpha * SampleRTT
TimeoutInterval = EstimatedRTT + 4 * DevRTT
After obtaining first SampleRTT 106ms:
DevRTT = 0.75*5 + 0.25 * | 106 - 100 | = 5.25ms
EstimatedRTT = 0.875 * 100 + 0.125 * 106 = 100.75 ms
TimeoutInterval = 100.75+4*5.25 = 121.75 ms
Q5 (Cont)...
After obtaining 120ms:
DevRTT = 0.75*5.25 + 0.25 * | 120 – 100.75 | = 8.75 ms
EstimatedRTT = 0.875 * 100.75 + 0.125 * 120 = 103.16 ms
TimeoutInterval = 103.16+4*8.75 = 138.16 ms
After obtaining 140ms:
DevRTT = 0.75*8.75 + 0.25 * | 140 – 103.16 | = 15.77 ms
EstimatedRTT = 0.875 * 103.16 + 0.125 * 140 = 107.76 ms
TimeoutInterval = 107.76+4*15.77 = 170.84 ms
Q5 (Cont)...
After obtaining 90ms:
DevRTT = 0.75*15.77 + 0.25 * | 90 – 107.76 | = 16.27 ms
EstimatedRTT = 0.875 * 107.76 + 0.125 * 90 = 105.54 ms
TimeoutInterval = 105.54+4*16.27 =170.62 ms
After obtaining 115ms:
DevRTT = 0.75*16.27 + 0.25 * | 115 – 105.54 | = 14.57 ms
EstimatedRTT = 0.875 * 105.54 + 0.125 * 115 = 106.72 ms
TimeoutInterval = 106.72+4*14.57 =165 ms
Q6
Recall the TCP’s formula for estimating RTT:
For part c. In order to get a generalized formula, we can take our answer
from part (a) and examine the pattern.
Q7
a.) Maximum window size:
Wmax = (BW×RTT)/MSS
=106×0.15 /8*1500
=125
So, the maximum window size is indeed 125 segments.
b.) The average window size (in segments) is given by;
Average = 0.75 * Window size
Average = 0.75 * 125
Average Window size = 9.375 sec
Q7 (Cont)...
c.) When there is a packet loss, W becomes W/2, i.e., 125/2=62.
(125 - 62) *0.15 = 9.45 seconds, as the number of RTTs (that this TCP
connections needs in order to increase its window size from 62 to 125) is 63.
Recall the window size increases by one in each RTT.
Q8.
a) Referring to the figure , we see that the total
delay is