PTP - Precision Time Protocol =============================== .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What is PTP?** The PTP (Precision Time Protocol) is a protocol used to synchronize clocks across a computer network with sub-microsecond accuracy. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What standard defines PTP?** PTP is defined by the IEEE 1588 standard. The first version, IEEE 1588-2002, is known as PTP v1. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What is the main use of PTP?** PTP is used in precise time coordination systems, such as industrial automation, telecommunications, power systems, and financial trading. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **How does PTP achieve high accuracy?** PTP uses hardware timestamping and a master-slave hierarchy to minimize jitter and delay, achieving sub-microsecond synchronization. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What is the difference between PTP and NTP?** * PTP offers much higher precision (sub-microsecond) compared to NTP (millisecond-level), making it suitable for time-critical applications. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What is a PTP master-slave?** * The master clock provides the reference time, while slave clocks synchronize to it. This hierarchy ensures consistent time distribution. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Does PTP require special hardware?** For high accuracy, PTP benefits from hardware timestamping support in network interface cards (NICs) and switches. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What transport protocols does PTP use?** PTP typically uses UDP over IP networks, often on port 319 (event messages) and 320 (general messages). .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Can PTP work over wireless communication?** While possible, wireless introduces variable latency and jitter, which can reduce synchronization accuracy. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What are the limitations of PTP v1?** PTP v1 lacks some features of later versions like profile support, improved fault tolerance, and better scalability. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Learnings in this section ` * :ref:`Terminology ` * :ref:`Version Info ` * :ref:`PTP Version&RFC Details ` * :ref:`PTP Basic Setup on Ubuntu using IPv4 ` * :ref:`PTP Basic Setup on Ubuntu using IPv6 ` * :ref:`PTP Protocol Packet Details ` * :ref:`PTP Usecases ` * :ref:`PTP Basic Features ` * :ref:`PTP Feature : High Precision Time Sync ` * :ref:`PTP Feature : Master-Slave Architecture ` * :ref:`PTP Feature : Hardware Timestamping ` * :ref:`PTP Feature : Event and General Messages ` * :ref:`PTP Feature : Loopback Testing Support ` * :ref:`PTP Feature : Delay Measurement and Mechanism ` * :ref:`PTP Feature : Best Master Clock Algorithm ` * :ref:`PTP Feature : Multicast and Unicast Support ` * :ref:`PTP Feature : Profile-Based Configuration ` * :ref:`PTP Feature : Scalability ` * :ref:`Reference links ` .. _PTP_step1: .. tab-set:: .. tab-item:: Learnings in this section * In this section, you are going to learn .. _PTP_step2: .. tab-set:: .. tab-item:: Terminology * Terminology .. _PTP_step3: .. tab-set:: .. tab-item:: Version Info * Version Info .. _PTP_step5: .. tab-set:: .. tab-item:: PTP Version&RFC Details .. csv-table:: :file: ./PTP/PTP_RFC_Details.csv :widths: 10,10,10,30,40 :header-rows: 1 .. _PTP_step19: .. tab-set:: .. tab-item:: PTP Basic Setup on Ubuntu using IPv4 * Setup .. _PTP_step20: .. tab-set:: .. tab-item:: PTP Basic Setup on Ubuntu using IPv6 * Setup .. _PTP_step6: .. tab-set:: .. tab-item:: PTP Protocol Packet Details **Syn Message Packet** .. csv-table:: :file: ./PTP/PTP_Protocol_Packet_1.csv :widths: 10,20,30,10 :header-rows: 1 **Follow_up Message Packet** .. csv-table:: :file: ./PTP/PTP_Protocol_Packet_2.csv :widths: 10,20,30,10 :header-rows: 1 **Delay_Req Message Packet** .. csv-table:: :file: ./PTP/PTP_Protocol_Packet_3.csv :widths: 10,20,30,10 :header-rows: 1 **Delay_Resp Packet** .. csv-table:: :file: ./PTP/PTP_Protocol_Packet_4.csv :widths: 10,20,30,10 :header-rows: 1 **Management Message Packet** .. csv-table:: :file: ./PTP/PTP_Protocol_Packet_5.csv :widths: 10,20,30,10 :header-rows: 1 **Announce Message Packet** .. csv-table:: :file: ./PTP/PTP_Protocol_Packet-6.csv :widths: 10,20,30,10 :header-rows: 1 **Signaling Message Packet** .. csv-table:: :file: ./PTP/PTP_Protocol_Packet_7.csv :widths: 10,20,30,10 :header-rows: 1 .. _PTP_step7: .. tab-set:: .. tab-item:: PTP Usecases .. csv-table:: :file: ./PTP/PTP_Usecases.csv :widths: 10,20,30 :header-rows: 1 .. _PTP_step8: .. tab-set:: .. tab-item:: PTP Basic Features .. csv-table:: :file: ./PTP/PTP_Features.csv :widths: 10,10,30 :header-rows: 1 .. _PTP_step9: .. tab-set:: .. tab-item:: PTP Feature : High Presion Time Sync **High Precision Time Sync- Testcases** .. csv-table:: :file: ./PTP/PTP_Feature-1_High_Precision_Time_sync_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _PTP_step10: .. tab-set:: .. tab-item:: PTP Feature : Master Slave Architecture **Master Slave Architecture - Testcases** .. csv-table:: :file: ./PTP/PTP_Feature-2_Master-Slave_Architecture_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _PTP_step11: .. tab-set:: .. tab-item:: PTP Feature : Hardware Timestamping **Hardware Timestamping - Testcases** .. csv-table:: :file: ./PTP/PTP_Feature-3_Hardware_Timestamping_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _PTP_step12: .. tab-set:: .. tab-item:: PTP Feature : Event and General Messages **Event and General Messages - Testcases** .. csv-table:: :file: ./PTP/PTP_Feature-4_Event_and_General_Messages_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _PTP_step13: .. tab-set:: .. tab-item:: PTP Feature : Loopback Testing Support Algorithm **Loopback Testing Support Algorithm - Testcases** .. csv-table:: :file: ./PTP/PTP_Feature-5_Loopback_Testing_Support_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _PTP_step14: .. tab-set:: .. tab-item:: PTP Feature : Delay Measurement Mechanism **Delay Measurement Mechanism - Testcases** .. csv-table:: :file: ./PTP/PTP_Feature-6_Delay_Measurement_Mechanism_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _PTP_step15: .. tab-set:: .. tab-item:: PTP Feature : Best Master CLock Algorithm **Best Master CLock Algorithm - Testcases** .. csv-table:: :file: ./PTP/PTP_Feature-7_Best_Master_Clock_Algorithm_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _PTP_step16: .. tab-set:: .. tab-item:: PTP Feature : Multicasr and Unicast Support **Multicast and Unicast Support - Testcases** .. csv-table:: :file: ./PTP/PTP_Feature-8_Multicast_and_Unicast_Support_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _PTP_step17: .. tab-set:: .. tab-item:: PTP Feature : Profile-Based Configuration **Profile-Based Configuration - Testcases** .. csv-table:: :file: ./PTP/PTP_Feature-9_Profile-Based_Configuration_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _PTP_step18: .. tab-set:: .. tab-item:: PTP Feature : Scalability **Scalability - Testcases** .. csv-table:: :file: ./PTP/PTP_Feature-10_Scalability_Testcase.csv :widths: 10,10,30,20 :header-rows: 1 .. _PTP_step21: .. tab-set:: .. tab-item:: Reference links * Reference links