6
Jonathan Ng Comp 431 Honor Code_____________ HW Chapter 3 1. ditive-increadditive-decrease algorithm would not retain the property that two connections sharing a link would receive roughly equal shares of link capacity. This is because without multiplicative decrease, the difference in throughput would always be constant, since the same constants are added and subtracted from both. On the other hand, multiplicative-decrease would have made the two values converge to one another because dividing takes away a proportional amount of throughput, unlike adding. The answer does depend on the initial rate: if the two starting throughputs are equal, then a constant will just be added to them until they reach the throughput goal. Since their difference is 0, it will stay zero at that point, meaning that the two connections would share roughly equal link capacity in that scenario. 2. 10 Embedded Objects + Webpage of size 5 kbytes, MSS = 536 bytes. Speeds are: 28Kbps, 100Kbps, 1Mbps, 10 Mbps a. RTT=100ms To compute the response time for a persistent connection, we must first set up one connection with a handshake, which takes 2 RTT. We can then retrieve the webpage and all objects on this connection. Starting from slow start, this will take 3RTT + O all /R + P(S/R + RTT) – (2 P – 1) S/R time where O all is the sum of all of the object sizes.

431 hw

Embed Size (px)

Citation preview

Page 1: 431 hw

Jonathan Ng

Comp 431

Honor Code_____________

HW Chapter 3

1. ditive-increadditive-decrease algorithm would not retain the property that two connections

sharing a link would receive roughly equal shares of link capacity. This is because without

multiplicative decrease, the difference in throughput would always be constant, since the same

constants are added and subtracted from both. On the other hand, multiplicative-decrease

would have made the two values converge to one another because dividing takes away a

proportional amount of throughput, unlike adding. The answer does depend on the initial rate:

if the two starting throughputs are equal, then a constant will just be added to them until they

reach the throughput goal. Since their difference is 0, it will stay zero at that point, meaning that

the two connections would share roughly equal link capacity in that scenario.

2. 10 Embedded Objects + Webpage of size 5 kbytes, MSS = 536 bytes. Speeds are: 28Kbps,

100Kbps, 1Mbps, 10 Mbps

a. RTT=100ms

To compute the response time for a persistent connection, we must first set up one

connection with a handshake, which takes 2 RTT. We can then retrieve the webpage and

all objects on this connection. Starting from slow start, this will take 3RTT + Oall/R + P(S/R

+ RTT) – (2P – 1) S/R time where Oall is the sum of all of the object sizes.

RTT=.1s

R=28000bps, 100000bps, 1000000bps, 10000000bps

Oall=11 objects x 5kbyes x 1000 bytes/kbyte = 55000bytes x 8bits/byte = 440000 bits

S=536bytes x 8bits = 4288 bits

P=MIN{q,k-1)

K=log2( Oall/S +1) =log2( 440000bits/4288bits+1)=log2( 103 +1)=6.7=7 windows

Q=log2(1+RTT/(S/R))+1=log2(1+.1/(4288bits/R)) +1

We can construct a chart of q values, corresponding P values, and times for

persistent connection:

Transmission Speed 28000 100000 1000000 10000000

Page 2: 431 hw

(bps)

Q (Windows) 2 3 6 9

P (Windows) 2 3 6 6

Time (s) 16.11 4.83 1.08 .64

To compute the response time for a non-persistent connect, we must set up a new

connection for each object. This will take N(2RTT + O/R + P(S/R + RTT) – (2P – 1) S/R)

time

N=11

RTT = .1s

R=28000bps, 100000bps, 1000000bps, 10000000bps

O = 5kbytes x 1000bytes = 5000bytes x 8bits = 40000 bits

S=536bytes x 8bits = 4288 bits

P=MIN{q,k-1)

K=log2( O/S +1) =log2( 40000bits/4288bits+1)=log2( 10 +1)=4 windows

Q=log2(1+RTT/(S/R))+1=log2(1+.1/(4288bits/R)) +1

We can construct a chart of q values, corresponding P values, and times for non-

persistent connection:

Transmission

Speed (bps)

28000 100000 1000000 10000000

Q (Windows) 2 3 6 9

P (Windows) 2 3 3 3

Time (s) 18.43 8.01 5.75 5.53

b. RTT=1s

We can follow the same procedure as in (a):

Persistent:

P=MIN{q,k-1)

K=log2( O/S +1) =log2( 440000bits/4288bits+1)=log2( 10 +1)=7 windows

Q=log2(1+RTT/(S/R))+1=log2(1+.1/(4288bits/R)) +1

Non-Persistent:

Page 3: 431 hw

P=MIN{q,k-1)

K=log2( O/S +1) =log2( 40000bits/4288bits+1)=log2( 10 +1)=4 windows

Q=log2(1+RTT/(S/R))+1=log2(1+1/(4288bits/R)) +1

T-Speed (bps) 28000 100000 1000000 10000000

Q (Windows) 4 6 9 13

Persistent P

(Windows)

4 6 6 6

Non-

Persistent P

(Windows)

3 3 3 3

Time (S)

Persistent

21.03 10.96 9.20 9.02

Time (S) Non-

Persistent

63.98 57.51 55.25 55.03

c. Prove (M+1)O/R + 2(M/x + 1)RTT + SSL

From our previous calculations, we know that a non-persistent connection time can be

calculated using N(2RTT + O/R + P(S/R + RTT) – (2P – 1) S/R)= NO/R +2NRTT + NP(S/R +

RTT) – N(2P – 1)S/R. The time for stall time is NP(S/R + RTT) – N(2P – 1)S/R, so we can

depict this as SSL. N stands for the total number of objects, M, plus the base page, all of

size O. So, N=M+1. From here, our equation becomes (M+1)O/R + 2(M + 1)RTT + SSL. It

takes (M+1)O/R time to transmit the objects, and 2(M+1)RTT time for round trips in a

non-persistent non-parallel connection, since it takes 2 RTTs for each handshake, and a

connection must be opened for the base page and for each object. However, to account

for x parallel connections, we must realize that after the base page is retrieved, we can

then start transferring the M objects simultaneously, which cuts the time to fetch the

objects by a factor of x: (M/x)RTT, because x connections can be open and closed at the

same time. So, our new formula becomes (M+1)O/R + 2(M/x + 1)RTT + SSL.

3. First, we must generate a formula for EstimatedRTT:

EstimatedRTT = (1-x) * EstimatedRTTprev + x * SampleRTT

Page 4: 431 hw

So, applying this to our scenario, EstimatedRTT1 = 0.1*SampleRTT1 + .9*EstmatedRTT2 (This is the

most recent Estimated RTT)

Where EstimatedRTT2=0.1*SampleRTT2 + .9*EstimatedRTT3

And EstimatedRTT3=0.1*SampleRTT3+.9*EstimatedRTT4

Finally, EstimatedRTT4=SampleRTT4 since that is the oldest RTT time, and there are no previous RTTs

to reference before it.

Working our way back up, we get:

EstimatedRTT3=0.1*SampleRTT3+.9*(SampleRTT4)

EstimatedRTT2=0.1*SampleRTT2+.9*(0.1*SampleRTT3+.9*EstimatedRTT4)

=0.1*SampleRTT2 + .9*.1*SampleRTT3+.92*SampleRTT4

EstimatedRTT1=0.1*SampleRTT1+.9(0.1*SampleRTT2 + .9*.1*SampleRTT3+.92*SampleRTT4)

=0.1*SampleRTT1+.9*.1*SampleRTT2+.92*.1*SampleRTT3+.93*SampleRTT4

We can generalize this expression for n sample values:

EstimatedRTT1=x*SampleRTT1+x*(1-x)*SampleRTT2+x*(1-x)2*SampleRTT3+…+x*

(1-x)i-1*SampleRTTi+…+(1-x)n-1SampleRTTn

4. Suppose TCP increased its window size by two segments rather than one for each ACK received

during slow-start:

a. Express K in terms of O and S

Applying the original formula for K:

K=MIN{i:30+31+32+…+3i-1 >= O/S}

=MIN{i: (3i-1)/2 >= O/S}

=MIN{i: i >= log3(2O/S + 1)}

=log3(2O/S+1)

b. Express Q in terms of RTT, S, and R

Applying the original formula for Q:

Page 5: 431 hw

Q=MAX{i: RTT+S/R >= 3i-1S/R}

=MAX{i: 3i-1 <= 1 + RTT/(S/R)}

=MAX{i: i <= log3(1 + RTT/(S/R) +1}

=log3(1+RTT/(S/R)) + 1

c. Express the latency of a TCP connection in terms of P, O, R, and RTT

Applying the original formula for Latency under slow start with a new definition for stall

time:

Latency=2RTT + O/R + P(S/R + RTT) – (3P-1)S/R