--- tcp_input.c.original Sun Jun 1 22:35:04 1997 +++ tcp_input.c Sun Jun 1 22:51:58 1997 @@ -1282,7 +1282,23 @@ tp->snd_nxt = onxt; goto drop; } else if (tp->t_dupacks > tcprexmtthresh) { - tp->snd_cwnd += tp->t_maxseg; + + /* + * tp->snd_cwnd += tp->t_maxseg; + * + * Above line replaced by following + * piece of code as part of the proposed + * modification to limit cwnd inflation. + * The new piece of code increments cwnd + * as in normal congestion avoidance. It + * also checks cwnd against TCP_MAXWIN. + * + */ + + tp->snd_cwnd = min(tp->snd_cwnd + + (tp->t_maxseg * tp->t_maxseg + / tp->snd_cwnd) + , TCP_MAXWIN<snd_scale); (void) tcp_output(tp); goto drop; } @@ -1293,10 +1309,21 @@ /* * If the congestion window was inflated to account * for the other side's cached packets, retract it. + * + * if (tp->t_dupacks >= tcprexmtthresh && + * tp->snd_cwnd > tp->snd_ssthresh) + * tp->snd_cwnd = tp->snd_ssthresh; + * + * Above if-statement remarked out as part of the proposed + * modification to limit cwnd inflation. + * Note that this if-statement can be left in if you want to + * limit the size of the burst of back-to-back segments that + * occurs when the non-duplicate ACK arrives. But doing this + * will make the TCP source slightly less agressive (i.e. it + * will be well-behaved ! ). + * */ - if (tp->t_dupacks >= tcprexmtthresh && - tp->snd_cwnd > tp->snd_ssthresh) - tp->snd_cwnd = tp->snd_ssthresh; + tp->t_dupacks = 0; if (SEQ_GT(ti->ti_ack, tp->snd_max)) { tcpstat.tcps_rcvacktoomuch++;