[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] Any problem with reset_rtx_timer() in tcp.cc ?



Dear Sir,

/*
 * We got a timeout or too many duplicate acks.  Clear the retransmit
timer.
 * Resume the sequence one past the last packet acked.
 * "mild" is 0 for timeouts and Tahoe dup acks, 1 for Reno dup acks.
 * "backoff" is 1 if the timer should be backed off, 0 otherwise.
 */
void TcpAgent::reset_rtx_timer(int mild, int backoff)
{
 if (backoff)
  rtt_backoff();
 set_rtx_timer();
 if (!mild)
  t_seqno_ = highest_ack_ + 1;
 rtt_active_ = 0;
}

/*
 * Set retransmit timer using current rtt estimate.  By calling
resched(),
 * it does not matter whether the timer was already running.
 */
void TcpAgent::set_rtx_timer()
{
 rtx_timer_.resched(rtt_timeout());
}


This is one of the function in tcp.cc. I guess it backoff the rto using
rtt_backoff(). Then re-calculate rto and set the retransmission timer
using set_rtx_timer(). Then, calculate the timing of the segment being
timed using rtt_active = 0.

However, I read TCP/IP Illustrated and according to my understanding,
the retransmission timer should be turned off in case of duplicate ack
and reset with the exponentially-backoff rto in case of timeout.

Therefore, should be code be

    void TcpAgent::reset_rtx_timer(int mild, int backoff)
{
 if (backoff)
  rtt_backoff();

if (mild)
  cancel_rtx_timer()
else
  set_rtx_timer();

 if (!mild)
  t_seqno_ = highest_ack_ + 1;
 rtt_active_ = 0;
}

I hope some experts on NS can advise me on this.

Regards
Estella