ntp in python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Janto Dreijer

    #1

    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

    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.

  • Jeremy Sanders

    #2
    Re: ntp in python

    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

    Comment

    • Sander Steffann

      #3
      Re: ntp in python

      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



      Comment

      • Janto Dreijer

        #4
        Re: ntp in python

        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...separa te measurement).

        Comment

        • Janto Dreijer

          #5
          Re: ntp in python

          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...separa te 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? :-)

          Comment

          • Jeremy Sanders

            #6
            Re: ntp in python

            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

            Comment

            Working...