Lund University ETSN01 Advanced Telecommunication Tutorial 8 : Congestion Control Author: Antonio Franco Emma Fitzgerald Tutor: Farnaz Moradi December 18, 2015
Contents I Before you start 3 II Exercises 3 1 Congestion Control 3 1.1..................................... 3 1.2..................................... 3 1.3..................................... 3 1.4..................................... 4 1.5..................................... 4 1.6..................................... 4 1.7..................................... 4 1.8..................................... 5 1.9..................................... 5 III Solutions 5 1 Congestion Control 5 1.1..................................... 5 1.2..................................... 5 1.3..................................... 6 1.4..................................... 7 1.5..................................... 7 1.6..................................... 8 1.7..................................... 8 1.8..................................... 9 1.9..................................... 9
Part I Before you start This tutorial is given to prepare you to the exam. Since time is limited, it is highly advised that you first try to solve the exercises (Part II) at home, then have a look at the solutions (Part III), and, finally, ask questions during the exercises sessions. Part II Exercises 1 Congestion Control 1.1 The token bucket scheme places a limit on the length of time at which traffic can depart at the maximum data rate. Let the token bucket be defined by a bucket size b octets and a token arrival rate of r octets/second, and let the maximum output data rate by M octets/s. 1.2 1. Derive a formula for S, which is the length of the maximum-rate burst. That is, for how long can a flow transmit at the maximum output rate when governed by a token bucket? 2. What is the value of S for b = 250 KB, r = 2 MB/s, and M = 25 MB/s? Two TCP entities communicate across a reliable network. Let the normalized time to transmit a fixed-length segment equal 1. Assume that the end-to-end propagation delay is 3, and that it takes a time 2 to deliver data from a received segment to the transport user. The sender initially grants a credit of seven segments. The receiver uses a conservative flow control policy and updates its credit allocation at every opportunity. What is the maximum achievable throughput? 1.3 1. What is the global synchronisation problem in TCP (Transport Control Protocol) congestion control and why does it occur? 2. How does RED (Random Early Detection) avoid this problem while still controlling congestion? 3
1.4 3. In RED, what is the reason for the conversion from P a to P b? That is, why is the packet drop probability not simply linear as a function of the queue length? Although slow start with congestion avoidance is an effective technique for coping with congestion, it can result in long recovery times in high-speed networks, as this problem demonstrates. 1.5 1. Assume a round-trip delay of 60 ms (about what might occur across a continent) and a link with an available bandwidth of 1 Gbps, and a segment size of 576 octets. Determine the window size needed to keep the pipe full. 2. Repeat the previous part for a segment size of 16 kbytes. One difficulty with the original TCP SRTT estimator is the choice of initial value. In the absence of any special knowledge of network conditions, the typical approach is to pick an arbitrary value, say 3 seconds, and hope that this will converge quickly to an accurate value. If this estimate is too small, TCP will perform unnecessary retransmissions. If it is too large, TCP will wait a long time before retransmitting if the first segment is lost. Also, the convergence may be slow, as this problem indicates. (a) Choose α = 0.85 and SRTT(0) = 3 seconds, and assume all measured RTT values = 1 second and no packet loss. What is SRTT(19)? 1. (b) Now let SRTT(0) = 1 second and assume measured RTT values = 3 seconds and no packet loss. What is SRTT(19)? 1.6 A TCP implementation uses a value of β = 1.5 when calculating the retransmissino timeout, a lower bound of 0.5 s, and an upper bound of 5 s. 1.7 1. If the next value of SRTT is calculated to be 2.5 s, what will the RTO be? 2. If the next value of SRTT is calculated to be 4 s, what will the RTO be? 1. How can a TCP receiver increase the available credit even when no new data has been received? 2. How can a TCP receiver acknowledge a segment of size m octets without allocating more credit? 1 Hint: α n 1 + α n 2 +... + α + 1 = 1 αn 1 α. 4
1.8 What is the effect of the TCP window size on the achievable throughput? 1.9 Which round-trip samples are used as input to the TCP RTO calculation? Part III Solutions 1 Congestion Control 1.1 r M b Figure 1: Our token bucket scheme. (a) Tokens are used with rate M octets/s and replenished with rate r octets/s, effectively depleted with rate M-r octets/s (Figure 1); thus, the time until b bucket is emptied is M r s, and the length of the maximum size burst will be: b M octets (1) M r ; (b) from (1) we have 25 0.25 25 2 1.2 = 271.74 KB. 5
Figure 2: Time scheme of our TCP exchange. The time from a segment transmission until receiving new credit (i.e. the effective RTT of the sliding window) is 3+2+3=8. Window size is 7. Maximum throughput is 7/(1+8)=7/9. See Figure 2, explaining why 7 segments are transmitted in every period of 9 RTTs. 1.3 1. The global synchronisation problem occurs when there is congestion in the network. Many TCP connections will detect the congestion at once (by losing packets as queue buffers fill up) and will then simultaneously lower their transmission rates. This results in an under-utilisation of the network. The connections will then see eased congestion and increase their transmission rate again, resulting in congestion again. 6
1.4 1.5 2. RED uses probabilistic packet dropping before the queue becomes full. This means that only some TCP connections will lose packets and thus enter back-off. Since some connections back off, congestion will be eased, but global synchronisation is avoided as not all connections are affected at the same time. The packet drop probability increases as the queue length increases, so that congestion can be controlled effectively at different offered loads. 3. The conversion causes the packet drop probability to begin low and then increase as the count of packets arriving since the last packet drop increases. This results in a uniform distribution of the number of packets allowed to join the queue between discards. This is done to prevent unfairly penalising bursty traffic. 1. The time taken to transmit one one segment is T = 576 8 1 2 30 = 4.29 µs With a round-trip delay of 60 ms, the sender can transmit 60 10 3 4.29 10 6 = 13986 segments before it can receive a response from the receiver. Thus the window size needs to be 13986 in order to keep the pipe full. 2. For a segment size of 16 kbytes, we have Hence we need a window size of Remember from the slides: T = 16 210 8 1 2 30 = 0.12 ms 60 10 3 0.12 10 3 = 500. SRTT(k + 1) = α SRTT(k) + (1 α) RTT(k + 1) 7
; since RTT(k + 1) = RTT(k) = RTT k: SRTT(k + 1) = α SRTT(k) + (1 α) RTT.. = α [α SRTT(k 1) + (1 α) RTT] + (1 α) RTT = α 2 SRTT(k 1) + (1 + α) (1 α) RTT = α 2 [α SRTT(k 2) + (1 α) RTT] + (1 + α) (1 α) RTT = α 3 SRTT(k 2) + (1 + α + α 2 ) (1 α) RTT = α k+1 SRTT(0) + (1 α) RTT (α k + α k 1 +... + α + 1) (a) SRTT(n) = α n SRTT(0) + (1 α) RTT (α n 1 + α n 2 +... + α + 1) = α n SRTT(0) + (1 α) RTT 1 αn 1 α = αn SRTT(0) + RTT (1 α n ), so, SRTT(19) = 1.1sec. (b) SRTT(19) = 2.9 sec; in both cases, the convergence speed is slow, because in both cases, the initial SRTT(0) is improperly chosen. 1.6 The RTO is calculated as 1.7 RT O(K + 1) = min{ub, max{lb, β SRT T (K + 1)}} 1. Substituting in the given values: RT O(K + 1) = min{5, max{0.5, 1.5 2.5}} = 3.75 2. Substituting in the given values: RT O(K + 1) = min{5, max{0.5, 1.5 4}} = 5 Suppose the last octet acknowledged was AN = i and the current window value is W = j 1. The receiver can send an acknowledgement with AN = i and W = k, with k > j. This will acknowledge the same octet but increase the window size. 2. The receiver can send an acknowledgement with AN = i+m and W = j m. This moves the acknowledged octet number up by m, while still keeping the end of the window at the same value it had before. 8
1.8 If the window size is greater than or equal to the rate-delay product RD, then throughput is not affected. However, if the window size is less than RD, throughput will be decreased to W RD, where W is the window size. 1.9 Only round-trip time samples from segments that have not been retransmitted (i.e. that succeeded on the first attempt) are used. This is because if a segment is retransmitted, there is no way to know whether the acknowledgement received was from the original transmission or the retransmission, and thus the round-trip time cannot be accurately determined. 9