[Top][All Lists]

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

Re: [lwip-users] Multi-Threaded netconn API TCP application

From: Darius Babrauskas
Subject: Re: [lwip-users] Multi-Threaded netconn API TCP application
Date: Fri, 9 Oct 2015 12:12:44 +0300


On Thu, Oct 01, 2015 at 04:41:34PM +0300, Darius Babrauskas wrote:

Maybe, not was supported the Linux port. Strange, that gettimeofday
CLOCK_REALTIME was used long time.

I don't understand any of that.

This can damage the test results. Exmp. NTP client can change
systemtime at each half hour, some seconds, when your testing LWIP.

linux have adjtime, which using ntp client for "slew " when time different is small < 128ms.
    If bigger different, doing "steps" (maybe small < 1000s)
This from my Ubuntu whireshark log (I think that wireshark using gettimeofday CLOCK_REALTIME ): No. Time Source Destination Protocol Length Info 1 0.000000 NTP 90 NTP Version 4, client 2 0.030025 X11 686 Requests: CreatePixmap, <Unknown opcode 145>, 3 0.041885 ViaTechn_ Broadcast ARP 60 Who has Tell 4 0.041896 AsustekC_ ViaTechn_f1 ARP 42 is at f4:6d:....... 5 0.042006 NTP 90 NTP Version 4, server 6 -0.279864 X11 686 Requests: CreatePixmap, <Unknown opcode 145>, <Unknown opcode 145>, 7 -0.279646 TCP 66 6000→47917 [ACK] Seq=1 Ack=1241 Win=65535 Len=0 TSval=301879 TSecr=7480572

No, that's not how NTP works on Linux. NTP does not step the system
time, it makes very small adjustments in the system clock frequency in
order to slow down or hurry up very very smoothly the system time.
CLOCK_MONOTONIC is still affected by incremental NTP adjustments.
But it "slew ". I think using CLOCK_MONOTONIC are better than CLOCK_MONOTONIC_RAW.

If you are talking about a NTP client called from time to time to set
the system clock, e.g: by calling ntpdate in a cronjob, then you are
doing it wrong, terribly wrong.
Yes, here more problems, which need resolve.

Embedded devices are of different concern, NTP is generally not used to
change a clock input used for timers or scheduler and very few devices
are adjusting a timer frequency based on the NTP timing data. Therefore
it is almost only used to output the current date in logs or human
interfaces, thus we don't care if it goes backward or forward a little
In my "embedded" projects I using SNTP for time synchronization without big problems, because use CLOCK_MONOTONIC.



reply via email to

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