Skip to content
Ask AI

PTP Configuration

The Precision Time Protocol (PTP) is a protocol used to achieve high-precision clock synchronization in computer networks. It was originally designed to meet the high-precision time requirements of applications in industrial automation, communications, finance, and other fields.

The main goal of PTP is to provide microsecond-level or even sub-microsecond-level clock synchronization accuracy in computer networks. This high level of precision is crucial for many fields, such as high-frequency trading systems, power system synchronization, and the time calibration of scientific research equipment.

PTP Domain: A PTP domain refers to a logical set of one or more PTP clock nodes that work in the same PTP network and share the same clock synchronization standards and configurations. Within a PTP domain, there is typically one master clock and multiple slave clocks.

Clock Node Types: Nodes in the PTP domain are called clock nodes and the following three types of basic clock nodes are defined in the IEEE 1588 v2 standard:

OC (Ordinary Clock): In the same PTP domain, there is only a single physical port involved in PTP time synchronization. The device uses this port to synchronize time from upstream nodes or to publish time to downstream nodes.

BC (Boundary Clock): In the same PTP domain, at least two or more physical ports can participate in PTP time synchronization. One port synchronizes time from upstream devices, while the remaining ports publish time to downstream devices.

TC (Transparent Clock): The main difference between a TC and BC/OC is that BC and OC need to maintain time synchronization with other devices, while a TC does not. A TC has multiple PTP ports and only forwards PTP messages between these ports, correcting the forwarding delay without synchronizing time from any port.

The following four types of basic clock nodes are defined in the ITU-T G.8275.1 standard:

T-GM (Telecom Grandmaster): This clock node has one or more physical ports involved in time synchronization within the same PTP domain and can only act as a Master, publishing time to downstream clock nodes.

T-BC (Telecom Boundary Clock): This clock node has multiple physical ports involved in time synchronization within the same PTP domain. it synchronizes the time from the upstream clock node through one of the interfaces and publishes the time to the downstream clock nodes through the remaining ports.

T-TSC (Telecom Time Slave Clock): This clock node has only a physical port in the same PTP domain to participate in time synchronization, and can only be used as a Slave to synchronize time from the upstream clock node.

T-TC (Telecom Transparent Clock): This clock node is an End-to-End Transparent Clock (E2E-TC) as defined in [IEEE 1588] and forwards all PTP protocol messages.

The following three types of basic clock nodes are defined in the ITU-T G.8275.2 standard:

T-GM (Telecom Grandmaster): This clock node has one or more physical ports involved in time synchronization within the same PTP domain, and can only act as a Master, publishing time to downstream clock nodes.

T-BC-P (Partial-Support Telecom Boundary Clock): This clock node has multiple physical ports involved in time synchronization within the same PTP domain, and it synchronizes the time from the upstream clock node through one of the interfaces and publishes the time to the downstream clock node through the remaining ports.

T-TSC-P (Partial-Support Telecom Time Slave Clock): This clock node can enable multiple physical ports in the same PTP domain, but it can only act as Slave to synchronize the time from the upstream clock node through one port, while the other ports act as Passive and do not participate in time synchronization.

PTP Ports: Ports on a device running the PTP protocol are known as PTP ports. These ports can be categorized based on their roles:

Master port: A port that publishes synchronized time.

Slave port: A port that receives synchronized time.

Passive port: A port that neither receive nor publish synchronized time.

In a PTP domain, node devices synchronize clocks according to a master-slave relationship. The master-slave relationship is relative: the node device that synchronizes time is called a slave node, and the node device that publishes the time is called a master node. A single device might synchronize time from an upstream node while also publishing time to downstream nodes.

For a pair of clock nodes that synchronize with each other, the following master-slave relationships apply:

Master Node: The node that publishes the synchronized time.

Slave Node: The node that receives the synchronized time.

Master Clock: The clock on the master node.

Slave Clock: The clock on the slave node.

Master Port: The port that publishes the synchronized time.

Slave Port: The port that receives the synchronized time.

Grandmaster clock selection for 1588v2, smpte and aes67

According to the IEEE 1588 v2 protocol standard, each clock node in the PTP domain elects the grandmaster clock through the BMC algorithm, and each clock node sends Announce messages to each other, and finally elects the optimal clock in the domain according to the clock priority, class, accuracy and other information carried in the message. The specific comparison rules are as follows:

  1. priority1: The smaller the priority1 value, the higher the priority.
  2. class: If priority1 values are the same, the smaller the class value, the higher the priority.
  3. accuracy: If the class value is also the same, the smaller the accuracy value, the higher the priority.
  4. priority2: If the accuracy value is also the same, the smaller the priority2 value, the higher the priority.

Grandmaster clock selection priority: priority1 > class > accuracy > priority2.

According to the ITU-T G.8275.x protocol standard, each clock node in the PTP domain elects the grandmaster clock through the ABMC algorithm, which will compare the clocks in the order of the class, accuracy, priority2 and priority carried by the Announce message, and the winner will be the optimal clock. In this algorithm, multiple GM clocks are allowed to be the grandmaster clock at the same time, when each non-GM clock is synchronized by one of the GMs in the PTP domain, and the comparison rules are as follows:

  1. class: The smaller the class value, the higher the priority.
  2. accuracy: If the class values are the same, the smaller the accuracy value, the higher the priority.
  3. priority2: If the accuracy value is also the same, the smaller the priority2 value, the higher the priority.
  4. priority: If the priority2 value is also the same, the lower the priority value, the higher the priority.
  5. If the local priority is still the same, determine if the class is less than or equal to 127.

If the class is less than or equal to 127, in the absence of a better clock node, two or more grandmaster clocks are elected in the PTP domain, and the slave node selects a grandmaster clock as the master node, and forms two spanning trees, and the two spanning trees do not interact with each other in terms of PTP messages.

If the class is greater than 127, the smaller clockID (which consists of the clock number and interface number together) wins.

Grandmaster clock selection priority: class > accuracy> priority2> priority.

When the grandmaster clock in the PTP domain is selected and the master-slave relationship is determined, in the subsequent time synchronization process, if the slave clock does not receive the Announce message sent by the master clock for a certain period of time, the election of the grandmaster clock will be restarted.

After determining the master-slave relationship between clocks, the master and slave clocks exchange synchronization messages and record the time. By calculating the round-trip time of the messages, the total round-trip delay between the master and slave clocks is computed. If the transmission delays in both directions are the same, half of the total round-trip delay is the one-way delay, which is the clock offset between the master and slave clocks. The slave clock adjusts its local time based on this offset to synchronize with the master clock.

PTP protocol defines two transmission delay measurement mechanisms: Request-Response (E2E) and Peer Delay (P2P) mechanisms. Both mechanisms assume network symmetry.

Request-Response Mechanism (E2E)

Based on whether a Follow_Up message needs to be sent, the request-response mechanism is divided into two modes: two-step mode and one-step mode:

Two-step mode: The transmission timestamp t1 of the Sync message is carried by the Follow_Up message.

One-step mode: The transmission timestamp t1 of the Sync message is carried by the Sync message itself, and no Follow_Up message is sent.

The implementation of the request-response mechanism in two-step mode is as follows:

The master clock sends a Sync message and records the transmission time t1. The slave clock receives this message and records the reception time t2.

After sending the Sync message, the master clock immediately sends a Follow_Up message containing t1.

The slave clock sends a Delay_Req message to the master clock to initiate the calculation of the reverse transmission delay and records the transmission time t3. The master clock receives this message and records the reception time t4.

Upon receiving the Delay_Req message, the master clock responds with a Delay_Resp message containing t4.

Now the slave clock has four timestamps: t1, t2, t3, and t4. The calculations are as follows:

Total Round-Trip Delay = (t2 – t1) + (t4 – t3)

One-Way Delay = [(t2 – t1) + (t4 – t3)] / 2

Clock Offset (Slave relative to Master) Offset = (t2 – t1) – [(t2 – t1) + (t4 – t3)] / 2 = [(t2 – t1) – (t4 – t3) ] / 2

Peer Delay Mechanism (P2P)

The Peer Delay (P2P) mechanism in PTP is used to calculate the average path delay between two clock nodes. It involves each clock node sending Pdelay messages to each other and calculating the one-way delay for the path between them. If there are Transparent Clocks (TC) between the master and slave clocks, they segment the synchronization path into multiple segments and participate in calculating the delay for each segment. Here’s how the two-step Peer Delay mechanism (P2P) works:

  1. Pdelay_Req Message Transmission:

Clock node B sends a Pdelay_Req message to Clock node A to initiate the calculation of the reverse transmission delay and records the transmission time t1.

Clock node A receives the Pdelay_Req message and records the reception time t2.

  1. Pdelay_Resp Message Transmission:

Upon receiving the Pdelay_Req message, Clock node A responds with a Pdelay_Resp message containing t2 and records the transmission time t3.

Clock node B receives the Pdelay_Resp message and records the reception time t4.

  1. Pdelay_Resp_Follow_Up Message Transmission:

After sending the Pdelay_Resp message, Clock node A immediately sends a Pdelay_Resp_Follow_Up message containing t3.

  1. Delay Calculation:

Clock node B now has timestamps t1, t2, t3, and t4. Using these timestamps, it calculates:

Round-trip delay between Clock node A and Clock node B: (t2−t1)+(t4−t3)

One-way delay for the link between Clock node A and Clock node B (assuming symmetric network): [(t2−t1)+(t4−t3)]/2=[(t3−t2)+(t4−t1)]/2

Clock node B’s offset relative to Clock node A’s time: Received time of Sync message by Clock node B −Sent time of Sync message by Clock node A – Cumulative one-way delay for each segment of the link – Sum of all TC residence times

Multiple mutually isolated PTP domains can be run on the same physical device, and one instance corresponds to one PTP domain, which ensures that different instances do not interfere with each other, so that different services can be carried out in different PTP domains. Currently, the 102S series devices support the configuration of four PTP domains, and other device types support two PTP domains.

OperationCommandDescription
Enter the system configuration viewconfigure terminal
Configure PTP instanceptp instance domain-id

After configuring the switching proflie, the PTP-related configuration of the instance will be deleted, and the PTP configuration will not be deleted if the same profile is configured repeatedly.

OperationCommandDescription
Enter the PTP configuration viewptp instance domain-id
Configure PTP profileptp profile {smpte-2059-2|g8275.1|g8275.2|1588v2|aes67}

When using the SMPTE-2059-2, 1588v2, and AES67 profiles, the clock types are: OC/BC/TC;

When using the G8275.1 profile, the clock types are: T-GM/T-BC/T-TSC/T-TC;

When using the G8275.2 profile, the clock types are: T-GM/T-BC-P/T-TSC-P.

OperationCommandDescription
Enter the PTP configuration viewptp instance domain-id
Configure PTP clock typeptp clock-type {oc|bc|tc|t-gm|t-bc|t-tsc|t-tc|t-bc-p|t-tsc-p}oc: Ordinary Clock bc: Boundary Clock
tc: Transparent Clock
t-gm: Telecom Grandmaster
t-bc: Telecom Boundary Clock
t-tc: Telecom Transparent Clock
t-tsc: Telecom Time Slave Clock
t-bc-p: Partial-Support Telecom Boundary Clock
t-tsc-p: Partial-Support Telecom Time Slave Clock

The master-slave relationship between clock nodes is determined by configuring the clock source parameters for each node.

priority1 can only be configured when the profile is set to smpte-2059-2, 1588v2, or aes67.

priority can only be configured in the interface view when the profile is set to g8275.1 or g8275.2.

priority2/class/accuracy can be configured under all profiles.

When the clock source is configured as GNSS, class/accuracy cannot be manually configured and will be dynamically adjusted based on the GNSS status; the device’s default clock source is local.

Only the CX308P-48S device supports configuring the clock source as GNSS.

OperationCommandDescription
Enter the PTP configuration viewptp instance domain-id
Configuring Clock Source Parametersptpclock-source {accuracy|
class|priority1|priority2|gnss|local}
accuracy: Configurable range 0-255, default value 254
class: Configurable range 0-255, default value 248
priority1: Configurable range 0-255, default value 128
priority2: Configurable range 0-255, default value 128
gnss: Set the device clock source to “GNSS”
local: Set the device clock source to “local”
Enter the interface configuration viewinterface ethernet* interface-id*
Enter the PTP interface configuration viewptpinstance* instance-id*Required
Configure the interface clock source parametersptp local prioritypriority: Configurable range 1-255, default value 128

When the mode of the PTP interface is not configured, the interface mode will be elected as master, slave, or passive during clock election.

when the PTP interface mode is manually specified, if the current device interface is master, the priority of the device’s clock-source local parameter must be greater than that of the peer; if the current device interface is slave, the priority of the device’s clock-source local parameter must be less than that of the peer.

When a slave device has multiple PTP interfaces all elected as slave mode, only one PTP interface of this device will be in slave mode, and the remaining interfaces will all be in passive mode.

OperationCommandDescription
Enter the PTP interface configuration viewptp instance domain-id
interface ethernet interface_num
Configure PTP interface modeptp mode {master|slave}

The E2E delay measurement mechanism is used by default.

The P2P delay measurement mechanism is only supported to be configured when the PTP profile is smpte-2059-2, 1588v2 or aes67.

The P2P+one_step configuration scenario is not supported.

OperationCommandDescription
Enter the PTP configuration viewptp instance domain-id
Configure delay measurement mechanismptp delay-mode {E2E|P2P}

PTP records the timestamps generated by the event message interaction between the master and slave clocks, calculates the path delay and time deviation between the master and slave clocks, and achieves time and frequency synchronization. The timestamp carrying mode is divided into the following two types:

Single-step mode (one_step): The master clock sends out the packets that need to be timestamped directly. For example, when the master clock sends a Sync message, the hardware chip marks t1 and puts it in the timestamp field of the Sync message and sends it directly. There is no need to send a FollowUp message subsequently.

Two-step mode (two_step): Marking the timestamp and sending the message are completed by two-step messages. For example, the timestamp t1 generated by the master clock sending the Sync synchronization message is marked and stored by the hardware chip. When the FollowUp message is sent, it is carried and sent to the slave clock.

OperationCommandDescription
Enter the PTP configuration viewptp instance domain-id
Configure timestamp carrying modeptp clock-step {two_step|one_step}When profile is 1588v2, two_step is used by default, and one_step is used by default when using other profiles

If unicast communication is used between clock nodes, configure the destination IP address of the unicast PTP message to be the IP address of the peer PTP interface.

If multicast or mixed communication is used between clock nodes, configure the interface address as the source IP address of the PTP message.

When the profile is smpte-2059-2, UDPv4/UDPv6 unicast, multicast, and mixed transport modes are supported.

When the profile is 1588v2, UDPv4/UDPv6 unicast, multicast, and Ethernet transport modes are supported. Additionally, when switching from UDPv4/UDPv6 unicast to Ethernet, the interface’s unicast master address A.B.C.D/A::B must be deleted.

When the profile is G8275.1, only Ethernet transport mode is supported.

When the profile is G8275.2/SMPTE/AES67, Ethernet transport mode is not supported.

When the profile is AES67, Ethernet and UDPv6 transport modes are not supported.

OperationCommandDescription
Enter the PTP configuration viewptp instance domain-id
Configure transport modeptp transport-mode {udpv4|udpv6|ethernet} [unicast|multicast|mixed]

Configuring the PTP Message Sending Interval

Section titled “Configuring the PTP Message Sending Interval”

Currently, it can support modifying the Sync, Announce, Delay_Req, and Pdelay_Req message sending interval, and the actual effective value is the logarithm of the time interval in seconds with 2 as the base. For example, if the parameter value is -2, the time interval is 0.25 seconds; if the parameter value is -1, the time interval is 0.5 seconds. For fast synchronization, it is recommended to use the default value or a shorter interval than the default value.

OperationCommandDescription
Enter the PTP interface configuration viewinterface ethernet interface_num
ptp instance domain-id
Configure the Sync message sending intervalptp sync-interval intervalWhen the ptp profile is smpte-2059-2, the interval setting of this parameter ranges from -7 to 1, and the default value is -3
When the ptp profile is g8275.2, the parameter interval setting ranges from -7 to 0, and the default value is -4
When the ptp profile is g8275.1, the default value of this parameter interval is -4, and does not support modification
When the ptp profile is 1588v2, the interval of this parameter is set from -7 to 1, and the default value is 0
When the ptp profile is aes67, the interval of this parameter is set from -4 to 1, and the default value is -3
Configure the Announce message sending intervalptp announce-interval intervalWhen the ptp profile is smpte-2059-2, the interval setting of this parameter ranges from -3 to 1, and the default value is 0
When the ptp profile is g8275.2, the parameter interval setting ranges from -3 to 0, and the default value is -3
When the ptp profile is g8275.1, the default value of this parameter interval is -3, and does not support modification
When the ptp profile is 1588v2, the interval of this parameter is set from 0 to 4, and the default value is 1
When the ptp profile is aes67, the interval of this parameter is set from 0 to 4, and the default value is 1
Configure the Delay_Req message sending intervalptp delay-req-interval intervalWhen the ptp profile is smpte-2059-2, the interval setting of this parameter ranges from -3 to 5, and the default value is -3
When the ptp profile is g8275.2, the parameter interval setting ranges from -7 to 0, and the default value is -4
When the ptp profile is g8275.1, the default value of this parameter interval is -4, and does not support modification
When the ptp profile is 1588v2, the interval of this parameter is set from -7 to 5, and the default value is 0
When the ptp profile is aes67, the interval of this parameter is set from -4 to 5, and the default value is 0
Configure the Pdelay_Req message sending intervalptp pdelay-req-interval intervalWhen the ptp profile is smpte-2059-2, the interval setting of this parameter ranges from -3 to 5, and the default value is -3.
When the ptp profile is 1588v2, the interval setting of this parameter ranges from -7 to 5, and the default value is 0.
When the ptp profile is aes67, the interval setting of this parameter ranges from -4 to 5, and the default value is 0.

In the SMPTE 2059-2 standard, SM-TLV (Stream Mapping Type-Length-Value) is a format for transmitting timecode and synchronization information to convey and manage time synchronization information in multi-device and multi-system environments to ensure accurate synchronization between devices. Therefore this function can only be used when the ptp profile is smpte.

When sm-tlv is enabled, Daylight Saving Time events are supported on the device. The BC clock receives the Daylight Saving Time message, records the jump time, prepares for the jump in advance, processes the jump when the seconds arrive, and forwards the message to the OC Clock. so that the system clock jumps forward or backward by one hour at the beginning and end of Daylight Saving Time, which prevents the inconsistency in time synchronization caused by such time jumps. (Daylight Saving Time (DST) is a system that artificially defines the local time in order to save energy,and the uniform time used during the implementation of this system is called “Daylight Saving Time”.)

OperationCommandDescription
Enter the system configuration viewconfigure terminal
Enable sm-tlvptp sm-tlv enable

This configuration is used on the master clock, which affects the synchronization of all devices through the time base it provides; the BC, as a relay device, will be responsible for forwarding sm-tlv information to ensure the smooth flow of data throughout the PTP domain; the OC receives the sm-tlv data and applies the timecode and synchronization information in it to maintain synchronization with the PTP domain.

OperationCommandDescription
Enter the system configuration viewconfigure terminal
Configure default frame rateptp sm-tlv default-frame-rates numerator denominatorThe numerator/denominator is the effective frame rate.
OperationCommand
Display PTP synchronization statusshow ptp clock
Display PTP interface statusshow ptp interface interface_num
Display sm-tlv statusshow ptp clock sm-tlv domain-id
Display PTP message statisticsshow ptp counter [interface id ] [instance domain_id ]

Using Smpte for IPv4 UDP Encapsulated and Multicast Communication

Section titled “Using Smpte for IPv4 UDP Encapsulated and Multicast Communication”

Network requirements

In this networking, Device A and Device B are in the same PTP domain, using the smpte-2059-2 protocol standard and IPv4 UDP encapsulated multicast communication. Device A is used as the grandmaster clock. PTP synchronization from Device B to Device A is achieved using the P2P delay measurement mechanism and two_step timestamp carrying mode.

Procedur

# Device A

sonic(config)# ptp enable
sonic(config)# ptp instance 0
sonic(config-ptp-0)# ptp profile smpte-2059-2
sonic(config-ptp-0)# ptp clock-id 000217.0000.000023
sonic(config-ptp-0)# ptp enable
sonic(config-ptp-0)# ptp clock-type oc
sonic(config-ptp-0)# ptp delay-mode P2P
sonic(config-ptp-0)# ptp clock-source local priority1 64
sonic(config-ptp-0)# ptp clock-step two_step
sonic(config-ptp-0)# ptp transport-mode udpv4 multicast
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.1.1.1/24
sonic(config-if-1)# ptp instance 0
sonic(config-if-ptp-0)# ptp enable
sonic(config-if-ptp-0)# ptp source ip 10.1.1.1

# Device B

sonic(config)# ptp enable
sonic(config)# ptp instance 0
sonic(config-ptp-0)# ptp profile smpte-2059-2
sonic(config-ptp-0)# ptp clock-id 000224.0000.000023
sonic(config-ptp-0)# ptp clock-type oc
sonic(config-ptp-0)# ptp delay-mode P2P
sonic(config-ptp-0)# ptp clock-source local priority1 128
sonic(config-ptp-0)# ptp clock-step two_step
sonic(config-ptp-0)# ptp transport-mode udpv4 multicast
sonic(config)# interface ethernet 1
sonic(config-if-1)# ptp instance 0
sonic(config-if-ptp-0)# ptp enable
sonic(config-if-ptp-0)# ptp source ip 10.1.1.2

Verify configuration

# Display PTP synchronization status on Device B

Domain: 0
Profile: smpte-2059-2
Clock Type: OC
Clock Step: two_step
Delay Mode: P2P
Transport Mode: udpv4
Dscp: 56
Source IP Address: 0.0.0.0
Local Clock Identity: 000224.0000.000023
Local Clock Accuracy: 0xFE
Local Clock Class: 248
Local Clock Priority1: 128
Local Clock Priority2: 128
ports: Ethernet23
Grandmaster Clock Identity: 000217.0000.000023
Grandmaster Clock Accuracy: 0xfe
Grandmaster Clock Class: 248
Grandmaster Clock Priority1: 64
Grandmaster Clock Priority2: 128
Parent Port Identity: 0
Servo State: locked
Offset To Master: -12
Path Delay: 239
Max Steps Removed: 255
Local Time: 432962822290957

# Display PTP interface 1 status on Device B

sonic# show ptp interface 1
Ethernet: Ethernet1
Enable: true
Domain: 0
Index: 1
Source IP Address: 10.1.1.2
Announce Interval: 0
Announce Receipt Timeout: 3
Delay Req Interval: -3
Pdelay Req Interval: -3
Sync Interval: -3
Mode: slave
Delay Mode: P2P

Using Smpte for IPv4 UDP Encapsulated and Unicast Communication

Section titled “Using Smpte for IPv4 UDP Encapsulated and Unicast Communication”

Network requirements

In this networking, Device A, Device B and Device C are in the same PTP domain, using the smpte-2059-2 protocol standard and IPv4 UDP encapsulated unicast communication. Using Device A as the grandmaster clock, the PTP synchronization of Device B and Device C to Device A is achieved using the E2E delay measurement mechanism and the timestamp carrying mode of two_step.

Procedur

# Device A

sonic(config)# ptp enable
sonic(config)# ptp instance 0
sonic(config-ptp-0)# ptp profile smpte-2059-2
sonic(config-ptp-0)# ptp clock-type oc
sonic(config-ptp-0)# ptp clock-source local priority1 64
sonic(config-ptp-0)# ptp clock-step two_step
sonic(config-ptp-0)# ptp transport-mode udpv4 unicast
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.1.1.1/24
sonic(config-if-1)# ptp instance 0
sonic(config-if-ptp-0)# ptp enable
sonic(config-if-ptp-0)# ptp source ip 10.1.1.1

# Device B

sonic(config)# ptp enable
sonic(config)# ptp instance 0
sonic(config-ptp-0)# ptp profile smpte-2059-2
sonic(config-ptp-0)# ptp clock-type bc
sonic(config-ptp-0)# ptp clock-source local priority1 127
sonic(config-ptp-0)# ptp clock-step two_step
sonic(config-ptp-0)# ptp transport-mode udpv4 unicast
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.1.1.2/24
sonic(config-if-1)# ptp instance 0
sonic(config-if-ptp-0)# ptp enable
sonic(config-if-ptp-0)# ptp unicast master address 10.1.1.1
sonic(config-if-ptp-0)# ptp source ip 10.1.1.2
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 10.1.2.1/24
sonic(config-if-2)# ptp instance 0
sonic(config-if-ptp-0)# ptp enable
sonic(config-if-ptp-0)# ptp source ip 10.1.2.1

# Device C

sonic(config)# ptp enable
sonic(config)# ptp instance 0
sonic(config-ptp-0)# ptp profile smpte-2059-2
sonic(config-ptp-0)# ptp clock-type oc
sonic(config-ptp-0)# ptp clock-source local priority1 255
sonic(config-ptp-0)# ptp clock-step two_step
sonic(config-ptp-0)# ptp transport-mode udpv4 unicast
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 10.1.2.2/24
sonic(config-if-2)# ptp instance 0
sonic(config-if-ptp-0)# ptp enable
sonic(config-if-ptp-0)# ptp source ip 10.1.2.2
sonic(config-if-ptp-0)# ptp unicast master address 10.1.2.1

Verify configuration

# Display PTP synchronization status on Device B

sonic# show ptp clock
Domain: 127
Profile: smpte-2059-2
Clock Type: BC
Clock step: two_step
Delay Mode: E2E
Transport Mode: udpv4
Dscp: 56
Source IP Address: 0.0.0.0
Local Clock Identity: 000FE2.FFFE.FF0000
Local Clock Accuracy: 0xFE
Local Clock Class: 248
Local Clock Priority1: 127
Local Clock Priority2: 128
ports: Ethernet1,Ethernet2
Grandmaster Clock Identity: 60eb5a.fffe.010299
Grandmaster Clock Accuracy: 0xFE
Grandmaster Clock Class: 248
Grandmaster Priority1: 64
Grandmaster Priority2: 128
Parent Port Identity: 1
Servo_state: locked
Offset_to_master: 10
Path delay: 268
Max Steps Removed: 255
Local Time: 86235188577296

# Display PTP interface 1 status on Device B

sonic# show ptp interface 1
Ethernet: Ethernet1
Enable: true
Domain: 0
Index: 1
Dscp: 56
Source IP Address: 10.1.1.2
Announce Interval: 0
Announce Receipt Timeout: 3
Delay Req Interval: -3
Pdelay Req Interval: -3
Sync Interval: -3
Mode: slave
Delay Mode: E2E
Unicat Master Address: ['10.1.1.1']

# Display PTP interface 2 status on Device B

sonic# show ptp interface 2
Ethernet: Ethernet2
Enable: true
Domain: 0
Index: 2
Dscp: 56
Source IP Address: 10.1.2.1
Announce Interval: 0
Announce Receipt Timeout: 3
Delay Req Interval: -3
Pdelay Req Interval: -3
Sync Interval: -3
Mode: master
Delay Mode: E2E

# Display PTP synchronization status on Device C

sonic# show ptp clock
Domain: 127
Profile: smpte-2059-2
Clock Type: OC
Clock step: two_step
Delay Mode: E2E
Transport Mode: udpv4
Dscp: 56
Source IP Address: 0.0.0.0
Local Clock Identity: 100520.2542.551384
Local Clock Accuracy: 0xFE
Local Clock Class: 248
Local Clock Priority1: 255
Local Clock Priority2: 128
ports: Ethernet2
Grandmaster Clock Identity: 60eb5a.fffe.010299
Grandmaster Clock Accuracy: 0xFE
Grandmaster Clock Class: 248
Grandmaster Priority1: 64
Grandmaster Priority2: 128
Parent Port Identity: 2
Servo_state: locked
Offset_to_master: 17
Path delay: 566
Max Steps Removed: 255
Local Time: 86235462577461

Using smpte for IPv4 UDP Encapsulated and Mixed Communication

Section titled “Using smpte for IPv4 UDP Encapsulated and Mixed Communication”

Network requirements

In this networking, Device A, Device B and Device C are in the same PTP domain and use the smpte-2059-2 protocol standard as well as IPv4 UDP encapsulation mixed communication. Device A is used as the grandmaster, and the E2E delay measurement mechanism and one_step timestamp carrying mode are used to realize the PTP synchronization from Device B and Device C to Device A.

Procedure

# Device A

sonic(config)# ptp enable
sonic(config)# ptp instance 0
sonic(config-ptp-0)# ptp profile smpte-2059-2
sonic(config-ptp-0)# ptp clock-type oc
sonic(config-ptp-0)# ptp clock-source local priority1 64
sonic(config-ptp-0)# ptp transport-mode udpv4 mixed
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.1.1.1/24
sonic(config-if-1)# ptp instance 0
sonic(config-if-ptp-0)# ptp enable
sonic(config-if-ptp-0)# ptp source ip 10.1.1.1

# Device B

sonic(config)# ptp enable
sonic(config)# ptp instance 0
sonic(config-ptp-0)# ptp profile smpte-2059-2
sonic(config-ptp-0)# ptp clock-type bc
sonic(config-ptp-0)# ptp clock-source local priority1 127
sonic(config-ptp-0)# ptp transport-mode udpv4 mixed
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.1.1.2/24
sonic(config-if-1)# ptp instance 0
sonic(config-if-ptp-0)# ptp enable
sonic(config-if-ptp-0)# ptp source ip 10.1.1.2
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 10.1.2.1/24
sonic(config-if-2)# ptp instance 0
sonic(config-if-ptp-0)# ptp enable
sonic(config-if-ptp-0)# ptp source ip 10.1.2.1

# Device C

sonic(config)# ptp enable
sonic(config)# ptp instance 0
sonic(config-ptp-0)# ptp profile smpte-2059-2
sonic(config-ptp-0)# ptp clock-type oc
sonic(config-ptp-0)# ptp clock-source local priority1 255
sonic(config-ptp-0)# ptp transport-mode udpv4 mixed
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 10.1.2.2/24
sonic(config-if-2)# ptp instance 0
sonic(config-if-ptp-0)# ptp enable
sonic(config-if-ptp-0)# ptp source ip 10.1.2.2

Verify configuration

# Display PTP synchronization status on Device B

sonic# show ptp clock
Domain: 127
Profile: smpte-2059-2
Clock Type: BC
Clock step: one_step
Delay Mode: E2E
Transport Mode: udpv4
Dscp: 56
Source IP Address: 0.0.0.0
Local Clock Identity: 000FE2.FFFE.FF0000
Local Clock Accuracy: 0xFE
Local Clock Class: 128
Local Clock Priority1: 127
Local Clock Priority2: 128
ports: Ethernet1,Ethernet2
Grandmaster Clock Identity: 60eb5a.fffe.010299
Grandmaster Clock Accuracy: 0xFE
Grandmaster Clock Class: 128
Grandmaster Priority1: 64
Grandmaster Priority2: 128
Parent Port Identity: 1
Servo_state: locked
Offset_to_master: 10
Path delay: 268
Max Steps Removed: 255
Local Time: 86235188577296

# Display PTP interface 1 status on Device B

sonic# show ptp interface 1
Ethernet: Ethernet1
Enable: true
Domain: 0
Index: 1
Source IP Address: 10.1.1.2
Announce Interval: 0
Announce Receipt Timeout: 3
Delay Req Interval: -3
Pdelay Req Interval: -3
Sync Interval: -3
Mode: slave
Delay Mode: E2E
Unicat Master Address: ['10.1.1.1']

# Display PTP interface 2 status on Device B

sonic# show ptp interface 2
Ethernet: Ethernet2
Enable: true
Domain: 0
Index: 2
Source IP Address: 10.1.2.1
Announce Interval: 0
Announce Receipt Timeout: 3
Delay Req Interval: -3
Pdelay Req Interval: -3
Sync Interval: -3
Mode: master
Delay Mode: E2E

# Display PTP synchronization status on Device C

sonic# show ptp clock
Domain: 127
Profile: smpte-2059-2
Clock Type: OC
Clock step: one_step
Delay Mode: E2E
Transport Mode: udpv4
Dscp: 56
Source IP Address: 0.0.0.0
Local Clock Identity: 100520.2542.551384
Local Clock Accuracy: 0xFE
Local Clock Class: 128
Local Clock Priority1: 255
Local Clock Priority2: 128
ports: Ethernet2
Grandmaster Clock Identity: 60eb5a.fffe.010299
Grandmaster Clock Accuracy: 0xFE
Grandmaster Clock Class: 128
Grandmaster Priority1: 64
Grandmaster Priority2: 128
Parent Port Identity: 2
Servo_state: locked
Offset_to_master: 17
Path delay: 539
Max Steps Removed: 255
Local Time: 86235462577461

Network requirements

In this network, both Device A and Device B support two PTP domains, and the domain 0 and domain 1 of Device A use the smpte and 1588v2 protocol standards as the master, and the domain 2 and domain 3 of Device B use the g8275.1 and g8275.2 protocol standards as the master. Device C supports four PTP domains and uses domain 0, domain 1, domain 2 and domain 4 to synchronize PTP time to the two domains of Device A and Device B respectively.

Procedure

# Device A

sonic(config)# ptp enable

# Configuring PTP domain 0

sonic(config)# ptp instance 0
sonic(config-ptp-0)# ptp profile smpte-2059-2
sonic(config-ptp-0)# ptp clock-id 000145.0000.440046
sonic(config-ptp-0)# ptp clock-type oc
sonic(config-ptp-0)# ptp clock-step one_step
sonic(config-ptp-0)# ptp delay-mode E2E
sonic(config-ptp-0)# ptp clock-source local priority1 64
sonic(config-ptp-0)# ptp transport-mode udpv4 unicast

# Configuring PTP domain 1

sonic(config)# ptp instance 1
sonic(config-ptp-0)# ptp profile 1588v2
sonic(config-ptp-0)# ptp clock-id 000145.0000.450047
sonic(config-ptp-0)# ptp clock-type oc
sonic(config-ptp-0)# ptp clock-step one_step
sonic(config-ptp-0)# ptp delay-mode E2E
sonic(config-ptp-0)# ptp clock-source local priority1 64

# Configuring PTP interface

sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.1.1.2/24
sonic(config-if-1)# ptp instance 0
sonic(config-if-ptp-0)# ptp enable
sonic(config-if-ptp-0)# ptp source ip 10.1.1.2
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 10.1.2.2/24
sonic(config-if-2)# ptp instance 1
sonic(config-if-ptp-1)# ptp enable
sonic(config-if-ptp-0)# ptp source ip 10.1.2.2

# Device B

sonic(config)# ptp enable

# Configuring PTP domain 2

sonic(config)# ptp instance 2
sonic(config-ptp-0)# ptp profile g8275.1
sonic(config-ptp-0)# ptp clock-id 000016.0000.000018
sonic(config-ptp-0)# ptp clock-type t-gm
sonic(config-ptp-0)# ptp clock-step one_step
sonic(config-ptp-0)# ptp delay-mode E2E
sonic(config-ptp-0)# ptp clock-source local priority1 64

# Configuring PTP domain 3

sonic(config)# ptp instance 3
sonic(config-ptp-0)# ptp profile g8275.2
sonic(config-ptp-0)# ptp clock-id 000016.0000.000017
sonic(config-ptp-0)# ptp clock-type t-gm
sonic(config-ptp-0)# ptp clock-step one_step
sonic(config-ptp-0)# ptp delay-mode E2E
sonic(config-ptp-0)# ptp clock-source local priority1 64
sonic(config-ptp-0)# ptp transport-mode udpv4 unicast

# Configuring PTP interface

sonic(config)# interface ethernet 3
sonic(config-if-1)# ip address 10.1.3.2/24
sonic(config-if-1)# ptp instance 2
sonic(config-if-ptp-2)# ptp enable
sonic(config-if-ptp-2)# ptp source ip 10.1.3.2
sonic(config)# interface ethernet 4
sonic(config-if-2)# ip address 10.1.4.2/24
sonic(config-if-2)# ptp instance 3
sonic(config-if-ptp-3)# ptp enable
sonic(config-if-ptp-3)# ptp source ip 10.1.4.2

# Device B

sonic(config)# ptp enable

# Configuring PTP domain 0

sonic(config)# ptp instance 0
sonic(config-ptp-0)# ptp profile smpte-2059-2
sonic(config-ptp-0)# ptp clock-id 000150.0000.000017
sonic(config-ptp-0)# ptp clock-type oc
sonic(config-ptp-0)# ptp clock-step one_step
sonic(config-ptp-0)# ptp delay-mode E2E
sonic(config-ptp-0)# ptp clock-source local priority1 128
sonic(config-ptp-0)# ptp transport-mode udpv4 unicast

# Configuring PTP domain 1

sonic(config)# ptp instance 1
sonic(config-ptp-0)# ptp profile 1588v2
sonic(config-ptp-0)# ptp clock-id 000150.0000.000018
sonic(config-ptp-0)# ptp clock-type oc
sonic(config-ptp-0)# ptp clock-step one_step
sonic(config-ptp-0)# ptp delay-mode E2E
sonic(config-ptp-0)# ptp clock-source local priority1 128

# Configuring PTP domain 2

sonic(config)# ptp instance 2
sonic(config-ptp-0)# ptp profile g8275.1
sonic(config-ptp-0)# ptp clock-id 000150.0000.000008
sonic(config-ptp-0)# ptp clock-type t-tsc
sonic(config-ptp-0)# ptp clock-step one_step
sonic(config-ptp-0)# ptp delay-mode E2E
sonic(config-ptp-0)# ptp clock-source local priority1 128

# Configuring PTP domain 3

sonic(config)# ptp instance 3
sonic(config-ptp-0)# ptp profile g8275.2
sonic(config-ptp-0)# ptp clock-id 000150.0000.000007
sonic(config-ptp-0)# ptp clock-type t-tsc-p
sonic(config-ptp-0)# ptp clock-step one_step
sonic(config-ptp-0)# ptp delay-mode E2E
sonic(config-ptp-0)# ptp clock-source local priority1 128
sonic(config-ptp-0)# ptp transport-mode udpv4 unicast

# Configuring PTP interface

sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.1.1.1/24
sonic(config-if-1)# ptp instance 0
sonic(config-if-ptp-0)# ptp enable
sonic(config-if-ptp-0)# ptp source ip 10.1.1.1
sonic(config-if-ptp-0)# ptp unicast master address 10.1.1.2
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 10.1.2.1/24
sonic(config-if-2)# ptp instance 1
sonic(config-if-ptp-1)# ptp enable
sonic(config-if-ptp-1)# ptp source ip 10.1.2.1
sonic(config)# interface ethernet 3
sonic(config-if-3)# ip address 10.1.3.1/24
sonic(config-if-3)# ptp instance 2
sonic(config-if-ptp-2)# ptp enable
sonic(config-if-ptp-2)# ptp source ip 10.1.3.1
sonic(config)# interface ethernet 4
sonic(config-if-4)# ip address 10.1.4.1/24
sonic(config-if-4)# ptp instance 3
sonic(config-if-ptp-3)# ptp enable
sonic(config-if-ptp-3)# ptp source ip 10.1.4.1
sonic(config-if-ptp-3)# ptp unicast master address 10.1.4.2

Verify configuration

# Display PTP synchronization status on Device C

sonic# show ptp clock
Domain: 1
Profile: 1588v2
Clock Type: OC
Clock Step: one_step
Delay Mode: E2E
Transport Mode: udpv4
Dscp: 56
Source IP Address: 0.0.0.0
Local Clock Identity: 000150.0000.000018
Local Clock Accuracy: 0xFE
Local Clock Class: 128
Local Clock Priority1: 128
Local Clock Priority2: 128
ports: Ethernet2
Grandmaster Clock Identity: 000145.0000.450047
Grandmaster Clock Accuracy: 0xfe
Grandmaster Clock Class: 64
Grandmaster Clock Priority1: 128
Grandmaster Clock Priority2: 128
Parent Port Identity: 3
Servo State: locked
Offset To Master: 14
Path Delay: 328
Max Steps Removed: 255
Local Time: 12235450387301
...

Using GNSS smpte for IPv4 UDP Encapsulated and Multicast Communication

Section titled “Using GNSS smpte for IPv4 UDP Encapsulated and Multicast Communication”

Network requirements

In this networking, Device A and Device B are in the same PTP domain, using the smpte-2059-2 protocol standard and IPv4 UDP encapsulated multicast communication. Device A uses GNSS satellite signals as the clock source. PTP synchronization from Device A to Device B is achieved using the P2P delay measurement mechanism and two_step timestamp carrying mode. Note: Currently, only the CX306P‑48Y device supports GNSS satellite source synchronization.

Procedure

sonic(config)# ptp enable
sonic(config)# ptp instance 0
sonic(config-ptp-0)# ptp profile smpte-2059-2
sonic(config-ptp-0)# ptp clock-id 000217.0000.000023
sonic(config-ptp-0)# ptp enable
sonic(config-ptp-0)# ptp clock-type oc
sonic(config-ptp-0)# ptp delay-mode P2P
sonic(config-ptp-0)# ptp clock-source priority1 64
sonic(config-ptp-0)# ptp clock-step two_step
sonic(config-ptp-0)# ptp transport-mode udpv4 multicast
sonic(config-ptp-0)# ptp clock-source gnss
sonic(config)# interface ethernet 1
sonic(config-if-1)# ip address 10.1.1.1/24
sonic(config-if-1)# ptp instance 0
sonic(config-if-ptp-0)# ptp enable
sonic(config-if-ptp-0)# ptp source ip 10.1.1.1

# Device B

sonic(config)# ptp enable
sonic(config)# ptp instance 0
sonic(config-ptp-0)# ptp profile smpte-2059-2
sonic(config-ptp-0)# ptp clock-id 000224.0000.000023
sonic(config-ptp-0)# ptp clock-type oc
sonic(config-ptp-0)# ptp delay-mode P2P
sonic(config-ptp-0)# ptp clock-source priority1 128
sonic(config-ptp-0)# ptp clock-step two_step
sonic(config-ptp-0)# ptp transport-mode udpv4 multicast
sonic(config)# interface ethernet 1
sonic(config-if-1)# ptp instance 0
sonic(config-if-ptp-0)# ptp enable
sonic(config-if-ptp-0)# ptp source ip 10.1.1.2

Verify configuration

# Display PTP synchronization status on Device B

Domain: 0
Profile: smpte-2059-2
Clock Type: OC
Clock Step: two_step
Delay Mode: P2P
Transport Mode: udpv4
Dscp: 56
Source IP Address: 0.0.0.0
Local Clock Identity: 000224.0000.000023
Local Clock Accuracy: 0xFE
Local Clock Class: 248
Local Clock Priority1: 128
Local Clock Priority2: 128
ports: Ethernet23
Grandmaster Clock Identity: 000217.0000.000023
Grandmaster Clock Accuracy: 0xfe
Grandmaster Clock Class: 248
Grandmaster Clock Priority1: 64
Grandmaster Clock Priority2: 128
Parent Port Identity: 0
Servo State: locked
Offset To Master: -12
Path Delay: 239
Max Steps Removed: 255
Local Time: 432962822290957