Initially:

cwnd = 1

ssthresh = infinite

Dup_ACK =0

New ACK arrives:

If (cwnd < ssthresh)

/*Slow start*/

cwnd = cwnd+1

Else

/*Congestion avoidance*/

cwnd = cwnd+1/cwnd

Duplicated ACK arrives:

Dup_ACK =Dup_ACK+1

If (Dup_ACK ==3)

/*Fast retransmit*/

cwnd =cwnd /2;

Timeout:

/* Multiplicative decrease */

/* check dup_Ack */

If (Dup_ACK==1)

cwnd=cwnd/8

Else if (Dup_ACK ==2)

cwnd = cwnd /4

Else

/ *Dup_Ack is zero*/

cwnd = 1