Menu

msgDebug timestamps are different from wireshark

Help
CK
2015-09-23
2015-09-25
  • CK

    CK - 2015-09-23

    Hi,
    I enable dump packet (--global:dump_packets=y) to see/debug detail, I found
    the print time is different from wireshark. which one is correct?
    How to do that if I want to see the t1, t2, t3, t4 time that are more
    precise in slave.
    I expect that slave should get the four times after slave receive
    delay_response.

    Here are wireshark log and ptpd2.log(I remove some information)
    Thanks.

     
  • Wojciech Owczarek

    Hi,

    It's not that one timestamp is correct and another is not. What matters is what PTPd itself uses to get the timestamps - and this is what is used to steer the clock. Wireshark / tcpdump use libpcap. They get different timestamps because pcap sits in a lower layer than the IP stack. Pcap gets the packets before the socket, and even before iptables. If you want to see the same timestamps, configure ptpd to use libpcap: ptpengine:use_libpcap=y

    If you are not using pcap, then PTPd sees the timestamps it gets from SO_TIMESTAMP socket option, which will be different from libpcap.

     
  • CK

    CK - 2015-09-23

    Hi,
    Shall I build ptp with define PTP_PCAP(-DPTP_PCAP in Makefile) or configure with-pcap-config or both of them? what's the difference?

     
  • Wojciech Owczarek

    Are you sure your ptpd was built without libpcap? Did you try enabling libpcap and did you get a warning?

    You don't need to do anything. You don't edit the makefile, configure script generates the makefile - https://en.wikipedia.org/wiki/GNU_build_system ; with-pcap-config is something else, it's used to tell where your system keeps libpcap pkgconfig data.

    If your system has libpcap installed and libpcap headers present, by default ptpd will build with libpcap. You may need to install a package like libpcap-dev or libpcap-devel tp get the pcap header files needed.

    At the end of the configure script output, there is a section that starts and ends with ** - what does it say about pcap?

     
  • CK

    CK - 2015-09-25

    yes, I got warning message 'Libpcap support disabled or not available. Please install libpcap,
    build without --disable-pcap, or try building with ---with-pcap-config
    to use ptpengine:use_libpcap.'
    I think my problem is how to assign pcap header path on my cross compile enviroment while confiure.
    libpcap source did exist in build enviroment, i.e /proj/lib/libpcap, and did generate out libpcap.so and pcap-config there.
    when I execute confiure by command:
    ./confiure CC=/toolchain_patch/gcc --inclcludedir=/proj/lib/libpcap --libdir=/proj/lib/libpcap

    get information while configure checking
    checking for pcap-config... no
    checking if we want to build with libpcap support... yes, guessing flags
    checking pcap/pcap.h usability... no
    checking pcap/pcap.h presence... no
    checking for pcap/pcap... no
    checking pcap.h usability... no
    checking pcap.h presence... no
    checking if we can build with PCAP support... no

     

    Last edit: CK 2015-09-25

Log in to post a comment.