Partie 9 Congestion Control in TCP Contrôle de
Transcription
Partie 9 Congestion Control in TCP Contrôle de
Congestion Control TCP Contrôle de congestion Partie 9 Congestion Control in TCP Principles Phases: Slow Start, Congestion Avoidance, Fast Recovery ● TCP s’appuie sur IP (sans connexion) ● TCP opère de bout-en-bout (détection de la congestion peu fiable et indirecte) ● Chaque source TCP agit «seule» (pas de coopération entre sources) ● Pertes de paquets interprétées comme un signalement de la congestion 588 589 Fenêtre d'émission Fenêtre d'émission F octets ● RTT ● ● Fenêtre d'émission - nombre d'octets non-acquittés – F = min (cwnd, W) »cwnd - variable maintenu par la source » W - fixé par la destination, champs fenêtre annoncée F - le nombre d'octets non acquittés – débit = F/RTT (formule de Little) Si congestion – RTT augmente, réduction automatique du débit de la source – mécanisme de contrôle : diminuer F 590 591 TCP and Congestion Control Phases de contrôle de congestion ● ● Connexion TCP peut être dans une de trois phases (point de vue du contrôle de congestion) – démarrage (slow start), après une perte détectée par une temporisation – récupération (fast recovery), après une perte détectée par retransmission rapide (fast retransmit) – évitement (congestion avoidance), tous les autres cas ● ● 592 TCP is used to avoid congestion in the Internet – a TCP source adjusts its window to the congestion status of the Internet (slow start, congestion avoidance) – this avoids congestion collapse and ensures some fairness TCP sources interprets losses as a negative feedback – use to reduce the sending rate UDP sources are a problem for the Internet – use for long lived sessions (ex: RealAudio) is a threat: congestion collapse – UDP sources should imitate TCP : “TCP friendly” 593 1 Congestion Control TCP Slow Start and Congestion Avoidance Increase/decrease connection opening: twnd = 65535 B cwnd = 1 seg ● retransmission timeout: Congestion Avoidance Slow Start exponential increase for cwnd until cwnd = twnd - multiplicative decrease for twnd - cwnd = 1 seg additive ● increase for twnd, cwnd = twnd cwnd = twnd retransmission timeout: notes this shows only 2 states out of 3 twnd = target window - multiplicative decrease for twnd - cwnd = 1 seg Multiplicative decrease – twnd = 0.5 × current_window – twnd = max (twnd, 2 × MSS) Additive increase – for each ACK »twnd = twnd + MSS × MSS / twnd (w←w + 1) »twnd = min (twnd, max-size) (64KB) 594 595 Increase/decrease ● twnd Additive Increase twnd = 1 seg Exponential increase – for each ACK »cwnd = cwnd + MSS »if (cwnd == twnd) go to avoidance phase ● ● 2 3 4 during one round trip + interval between packets: increase by 1 packet (linear increase) (equivalent to twnd = twnd + 1/twnd if TCP would have all segments of length MSS) 596 597 Slow Start cwnd = 1 seg 2 3 4 Slow Start 5 678 ● / * exponential increase for cwnd */ non dupl. ack received during slow start -> cwnd = cwnd + seg (in bytes) if cwnd = twnd then transition to congestion avoidance ● purpose of this phase: avoid burst of data after a retransmission timeout ● 598 window increases rapidly up to the stored value of twnd (this stored value is called ssthresh in the literature) 599 2 Congestion Control TCP Slow Start and Congestion Avoidance Example Slow Start and Congestion Avoidance Example Bytes twnd B A C 60 cwnd Bytes twnd B A C 30 60 0 cwnd 0 30 1 2 3 4 5 6 7 8 9 seconds B slow C congestion avoidance start congestion avoidance 0 0 1 2 3 4 5 6 7 8 9 seconds created from data from: IEEE Transactions on Networking, Oct. 95, “TCP Vegas”, L. Brakmo and L. Petersen 600 created from data from: IEEE Transactions on Networking, Oct. 95, “TCP Vegas”, L. Brakmo and L. Petersen 601 Congestion Control States Slow Start and Congestion Avoidance Example B slow start congestion avoidance new connection: C congestion avoidance cwnd = twnd: Congestion Avoidance Slow Start - exponential increase - additive increase retr. timeout: fast retransmit: fast retransmit: retr. timeout: Fast Recovery retr. timeout: - exponential increase beyond twnd expected ack received: created from data from: IEEE Transactions on Networking, Oct. 95, “TCP Vegas”, L. Brakmo and L. Petersen 602 Fast Recovery Example Fast Recovery ● Bytes A B C D F E 30 Fast Recovery 0 – cwnd = twnd + 3 × MSS (exp. increase) – cwnd = min (cwnd, 64K) – retransmission of the missing segment (n) ● twnd 60 Multiplicative decrease – twnd = 0.5 × current-size – twnd = max (twnd, 2 × MSS) ● 603 0 E cwnd 1 2 3 4 5 6 seconds F For each duplicated ACK A-B, E-F: fast recovery C-D: slow start – cwnd = cwnd + MSS (exp. increase) – cwnd = min (cwnd, 64K) – send following segments 604 605 3 Congestion Control TCP Congestion Control: Summary ● Congestion Control: Summary Congestion control aims at avoiding congestion collapse in the network With TCP/IP, performed in end-systems, mainly with TCP TCP Congestion control summary Principle: sender increases its sending window until losses occur, then decrease ● ● additive increase ● ● Target window – additive increase (no loss) – multiplicative decrease (loss) 3 phases – slow start: » starts with 1, exponential increase up to twnd – congestion avoidance » additive increase until loss or no increase – fast recovery » fast retransmission of one segment multiplicative decrease loss additive increase loss slow start 606 607 Congestion Control: Summary ● ● ● TCP Friendly Applications Slow start entered at setup or after retransmission timeout Fast recovery entered at fast retransmit Congestion avoidance entered when cwnd = twnd 608 ● ● All TCP/IP applications that generate long lived flows should mimics the behavior of a TCP source – RTP/UDP flow sending video/audio data Adaptive algorithm – application determines the sending rate – feedback - amount of lost packets, loss ratio – sending rate = rate of a TCP flow experiencing the same loss ratio 609 TCP Loss - Throughput formulae θ=L C T q ● ● TCP connection with – RTT T – packet size L – average packet loss ratio q – constant C = 1.22 Transmission time negligible compared to RTT, losses are rare, time spent in Slow Start and Fast Recovery negligible 610 4