[ntp:questions] Clock and Network Simulator

David L. Mills mills at udel.edu
Tue Jun 29 18:31:01 UTC 2010


You don't need to read the code, just the documentation. The ntpdsim is 
what the literature calls a probabilistic discrete event simulator 
(PDES). It provides a virtual environment including multiple servers and 
simulated network behavior within which the actual ntpd code runs. 
Everything, including packet send and receive, is simulated independent 
of operating system. It runs hundreds of times faster than the real 
system. It is indent is to study the synchronization behavior under 
low-probabiliy and long-baseline conditions. It is not a simple system; 
it simulates the actual conditions in a real world, multiple server 
environment and provides the same error reports, statistics reports and 
synchronization data as the real system..

 From your description your simulator is designed to do something else, 
but what else is not clear from your messages. It might help to describe 
an experiment using your simulator and show what results it produces.


Miroslav Lichvar wrote:

>On Mon, Jun 28, 2010 at 05:35:34PM +0000, David L. Mills wrote:
>>How is your simulator different than the one included in the NTP
>>software distribution?
>If I read the code correctly, ntpdsim simulates inside ntpd a
>minimalistic NTP server (or multiple servers) with configured wander
>and network delay, and an ideal local clock.
>clknetsim simulates clocks and a network to which are connected
>unmodified ntpd daemons. The simulation is transparent for them. With
>symbol preloading (dynamic linker's LD_PRELOAD variable) they don't
>use the real system calls like sendto(), recvfrom(), select(),
>gettimeofday(), ntp_adjtime(), but they use the symbols provided by
>clknetsim instead. The system calls are passed to the clknetsim
>server, which synchronizes all events, adjusts the clocks, forwards
>NTP packets and monitors the real time and frequency offsets of the
>virtual clocks.
>So, for a simulation similar to ntpdsim, at least two ntpd daemons
>have to be connected to clknetsim, one configured as a server with
>LOCAL clock (adding a refclock source is on my todo list) and a client
>which will be the subject of testing. 
>The advantage of this approach is that it allows you to test pretty
>much anything that can be tested in a real network, a chain of NTP
>servers (few such tests are on the clknetsim webpage), server/peer
>modes, broadcast modes, authentication, compatibility with older
>versions or different NTP implementations, etc.
>The disadvantage is that the simulation runs slower.

More information about the questions mailing list