test 2 - answer

advertisement
EKT335 PRINCIPLES OF COMPUTER NETWORK
TEST II - ANSWER
DATE
: 06 DEC 2012
DURATION : 1 HOUR
1
1. The following figure shows the three way handshake for TCP connection between two hosts;
Host A and Host B.
[3 marks]
a. Determine the ACK number in A.
102
b. Determine the Sequence number in B.
102
c. Determine the ACK number in C.
223
2. Host A and Host 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 to Host B backto-back. The first and second segments contain 80 and 40 bytes of data, respectively. In the first
segment, the sequence number is 127, the source port number is 302, and the destination port
number is 80. Host B sends an acknowledgment whenever it receives a segment from Host A.
a. Determine the sequence number, source port number and destination port number in the
second segment sent from Host A to B.
[3 marks]
Seq. #:
Source Port #:
Dest. Port #:
207
302
80
b. If the first segment arrives before the second segment, in the acknowledgment of the first
arriving segment, what are the acknowledgment number, the source port number, and the
destination port number?
[3 marks]
ACK #:
Source Port #:
Dest. Port #:
207
80
302
2
c. If the second segment arrives before the first segment, in the acknowledgment of the first
arriving segment, what is the acknowledgment number? Justify your answer.
[2 marks]
ACK #:
127
To indicate that B is still waiting for bytes 127 and onwards.
3. The round trip time (RTT) for a TCP segment can be estimated by using the formula:
EstimatedRTT   SampleRTT )  (1   ) EstimatedRTT
Starting with an estimate of old RTT = 25 ms,
a. Calculate the estimated RTT, if the first three segments transmissions actually require 30,
36, and 33 ms, respectively. Assume α = 0.5.
[6 marks]
1. Estimated RTT1 = 0.5 (30 ms) + (1-0.5) 25 ms
= 15 ms + 12.5 ms = 27.50 ms
2. Estimated RTT2 = 0.5 (36 ms) + (0.5) 27.5 ms
= 18 ms + 13.75 ms = 31.75 ms
3. Estimated RTT3 = 0.5 (33 ms) + (0.5) 31.75 ms
= 16.5 ms + 15.875 ms = 32.375 ms
b. Calculate the DevRTT after each sample is obtained, assuming a value of  = 0.25 and
assuming the value of DevRTT was 3 ms just before the first of these three samples is
obtained. DevRTT is calculated using the formula:
DevRTT   SampleRTT  EstimatedRTT  (1   ) DevRTT
1. DevRTT1
= 0.25 |30 ms – 27.50 ms| + (1-0.25) 3 ms
= 0.25 |2.5 ms| + 2.25 ms
= 2.875 ms
2. DevRTT2
= 0.25 |36 ms – 31.75 ms| + (1-0.25) 2.875 ms
= 0.25 |4.25 ms| + 2.156 ms
= 3.22 ms
3.
= 0.25 |33 ms – 32.375 ms| + (1-0.25) 3.22 ms
= 0.25 |0.625 ms| + 2.41 ms
= 2.57 ms
DevRTT3
[6 marks]
c. Calculate the TCP’s retransmission timeout interval after each of these samples is obtained.
Timeout interval is calculated using the formula:
TimeoutInterval  EstimatedRTT  4 * DevRTT
1. TOI1
2. TOI2
3. TOI3
= 27.50 ms + 4 (2.875 ms) = 39.00 ms
= 31.75 ms + 4 (3.22 ms) = 44.63 ms
= 32.375 ms + 4 (2.57 ms) = 42.66 ms
3
[6 marks]
4. Consider the following plot of TCP window size as a function of time.
a. Identify the intervals of time when TCP slow start is operating.
[2 marks]
TCP slow start is operating in the intervals [1,4] and [9,12].
b. Identify the intervals of time when TCP congestion avoidance is operating.
[2 marks]
Intervals [4 , 8] and [12, 15].
c. After the 8th transmission round, is segment loss detected by a triple duplicate ACK or by a
timeout? Justify your answer.
[2 marks]
By triple duplicate ACKs, if there was a timeout, the congestion window size for TCP Reno would
have dropped to 1.
d. What is the initial value of Threshold at the first transmission round?
[2 marks]
8, since it is at this window size that slow start stops and congestion avoidance begins.
e. What is the value of Threshold at the 9th transmission round?
6 = (1/2 cwnd)
Threshold is set to half the value of congestion window.
4
[2 marks]
5. Suppose your boss calls you up while visiting a client and says he left a 250,000 byte file on a server
at the office, and he needs you to send it to him. The connection between the office and his current
site is 2 million bits/second.
a. Assuming that all bandwidth is consumed by your data (e.g., there aren’t any packet headers,
there’s no other traffic on the link, etc.) and that you can immediately start sending data at the
maximum rate, how long will it take to transmit the file?
[2 marks]
ttrans = L/R = (250,000 x 8) / (2 x 106) = 1.00 s
b. Now assume that you are sending the file via TCP, with a maximum segment size of 1000 bytes.
You have to follow TCP’s transport algorithm, so you start transmitting the file at a low rate.
How many networks round trip times (RTTs) will it take to transmit the entire file? Again assume
that all bandwidth is consumed by your data.
[4 marks]
RTT1 = 1 KB, RTT2 = 2 KB, RTT3 = 4 KB, RTT4 = 8 KB,…RTT8 = 256 KB
After 8 RTTs the window size will become 256 KB, by the end of the 8th RTT we have transmitted
256 MB, thus we need 8 RTTs to transmit the entire file.
-oooOooo-
5
Download