[En-Nut-Discussion] Latest fix in tcpsm.c and tcpout.c

Henrik Maier hmlists at focus-sw.com
Tue Apr 15 04:16:28 CEST 2008


> -----Original Message-----
> From: en-nut-discussion-bounces at egnite.de [mailto:en-nut-discussion-
> bounces at egnite.de] On Behalf Of Alain M.
> Sent: Tuesday, 15 April 2008 8:57 AM
> To: Ethernut User Chat (English)
> Subject: Re: [En-Nut-Discussion] Latest fix in tcpsm.c and tcpout.c
> 
> I am very glad it is so :) but then "something" has been wrong in some
> of our discussions...
> 
> If timeous are limited, then is it normal to have timeouts in excess of
> 65s?

It is not possible to have time-outs > 65s. It only was suggested to use a
32-bit variable instead of 16-bit as a solution to overcome the fact that a
timer variable will roll over and it's value becomes zero then. Despite 0
being a valid time it had also a special meaning and indicated a state. This
conflict caused a bug. Using a 32-bit value would make this less likely but
it still will happen (once every 49.7 days instead of 65s). A better fix has
been discussed and approved by Harald.

This is the logic which calculates the time-out:
 
    /* According to RFC793 (or STD007), page 41, we use 0.8 for ALPHA and
2.0 for BETA. */
    /* Limit retransmission timeout to 200ms as lower and 20secs as upper
boundary */
    sock->so_rtto = min (20000, max(200, (delta * 4 + sock->so_rtto * 8) /
10));

As you see it is within the range of 200ms and 20s.

Henrik
http://www.proconx.com





More information about the En-Nut-Discussion mailing list