Observe conservation of packets when entering Fast Recovery while

doing Limited Transmit.  Only artificially inflate the congestion
window by 1 segment instead of the usual 3 to take into account
the 2 already sent by Limited Transmit.

Approved in principle by:	Mark Allman <mallman@grc.nasa.gov>,
Hari Balakrishnan <hari@nms.lcs.mit.edu>, Sally Floyd <floyd@icir.org>
This commit is contained in:
Jeffrey Hsu 2003-04-01 21:16:46 +00:00
parent 711c2e1de2
commit 48d2549c3e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112957
3 changed files with 43 additions and 6 deletions

View File

@ -1762,19 +1762,37 @@ tcp_input(m, off0)
tp->snd_nxt = th->th_ack;
tp->snd_cwnd = tp->t_maxseg;
(void) tcp_output(tp);
KASSERT(tp->snd_limited <= 2,
("tp->snd_limited too big"));
tp->snd_cwnd = tp->snd_ssthresh +
tp->t_maxseg * tp->t_dupacks;
tp->t_maxseg *
(tp->t_dupacks - tp->snd_limited);
if (SEQ_GT(onxt, tp->snd_nxt))
tp->snd_nxt = onxt;
goto drop;
} else if (tcp_do_rfc3042) {
u_long oldcwnd = tp->snd_cwnd;
tcp_seq oldsndmax = tp->snd_max;
u_int sent;
KASSERT(tp->t_dupacks == 1 ||
tp->t_dupacks == 2,
("dupacks not 1 or 2"));
tp->snd_cwnd += tp->t_dupacks *
tp->t_maxseg;
if (tp->t_dupacks == 1) {
tp->snd_limited = 0;
tp->snd_cwnd += tp->t_maxseg;
} else {
tp->snd_cwnd +=
tp->t_maxseg * 2;
}
(void) tcp_output(tp);
sent = tp->snd_max - oldsndmax;
if (sent > tp->t_maxseg) {
KASSERT(tp->snd_limited == 0 &&
tp->t_dupacks == 2,
("sent too much"));
tp->snd_limited = 2;
} else if (sent > 0)
++tp->snd_limited;
tp->snd_cwnd = oldcwnd;
goto drop;
}

View File

@ -1762,19 +1762,37 @@ tcp_input(m, off0)
tp->snd_nxt = th->th_ack;
tp->snd_cwnd = tp->t_maxseg;
(void) tcp_output(tp);
KASSERT(tp->snd_limited <= 2,
("tp->snd_limited too big"));
tp->snd_cwnd = tp->snd_ssthresh +
tp->t_maxseg * tp->t_dupacks;
tp->t_maxseg *
(tp->t_dupacks - tp->snd_limited);
if (SEQ_GT(onxt, tp->snd_nxt))
tp->snd_nxt = onxt;
goto drop;
} else if (tcp_do_rfc3042) {
u_long oldcwnd = tp->snd_cwnd;
tcp_seq oldsndmax = tp->snd_max;
u_int sent;
KASSERT(tp->t_dupacks == 1 ||
tp->t_dupacks == 2,
("dupacks not 1 or 2"));
tp->snd_cwnd += tp->t_dupacks *
tp->t_maxseg;
if (tp->t_dupacks == 1) {
tp->snd_limited = 0;
tp->snd_cwnd += tp->t_maxseg;
} else {
tp->snd_cwnd +=
tp->t_maxseg * 2;
}
(void) tcp_output(tp);
sent = tp->snd_max - oldsndmax;
if (sent > tp->t_maxseg) {
KASSERT(tp->snd_limited == 0 &&
tp->t_dupacks == 2,
("sent too much"));
tp->snd_limited = 2;
} else if (sent > 0)
++tp->snd_limited;
tp->snd_cwnd = oldcwnd;
goto drop;
}

View File

@ -177,6 +177,7 @@ struct tcpcb {
u_long snd_ssthresh_prev; /* ssthresh prior to retransmit */
tcp_seq snd_high_prev; /* snd_high prior to retransmit */
u_long t_badrxtwin; /* window for retransmit recovery */
u_char snd_limited; /* segments limited transmitted */
};
/*