[Olsr-users] 0.5.6 Routes disappear after 4 mins of uptime, then all OK - suspect clock sync

Hannes Gredler (spam-protected)
Thu Sep 4 10:54:23 CEST 2008


On Thu, Sep 04, 2008 at 08:10:06AM +0200, Henning Rogge wrote:
| Am Mittwoch 03 September 2008 18:28:32 schrieb Hannes Gredler:
| > On Wed, Sep 03, 2008 at 06:18:54PM +0200, Henning Rogge wrote:
| > | we could just use a function like this to compare two time-values:
| > |
| > | int olsr_timer_cmp(olsr_u32_t t1, olsr_u32_t t2) {
| > |    if (t1 == t2)
| > |       return 0;
| > |
| > |    if (t1 > t2 && (t1-t2) < (1<<31)) {
| > |        return 1;
| > |    return -1;
| > | }
| >
| > you are assuming that you have no timer in the system
| > that ever spans across a 2^31 clocktick period and that
| > 2^31 clocktick is sufficiently large (order of days).
| I think 2^31 milliseconds (I would like to normalize our clock to something 
| like this) should be more than enough. That's 596 day or nearly two years.

millisecond resolution of a 2^31 wide timer gets you down to an overflow
every 24.85 days.
 
| > i just wonder on a sufficient small clocktick resolution
| > one could break this form of overflow detection.
| With normalization that should be no problem.

what we could do is normalizing to each scheduler interval of 50ms.

2^31/20 = which would give us an overflow each 3.4 years.

/hannes




More information about the Olsr-users mailing list