Advanced Computer Networks: CWND Offeredwindow
Advanced Computer Networks: CWND Offeredwindow
Contents
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
RTT
use for long lived sessions (ex: RealAudio) is a threat: congestion collapse UDP sources should imitate TCP : TCP friendly
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
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
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
Congestion Avoidance
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
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
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
Bytes
Example60
Bytes 60 cwnd 30 twnd A B C congestion avoidance
30
0 1 2 3 4 5 6 7 8 9 seconds
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
Fast Retransmit
P1 P2 P3 P4 P5 P6 P3 P7
retr. timeout:
A1 A2 A2 A2 A2 A?
fast retransmit:
Fast Retransmit
retr. timeout:
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
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.
17
6 seconds
18
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
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
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
21
NS simulation
Throughput in time
ACK numbers S1
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
Facts to remember
TCP performs congestion control in end-systems
sender increases its sending window until loss occurs, then decreases
TCP states
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