Configuration Guide
Network Management and Monitor...
PTP Configuration
50 min
ptp configuration ptp configuration introduction introduction 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 explanation of principles explanation of principles basic concepts of ptp basic concepts of ptp 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 establishing master slave relationships establishing master slave relationships 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 grandmaster clock selection grandmaster clock selection for 1588v2, smpte and aes67 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 priority1 the smaller the priority1 value, the higher the priority class if priority1 values are the same, the smaller the class value, the higher the priority accuracy if the class value is also the same, the smaller the accuracy value, the higher the priority 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 grandmaster clock selection for g8275 1 and g8275 2 grandmaster clock selection for g8275 1 and g8275 2 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 class the smaller the class value, the higher the priority accuracy if the class values are the same, the smaller the accuracy value, the higher the priority priority2 if the accuracy value is also the same, the smaller the priority2 value, the higher the priority priority if the priority2 value is also the same, the lower the priority value, the higher the priority 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 time synchronization method time synchronization method 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 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 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 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 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 ptp configuration ptp configuration configuring ptp instance configuring ptp instance 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 operation command description enter the system configuration view configure terminal configure ptp instance ptp instance domain id configuring ptp profile configuring ptp profile 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 operation command description enter the ptp configuration view ptp instance domain id configure ptp profile ptp profile {smpte 2059 2|g8275 1|g8275 2|1588v2|aes67} configuring clock id configuring clock id the clock id is an 8 byte array and should be written as a string in this configuration it should be unique as it is used to identify a specific clock when a device is configured with multiple instances, it needs to be manually specified so that the multiple instance clock ids are different operation command description enter the ptp configuration view ptp instance domain id configure ptp clock id ptp clock id xxxxxx xxxx xxxxxx the default value is "000000 0000 000000" if the default is used or not set at all, the clock id will be automatically generated based on the device mac address configuring clock type configuring clock type when profile is smpte 2059 2 ,1588v2 or aes67, the clock types support oc, bc, tc when profile is g8275 1, the clock type supports t gm, t bc, t tsc, t tc when profile is g8275 2, the clock type supports t gm, t bc p, t tsc p operation command description enter the ptp configuration view ptp instance domain id configure ptp clock type ptp 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 configuring clock source parameters configuring clock source parameters the master slave relationship between each clock node is determined by configuring their clock source parameters priority1 is only supported when profile is smpte 2059 2, 1588v2 or aes67 priority is only supported when profile is g8275 1 or g8275 2 operation command description enter the ptp configuration view ptp instance domain id configure ptp clock source parameters ptp clock source local {accuracy|class|priority1|priority2|priority} accuracy configure range 0 255, default value is 254 class configure range 0 255, default value is 248 priority1 configure range 0 255, default value is 128 priority2 configure range 0 255, default value is 128 priority configure range 1 255, default value is 128 configuring ptp interface mode configuring ptp interface mode when the mode of a ptp interface is not configured, the mode of the interface is elected as master, slave, or passive during clock election; when the ptp interface mode is specified manually, if the current device interface is master, the priority of the clock source local parameter of the device must be greater than that of the peer if the current device interface is slave, the priority of the clock source local parameter of the device must be less than that of the peer operation command description enter the ptp interface configuration view ptp instance domain id interface ethernet interface num configure ptp interface mode ptp mode {master|slave} configuring delay measurement mechanism configuring delay measurement mechanism 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 operation command description enter the ptp configuration view ptp instance domain id configure delay measurement mechanism ptp delay mode {e2e|p2p} configuring timestamp carrying mode configuring timestamp carrying mode 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 operation command description enter the ptp configuration view ptp instance domain id configure timestamp carrying mode ptp 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 configuring transport mode configuring transport mode when the ptp profile is smpte 2059 2, it can communicate with udpv4/udpv6 unicast, multicast and mixed when the ptp profile is 1588v2, it can communicate with udp4/udpv6 unicast, multicast and ethernet when udpv4 or udpv6 unicast is modified to ethernet, the interface's unicast master address a b c d/a b needs to be removed when the ptp profile is g8275 1, it can only communicate with ethernet when the ptp profile is g8275 2, it can communicate with udpv4/udpv6 unicast if unicast communication is used between clock nodes, you need to configure the ip address of the interface as the source ip, and the ip address of the ptp interface at the opposite end as the destination ip address of the ptp message if mixed communication is used between clock nodes, you need to configure the interface ip address as the source ip operation command description enter the ptp configuration view ptp instance domain id configure transport mode ptp transport mode {udpv4|udpv6|ethernet} \[unicast|multicast|mixed] configuring the ptp message sending interval 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 operation command description enter the ptp interface configuration view interface ethernet interface num ptp instance domain id configure the sync message sending interval ptp sync interval interval when 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 interval ptp announce interval interval when 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 interval ptp delay req interval interval when 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 interval ptp pdelay req interval interval when 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 sm tlv configuration sm tlv configuration 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 enable sm tlv enable sm tlv 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" ) operation command description enter the system configuration view configure terminal enable sm tlv ptp sm tlv enable configuring default frame rates configuring default frame rates 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 operation command description enter the system configuration view configure terminal configure default frame rate ptp sm tlv default frame rates numerator denominator the numerator/denominator is the effective frame rate display and maintenance display and maintenance operation command display ptp synchronization status show ptp clock display ptp interface status show ptp interface interface num display sm tlv status show ptp clock sm tlv domain id display ptp message statistics show ptp counter \[interface id ] \[instance domain id ] ptp configuration example ptp configuration example using smpte for ipv4 udp encapsulated and multicast communication using smpte for ipv4 udp encapsulated and multicast communication network requirements 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 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 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 using smpte for ipv4 udp encapsulated and unicast communication network requirements 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 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 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 using smpte for ipv4 udp encapsulated and mixed communication network requirements 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 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 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 ptp multi domain synchronization example ptp multi domain synchronization example network requirements 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 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 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
