You are on page 1of 10

Computer Networks (theory) Registration No: _________________

Fall 2023 Date submitted: _________________

Assignment No. 03
Scenario 1
Consider the figure below in which a TCP sender and receiver communicate over a connection in which
the segments can be lost. The TCP sender wants to send a total of 10 segments to the receiver and
sends an initial window of 5 segments at t = 1, 2, 3, 4, and 5, respectively. Suppose the initial value of
the sequence number is 166 and every segment sent to the receiver each contains 309 bytes. The delay
between the sender and receiver is 7 time units, and so the first segment arrives at the receiver at t = 8,
and an ACK for this segment arrives at t = 15. As shown in the figure, 1 of the 5 segments is lost between
the sender and the receiver, but none of the ACKs are lost. Assume there are no timeouts and any out of
order segments received are thrown out.

Attempt the following questions.

1. What is the sequence number of the segment sent at t=1?


ANS:
The sequence number of the first segment is the starting sequence
number, which is 166.
2. What is the sequence number of the segment sent at t=2?
The sequence number of the second segment is = 166 + 309 = 475.
3. What is the sequence number of the segment sent at t=3?
The sequence number of the third segment is = 475 + 309 = 784.

Page 1 of 10
Computer Networks (theory) Registration No: _________________
Fall 2023 Date submitted: _________________

4. What is the sequence number of the segment sent at t=4?


The sequence number of the fourth segment is = 784+ 309 = 1174.
5. What is the sequence number of the segment sent at t=5?
The sequence number of the fourth segment is = 1174+ 309 = 1483.
6. What is the value of the ACK sent at t=8? (If segment lost, write 'x')
The ACK value is the sequence number of the next expected segment,
which is 475.
7. What is the value of the ACK sent at t=9? (If segment lost, write 'x')
The ACK value is the sequence number of the next expected segment,
which is 784.
8. What is the value of the ACK sent at t=10? (If segment lost, write 'x')
The ACK value is the sequence number of the next expected segment,
which is 1093.
9. What is the value of the ACK sent at t=11? (If segment lost, write 'x')
Segment was lost, the ACK is never sent.
10. What is the value of the ACK sent at t=12? (If segment lost, write 'x')
The ACK value is the sequence number of the next expected segment,
which is 1093.
11. What is the sequence number of the segment sent at t = 15? (If ACK never arrives, write 'x')
The sequence number of this segment is calculated the same way as the
first five segments. The sequence number is 2589.
12. What is the sequence number of the segment sent at t = 16? (If ACK never arrives, write 'x')
The sequence number of this segment is calculated the same way as the
first five segments. T he sequence number is 3101
13. What is the sequence number of the segment sent at t = 17? (If ACK never arrives, write 'x')
The sequence number of this segment is calculated the same way as the
first five segments. The sequence number is 3613.
14. What is the sequence number of the segment sent at t = 18? (If ACK never arrives, write 'x')
There was nothing to send (as we're waiting for ACKs)
15. What is the sequence number of the segment sent at t = 19? (If ACK never arrives, write 'x')
There was nothing to send (as we're waiting for ACKs)
Scenario 2
Consider the figure below, which plots the evolution of TCP's congestion window at the beginning of
each time unit (where the unit of time is equal to the RTT); see Figure 3.53 in the text. In the abstract
model for this problem, TCP sends a "flight" of packets of size cwnd at the beginning of each time unit.

Page 2 of 10
Computer Networks (theory) Registration No: _________________
Fall 2023 Date submitted: _________________

The result of sending that flight of packets is that either (i) all packets are ACKed at the end of the time
unit, (ii) there is a timeout for the first packet, or (iii) there is a triple duplicate ACK for the first packet. In
this problem, you are asked to reconstruct the sequence of events (ACKs, losses) that resulted in the
evolution of TCP's cwnd shown below.

Attempt the following questions.

1. Give the times at which TCP is in slow start. Format your answer like: 1,3,5,9 (If none submit
blank)
The times where TCP is in slow start are: 1,2,3,7,8,11,12,13,30,31,32.
2. Give the times at which TCP is in congestion avoidance. Format your answer like: 1,3,5,9 (If none
submit blank)
The times where TCP is in slow start are:
4,5,6,9,10,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,33,34,35,36,37,38,39
,40.
3. Give the times at which TCP is in fast recovery. Format your answer like: 1,3,5,9 (If none submit
blank)
The times where TCP is in fast recovery are:
4. Give the times at which packets are lost via timeout. Format your answer like: 1,3,5,9 (If none
submit blank)
The times where TCP has a loss by timeout are: 1,7,13,20,30.
5. Give the times at which packets are lost via triple ACK. Format your answer like: 1,3,5,9 (If none
submit blank)
The times where TCP has a loss by triple duplicate ACK are:

Page 3 of 10
Computer Networks (theory) Registration No: _________________
Fall 2023 Date submitted: _________________

6. Give the times at which the value of ssthresh changes (if it changes between t=3 and t=4, use
t=4 in your answer)
The times where the ssthresh changes are: 2,6,11,17,26,34,35
Scenario 3
Suppose that TCP's current estimated values for the round trip time (estimatedRTT) and deviation in the
RTT (DevRTT) are 340 msec and 39 msec, respectively (see Section 3.5.3 for a discussion of these
variables). Suppose that the next three measured values of the RTT are 260 msec, 200 msec, and 290
msec respectively.

Attempt the following questions.

1. What is the estimatedRTT after the first RTT?


The estimatedRTT for RTT1 is 340.
DevRTT (Dev0) = 39 msec
Measured RTT1 = 260 msec
Measured RTT2 = 200 msec
Measured RTT3 = 290 msec
2. What is the RTT Deviation for the the first RTT?
=(1−β)⋅Dev0+β⋅∣RTT1−RTT0∣
=(1−0.25)⋅39+0.25⋅∣260−340∣
=0.75⋅39+0.25⋅80
=29.25+20
=49.25msec

3. What is the TCP timeout for the first RTT?


=RTT0+4⋅Dev0
=340+4⋅39
=340+156
=496msec

4. What is the estimatedRTT after the second RTT?


=(1−α)⋅RTT1+α⋅MeasuredRTT2
=(1−0.125)⋅260+0.125⋅200
=0.875⋅260+0.125⋅200
=227.5+25
=252.5msec

Page 4 of 10
Computer Networks (theory) Registration No: _________________
Fall 2023 Date submitted: _________________

5. What is the RTT Deviation for the the second RTT?

=(1−α)⋅RTT2+α⋅MeasuredRTT3
=(1−0.125)⋅252.5+0.125⋅290
=0.875⋅252.5+0.125⋅290
=220.9375+36.25
=257.1875msec
6. What is the TCP timeout for the second RTT?
=RTT1+4⋅Dev1
=260+4⋅49.25
=260+197
=457msec
7. What is the estimatedRTT after the third RTT?
=(1−α)⋅RTT2+α⋅MeasuredRTT3
=(1−0.125)⋅252.5+0.125⋅290
=0.875⋅252.5+0.125⋅290
=220.9375+36.25
=257.1875msec
8. What is the RTT Deviation for the the third RTT?
=(1−β)⋅Dev2+β⋅∣RTT3−RTT2∣
=(1−0.25)⋅38.8125+0.25⋅∣257.1875−252.5∣
=0.75⋅38.8125+0.25⋅4.6875
=29.109375+1.171875
=30.28125msec
9. What is the TCP timeout for the third RTT?

=RTT2+4⋅Dev2
=252.5+4⋅38.8125
=252.5+155.25
=407.75msec
Scenario 4
Consider the RDT 3.0 protocol, for reliably communicating data from a sender to receiver over a channel
that can lose or corrupt packets in either direction, and when the maximum delay from sender to

Page 5 of 10
Computer Networks (theory) Registration No: _________________
Fall 2023 Date submitted: _________________

receiver and back is not known. The FSMs for the sender and receiver are shown below, with their
transitions labeled as SX and RY, respectively.

Now let’s consider the sequence of sender and receiver transitions that would happen when one or
more of the following complications occur: a packet (data or ACK) is lost, a timer times out (prematurely
or not), or a message is corrupted. One or more of these events has occurred to produce the sequence
of transitions below. In the sequence below, one transition has been omitted and replaced with a "*".

Transition Sequence: S0, R0, S3, S4, S5, R2, S7, *, S6, S7, R3, S8

Question.

Page 6 of 10
Computer Networks (theory) Registration No: _________________
Fall 2023 Date submitted: _________________

1. What is the missing transition? To indicate the missing transition, enter S or R, followed by an
index.
The missing transition is: S6

Scenario 5
Consider the rdt2.2 protocol from the text (pages 209-212). The FSMs for the sender and receiver are
shown below:

Page 7 of 10
Computer Networks (theory) Registration No: _________________
Fall 2023 Date submitted: _________________

Suppose that the channel connecting the sender and receiver can corrupt but not lose or reorder
packets. Now consider the figure below, which shows four data packets and three corresponding ACKs
being exchanged between an rdt 2.2 sender and receiver. The actual corruption or successful
transmission/reception of a packet is indicated by the corrupt and OK labels, respectively, shown above
the packets in the figure below.

Attempt the following question.

1. At time t=0, what is the sender state?


At time t=0, the sender state is: Wait for ACK 0
2. At time t=0, what is the receiver state?
At time t=0, the receiver state is: Wait for 0 from below

Page 8 of 10
Computer Networks (theory) Registration No: _________________
Fall 2023 Date submitted: _________________

3. At time t=0, what is the sequence/ack # of the packet?


At time t=0, the sequence # is: 0

4. At time t=1, what is the sender state?


At time t=1, the sender state is: Wait for ACK 0

5. At time t=1, what is the receiver state?


Time t=1, the receiver state is: Wait for 1 from below

6. At time t=1, what is the sequence/ack # of the packet?


At time t=1, the ACK # is: 0

7. At time t=2, what is the sender state?


At time t=2, the sender state is: Wait for ACK 1

8. At time t=2, what is the receiver state?


At time t=2, the receiver state is: Wait for 1 from below

9. At time t=2, what is the sequence/ack # of the packet?


At time t=2, the sequence # is: 1

10. At time t=3, what is the sender state?


At time t=3, the sender state is: Wait for ACK 1

11. At time t=3, what is the receiver state?


At time t=3, the receiver state is: Wait for 0 from below

12. At time t=3, what is the sequence/ack # of the packet?


At time t=3, the ACK # is: 1

13. How many times is the payload of the received packet passed up to the higher layer?
1 packets were passed up to the higher layer by the receiver.

Scenario 6
You are assigned the IP address 10.0.0.0/8. Design a subnetting scheme to accommodate at least 1000
subnets, with each subnet supporting a minimum of 100 hosts. Provide the subnet mask for the scheme.
Present your answers in a table with columns for the subnet address, 1st host address, last host address,
broadcast address, and subnet mask.

Subnet # Subnet Address 1st Host Last Host Broadcast Address Subnet Mask

1 10.0.0.0 10.0.0.1 10.0.63.254 10.0.63.255 255.255.192.0

2 10.0.64.0 10.0.64.1 10.0.127.254 10.0.127.255 255.255.192.0

... ... ... ... ...

1000 10.15.192.0 10.15.192.1 10.15.255.254 10.15.255.255 255.255.192.0

Page 9 of 10
Computer Networks (theory) Registration No: _________________
Fall 2023 Date submitted: _________________

Scenario 7
Given the IP address 172.16.0.0/16, design a subnetting plan that allows for 50 subnets, each capable of
supporting up to 500 hosts. Specify the subnet mask for the designed scheme. Present your answers in a
table with columns for the subnet address, 1st host address, last host address, broadcast address, and
subnet mask.

Subnet # Subnet Address 1st Host Last Host Broadcast Address Subnet Mask

1 172.16.0.0 172.16.0.1 172.16.3.254 172.16.3.255 255.255.252.0

2 172.16.4.0 172.16.4.1 172.16.7.254 172.16.7.255 255.255.252.0

... ... ... ... ...

50 172.16.196.0 172.16.196.1 172.16.199.254 172.16.199.255 255.255.252.0

Page 10 of 10

You might also like