lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] tcp_tmr - TCP_TMR_INTERVAL


From: Hampus Thorell
Subject: Re: [lwip-users] tcp_tmr - TCP_TMR_INTERVAL
Date: Tue, 22 Aug 2006 10:32:35 +0200
User-agent: Thunderbird 1.5 (Windows/20051201)

Yes, the information was very valuable.

However, I was thinking of decreasing the TCP_TMR_INTERVAL which is set to default 250 in my version to for instance 1, do you believe this would corrupt anything?

Hampus

Kieran Mansley wrote:
On Tue, 2006-08-22 at 08:15 +0200, Hampus Thorell wrote:
Hello!

I have some questions about the tcp_tmr(). I know this function calls two other timer functions but why are they needed?

In the documentation it says that it must be called every TCP_TMR_INTERVAL milliseconds. Does this imply that it must be called exactly every TCP_TMR_INTERVAL milliseconds or is it okay to call it more often than that? What happens if it isn't called exactly every TCP_TMR_INTERVAL milliseconds?

I think (and it's been a while since I looked at this code in detail, so
could be wrong) that the reasoning behind this is that to make lwIP more
portable it does not assume there are any particular facilities
available to it from the operating system, and timers are one of these.
As a result, it is left as an exercise to the porter to find some
mechanism to ensure that the timers are executed in a timely manner, and
the API for this is the tcp_tmr() function.

Because the lwIP code can't access anything to do with measuring time
(without becoming less portable) it wouldn't know if you called it more
or less often than TCP_TMR_INTERVAL milliseconds.  It just counts how
often the function has been called, and uses that count to decide when
to do certain TCP related actions such as retransmitting a packet that
has not been acknowledged for example.  If you called tcp_tmr() more
frequently, these actions would happen sooner, which while if it was
only a few tens of milliseconds different it might not have much effect,
if it was significantly more frequent you could start to see things
breaking the TCP RFC standards for how long you should wait before
sending packets etc.

Hope that helps,

Kieran


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users






reply via email to

[Prev in Thread] Current Thread [Next in Thread]