ptpmeasure is a simple tool to sanity-check ST 2110/2022-6 streams and make measurements relative to PTP. It has minimal dependencies and allows for multi-day measurements without the need to create large and unwieldy packet captures. Nor does it require many dependencies.
More information about the measurements can be found here: https://www.slideshare.net/kierank12/ibc-2022-ip-showcase-timestamps-in-st-2110-what-they-mean-and-how-to-measure-them
- bitstream
- libpcap development headers (e.g On Ubuntu/Debian run
apt install libpcap-dev)
- Any network card with hardware timestamping of all packets with a VSS Ethernet Trailer such as the Silicom PE310G2TSI9P
- Any network card with hardware timestamping of all packets via “adapter_unsynced” such as the Mellanox ConnectX5
- For VSS trailer cards, use the provided vendor tools to lock the card to PTP
- For "adapter_unsynced" , use a command such as
ptp4l -m -q -i p9p1 -f ~/ptp-smpte.conf -swhere "ptp-smpte.conf" contains configuration matching your PTP configuration
To measure a 2110-20 29.97fps video flow from 238.16.1.10:5000 on NIC "eth3.38" in “adapter_unsynced” (--mellanox) mode:
sudo ./ptpmeasure 238.16.1.10 5000 eth3.38 --mellanox --2110-video --fps 30000/1001 --interlaced
An output like this will be generated:
2022-09-16 21:30:28+0100: First Packet arrived 0.616 ms after ideal, RTP-PTP offset -11.111us (-1 rtp).
2022-09-16 21:30:28+0100: First Packet arrived 0.630 ms after ideal, RTP-PTP offset 0.000us (0 rtp).
2022-09-16 21:30:28+0100: First Packet arrived 0.615 ms after ideal, RTP-PTP offset -11.111us (-1 rtp).
Note for gapped output the first packet arriving ~600us after ideal is normal
To measure a 2110-30 audio flow from 238.16.1.11:5002 on NIC "eth3.38" in “adapter_unsynced” (--mellanox) mode:
sudo ./ptpmeasure 238.16.1.11 5002 eth3.38 --mellanox
An output like this will be generated:
2022-09-16 21:34:20+0100: RTP-PTP offset -291.666667 us. Audio samples 96
2022-09-16 21:34:20+0100: RTP-PTP offset -270.833333 us. Audio samples 96
2022-09-16 21:34:20+0100: RTP-PTP offset -270.833333 us. Audio samples 96
This tool can probe the packets of an ST 2110-40 (RFC 8331) flow and from the header print how many ancillary packets are in each network packet and the total length. For example:
sudo ./ptpmeasure 238.10.1.20 5004 eth0 --2110-ancillary
An output like the following will be generated:
marker: 0, ts: 1012828175, ext seq num: 26249442, len: 140, count: 1
marker: 1, ts: 1012828175, ext seq num: 26249443, len: 0, count: 0
marker: 0, ts: 1012829975, ext seq num: 26249444, len: 84, count: 1
If you provide the video framerate and interlacing then it will measure the arrival times of the packets relative to PTP and RTP in much the same manner as for ST 2110-20 video above. Example:
sudo ./ptpmeasure 238.10.1.20 5004 eth0 --2110-ancillary --fps 25/1 --interlaced
2025-09-05 16:38:33+0100: Packet arrived 0.325 ms after ideal, RTP-PTP offset -11.111us (-1 rtp), marker: 0.
2025-09-05 16:38:33+0100: Packet arrived 0.011 ms after ideal, RTP-PTP offset -20011.111us (-1801 rtp), marker: 1.
2025-09-05 16:38:33+0100: Packet arrived 0.342 ms after ideal, RTP-PTP offset -11.111us (-1 rtp), marker: 0.