Menu

Changing Master Clock is not Working

Help
Corey Quon
2015-07-14
2015-07-14
  • Corey Quon

    Corey Quon - 2015-07-14

    Hi, I have 2 systems in a cluster and am having an issue when I am changing the master clock. Here's the command I'm running:

    When I run this on one system, and change the date on system 2, system 2 clock syncs to the clock on system 1.
    ptpd -b bond0 -p -u 127.12.0.2

    However, when I kill the above process on system 1 and run it on system 2:
    ptpd -b bond0 -p -u 127.12.0.1
    And then I change the date on system 1, system 1's time is not being updated to match with system 2.

    Is this a known issue or is there something wrong with what I am doing?

    System 1:
    Linux# ifconfig bond0
    bond0 Link encap:Ethernet HWaddr 00:2A:6A:39:DB:41
    inet addr:127.12.0.1 Bcast:127.12.255.255 Mask:255.255.0.0
    inet6 addr: fe80::22a:6aff:fe39:db41/64 Scope:Link
    UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
    RX packets:7347 errors:0 dropped:0 overruns:0 frame:0
    TX packets:6502 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:3506004 (3.3 MiB) TX bytes:4700508 (4.4 MiB)

    System 2:
    Linux# ifconfig bond0
    bond0 Link encap:Ethernet HWaddr 00:2A:6A:3B:06:81
    inet addr:127.12.0.2 Bcast:127.12.255.255 Mask:255.255.0.0
    inet6 addr: fe80::22a:6aff:fe3b:681/64 Scope:Link
    UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
    RX packets:6507 errors:0 dropped:0 overruns:0 frame:0
    TX packets:7373 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:4709700 (4.4 MiB) TX bytes:3511220 (3.3 MiB)

    Thanks.

     
  • Jan Breuer

    Jan Breuer - 2015-07-14

    We also need a version of your PTPd because -u has lot of changes between <=2.3.0 and >=2.3.1

    I don't understand it well, please can you tell me more details.

    Situation 1
    - command line options of ptpd on system 1
    - command line options of ptpd on system 2
    - what time you change and what you expect

    Situation 2
    - command line options of ptpd on system 1
    - command line options of ptpd on system 2
    - what time you change and what you expect

     
    • Corey Quon

      Corey Quon - 2015-07-14

      I do believe the PTPd version is pretty old.

      In situation 1:
      I am only running
      ptpd -b bond0 -p -u 127.12.0.2 on system 1, nothing is run on system 2.

      With this, system 2 time is being synced to system 1 I can easily tell by modifying the date on system 1 and then it will sync back to the date on system 2.

      In situation 2 I reverse the roles:
      - I kill the ptpd that was previously running on system 1
      - Then I run:
      ptpd -b bond0 -p -u 127.12.0.1 on system 2, nothing else is run on system 1.
      I expect the time on system 1 to now sync with the time on system 2, but when I modify the date on system 1, it is not syncing to system 2 as it was doing in the reverse situation.

       
      • Jan Breuer

        Jan Breuer - 2015-07-14

        It is really strange, it should NOT work for you in both situations. If it changes time on the other machine, it is not caused by ptpd.

        Are you running two physical machines or one is VM host and one is VM guest, or so?

        You must run ptpd on both ends to enable PTP synchronization and follow Wojciech proposals.

         
        • Corey Quon

          Corey Quon - 2015-07-14

          Both are physical machines, none are VM's.

          I originally was running
          ptpd -b bond0 -p

          and on the other system run:
          ptpd -b bond0 -g

          and this would converge slowly as the time on the slave would oscillate, but eventually converge after some time.

          Then I was playing around and when I did the unicast option:

          ptpd -b bond0 -p -u 127.12.0.2

          it would immediately update the time on 127.12.0.2

          Example:

          Tue Jul 14 11:50:29 UTC 2015
          Linux# date -s "3 JUL 2015 00:00:00"
          Fri Jul 3 00:00:00 UTC 2015
          Linux# date
          Fri Jul 3 00:00:00 UTC 2015
          Linux# date <<<< within a couple of seconds the date would be synced
          Tue Jul 14 11:50:39 UTC 2015

          But if I kill the ptpd process, and I change the date on system 2, the date was not updating, so I figured ptpd was modifying the time.

          And in terms of "configuring priorities" does that mean manually specifying the master and slaves? Or are there other configurations that need to be done.

          Thanks.

           
          • Jan Breuer

            Jan Breuer - 2015-07-14

            If you run, I think
            ptpd -H
            you can se options and there is also priority1 and priority2, but running one in slave only and other one in maser only is enough for you.

            ptpd has slow convergence, but be patient. Precision needs some averaging and it takes some time.

             
  • Wojciech Owczarek

    Judging by the options -b and -p I think you're running an old version of ptpd.

    You're not showing any log output, so "time is not being updated" may mean anything.

    You need to be specific as to which host is the master and which is the slave. When you run them with nearly zero config as you show here, the master will be the host with lower MAC address, which I think is your problem. System 1 has lower MAC so will always be master when both are talking.

    What are you expecting to happen? If you don't configure priorities, in your situation System 1 will always be the master. Try running one as master and the other as slave only, then at least you will force the sync hierarchy.

    FYI - you are using the 127.0.0.0/8 range, and a very wide subnet at that, /16. Is this intended? These addresses are reserved for loopbacks - do not try to route this as it will inevitably fail. This range should not leave the local host.

    Cheers,
    Wojciech

     
  • Corey Quon

    Corey Quon - 2015-07-14

    Do you mean:

    On one system run:
    ptpd -b bond0 -p

    and on the other system run:
    ptpd -b bond0 -g

    I've tried this as well and when I reverse the roles, it is not being updated as well.

    Thanks.

     

Log in to post a comment.