Skip to content

Testing kernel time management from userspace #40

@teto

Description

@teto

hi,

I am interested in testing the ntp protocol and real implementations such as chrony (http://chrony.tuxfamily.org) or ntpd (www.ntp.org) in a simulated environement, more precisely in the ns3 simulator (www.nsnam.org). ns3 makes it possible to run real code thanks to its Direct Code Execution (DCE) extension (https://github.com/direct-code-execution/ns-3-dce).

This issue is a way to assess my understanding as well as checking for possible solutions of what I want to achieve. Hence it's likely Ive misunderstood some parts, hope you will correct me.

So far I found a few testing projects:

Now there seems to be 2 modes for clocks:

The scenario I would like to achieve is:

  1. setup a topology/links in ns3
  2. load some ntp servers (chrony/ntpd) in the ns3 simulation with DCE
  3. these servers should call kernel adjtimex (thanks to lkl or libOS ?)
  4. changes made by the kernel need to be reflected in ns3

ns3 is a discrete event simulator, ie. it is tickless: if you schedule an event at t0=5sec and a second one at t1=100s, then ns3 will just execute the first event, set the integer representing time to t1=100 and execute the event.
So far in ns3, the nodes share the time value and are all perfectly synchronized, I want to introduce per node clocks.

My problem is step 4:

  • when ns3 advances time from t0 to t1, how can it update the kernel value ? There is no notion of tick it justs jumps. Should I write some driver struct clock_event_device ?
  • and the opposite, if the kernel needs to inject an offset, should it have an impact on the ns3 node clock ?

Sorry if it sounds confused or for mentioning you if you are not interested. I think this LKL project or libOS can help in what I want to achieve. I am willing to contribute to LKL if that helps but I would need directions.

Matt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions