HOW (derivation): We want +1 segment per RTT, but ACKs arrive throughout the RTT. With cwnd = W segments, W ACKs arrive per RTT, and we want their total effect to be +1 MSS:
per ACK: cwnd+=cwndMSS×MSS
Summing over W ACKs: W×W⋅MSSMSS2=MSS. ✓ Exactly +1 per RTT.
So per-RTT:
cwnd(t+RTT)=cwnd(t)+1MSS
This is the AI of AIMD (Additive Increase, Multiplicative Decrease).
WHY halve (the MD in AIMD)? Cutting in half is a strong, multiplicative back-off that quickly relieves congestion and, combined with additive increase, gives a fair, stable sawtooth that converges (proven via the AIMD chart — fairness line).
Derivation of K (WHY that cube root): After a loss, cwnd drops to βWmax... wait — actually CUBIC drops by factor (1−β), so new window =(1−β)Wmax. We want the cubic curve to pass through the new window at t=0 and reach Wmax at t=K (its inflection plateau). Set Wcubic(0)=(1−β)Wmax:
C(0−K)3+Wmax=(1−β)Wmax−CK3=−βWmax⇒K=3CβWmax
Imagine pouring water into a thin pipe but you can't see the pipe. You start with a trickle, then double the flow each second to find how much it takes. The moment water splashes back (a packet got lost), you know you pushed too hard, so you cut the flow in half and then add just a tiny bit more each second, sneaking up on the perfect amount. If the splash was a tiny dribble (3 duplicate "I'm still missing one!" notes), you only halve. If the pipe went totally silent (timeout), you slam back to a trickle. CUBIC is a smarter version: it remembers the flow rate that caused the last splash, races back up to just below it, pauses to test it, then carefully pushes higher to see if the pipe got bigger.
Dekho, Internet ek shared road hai jisme koi traffic police nahi hai. Agar har sender apni
poori speed se data bhej de, to routers ki queue overflow ho jaayegi, packets drop honge, sab
log retransmit karenge aur network collapse — yeh 1986 mein literally hua tha. Isliye har
sender khud andaaza lagata hai ki network kitna le sakta hai, aur iska control hota hai
cwnd (congestion window) se. Throughput basically cwnd/RTT hai.
Game simple hai: Slow Start mein chhote se shuru karo (1 MSS) aur har RTT mein double
karo — naam "slow" hai par yeh sabse fast exponential growth hai. Jab cwnd ek ssthresh
tak pahunch jaaye, switch karo Congestion Avoidance pe, jahan har RTT sirf +1 MSS
badhta hai (tiptoe karke limit dhoondhna). Yeh poora pattern AIMD kehlata hai — additive
increase, multiplicative decrease.
Loss do tarah ka hota hai. Timeout = network bilkul silent, bahut severe → cwnd ko 1 par
patak do aur slow start dobara. 3 duplicate ACKs = halka signal, kyunki baaki packets aa
rahe hai, sirf ek kho gaya → ssthresh aur cwnd ko aadha karo, CA mein hi raho. Teen dup ACK
isliye, kyunki ek-do to reordering ho sakta hai, teen ka matlab pakka loss — to turant
retransmit karo bina timer ka wait kiye; ise Fast Retransmit kehte hai.
CUBIC modern Linux default hai. Reno ka +1/RTT fast long-distance links pe bahut slow hai.
CUBIC formula W(t)=C(t−K)3+Wmax use karta hai, jahan t last loss ke baad ka real
time hai (RTT nahi) — isliye alag-alag RTT waale flows fair rehte hai. Curve pehle concave
hota hai (purane Wmax ke paas careful), phir convex (naya bandwidth khojne ke liye tezi
se upar). Bas yahi pura khel hai — gently upar chalo, congestion sense karte hi zor se back off.