ns-allinone-2.35/tcp/tcp.cc
void TcpAgent::newtimer(Packet* pkt)
{
	hdr_tcp *tcph = hdr_tcp::access(pkt);
	/*
	 * t_seqno_, the next packet to send, is reset (decreased) 
	 *   to highest_ack_ + 1 after a timeout,
	 *   so we also have to check maxseq_, the highest seqno sent.
	 * In addition, if the packet sent after the timeout has
	 *   the ECN bit set, then the returning ACK caused cwnd_ to
	 *   be decreased to less than one, and we can't send another
	 *   packet until the retransmit timer again expires.
	 *   So we have to check for "cwnd_ < 1" as well.
	 */
	if (t_seqno_ > tcph->seqno() || tcph->seqno() < maxseq_ || cwnd_ < 1) 
		set_rtx_timer();
	else
		cancel_rtx_timer();
}
/*
 * Set new retransmission timer if not all outstanding
 * or available data acked, or if we are unable to send because 
 * cwnd is less than one (as when the ECN bit is set when cwnd was 1).
 * Otherwise, if a timer is still outstanding, cancel it.
 */
Set new retransmission timer if not all outstanding
or available data acked, or if we are unable to send because
cwnd is less than one (as when the ECN bit is set when cwnd was 1).
Otherwise, if a timer is still outstanding, cancel it.
Set new retransmission timer if not all outstanding or available data acked or if we are unable to send because cwnd is less than one ( as when the ECN bit is set when cwnd was 1 ) . Otherwise if a timer is still outstanding cancel it .
void TcpAgent::newtimer(Packet* pkt)
{
	hdr_tcp *tcph = hdr_tcp::access(pkt);
	if (t_seqno_ > tcph->seqno() || tcph->seqno() < maxseq_ || cwnd_ < 1) 
		set_rtx_timer();
	else
		cancel_rtx_timer();
}
void TcpAgent :: newtimer ( Packet * pkt ) { hdr_tcp * tcph = hdr_tcp :: access ( pkt ) ; if ( t_seqno_ > tcph -> seqno ( ) || tcph -> seqno ( ) < maxseq_ || cwnd_ < 1 ) set_rtx_timer ( ) ; else cancel_rtx_timer ( ) ; }
Set new retransmission timer if not all outstanding
 or available data acked, or if we are unable to send because
 cwnd is less than one (as when the ECN bit is set when cwnd was 1).
Set new retransmission timer if not all outstanding or available data acked or if we are unable to send because cwnd is less than one ( as when the ECN bit is set when cwnd was 1 ) .
/*
	 * t_seqno_, the next packet to send, is reset (decreased) 
	 *   to highest_ack_ + 1 after a timeout,
	 *   so we also have to check maxseq_, the highest seqno sent.
	 * In addition, if the packet sent after the timeout has
	 *   the ECN bit set, then the returning ACK caused cwnd_ to
	 *   be decreased to less than one, and we can't send another
	 *   packet until the retransmit timer again expires.
	 *   So we have to check for "cwnd_ < 1" as well.
	 */