Command Line Reference
Network Management And Monitor...
PTP Configuration
43 min
show ptp clock show ptp clock \[command] show ptp clock \[ domain id ] \[purpose] display the ptp clock information of the device \[view] system configuration view \[usage scenario] use this command to check the ptp clock configuration on the device, including current clock status, mode, clock accuracy, and other information \[use cases] domain 0 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 000217 0000 000023 local clock accuracy 0xfe local clock class 248 local clock priority1 20 local clock priority2 128 ports ethernet23 grandmaster clock identity 000217 0000 000023 grandmaster clock accuracy 0xfe grandmaster clock class 248 grandmaster clock priority1 20 grandmaster clock priority2 128 parent port identity 0 servo state unlocked offset to master 0 path delay 0 max steps removed 255 local time 432962822290957 show ptp clock sm tlv show ptp clock sm tlv \[command] show ptp clock sm tlv domain id \[purpose] display the ptp clock sm tlv information of the device \[view] system configuration view \[usage scenario] use this command to check the ptp clock sm tlv information on the device \[use cases] sonic# show ptp clock sm tlv default frame rate 0/0 gm lock status 0 time address flags 3 current local offset 0 jump seconds 0 time of next jump 0 time of next jam 0 time of previous jam 0 previous jam local offset 0 daylight saving 0 leap second jump 0 show ptp counter \[interface] \[instance] show ptp counter \[interface] \[instance] \[command] show ptp counter \[interface interface name ] \[instance domain id ] \[purpose] display ptp packet statistics on the interface \[view] system configuration view \[usage scenario] use this command to check the ptp packet statistics information on the interface \[use cases] sonic# show ptp counters interface ethernet1 recv packets send packets \ announce 28249 28249 sync 225857 225857 followup 0 0 delayreq 0 0 delayresp 0 0 pdelayreq 0 0 pdelayresp 0 0 pdelayrespfollowup 0 0 signaling 0 0 managment 0 0 show ptp interface show ptp interface \[command] show ptp interface interface num \[purpose] display the ptp operation information of the interface \[view] system configuration view \[use cases] sonic# show ptp interface 1 ethernet ethernet1 enable true domain 1 index 2 dscp 56 source ip address 10 1 10 2 announce interval 1 announce receipt timeout 3 delay req interval 0 pdelay req interval 0 sync interval 0 mode slave delay mode e2e unicat master address \['10 1 10 1'] ptp source ip ptp source ip \[command] ptp source ip { a b c d | a b } \[purpose] specify the source ip for ptp packets on the interface or globally \[view] ptp instance configuration view or interface configuration view \[usage scenario] it is recommended that source ip be configured for unicast, multicast, and mixed transport modes unicast and mixed specify the interface ip under interface view, and multicast can be configured in both ptp instance configuration view and interface configuration view \[use cases] sonic(config ptp 0)# ptp source ip 10 1 1 1 ptp enable ptp enable \[command] ptp enable no ptp enable \[purpose] enable ptp function \[view] system configuration view or interface configuration view \[usage scenario] when using ptp synchronization, you must enable ptp globally and on the interface \[use cases] \# enable global ptp function sonic(config)# ptp enable \# enable ptp function in interface 1 sonic(config)# interface ethernet 1 sonic(config if 1)# ptp instance 0 sonic(config if ptp 0)# ptp enable ptp clock id ptp clock id \[command] ptp clock id xxxxxx xxxx xxxxxx \[purpose] the clock identity attribute of the local clock \[view] ptp instance configuration view \[usage scenario] 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 the default value is "000000 0000 000000" if the default is used or not set at all, the clock id will be automatically generated \[use cases] sonic(config ptp 127)# ptp clock id 000001 0001 000001 ptp clock source local {accuracy|class|priority1|priority2} ptp clock source local {accuracy|class|priority1|priority2} \[command] ptp clock source local {accuracy|class|priority1|priority2|priority} \[purpose] configure relevant parameters of the clock source \[parameter] parameter description accuracy value range 0 to 255, default value 254 class value range 0 to 255, default value 248 priority1 value range 0 to 255, default value 128, it’s only supported when profile is smpte 2059 2, 1588v2 or aes67 priority2 value range 0 to 255, default value 128 \[view] ptp instance configuration view \[usage scenario] when the ptp profile is smpte 2059 2 or 1588v2 or aes67, each clock node in the ptp domain elects the grandmaster clock through the bmc algorithm, they compare the clocks based on the priority1, class, accuracy and priority2 carried in the announce message the comparison rules are as follows the one with higher priority1 wins if priority1 is the same, the one with a higher class wins if class is also the same, the one with higher accuracy wins if accuracy is still the same, the one with higher priority2 wins if priority2 is still the same, the one with the smaller interface identifier wins when the ptp profile is g8275 1 or g8275 2, each clock node in the ptp domain elects the grandmaster clock through the abmc algorithm, they compare the clocks based on the class, accuracy, priority2 and priority carried in the announce message in this algorithm, multiple grandmaster clocks are allowed to be optimal at the same time if multiple gm clocks exist, each non gm clock is synchronized by one of the grandmasters in the ptp domain the comparison rules are as follows the one with higher class wins if class is the same, the one with a higher accuracy wins if accuracy is also the same, the one with higher priority2 wins if priority2 is still the same, then 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 optimal clocks are elected in the ptp domain, and the slave node chooses an optimal clock as the master node nearby and forms two spanning trees, and the two spanning trees do not interact with each other in terms of ptp message if the class is greater than 127, the smaller clockid (which consists of the clock identity and interface number together) wins \[use cases] sonic(config ptp 127)# ptp clock source local class 64 ptp clock step {one step|two step} ptp clock step {one step|two step} \[command] ptp clock step {one step|two step} \[purpose] configure the mode for carrying timestamps \[parameter] parameter description one step specifies to one step mode two step specifies to two step mode \[view] ptp instance configuration view \[usage scenario] when the ptp profile is 1588v2, the default is two step, and when using other profiles, the default is one step one step the sync egress transmit timestamp is carried in the sync messages, and follow up messages is not sent the pdelay resp egress transmit timestamp is carried in the pdelay resp messages, and pdelay resp follow up messages is not sent two step the sync egress transmit timestamp is carried in the follow up messages the pdelay resp egress transmit timestamp is carried in the pdelay resp follow up messages \[use cases] sonic(config ptp 127)# ptp clock step two step ptp clock type {oc|bc|tc|t gm|t bc|t tsc|t tc|t bc p|t tsc p} ptp clock type {oc|bc|tc|t gm|t bc|t tsc|t tc|t bc p|t tsc p} \[command] ptp clock type {oc|bc|tc|t gm|t bc|t tsc|t tc|t bc p|t tsc p} \[purpose] configure basic clock node type for ptp \[parameter] parameter description bc boundary clock oc ordinary 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 \[view] ptp instance configuration view \[usage scenario] when the ptp profiles is smpte 2059 2 or 1588v2 or aes67, the clock type can be configured oc, bc, tc oc (ordinary clock) the clock node has only one ptp interface participating in time synchronization within the same ptp domain, and uses it to synchronize time from an upstream clock node or to distributes time to a downstream node bc (boundary clock) the clock node has multiple ptp interfaces participating in time synchronization within the same ptp domain it synchronizes time from an upstream clock node through one interface and distributes time to downstream clock nodes through the remaining interfaces tc (transparent clock) unlike bc/oc, which require time synchronization with other clock nodes, tc does not synchronize time with other clock nodes tc has multiple ptp interfaces, but it only forwards ptp protocol messages between these interfaces and performs forwarding delay correction, without synchronizing time through any interface when the ptp profiles is g8275 1, the clock type can be configured t gm, t bc, t tsc, t tc t gm (telecom grandmaster) the clock node has one or more ptp interfaces participating in time synchronization within the same ptp domain, and can only act as a master, distributes time to downstream clock nodes t bc (telecom boundary clock) the clock node has multiple ptp interfaces participating in time synchronization within the same ptp domain, and it synchronizes time from the upstream clock node through one of the interfaces and distributes time to the downstream clock node through the remaining interfaces t tsc (telecom time slave clock) the clock node has only one ptp interface in the same ptp domain participating in time synchronization, and can only act as a slave to synchronize time from the upstream clock node t tc (telecom transparent clock) the clock node is an end to end transparent clock (e2e tc) as defined in \[ieee 1588] and forwards all ptp protocol messages when the ptp profiles is g8275 2, the clock type can be configured t gm, t bc p, t tsc p t gm (telecom grandmaster) the clock node has one or more ptp interfaces participating in time synchronization within the same ptp domain, and can only act as a master, distributes time to downstream clock nodes t bc p (partial support telecom boundary clock) the clock node has multiple ptp interfaces participating in time synchronization within the same ptp domain, and it synchronizes time from the upstream clock node through one of the interfaces and distributes time to the downstream clock node through the remaining interfaces t tsc p (partial support telecom time slave clock) the clock node can enable multiple ptp interfaces in the same ptp domain, but can only act as slave and synchronize the time from the upstream clock node through one interface, and the other interfaces act as passive and do not participate in the time synchronization \[use cases] sonic(config ptp 127)# ptp clock type oc ptp instance ptp instance \[command] ptp instance domain id \[purpose] create a ptp domain or interface to join a ptp domain \[parameter] parameter description domain id ptp domain \[view] ptp instance configuration view or interface configuration view \[usage scenario] in the same ptp domain, devices follow common rules to ensure stable communication between them devices from different domains cannot directly interact all types of profiles, the domain value can be configured in the range 0 127 \[use cases] sonic(config)# ptp instance 64 sonic(config)# interface ethernet 1 sonic(config if 1)ptp instance 64 ptp profile \<smpte 2059 2|1588v2|g8275 1|g8275 2|aes67> ptp profile \<smpte 2059 2|1588v2|g8275 1|g8275 2|aes67> \[command] ptp profile \<smpte 2059 2|1588v2|g8275 1|g8275 2|aes67> \[purpose] configure the protocol standard of ptp \[parameter] parameter description smpte 2059 2 standard protocol for clock synchronization smpte st 2059 2 1588v2 standard protocol for clock synchronization 1588v2 g8275 1 standard protocol for clock synchronization itu t g8275 1 g8275 2 standard protocol for clock synchronization itu t g8275 2 aes67 standard protocol for clock synchronization aes67 \[view] ptp instance configuration view \[usage scenario] the command must be executed before other ptp configurations are issued, and its execution clears all current ptp configurations \[use cases] sonic(config ptp 127)# ptp profile smpte 2059 2 deleted all ptp configurations ptp transport mode {udpv4|udpv6|ethernet} \[unicast|multicast|mixed] ptp transport mode {udpv4|udpv6|ethernet} \[unicast|multicast|mixed] \[command] ptp transport mode {udpv4|udpv6|ethernet} \[unicast|multicast|mixed] \[purpose] configure the udpv4/udpv6/ethernet ptp transport protocol for ptp messages \[parameter] parameter description udpv4 ipv4+udp encapsulation udpv6 ipv6+udp encapsulation ethernet mac encapsulation unicast communicate with unicast address multicast communicate with multicast address mixed communicate with unicast address for delay req/delay resp, and multicast address for others \[view] ptp instance configuration view \[usage scenario] if unicast communication is used between clock nodes, you need to configure the ip address of the interface as the source ip, the ip address of the ptp interface at the opposite end as the destination ip address of the ptp message, and make sure that the route from the current interface to the ptp interface at the opposite end is reachable if mixed communication is used between clock nodes, you need to configure the interface ip address as the source ip when the ptp profile is smpte 2059 2, it can communicate with udpv4/udpv6 unicast, multicast and mixed when the ptp profile is aes67,it can only communicate with udpv4 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 \[use cases] sonic(config ptp 127)# ptp transport mode udpv4 ptp delay mode {e2e|p2p} ptp delay mode {e2e|p2p} \[command] ptp delay mode {e2e|p2p} \[purpose] configure delay measurement mechanism \[parameter] parameter description e2e end to end delay mechanism p2p peer to peer delay mechanism \[view] ptp instance configuration view \[usage scenario] the default is e2e e2e is end to end, which is measure the ptp event message resident time for sync and delay req messages p2p is peer to peer, which is measure the ptp event message resident time for pdelay req messages the p2p delay measurement mechanism only supports configuration when the profile is smpte 2059 2, 1588v2, or aes67 configuration scenarios where p2p+one step is not supported \[use cases] sonic(config ptp 127)# ptp delay mode e2e ptp sm tlv enable ptp sm tlv enable \[command] ptp sm tlv enable \[purpose] enable sm tlv function \[view] ptp instance configuration view \[usage scenario] 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 when sm tlv is enabled, 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" \[use cases] sonic(config ptp 127)# ptp sm tlv enable ptp sm tlv default frame rates ptp sm tlv default frame rates \[command] ptp sm tlv default frame rates numerator denominator \[purpose] configure the default system frame rate, common frame rates are 24fps (movie), 25fps (pal), 30fps (ntsc) and so on helps the system specify how many frames per second for proper processing and synchronization of timecode and media streams \[parameter] parameter description numerator configure the sm tlv default system frame rate denominator configure the default system frame rate for sm tlv, numerator/denominator is the effective frame rate \[view] ptp instance configuration view \[usage scenario] this configuration is used on the grandmaster 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 \[use cases] sonic(config ptp 127)# ptp sm tlv default frame rates 3000 1001 ptp sm tlv time address flags drop frame ptp sm tlv time address flags drop frame \[command] ptp sm tlv time address flags drop frame \[purpose] configure the current time address or time code to be in drop frame time code format \[view] ptp instance configuration view \[usage scenario] in 24 hour time code, two frames per minute of time code are usually discarded in order to keep the time code consistent with the actual time this compensates for the time deviation in standard time code due to the frame rate for example, common dropped frame time code formats include 29 97 fps in ntsc \[use cases] sonic(config ptp 127)# ptp sm tlv time address flags drop frame ptp sm tlv time address flags color frame ptp sm tlv time address flags color frame \[command] ptp sm tlv time address flags color frame \[purpose] configure the time address or time code to be associated with a color frame \[view] ptp instance configuration view \[usage scenario] in some video systems, especially where color video is involved (e g , color video broadcasting), color time code may require special handling this is because different video formats may have different requirements for timecode, and color timecode is commonly used to represent timing information in color video content \[use cases] sonic(config ptp 127)# ptp sm tlv time address flags color frame ptp mode {master|slave} ptp mode {master|slave} \[command] ptp mode {master|slave} \[purpose] configure ptp interface role \[parameter] parameter description master primary interface, broadcasting time information to other devices slave secondary interface, receiving time information from external sources \[view] interface ptp configuration view \[usage scenario] when configuring interface mode, if the current device interface is master, the value 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 value of the clock source local parameter of the device must be less than that of the peer \[use cases] sonic(config)# interface ethernet 1 sonic(config if 1)# ptp instance 127 sonic(config if ptp 127)# ptp mode master ptp unicast master address ptp unicast master address \[command] ptp unicast master address { a b c d a b } \[purpose] configure the interface address of the master device on the opposite end of unicast negotiation \[parameter] parameter description a b c d ipv4 address a b ipv6 address \[view] interface ptp configuration view \[usage scenario] after this command is configured, the interface sends signal message to the peer master, requesting the peer to send a announce message, unicast negotiation, and then begins time synchronization \[use cases] sonic(config)# interface ethernet 1 sonic(config if 1)# ptp instance 127 sonic(config if ptp 127)# ptp unicast master address 10 1 1 1 ptp announce interval ptp announce interval \[command] ptp announce interval interval \[purpose] configure the transmission period of announce messages \[parameter] parameter description interval the transmission period of announce messages \[view] interface ptp configuration view \[usage scenario] when the ptp profile is smpte 2059 2, the announce interval can be configured in the range 3 to 1, and the default value is 0 when the ptp profile is 1588v2, the announce interval can be configured in the range 0 to 4, and the default value is 3 when the ptp profile is g8275 2, the announce interval can be configured in the range 3 to 0, and the default value is 3 when the ptp profile is g8275 1, this announce interval is not supported for change and the default value is 3 the value of the parameter is the logarithm to base 2 of the time interval in seconds for example, an interval of 0 25s gives a value of 2, and an interval of 0 5s gives value of 1 in order to facilitate quick synchronization, the default value, or a shorter interval than the default, is recommended \[use cases] sonic(config)# interface ethernet 1 sonic(config if 1)# ptp instance 127 sonic(config if ptp 127)# ptp announce interval 1 ptp announce receipt timeout ptp announce receipt timeout \[command] ptp announce receipt timeout time \[purpose] configure the receive timeout multiplier for announce messages \[parameter] parameter description time value range is 2 to 10, default value is 3 \[view] interface ptp configuration view \[usage scenario] the master node periodically sends an announce message to the slave node if the slave node does not receive an announce message from the master node within the timeout reception time of the message, it is considered that the master node is disabled only supported when ptp profile is smpte 2059 2 or 1588v2 \[use cases] sonic(config)# interface ethernet 1 sonic(config if 1)# ptp instance 127 sonic(config if ptp 127)# ptp announce receipt timeout 2 ptp sync interval ptp sync interval \[command] ptp sync interval interval \[purpose] configure the transmission period of sync messages \[parameter] parameter description interval the transmission period of sync messages \[view] interface ptp configuration view \[usage scenario] when the ptp profile is smpte 2059 2, the sync interval can be configured in the range 7 to 1, and the default value is 3 when the ptp profile is 1588v2, the sync interval can be configured in the range 7 to 1, and the default value is 0 when the ptp profile is g8275 2, the sync interval can be configured in the range 7 to 0, and the default value is 4 when the ptp profile is g8275 1, this sync interval is not supported for change and the default value is 4 the value of the parameter is the logarithm to base 2 of the time interval in seconds for example, an interval of 0 25s gives a value of 2, and an interval of 0 5s gives value of 1 \[use cases] sonic(config)# interface ethernet 1 sonic(config if 1)# ptp instance 127 sonic(config if ptp 127)# ptp sync interval 2 ptp delay req interval ptp delay req interval \[command] ptp delay req interval interval \[purpose] configure the transmission period of delay req messages \[parameter] parameter description interval the transmission period of delay req messages \[view] interface ptp configuration view \[usage scenario] when the ptp profile is smpte 2059 2, the delay req interval can be configured in the range 3 to 5, and the default value is 3 when the ptp profile is 1588v2, the delay req interval can be configured in the range 7 to 5, and the default value is 0 when the ptp profile is g8275 2, the delay req interval can be configured in the range 7 to 0, and the default value is 4 when the ptp profile is g8275 1, this delay req interval is not supported for change and the default value is 4 the value of the parameter is the logarithm to base 2 of the time interval in seconds for example, an interval of 0 25s gives a value of 2, and an interval of 0 5s gives value of 1 \[use cases] sonic(config)# interface ethernet 1 sonic(config if 1)# ptp instance 127 sonic(config if ptp 127)# ptp delay req interval 3 ptp pdelay req interval ptp pdelay req interval \[command] ptp pdelay req interval interval \[purpose] configure the transmission period of pdelay req messages \[parameter] parameter description interval the transmission period of pdelay req messages \[view] interface ptp configuration view \[usage scenario] when the ptp profile is smpte 2059 2, the pdelay req interval can be configured in the range 3 to 5, and the default value is 3 when the ptp profile is 1588v2, the pdelay req interval can be configured in the range 0 to 5, and the default value is 0 the value of the parameter is the logarithm to base 2 of the time interval in seconds for example, an interval of 0 25s gives a value of 2, and an interval of 0 5s gives value of 1 \[use cases] sonic(config)# interface ethernet 1 sonic(config if 1)# ptp instance 127 sonic(config if ptp 127)# ptp pdelay req interval 3 ptp dscp ptp dscp \[command] ptp dscp value \[purpose] configure the dscp of ptp packet \[parameter] parameter description value set value range of 0 63 \[view] ptp instance configuration view or interface ptp configuration view \[use cases] sonic(config)# interface ethernet 1 sonic(config if 1)# ptp instance 127 sonic(config if ptp 127)# ptp dscp 10 ptp asymmetry correction {positive|negative} ptp asymmetry correction {positive|negative} \[command] ptp asymmetry correction {positive|negative} time \[purpose] configure asymmetric delay compensation for ptp on the interface \[parameter] parameter description positive need to add compensation value negative compensation value needs to be subtracted time compensation value (unit ns, range 0 1,000,000,000) \[view] interface view \[use cases] sonic(config)# interface ethernet 1 sonic(config if 1)# ptp instance 127 sonic(config if ptp 127)# ptp asymmetry correction positive 1000 ptp loglevel {error|warning|notice|info|debug} ptp loglevel {error|warning|notice|info|debug} \[command] ptp loglevel {error|warning|notice|info|debug} \[purpose] configure the ptp4l logging level in ptp log \[parameter] parameter description error configure loglevel to error warning configure loglevel to warning notice configure loglevel to notice info configure loglevel to info, the default level is info debug configure loglevel to debug \[view] system configuration view \[use cases] sonic(config)# ptp loglevel debug ptp reset ptp reset \[command] ptp reset \[purpose] clear all ptp configurations \[view] system configuration view \[use cases] sonic(config)# ptp reset
