0% found this document useful (0 votes)
33 views5 pages

Solution To Practice Problem Set 5

The document discusses 5 problems related to TCP/IP networking. Problem 1 calculates estimated round trip time using sample RTT values. Problem 2 describes TCP segments being sent and received with different ordering and lost acknowledgments. Problem 3 designs a stop-and-wait reliable communication protocol. Problems 4 and 5 analyze TCP Reno behavior based on a congestion graph and for a single saturated TCP connection respectively.

Uploaded by

agentrangoman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views5 pages

Solution To Practice Problem Set 5

The document discusses 5 problems related to TCP/IP networking. Problem 1 calculates estimated round trip time using sample RTT values. Problem 2 describes TCP segments being sent and received with different ordering and lost acknowledgments. Problem 3 designs a stop-and-wait reliable communication protocol. Problems 4 and 5 analyze TCP Reno behavior based on a congestion graph and for a single saturated TCP connection respectively.

Uploaded by

agentrangoman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

ELEC 373, W24 : Solution #5

Problem 1
Suppose that the five measured SampleRTT values are 106ms, 120ms, 140ms, 90ms, and 115ms. Compute
the EstimatedRTT after each of these SampleRTT values is obtained, using a value of alpha = 0.125 and
assuming that the value of EstimatedRTT was 100ms just before the first of these 5 samples were obtained.

ANSWER:
EstimatedRTT = alpha * SampleRTT + (1–alpha ) * EstimatedRTT
After obtaining first sampleRTT: EstimatedRTT = 0.125 * 106 + 0.875 * 100 = 100.75ms
After obtaining second sampleRTT: EstimatedRTT = 0.125 * 120 + 0.875 * 100.75 = 103.15ms
After obtaining third sampleRTT: EstimatedRTT = 0.125 * 140 + 0.875 * 103.15 = 107.76ms
After obtaining fourth sampleRTT: EstimatedRTT = 0.125 * 90 + 0.875 * 107.76 = 105.54ms
After obtaining fifth sampleRTT: EstimatedRTT = 0.125 * 115 + 0.875 * 105.54 = 106.71ms 

Problem 2
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 to Host B back-to-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) In the second segment sent from Host A to B, what are the sequence number, source port number, and
destination port number?

(b) If the first segment arrives before the second segment, in the acknowledgment of the first arriving
segments, what is the ACK number, the source port number. and the destination port number?

(c) If the second segment arrives before the first segment, in the ACK of the first arriving segment, what
is the ACK number?

(d) Suppose the two segments sent by A arrive in order at B. The first acknowledgment is lost and the
second acknowledgment arrives after the first timeout interval. Draw a timing diagram, showing these
segments and all other segments and acknowledgments sent (Assume there is no additional packet
loss). For each segment in your figure, provide the sequence number and the number of bytes of data;
for each acknowledgment that you add, provide the acknowledgment number.

ANSWER:

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.

d. The timing diagram is shown as follows.

Page 1 of 5
ELEC 373, W24 : Solution #5

Problem 3
Suppose we want to design a stop-and-wait, reliable protocol for communication between a sender S and
a receiver R. The network resource at R is precious, therefore we do not want R to send ACK for every
packet it receives. R only sends an NAK packet when it detects a corrupted packet. S uses a timer to
check if a packet is received correctly. If a NAK is received before timeout, S will retransmit the packet.
Otherwise, S is ready to send a new packet. The channel between R and S may corrupt packets, but
will always deliver the packets (no packet loss) in order. Furthermore, the maximum RTT between S and
R is known and is guaranteed to be D. Based on the description above, you are to design a stop-and-
wait protocol (i.e., both receiver and sender has a window size of 1) for reliable communication between
S and R. Show your design by drawing the FSM for the sender side and receiver side of the protocol.
You can use the pseudo code notation shown in lecture to describe the events and actions in your FSM.

ANSWER:


Page 2 of 5
ELEC 373, W24 : Solution #5

Problem 4
Assuming TCP Reno is the protocol experiencing the behavior shown in the following figure. Answer the
following questions. In all cases, you should provide a short discussion justifying your answer.

(a) Identify the intervals of time when TCP slow start is operating.

(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 by a timeout?

(d) After the 22nd transmission round, is segment loss detected by a triple duplicate ACK or by 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) During what transmission round is the 70th segment sent?

(i) Assuming a packet loss is detected after the 26th round by the receipt of a triple duplicate ACK, what
will be the values of the congestion window size and of ssthresh?

(j) Suppose TCP Tahoe is used (instead of TCP Reno), and assume that triple duplicate ACKs are received
at the 16th round. What are the ssthresh and the congestion window size at the 19th round?

ANSWER:

(a) TCP slow start is operating in the intervals [1,6] and [23,26];

(b) TCP congestion avoidance is operating in the intervals [6,16] and [17,22];

(c) After the 16th transmission round, packet loss is recognized by a triple duplicate ACK. If there was a
timeout, the congestion window size would have dropped to 1;

Page 3 of 5
ELEC 373, W24 : Solution #5

(d) After the 22nd transmission round, segment loss is detected due to timeout, and hence the congestion
window size is set to 1;

(e) The threshold is initially 32, since it is at this window size that slow start stops and congestion avoidance
begins;

(f) The threshold is set to half the value of the congestion window when packet loss is detected. When
loss is detected during transmission round 16, the congestion windows size is 42. Hence the threshold
is 21 during the 18th transmission round;

(g) The threshold is set to half the value of the congestion window when packet loss is detected. When
loss is detected during transmission round 22, the congestion windows size is 29. Hence the threshold
is 15 during the 24th transmission round;

(h) During the 1st transmission round, packet 1 is sent; packet 2-3 are sent in the 2nd transmission round;
packets 4-7 are sent in the 3rd transmission round; packets 8-15 are sent in the 4th transmission round;
packets 16-31 are sent in the 5th transmission round; packets 32-63 are sent in the 6th transmission
round; packets 64-96 are sent in the 7th transmission round. Thus packet 70 is sent in the 7th
transmission round;

(i) The threshold will be set to half the current value of the congestion window (8) when the loss occurred
and congestion window will be set to the new threshold value + 3 MSS . Thus the new values of the
threshold and window will be 4 and 7 respectively;

(j) Threshold is 21, and congestion window size resets to 1. At the 19th round, the window is 4.

Problem 5
Consider that only a single TCP (Reno) connection uses one 10 Mbps link which does not buffer any data.
Suppose that this link is the only congested link between the sending and receiving hosts. Assume that the
TCP sender has a huge file to send to the receiver, and the receiver’s receive buffer is much larger than the
congestion window. We also make the following assumptions: each TCP segment size is 1,500 bytes; the
two-way propagation delay of this connection is 150 msec; and this TCP connection is always in congestion
avoidance phase, that is, ignore slow start.

(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?

ANSWER:

(a) Let W denote the max window size measured in segments. Then, W*MSS/RTT = 10Mbps, as packets
will be dropped if the maximum sending rate exceeds link capacity. Thus, we have W*1500*8/0.15=10*106 ,
then W is about 125 segments.

(b) As congestion window size varies from W/2 to W, then the average window size is 0.75W=94 (ceiling
of 93.75) segments. Average throughput is 94*1500*8/0.15 =7.52Mbps.

Page 4 of 5
ELEC 373, W24 : Solution #5

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

Page 5 of 5

You might also like