Menu

Various instances of PTPd on one machine

Help
iarenzana
2009-11-03
2012-11-23
  • iarenzana

    iarenzana - 2009-11-03

    Hi all,

    I got a machine that would run 2 instances of PTPd; one of them would sync against a master and the other one should be able to send a unicast message across the subnet to a particular host. These are the commands I'm using:

        daemon ptpd -b eth1 -g -D -f /else/root/ptpd.log
       
        daemon ptpd -b eth3 -t -s 2 -u 192.168.201.91 -D -f /else/root/ptpd_eth3.log

    I've found that both instances seem to do their job individually but, when running both in parallel I can't seem to get them to work.
    What should I be looking at here?
    Thanks.

     
  • Zeke

    Zeke - 2010-01-25

    i have a similar question.  How can you get ptpd to run across multiple subnets?

     
  • Daniel Le

    Daniel Le - 2010-01-26

    I don't know the answer, but have a couple of suggestions that may help debugging.

    - Check your routing/switching table for multicast and unitcast
    - Display process status (ps) and check out the two ptpd daemon instances
    - Use a sniffer tool (ethereal, wire shark, tcpdump…) to capture packets and verfiy how PTP packets go out and arrive

     
  • Zeke

    Zeke - 2010-01-26

    Another question along similar lines (very similar to the first post here).

    Say I have a machine that I want to act as the master clock for 2 different subnets.  I tried to achieve this by running 2 separate ptpd instances, each bound to a different interface corresponding to each subnet. So for example:
    instance 1 ( on 192.168.10.x subnet)  ./ptpd -d -t -s2 -p -b eth1
    instance 2 ( on 192.168.11.x subnet) ./ptpd -d -t -s2 -p -b eth3

    However, they seem to see each other's multicast traffic and interfere with each other (e.g,. one becomes the master, the other the slave, when I want them to be running as independent masters on their respective subnets).

    Is there a way I can get each instance of ptpd to ignore the other instance on the same machine?  I just want them to interact with the other machines on that subnet, not within the same machine.

    Thanks!

     
  • Daniel Le

    Daniel Le - 2010-01-27

    Likely because the two ptpd instances run in same (default) PTP subdomain.
    You might want to try a different subdomain for each ptpd, using option -n.

     
  • Zeke

    Zeke - 2010-01-28

    Great: the subdomain thing works!

    I ran 2 instances of ptpd with the following commands:
    ./ptpd -d -b eth3 -p -n e0.0.1.81
    ./ptpd -d -b eth4 -p -n e0.0.2.81

    seemed to work.  What exactly IS a ptpd subdomain (what does each of the 4 fields signify?)

    Thanks for your help!

     
  • Daniel Le

    Daniel Le - 2010-01-28

    Nice to hear that!

    I assume you're running PTPv1 on IPv4 (the domain encoding for PTPv2 is different).

    Basically a PTP subdomain (which consists of a subdomain name and a subdomain address) divides a physical network into multiple PTP logical networks and allows independent time scales. Please refer to the IEEE Standard 1588-2002 Clauses 6.2.3, 6.2.5.1, 6.2.5.2 and Annex D for detailed specification of PTP subdomain.

     
  • Jeremy Friesner

    Jeremy Friesner - 2010-01-28

    Is it possible to run ptpd on IPv6?  (i.e. on a machine that has no IPv4 address?)  If so, are there any special steps that must be followed to do that?

    Thanks,
    Jeremy

     
  • Daniel Le

    Daniel Le - 2010-01-28

    Yes, ptpd code that supports PTPv2 runs on IPv6, which is located at
    http://ptpd.svn.sourceforge.net/viewvc/ptpd/branches/v2/ (Thanks to Gaël Mace and Skreuzer).

    Note that the release notes, readme and makefile have not been updated to reflect support of PTPv2.

    I'm also new to PTP and haven't got a chance to try the ptpd open source code yet. The IEEE Standard 1588-2008 for PTPv2 Annex E (among other avaialble documentation) explains how to transport PTP messages over UPD/IPv6. I'm hoping the ptpd v2 code provides an option such as -6 to run ptpd on IPv6.

     
  • Jeremy Friesner

    Jeremy Friesner - 2010-01-28

    Hi dle2010,

    Thanks for the response… I just downloaded the code you linked to, and I didn't see any evidence that it has IPv6 support.  For example, I grepped for all instances of calls to socket() in that code, and came up with these:

    src/dep/net.c:238:  if( (netPath->eventSock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) ) < 0
    src/dep/net.c:239:    || (netPath->generalSock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) ) < 0 )

    … if there was an IPv6 mode, I would expect to see the a socket(PF_INET6, …) call somewhere.  Am I looking in the wrong place?

    -Jeremy

     
  • Daniel Le

    Daniel Le - 2010-01-28

    I think you're right. I also see a declaration of UDP_IPV6 in constants.h but it doesn't seem to be used anywhere in the source code. Sorry, I thought the current ptpd v2 code had support for ipv6.

    You might want to folow up with the author of ptpd v2 Gaël Mace on the ptpd SourceForge Open Discussion forum https://sourceforge.net/projects/ptpd/forums/forum/469207 and the (separate) PTPd Mailing List  ptpd@lists.infradead.org. You need an account to participate in the ptpd list (register at http://lists.infradead.org/mailman/listinfo/ptpd). Please post if you find out additonal info on IPv6 support.

    Daniel

     
  • George Neville-Neil

    While PTP is not recommended to be run across multiple subnets it is possible.  In the latest versions of the code there is
    a -T ttl option.  You will also need to set the ttl on your master so that the multicast packets can flow in both directions
    across a router.  Note that the accuracy will definitely drop if you run PTP across multiple subnets.

     

Log in to post a comment.