473,387 Members | 3,684 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ntp in python

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.

Aug 29 '06 #1
5 4262
Janto Dreijer wrote:
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

--
Jeremy Sanders
http://www.jeremysanders.net/
Aug 29 '06 #2
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

Aug 29 '06 #3
Jeremy Sanders wrote:
Janto Dreijer wrote:
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.
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).

Aug 29 '06 #4
Janto Dreijer wrote:
Jeremy Sanders wrote:
Janto Dreijer wrote:
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.

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? :-)

Aug 29 '06 #5
Janto Dreijer wrote:
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

--
Jeremy Sanders
http://www.jeremysanders.net/
Aug 30 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.