ns-allinone-2.35/tcp/tcp-full.cc
int
FullTcpAgent::need_send()
{
	if (flags_ & TF_ACKNOW)
		return TRUE;

	int spa = (spa_thresh_ > 0 && ((rcv_nxt_ - irs_)  < spa_thresh_)) ?
		1 : segs_per_ack_;
		
	return ((rcv_nxt_ - last_ack_sent_) >= (spa * maxseg_));
}
/*
 * real tcp determines if the remote
 * side should receive a window update/ACK from us, and often
 * results in sending an update every 2 segments, thereby
 * giving the familiar 2-packets-per-ack behavior of TCP.
 * Here, we don't advertise any windows, so we just see if
 * there's at least 'segs_per_ack_' pkts not yet acked
 *
 * also, provide for a segs-per-ack "threshold" where
 * we generate 1-ack-per-seg until enough stuff
 * (spa_thresh_ bytes) has been received from the other side
 * This idea came from vj/kmn in BayTcp.  Added 8/21/01.
 */
real tcp determines if the remote
side should receive a window update/ACK from us, and often
results in sending an update every 2 segments, thereby
giving the familiar 2-packets-per-ack behavior of TCP.
Here, we don't advertise any windows, so we just see if
there's at least 'segs_per_ack_' pkts not yet acked


real tcp determines if the remote side should receive a window update / ACK from us and often results in sending an update every 2 segments thereby giving the familiar 2 - packets - per - ack behavior of TCP . Here we don ' t advertise any windows so we just see if there ' s at least ' segs_per_ack_ ' pkts not yet acked
int
FullTcpAgent::need_send()
{
	if (flags_ & TF_ACKNOW)
		return TRUE;
	int spa = (spa_thresh_ > 0 && ((rcv_nxt_ - irs_)  < spa_thresh_)) ?
		1 : segs_per_ack_;
	return ((rcv_nxt_ - last_ack_sent_) >= (spa * maxseg_));
}
int FullTcpAgent :: need_send ( ) { if ( flags_ & TF_ACKNOW ) return TRUE ; int spa = ( spa_thresh_ > 0 && ( ( rcv_nxt_ - irs_ ) < spa_thresh_ ) ) ? 1 : segs_per_ack_ ; return ( ( rcv_nxt_ - last_ack_sent_ ) >= ( spa * maxseg_ ) ) ; }
real tcp determines if the remote
 side should receive a window update/ACK from us, and often
 results in sending an update every 2 segments, thereby
 giving the familiar 2-packets-per-ack behavior of TCP.
real tcp determines if the remote side should receive a window update / ACK from us and often results in sending an update every 2 segments thereby giving the familiar 2 - packets - per - ack behavior of TCP .