Lec6
Lec6
Introduction to Networks
Hisham Othman
Basma Mohamed Afifi
Nadeen Hamza
rwnd
RcvBuffer speed-matching service:
app process may be slow at reading from matching send rate to
buffer receiving application’s
receiver: advertises unused buffer space drain rate
by including rwnd value in segment
header
guarantees receiver’s
sender: limits # of unACK’ed bytes to rwnd buffer doesn’t overflow
Congestion Control
TCP Congestion Control
Sliding Window Protocol
Sender maintains a congestion window (cwnd), in
addition to the receiver’s window (rwnd) advertised in
ACK
Allowed-window = min(cwnd, rwnd)
Ifno congestion: Allowed-window = rwnd
Packet loss is interpreted as congestion occurrence:
reduce congestion window size
TCP Congestion Control
Congestion control is performed at the sending host, using
feedback from the destination host (acknowledgments)
.
TCP Tahoe
Exponential increase takes place until one of 3 things
occur:
cwnd ≥ ssthresh, or
timeout event occurs, or
3 duplicate ACKs are detected
If cwnd ≥ ssthresh:
go to congestion avoidance state directly – steady “cautious”
transmission
If timeout or 3 duplicate ACKs:
set ssthresh = cwnd/2, and
set cwnd = 1,
Increase exponentially (go to slow start) until cwnd ≥ ssthresh,
then go to congestion avoidance state
TCP Congestion Avoidance
Reaction:
ssthresh = cwnd/2,
cwnd = 1,
enter slow start
Example
Assume 1 MSS = 1 KB
RTT cwnd ssthresh Event
1 Initial: 1 MSS = 1 KB Initial: 64KB
2 2 64
3 4 64
4 8 64
5 16 64 Timeout or 3 dup ACKs
cwnd
6 =1 1
2 8 ssthresh = cwnd/2
7 2 8
8 4 8
9 8 8
10 9 8
11 10 8 Timeout or 3 dup ACKs
12
13
Example
Assume 1 MSS = 1 KB
RTT cwnd ssthresh Event
1 Initial: 1 MSS = 1 KB Initial: 64KB
2 2 64
3 4 64
4 8 64
5 16 64 Timeout or 3 dup ACKs
cwnd
6 =1 1
2 8 ssthresh = cwnd/2
7 2 8
8 4 8
9 8 8
10 9 8
11 10 8 Timeout or 3 dup ACKs
12 1 5
13 2 5
TCP Reno
Slow start still incorporates exponential increase
If a timeout event occurs:
ssthresh = cwnd/2,
cwnd = 1,
increase exponentially until cwnd ≥ ssthresh, then enter congestion avoidance
If the missing ACK did not arrive then a timeout will occur:
ssthresh = cwnd/2,
cwnd = 1,
go to slow start (increase exponentially)