problem 19 - carleton university

10
Problem 19 10 -3 10 -2 10 -1 10 0 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 PER Throughput r=0.1 r=0.5 r=1 Figure 2.3: Throughput of ABP vs. PER Figure above shows the throughput of SRP as it varies with the packet error rate (PER). The results are plotted for a link rate of 1 Mbps, a packet size of 1 Kilobits, propagation delay of 0.1, 0.5 and 1 ms respectively. It is assumed that the transmission and propagation delay for both the data packet and the ACK are the same. The maximum transmission rate achievable is 1000 packets/s. Thus, the throughput in the plot is normalized to this maximum value. The average throughput of ABP can be obtained theoretically. It is given by ¯ λ = 1 T t 1 + 2(1 + r)( p 1p ) packets/s where T t is the packet transmission time, p the packet error rate (PER), r the ratio of propagation time to the transmission time. The throughput of ABP obtained through simulation should match with the theoretically obtained throughput. Note that the throughput decreases with the PER. Also note that with increas- ing r, the throughput reduces and the performance of ABP degrades.

Upload: others

Post on 06-Feb-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Problem 19 - Carleton University

Problem 19

10−3

10−2

10−1

100

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

PER

Thr

ough

put

r=0.1r=0.5r=1

Figure 2.3: Throughput of ABP vs. PER

Figure above shows the throughput of SRP as it varies with the packet errorrate (PER). The results are plotted for a link rate of 1 Mbps, a packet size of 1Kilobits, propagation delay of 0.1, 0.5 and 1 ms respectively. It is assumed thatthe transmission and propagation delay for both the data packet and the ACK arethe same. The maximum transmission rate achievable is 1000 packets/s. Thus,the throughput in the plot is normalized to this maximum value.

The average throughput of ABP can be obtained theoretically. It is given by

λ̄ =1

Tt

(1 + 2(1 + r)( p

1−p)) packets/s

where Tt is the packet transmission time, p the packet error rate (PER), r the ratioof propagation time to the transmission time. The throughput of ABP obtainedthrough simulation should match with the theoretically obtained throughput.

Note that the throughput decreases with the PER. Also note that with increas-ing r, the throughput reduces and the performance of ABP degrades.

Page 2: Problem 19 - Carleton University

Problem 20

We have a 10,000 km round-trip route with a propagation time of 5 µs/km, so itwill take 50 ms to make the round trip. At a transmission rate of 100 Mbps, a “fullpipe” will have 5 Mb of data, or 5000 thousand-bit packets.

If N is the minimum window size to achieve 100% efficiency, we should have

NTRANSPTRANSP + 2PROP + ACK

= 1

1000N

1000 + 5, 000, 000 + 80= 1

N = 5001.

We should have a window of at least 5001 packets to achieve 100% efficiency.

Problem 21

(a) Total round-trip time Trt, is given by

Trt = T SRt + T SR

p + TRSt + TRS

p ,

where TABt , TAB

p are the transmission time and propagation time respec-tively from node A to node B. We assume that there is no queueing delayat R. Propagation time in each direction is 1 ms. Transmission times perpacket are given by

T SRt =

8 ∗ 1000107

= 0.8 ms,

TRSt =

8 ∗ 4030 ∗ 1000 = 0.0107 ms,

which gives Trt = 4.8107 ms. Thus, the window size W is

W =Trt

T SRt

≈ 6.

(b) The probability of both a packet and its ACK being received without errorsis p, where p is the probability of an ACK packet being received correctly,

Page 3: Problem 19 - Carleton University

the channel from S to R being error-free. Then, the average time it takes totransmit a packet successfully is given by

E[T succt ] = (1− p)T SR

t + p(WT SRt + E[T succ

t ]),

E[T succt ] = T SR

t

(1 +

(p

1− p

)W

).

Then, the average throughput is given by

λ̄ =1

E[T succt ]

= 950 packets/s.

Problem 22

In this problem we would like to calculate the efficiency of the Go Back N (GBN)protocol in the presence of error, and assuming that errors in different packets areindependent.

Efficiency is defined as the ratio of the time required to transmit a packet,TRANSP, to the average time it takes for a packet to be transmitted, E(T ),

Efficiency =TRANSP

E(T ).

To calculate τ = E(T ), let the state of the system be the number of packets re-maining to be transmitted and p be the packet error probability. The system movesfrom state n to n− 1 when a packet is successfully transmitted; the probability ofsuch an event is 1 − p, and it takes TRANSP seconds. The system moves fromstate n to state n when a packet has error; the probability of such an event is p andit takes time-out seconds, where time-out is the time round-trip travel time for apacket. When the pipe is just full with N packets, then time-out is N ×TRANSP.

From the above description we can calculate E(T ) as follows:

E(T ) = (1− p)TRANSP + p(time-out + E(T ))

= TRANSP +p× time-out

1− p

= TRANSP +pN × TRANSP

1− p.

Page 4: Problem 19 - Carleton University

So efficiency can be expressed as:

Efficiency =TRANSP

TRANSP + pN×TRANSP1−p

=1

1 + pN1−p

.

Note that the value of time-out does not depend of the window size but on thenumber of packets that we can store in the pipe; therefore, if we increase thewindow size the efficiency doesn’t change. However, if we increase the time-outas the window size increases, the efficiency drops.

Problem 23

(a) Probability of a packet being received correctly is (1− p)d+h.

(b) Probability that a data packet is received correctly and its ACK is also re-ceived correctly is Pc = (1− p)d+h(1− q)a.

(c) Let a random variable X equal the number of times a data packet had to betransmitted before an ACK was successfully received. Then,

E[X] =

∞∑x=1

Pc(1− Pc)x−1 =

1

Pc.

where Pc is the probability of a packet and its ACK being correctly receivedas found in (b).

(d) Efficiency of this protocol is given by

η =time to transmit d data bits

time to transmit mean number of bits transmitted before a successful ACK

=d

E[X](d+ h + a)

=dPc

(d+ h + a).

(e) This protocol is similar to SRP in that it retransmits only those packets thatfailed in successful transmission of both the packet and its ACK, but sincethe window size is infinite, the transmitter is never idle waiting for ACKs.Thus, the analysis is not valid for the standard SRP.

Page 5: Problem 19 - Carleton University
Page 6: Problem 19 - Carleton University

16

2w sequence numbers. That is, the sequence number space must be at least twice as large as thewindow size, k � 2w:

Problem 16.

a) True. Suppose the sender has a window size of 3 and sends packets 1, 2, 3 at t0. At t1 (t1 >t0) the receiver ACKS 1, 2, 3. At t2 (t2 > t1) the sender times out and resends 1, 2, 3. At t3 thereceiver receives the duplicates and re-acknowledges 1, 2, 3. At t4 the sender receives the ACKs thatthe receiver sent at t1 and advances its window to 4, 5, 6. At t5 the sender receives the ACKs 1, 2,3 the receiver sent at t2. These ACKs are outside its window.

b) True. By essentially the same scenario as in (a).

c) True.

d) True. Note that with a window size of 1, SR, GBN, and the alternating bit protocol are func-tionally equivalent. The window size of 1 precludes the possibility of out-of-order packets (withinthe window). A cumulative ACK is just an ordinary ACK in this situation, since it can only referto the single packet within the window.

Problem 17.

There are 232 = 4; 294; 967; 296 possible sequence numbers.

a) The sequence number does not increment by one with each segment. Rather, is increments bythe number of bytes of data sent. So the size of the MSS is irrelevant { the maximum size �le thatcan be sent from A to B is simply the number of bytes representable by 232 � 4:19 Gbytes.

b) The number of segments is d 232

1460e = 2; 941; 758. 66 bytes of header get added to each segment

giving a total of 194,156,028 bytes of header. The total number of bytes transmitted is 224 +194; 156; 028 = 3; 591 � 107 bits.

Thus it would take 3,591 seconds = 59 minutes to transmit the �le over a 10 Mbps link.

Problem 18.

Suppose packets n, n+1, and n+2 are sent, and that packet n is received and ACKed. If packets n+1and n+2 are reordered along the end-to-end-path (i.e., are received in the order n+2, n+1) then thereceipt of packet n+2 will generate a duplicate ack for n and would trigger a retransmission under apolicy of waiting only for second duplicate ACK for retransmission. By waiting for a triple duplicateACK, it must be the case that two packet after packet n are correctly received, while n+1 wasnot received. The designers of the triple duplicate ACK scheme probably felt that waiting for twosubsequent packets (rather than 1) was the right tradeo� between triggering a quick retransmissionwhen needed, but not retransmitting prematurely in the face of packet reordering.

Problem 19. Denote EstimatedRTT (n) for the estimate after the nth sample.

EstimatedRTT(1) = SampleRTT1

EstimatedRTT(2) = xSampleRTT1 + (1� x)SampleRTT2

Page 7: Problem 19 - Carleton University

20

R min latency W

28 Kbps 28.77 sec 2100 Kbps 8.2 sec 41 Mbps 1 sec 2510 Mbps 0.28 sec 235

Problem 23.

a)

K = number of windows that cover the object

= minfk : 30 + 31 + � � �+ 3k�1 � O=Sg

= min

�k :

1� 3k

1� 3� O=S

= minfk : 3k � 1 + 2O=Sg= dlog3(1 + 2O=S)e

b) Q is the number of times the server would stall for an object of in�nite size.

Q = max

�k : RTT+

S

R� S

R3k�1 � 0

=

�1 + log3

�1 +

RTT

S=R

��

Page 8: Problem 19 - Carleton University

21

c)

latency =O

R+ 2RTT+

PXk=1

stallk

=O

R+ 2RTT+

PXk=1

�RTT+

S

R� S

R3k�1

=O

R+ 2RTT+ P (RTT + S=R)� (3P � 1)

2

S

R

Problem 24.

R O/R P Min Latency withlatency slow start

28 Kbps 29.25 s 3 31.25 sec 33.18 sec100 Kbps 8.19 s 5 10.19 sec 13.86 sec1 Mbps 819 msec 7 2.81 sec 9.26 sec10 Mbps 82 msec 7 2 sec 9 sec

Problem 25.

a) T

b) T

c) F

d) F

Problem 26.

When the server sends a segment, it has to wait a time of TS=R+RTT for the acknowledgement to

Page 9: Problem 19 - Carleton University

23

Problem 27.

P�RTT+ S

R

�� (2P � 1) S

R

2RTT + OR + P

�RTT+ S

R

�� (2P � 1) SR

Problem 28.

a)

Transfer time of all M + 1 objects : (M + 1)O

R

TCP connection setup : 2 �RTTRequest for images : RTT

To this we have to add the latency due to slow-start.

Comparing the contribution of RTTs with that in non-persistent HTTP we see that the only RTTsthat a�ect the response time are the two RTTs needed for setting up the TCP connection andsending the initial request and one RTT for requesting the images. In non-persistent HTTP we havea separate TCP connection setup for each object.

b)

Because the last window of the initial object is full and the server does not need to wait for a requestfor the images, the situation is identical to the server sending one large object of (M + 1)O bytes.The response time is

2 � RTT +(M + 1)O

R+ P

0

�RTT +

S

R

�� (2P

0 � 1)S

R

c)

In the previous question, the server did not have to wait for a request for the images. The stalltime after sending the initial object in that case is [S=R+RTT � 2K�1(S=R)]+. In reality, the stall

Page 10: Problem 19 - Carleton University

24

time is RTT because the server has to wait for an explicit request for the images from the client.Substituting this into the response time equation gives

3 �RTT +(M + 1)O

R+ P

0

�RTT +

S

R

�� (2P

0 � 1)S

R� [

S

R+RTT � 2K�1

S

R]+

Problem 29.

Rate Persistent Non-persistent

28 Kbps 16.2 sec 20.4 sec100 Kbps 5.1 sec 10.6 sec1 Mbps 1.3 sec 8.9 sec10 Mbps 1.1 sec 8.8 sec

Problem 30.

Rate Persistent Non-persistent

28 Kbps 23.6 sec 91.7 sec100 Kbps 13.4 sec 89.0 sec1 Mbps 11.2 sec 88.1 sec10 Mbps 11.0 sec 88.0 sec

Problem 31.

Time to transfer all objects over the link : (M + 1)O=R

TCP connection setup for �rst request : 2RTT

TCP connection setup for X sets of image requests : M=X � 2RTT