Uploaded by Tlotlisang Lekena

Homework6-solution

advertisement
Homework, sheet 6
June 6, 2013
Exercise 1. Consider the plot below that shows the congestion window size of
a sender using TCP Reno. Answer the following questions. In all cases, you
should provide a short discussion justifying your answer.
Congestion window size (segments)
45
40
35
30
25
20
15
10
5
0
0
2
4
6
8
10 12 14 16 18 20 22 24 26 28
Transmission round
a) Identify the time intervals when TCP slow start is operating.
Answer: TCP slowstart is operating in the intervals [1,6] and [23,26]
b) Identify the time intervals when TCP congestion avoidance is operating.
Answer: TCP congestion avoidance is operating in the intervals [6,16]
and [17,22] (assuming that the ACK of the lost segement arrives directly
after the three duplicate ACKs).
c) After the 16th transmission round, is segment loss detected by a triple
duplicate ACK or by a timeout?
Answer: 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, is segment loss detected by a triple
duplicate ACK or by a timeout?
Answer: After the 22nd transmission round, segment loss is detected due
to timeout, and hence the congestion window size is set to 1.
1
e) What is the initial value of ssthresh at the first transmission round?
Answer: The threshold is initially 32, since it is at this window size that
slow start stops and congestion avoidance begins.
f) What is the value of ssthresh at the 18th transmission round?
Answer: 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) What is the value of ssthresh at the 24th transmission round?
Answer: 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 14
(taking lower floor of 14.5) during the 24th transmission round.
h) During what transmission round is the 70th segment sent?
Answer: 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 to 31 are sent in the 5th transmission round; packets 32 to 63
are sent in the 6th transmission round; packets 64 to 96 are sent in the
7th transmission round. Thus packet 70 is sent in the 7th transmission
round.
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?
Answer: 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) 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?
Answer: The threshold is 21, and the congestion window size is 1.
k) Again suppose TCP Tahoe is used, and there is a timeout event at 22nd
round. How many packets have been sent out from 17th round till 22nd
round, inclusive?
Answer: round 17, 1 packet; round 18, 2 packets; round 19, 4 packets;
round 20, 8 packets; round 21, 16 packets; round 22, 21 packets. So, the
total number is 52.
Exercise 2. Recall the macroscopic description of TCP throughput (slide 3142). In the period of time from when the connection’s rate varies from W/(2 ·
RT T ) to W/RT T , only one packet is lost (at the very end of the period).
a) Show that the loss rate (fraction of packets lost) is equal to
L = loss rate =
2
3
2
8W
1
.
+ 43 W
Answer: The loss rate L is the ratio of the number of packets lost over
the number of packets sent. In a cycle, 1 packet is lost. The number of
packets sent in a cycle is
W/2
X W
W
W
+(
+ 1) + · + W =
(
+ n)
2
2
2
n=0
W/2
=(
X
W
W
+ 1) ·
+
n
2
2
n=0
W
W
W/2 · (W/2 + 1)
+ 1) ·
+
2
2
2
W2
W
W2
W
=
+
+
+
4
2
8
4
3 2 3
= W + W
8
4
=(
Thus the loss rate is
3
2
8W
1
.
+ 34 W
b) Use the result above to show that if a connection has loss rate L, then its
average rate is approximately given by
≈
1.22 · M SS
√ .
RT T · L
Answer: For large W , 38 W 2 >> 34 W . Thus, L ≈ 83 W 2 or W ≈
From the text, we therefore have
r
3
1.22 · M SS
8 M SS
√ .
average throughput =
·
≈
4 3L RT T
RT T · L
q
8
3L .
Exercise 3. Consider the following network. With the indicated link costs, use
Dijkstra’s shortest-path algorithm to compute the shortest path from x to all
network nodes. Show how the algorithm works by computing a table similar to
the table in the slides (see slide 4-75).
z
12
8
7
y
6
8
3
x
6
t
4
v
2
3
4
3
w
3
u
Problem 26
Answer:
Step
N’
D(t),p(t)
D(u),p(u)
D(v),p(v)
D(w),p(w)
D(y),p(y)
D(z),p(z)
0
1
2
3
4
5
6
x
xv
xvu
xvuw
xvuwy
xvuwyt
xvuwytz
!
7,v
7,v
7,v
7,v
7,v
7,v
!
6,v
6,v
6,v
6,v
6,v
6,v
3,x
3,x
3,x
3,x
3,x
3,x
3,x
6,x
6,x
6,x
6,x
6,x
6,x
6,x
6,x
6,x
6,x
6,x
6,x
6,x
6,x
8,x
8,x
8,x
8,x
8,x
8,x
8,x
Exercise
Problem4.27Consider a general network topology and a synchronous version of
the distance-vector algorithm. Suppose that at each iteration, a node exchanges
its distance vectors with its neighbors and receives their distance vectors. Asa)
suming
that
the algorithm
begins
withD(v),p(v)
each nodeD(w),p(w)
knowing D(y),p(y)
only the costs
to
Step
N’
D(x), p(x)
D(u),p(u)
D(z),p(z)
its immediate neighbors, what is the maximum number of iterations required
before the distributed algorithm converges? Justify your answer.
Answer:
of this
0
t The wording
!
2,t question4,twas a bit!ambiguous.
! this
7,t We meant
to1 mean, tu”the number
from4,twhen the 5,u
algorithm 7,t
is run for the
! of iterations
2,t
! first
2
tuv is, assuming
7,v the only
2,t information
4,t
! cost
time”
(that
the nodes
5,u initially
7,t have is the
tuvw
7,v
2,t assume 4,t
!
5,u
7,t synchronously
to3 their nearest
neighbors).
We
that the algorithm
runs
4
tuvwx
7,v all nodes
2,t compute 4,t
15,xtime
5,u tables7,t
(that
is, in
one step,
their distance
at the same
5 then tuvwxy
4,t
5,u exchanges
7,t distance15,x
and
exchange 7,v
tables). At2,teach iteration,
a node
tables
6 its neighbors.
tuvwxyz
7,v
2,t are node4,tA, and your
5,u neighbor
7,t is B, all15,x
with
Thus, if you
of B’s
neighbors (which will all be one or two hops from you) will know the shortest
cost path of one or two hops to you after one iteration (i.e., after B tells them its
b) to you). Let d be the ”diameter” of the network - the length of the longest
cost
Step without
N’ loops between
D(x), p(x) any
D(t),p(t)
D(v),p(v)
D(w),p(w) Using
D(y),p(y)
D(z),p(z)
path
two nodes
in the network.
the reasoning
above, after d-1 iterations, all nodes will know the shortest path cost of d or
fewer hops
Since any 3,u
path with 3,u
greater than
u to all other
! nodes. 2,u
! d hops will
! have
loops (and
thus
have
a
greater
cost
than
that
path
with
the
loops
removed),
ut
!
2,u
3,u
! the
3,u
9,t
algorithmutvwill converge
in
at
most
d-1
iterations.
ASIDE:
if
the
DV
algorithm
6,v
2,u
3,u
!
3,u
9,t
is run asutvw
a result of6,va change2,uin link costs,
is no a priori
3,u there 3,u
9,t bound !on the
number ofutvwx
iterations6,vrequired until
unless
bound
2,u convergence
3,u
3,u one also
9,tspecifies a14,x
on link costs.
utvwxy
6,v
2,u
3,u
14,x
3,u
9,t
utvwxyz
6,v
2,u
3,u
14,x
3,u
9,t
4
Download