0% found this document useful (0 votes)
75 views5 pages

Advanced Computer Networks: CWND Offeredwindow

TCP performs congestion control using three states - slow start, congestion avoidance, and fast recovery. Slow start exponentially increases the congestion window until a threshold is reached. Congestion avoidance additively increases the window. If a loss is detected, the window is multiplicatively decreased. Fast recovery allows quick retransmission without slowing increasing the window. The goal is to increase sending rate until losses occur then decrease in a controlled way to avoid congestion collapse.

Uploaded by

vermuz
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views5 pages

Advanced Computer Networks: CWND Offeredwindow

TCP performs congestion control using three states - slow start, congestion avoidance, and fast recovery. Slow start exponentially increases the congestion window until a threshold is reached. Congestion avoidance additively increases the window. If a loss is detected, the window is multiplicatively decreased. Fast recovery allows quick retransmission without slowing increasing the window. The goal is to increase sending rate until losses occur then decrease in a controlled way to avoid congestion collapse.

Uploaded by

vermuz
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

TCP Congestion Control

Contents

Advanced Computer Networks


Congestion control in TCP
Prof. Andrzej Duda duda@imag.fr
http://duda.imag.fr
1

Principles TCP congestion control states


Slow Start Congestion Avoidance Fast Recovery

TCP friendly applications

TCP and Congestion Control


TCP is used to avoid congestion in the Internet

Sending window
W bytes

a TCP source adjusts its sending window to the congestion state of the network this avoids congestion collapse and ensures some fairness used to reduce the sending rate

TCP sources interpret losses as a negative feedback

Window-based control UDP sources are a problem for the Internet


RTT

use for long lived sessions (ex: RealAudio) is a threat: congestion collapse UDP sources should imitate TCP : TCP friendly

W - the number of non ACKed bytes

throughput = W/RTT (Little's formulae) RTT increases, automatic reduction of the source rate additional control: decrease W
4

If congestion

3

Sending window
Sending window - number of non ACKed bytes

Congestion control states


TCP connection may be in three states with respect to congestion

W = min (cwnd, OfferedWindow)

cwnd

congestion window - maintained by TCP source announced by destination in TCP header flow control reflects free buffer space

OfferedWindow

Slow Start (Dmarrage Lent) after loss detected by retransmission timer Fast Recovery (Rcupration Rapide) after loss detected by Fast Retransmit (three duplicated ACKs) Congestion Avoidance (vitement de Congestion) otherwise

Same mechanism used for flow control and for congestion control

TCP Congestion Control

Slow Start and Congestion Avoidance


connection opening: twnd = 65535 B cwnd = 1 seg retransmission timeout:

Slow Start
/ * exponential increase for cwnd */ non dupl. ack received during slow start -> cwnd = cwnd + MSS (in bytes) if cwnd = twnd then transition to congestion avoidance

Slow Start exponential increase for cwnd until cwnd = twnd

- multiplicative decrease for twnd - cwnd = 1 seg additive

Congestion Avoidance

increase for twnd, cwnd = twnd

cwnd = twnd retransmission timeout: - multiplicative decrease for twnd - cwnd = 1 seg notes this shows only 2 states out of 3 twnd = target window 7

Window increases rapidly up to the stored value of twnd (this stored value is also called ssthresh in the literature) Not so slow, rather exponential
8

Slow Start
cwnd = 1 seg 2 3 4 5 67 8

Increase/decrease
Multiplicative decrease twnd = 0.5 cwnd twnd = max (twnd, 2 MSS) Additive increase

for each ACK


purpose of this phase: avoid bursts of data at the beggining or after a retransmission timeout

twnd = twnd + MSS MSS / twnd twnd = min (twnd, max-size) (64KB)
for each ACK: twnd/MSS 1/W for a full window: WW + 1
10

twnd is in bytes, counting in segments this means that


twnd Additive Increase


twnd = cwnd = 1 seg 2 3 4

Example
Bytes 60 twnd

cwnd 30

during one round trip + interval between packets: increase by 1 MSS (linear increase)

0 0 1 2 3 4 5 6 7 8 9 seconds

11

created from data from: IEEE Transactions on Networking, Oct. 95, TCP Vegas, L. Brakmo and L. Petersen 12

TCP Congestion Control

Bytes
Example60
Bytes 60 cwnd 30 twnd A B C congestion avoidance

Slow Start and Congestion Avoidance


B slow start C congestion avoidance

30
0 1 2 3 4 5 6 7 8 9 seconds

B slow C congestion avoidance start congestion avoidance

0 0
3 4 5 6
created from data from: IEEE Transactions on Networking, Oct. 95, TCP Vegas, L. Brakmo and L. Petersen 13

created from data from: IEEE Transactions on Networking, Oct. 95, TCP Vegas, L. Brakmo and L. Petersen 14

9 seconds

9 seconds

Congestion Control States


new connection: Slow Start - exponential increase cwnd = twnd: Congestion Avoidance - additive increase

Fast Retransmit
P1 P2 P3 P4 P5 P6 P3 P7

retr. timeout:

A1 A2 A2 A2 A2 A?

fast retransmit: retr. timeout:

fast retransmit:

Fast Recovery - exponential increase beyond twnd

Fast Retransmit

retr. timeout:

expected ack received:


15

retransmit timer can be large optimize retransmissions similarly to Selective Retransmit if sender receives 3 duplicated ACKs, retransmit missing segment
16

Fast Recovery
Multiplicative decrease

Fast Recovery Example


Bytes twnd A B C D E F

twnd = 0.5 cwnd twnd = max (twnd, 2 MSS)

Bytes

twnd

60

Fast Recovery

30

cwnd = twnd + 3 increase) cwnd = min (cwnd, 64K) retransmission of the missing segment (n) cwnd = cwnd + MSS cwnd = min (cwnd, 64K) keep sending segments in the current window

60 MSS (exp.

0 E 0 cwnd 1 2 F A-B, E-F: fast recovery C-D: slow start 3 4 5 6 seconds

For each duplicated ACK


30 (exp. increase) 0 0 cwnd

17

6 seconds

18

TCP Congestion Control

TCP Congestion Control


TCP performs congestion control in end-systems Principle

TCP Congestion Control


3 phases

sender increases its sending window until loss occurs, then decreases additive increase (no loss) multiplicative decrease (loss)

slow start

starts with 1, exponential increase up to twnd additive increase until loss or max window fast retransmission of one segment

Target window

congestion avoidance

fast recovery

multiplicative decrease additive increase loss additive increase loss

Slow start entered at setup or after retransmission timeout Fast recovery entered at fast retransmit Congestion avoidance entered when cwnd = twnd
19 20

slow start

Fairness of the TCP


TCP differs from the pure AI-MD principle

Fairness of the TCP


S1
10 Mb/s, 20 ms 10 Mb/s, 60 ms

window based control, not rate based increase in rate is not strictly additive - window is increased by 1/W for each ACK

router

destination
1 Mb/s 10 ms 8 seg.

Adaptation algorithm of TCP results in a negative bias against long round trip times Like with proportional fairness, the adaptation algorithm gives less to sources using many resources

8 seg.

S2

not the number of links, but RTT

Example network with two TCP sources

21

link capacity, delay


limited queues on the link (8 segments)
22

NS simulation

Throughput in time
ACK numbers S1

TCP Friendly Applications


All TCP/IP applications that generate long lived flows should mimics the behavior of a TCP source

RTP/UDP flow sending video/audio data application determines the sending rate feedback - amount of lost packets, loss ratio sending rate = rate of a TCP flow experiencing the same loss ratio

Adaptive algorithm

S2

time
23 24

TCP Congestion Control

TCP Loss - Throughput formulae


!=L C T q
TCP connection with

Facts to remember
TCP performs congestion control in end-systems

sender increases its sending window until loss occurs, then decreases

additive increase (no loss) multiplicative decrease (loss)

TCP states

RTT T segment size L average packet loss ratio q constant C = 1.22

slow start, congestion avoidance, fast recovery

Negative bias towards long round trip times UDP applications should behave like TCP with the same loss rate

Transmission time negligible compared to RTT, losses are rare, time spent in Slow Start and Fast Recovery negligible
25 26

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy