Pseudo-Code Summary for TCP Congestion Control Algorithms (in segments)
TCP Tahoe TCP Reno
========= ========
Initialization: Initialization:
cwnd = 1; cwnd = 1;
Slow Start: Slow Start:
for each new ACK received for each new ACK received
cwnd++; cwnd++;
Congestion Avoidance: Congestion Avoidance:
for each new ACK received for each new ACK received
cwnd += 1/cwnd; cwnd += 1/cwnd;
Packet Loss (3 dupACKs): Packet Loss (3 dupACKs):
ssthresh = cwnd/2; ssthresh = cwnd/2;
cwnd = 1; cwnd = ssthresh;
Packet Loss (timeout): Packet Loss (timeout):
ssthresh = cwnd/2; ssthresh = cwnd/2;
cwnd = 1; cwnd = 1;
Notes:
1 segment = MSS bytes (Maximum Segment Size) (e.g., 1460 bytes)
W = min(W_s, W_r, cwnd)