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

Re: problem in newtimer() (?)



Mark -

>I think I have run across a bug in ns' one-way TCP implementation.
...
>It is hung because there is no rexmt
>timer, I think.  So, I made a patch that seems to help the
>situation.  Here is my version of the newtimer() function.

I wasn't able to (quickly) construct a validation test that exhibits
the bug, but it is clearly a bug in the code, and I have put in
your fix.  (It doesn't make any change in the existing validation
tests one way or another.) 

The existing comments for newtimer() were as follows:

/*    
 * Set new retransmission timer if not all outstanding
 * or available data acked.  Otherwise, if a timer is still
 * outstanding, cancel it.
 */

but the code in newtimer() did not accurately check if all outstanding
data had been acked.  In particular, after a retransmit timeout,
the variable "t_seqno_" is reset (decreased) to highest_ack_ + 1,
but we might have outstanding unacknowledged packets higher than
"t_seqno_", up to "maxseq_", that have not been acknowledged.  The
timeout() code does the check correctly, I believe, by checking
"maxseq_" instead of "t_seqno_"...

The other functionally-equivalent fix would have been not to cancel
the rtx_timer in newtimer(), and to simply wait until it expires
in timeout(), where the check about whether to set another timer
was already correct...

(This fix will not go in the upcoming release, which is
unfortunately based on yesterday's code...)

- Sally
--------------------------------
http://www.aciri.org/floyd/
--------------------------------