You are on page 1of 5

Computer Networks Written Homework Answers

CSIE
Jun, 2007

1-1: Consider the GBN protocol with a sender size of 3 and a sequence number
range of 1,024. Suppose that at time t, the next in-order packet that the receiver is
expecting has a sequence number of k. Assume that the medium does not reorder
messages. Answer the following quetions:

a. What are the possible sets of sequence numbers inside the sender’s window
at time t? Justify your answer.

b. What are all possible values of the ACK field in all possible messages cur-
rently propagating back to the sender at time t? Justify your answer.

a) Here we have a window size of N = 3. 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].

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 in-flight ACK values can range from
k − N − 1 to k − 1.

1-2: Consider the TCP procedure for estimating RTT. Suppose that α = 0.1.Let
SampleRT T1 be the most recent sample RTT, let SampleRT T2 be the next most recent
sample RTT, and so on.

a. For a given TCP connection, suppose four acknowledgements have been returned
with corresponding sample RTTs SampleRT T4 , SampleRT T3 , SampleRT T2 , SampleRT T1 .
Express EstimatedRT T in terms of the four sample RTTs.

b. Generalize your formula for n sample RTTs.

c. For the formula in part (b) let n approach infinity. Comment on why this averaging
procedure is called an exponential moving average.

1
CN Written HW1

a) Denote EstimatedRT T (n) for the estimate after the nth sample.

EstimatedRT T (1) = SampleRT T


EstimatedRT T (2) = x × SampleRT T1 + (1 − x) × SampleRT T2
EstimatedRT T (3) = x × SampleRT T1 + (1 − x) [x × SampleRT T2 + (1 − x) × SampleRT T3 ]
= x × SampleRT T1 + (1 − x)x × SampleRT T2 + (1 − x)2 × SampleRT T3
EstimatedRT T (4) = x × SampleRT T1 + (1 − x) × EstimatedRT T (3)
= x × SampleRT T1 + (1 − x)x × SampleRT T2 + (1 − x)2 x × SampleRT T3
+(1 − x)3 × SampleRT T4

b)
X
EstimatedRT T (n) = x n − 1(1 − x)j × SampleRT Tj + (1 − x)n × SampleRT Tn
j=1

c)

(∞) x X
EstimatedRT T = (1 − x)j × SampleRT Tj
1−x
j=1

X
1
= (0.9)j × SampleRT Tj
9
j=1

1-3: Consider the Figure of TCP window size as a function of time. Assuming TCP
Reno is the protocol experiencing the behavior shown above, 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 T hreshold at the first transmission round?

f. What is the value of T hreshold at the 18th transmission round?

g. What is the value of T hreshold 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
T hreshold?

2
CN Written HW1

a) TCP slowstart is operating in the intervals [1, 6] and [23, 26].

b) TCP congestion advoidance 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.

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 slowtart 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 21. Hence
the threshold is 10 during the 24th transmission round.

h) During the 1st transmission round, packet 1 is sent; packet 2 − 3 are sent in the 2nd transmis-
sion round; packets 4 − 7 are sent in the 3rd transmission round; packets 8 − 15 are sent in
the 4th transmission round; packets 15 − 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 congestion window and threshold will be set to half the current value of the congestion
window (8) when the loss occurred. Thus the new values of the threshold and window will
be 4.

2-1: Consider the topology shown in Figure 1(referred to Figure 4.17 in the text).
Denote the three subnets with hosts (starting clockwise at 12:00) as Networks A, B,
C. Denote the subnets without hosts as Networks D, E, and F.
a. Assign network addresses to each of these six subnets, with the following con-
straints: All addresses must be allocated from 14.97.254/23; Subnet A should
have enough addresses to support 250 interfaces; Subnet B should have enough
addresses to support 120 interfaces; Subnet C should have enough addresses to
support 250 interfaces; Of course, subnets D, E, and F should each be able to
support two interfaces. For each subnet, the assignment should take the form
a.b.c.d/x or a.b.c.d/x - e.f.g.h/y.

b. Using your answer to part (a), provide the forwarding tables (using longest prefix
matching) for each of the three routers.

From 14.97.254/23, possible assignments are


a) Subnet A: 14.97.255/24 (256 addresses) Subnet B: 14.97.254.0/25−214.97.354.0/29 (128−8 =
120 addresses) Subnet C: 14.97.254.128/25 (128 addresses)
Subnet D: 14.97.254.0/31 (2 addresses) Subnet E: 14.97.254.2/31 (2 addresses) Subnet F:
14.97.254.4/30 (4 addresses)

3
CN Written HW1

b) To simplify the solution, assume that no datagrams have router interfaces as ultimate des-
tinations. Also, label D, E, F for the upper-right, bottom, and upper-left interior subnets,
respectively.
Router 1
Longest Prefix Match Outgoing Interface
00001110 01100001 11111111 Subnet A
00001110 01100001 11111110 0 Subnet D
00001110 01100001 11111110 1 Subnet F
Router 2
Longest Prefix Match Outgoing Interface
00001110 01100001 11111111 Subnet D
00001110 01100001 11111110 0 Subnet B
00001110 01100001 11111110 1 Subnet E
Router 3
Longest Prefix Match Outgoing Interface
00001110 01100001 11111111 Subnet F
00001110 01100001 11111110 0 Subnet E
00001110 01100001 11111110 1 Subnet C

2-2: Consider the network setup in Figure 2 (referred to Figure 4.20 in the text).
Suppose that the ISP instead assigns the router the address 126.13.89.67 and that
network address of the home network is 192.168/16.

a. Assign addresses to all interfaces in the home network.

b. Suppose each host has two ongoing TCP connections, all to port 80 at host 128.119.40.86.
Provide the six corresponding entries in the NAT translation table.

a) Home addresses: 192.168.0.1, 192.168.0.2, 192.168.0.3 with the router interface being 192.168.0.4.

b) NAT Translation Table


WAN Side LAN Side
128.119.40.86, 4000 192.168.0.1, 3345
128.119.40.86, 4001 192.168.0.1, 3346
128.119.40.86, 4002 192.168.0.2, 3345
128.119.40.86, 4003 192.168.0.2, 3346
128.119.40.86, 4004 192.168.0.3, 3345
128.119.40.86, 4005 192.168.0.3, 3346

2-3: Consider the network fragment shown in Figure ??. x has only two attached
neighbors, w and y. w has a minimum-cost path to destination u (not shown) of 5,
and y has a minimum-cost path to u of 6. The complete paths from w and y to u (and
between w and y) are not shown. All link costs in the network have strictly positive
integer values.

4
CN Written HW1

a. Give x’s distance vector for destinations w, y, and u.

b. Give a link-cost change for either c(x, w) or c(x, y) such that x will inform its neigh-
bors of a new minimum-cost path to u as a result of executing the distance vector
algorithm.

c. Give a link-cost change for either c(x, w) or c(x, y) such that x will not inform its
neighbors of a new minimum-cost path to u as a result of executing the distance
vector algorithm.

a) Dx (y) = 4, Dx (w) = 1, Dx (u) = 6.

b) First consider what happens if c(x, y) changes. If c(x, y) becomes larger or smaller (as long as
c(x, y) > 0), the least cost path from x to u will still have cost 6 and pass through w. Thus
a change in c(x, y) will not cause x to inform its neighbors of any changes. Now consider if
c(x, w) changes. If c(x, w) = ² ≤ 5, then the least-cost path to u continues to pass through w
and its cost changes to 5 + ²; x will inform its neighbors of this new cost. If c(x, y) = δ > 5,
then the least cost path now passes through y and has cost 10; again x will inform its neighbors
of this new cost.

c) Any change in link cost c(x, y) will not cause x to inform its neighbors of a new minimum-cost
path to u.

You might also like