ntp in python

J

Janto Dreijer

I want to measure the packet delivery delays over various network
links. For this I need to synchronise the times of the sender and
receiver, either against NTP or eachother.

Unfortunately I won't necessarily have root priviledges to change the
PCs' clocks. So I'm looking for a way I can determine the offset and
simply correct my measurements from my Python code.

I doubt something like
http://www.nightsong.com/phr/python/setclock.py
would give me a resolution of less than 10ms - which is what I want.

Any Python module out there that uses a more sophisticated method?

btw I can do round-trip delivery and avoid the whole clock-mismatch
issue, but this would lose information on the network's asymmetry -
which would be really nice to have.
 
J

Jeremy Sanders

Janto said:
I want to measure the packet delivery delays over various network
links. For this I need to synchronise the times of the sender and
receiver, either against NTP or eachother.

Couldn't you just use NTP itself to get the delivery delay? You can read the
delay out from the ntpdc console using dmpeers, or lopeers in ntpq. You
could have two peers either side of the link and measure the delay from
NTP.

You may also be able to query remote ntp servers to get their delays to
their peers.

Jeremy
 
S

Sander Steffann

Hi,
I want to measure the packet delivery delays over various network
links. For this I need to synchronise the times of the sender and
receiver, either against NTP or eachother.

Maybe you can contact RIPE. They have test-boxes for exactly these kind of
tests. I know AMS-IX uses them to measure the quality of their switch
platform.

See http://www.ripe.net/projects/ttm/index.html

- Sander
 
J

Janto Dreijer

Jeremy said:
Couldn't you just use NTP itself to get the delivery delay? You can read the
delay out from the ntpdc console using dmpeers, or lopeers in ntpq. You
could have two peers either side of the link and measure the delay from
NTP.

You may also be able to query remote ntp servers to get their delays to
their peers.

Unfortunately I don't think that would work for me. I need the delay of
a stream of packets. Not just a single delay number. More specifically:
I'm testing RTP (VoIP) packet speeds and would like to predict lag
(ignoring jitter...separate measurement).
 
J

Janto Dreijer

Janto said:
Unfortunately I don't think that would work for me. I need the delay of
a stream of packets. Not just a single delay number. More specifically:
I'm testing RTP (VoIP) packet speeds and would like to predict lag
(ignoring jitter...separate measurement).

(replying to myself here)

More importantly, it looks like some of the network firewalls I'll be
testing though block the ports typically used by NTP...I hope I'm
wrong.

Maybe I'd be better off writing my own implementation that synchronises
the two pc clocks. Any hints? :)
 
J

Jeremy Sanders

Janto said:
Maybe I'd be better off writing my own implementation that synchronises
the two pc clocks. Any hints? :)

I think you might read up on how ntp synchronises clocks (their website is
very thorough), and use their algorithm. It is supposed to be very robust
algorithm. I saw something about ntp on the twisted mailing list, so you
could ask there.

Jeremy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top