Command Line Reference
PTP Configuration
49 min
the precision time protocol (ptp) provides clock accuracy for networked devices only the following device models support ptp functionality cx308p 48y n v2 cx308p 48y n v2 cx532p n v2 cx532p n v2 cx732q n v2 cx732q n v2 ptp view ptp view table 1 ptp view table 1 ptp view command purpose show ptp clock \[ domain id ] display ptp clock information show ptp clock sm tlv domain id display sm tlv information show ptp interface ethernet interface name display ptp interface configuration information show ptp counters { interface ethernet interface name | domain domain id } display ptp interface counters clear ptp counters clear ptp packet counters show ptp clock \[ show ptp clock \[ domain id ] \[command] show ptp clock \[ domain id ] \[purpose] display ptp clock information \[parameters] parameter description domain id specify the domain id, the range is \[0,127] \[view] privileged user view \[use cases] sonic# show ptp clock 127 domain 127 profile smpte 2059 2 clock mode oc clock step one step dscp 56 source ip address 0 0 0 0 local clock identity 60eb5a fffe 0110b1 local clock accuracy 0xfe local clock class 248 local clock priority1 128 local clock priority2 128 ports ethernet18 grandmaster clock identity 001395 fffe 43a733 grandmaster clock accuracy 0xfe grandmaster clock class 248 grandmaster clock priority1 1 grandmaster clock priority2 128 parent port identity 1 servo state locked offset to master 2 path delay 659 max steps removed 255 local time 9921883176191 show ptp clock sm tlv show ptp clock sm tlv domain id \[command] show ptp clock sm tlv domain id \[purpose] display sm tlv information \[parameters] parameter description domain id specify the domain id, the range is \[0,127] \[view] privileged user view \[use cases] sonic# show ptp clock sm tlv 127 default frame rate 0/0 gm lock status 0 time address flags 0 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 interface ethernet show ptp interface ethernet interface name \[command] show ptp interface ethernet interface name \[purpose] display ptp interface configuration information \[parameters] parameter description interface name interface name (eg 0/1) \[view] privileged user view \[use cases] sonic# show ptp interface ethernet 0/18 ethernet ethernet18 enable true domain 127 index 1 dscp 56 announce interval 2 announce receipt timeout 3 delay req interval 3 pdelay req interval 3 sync interval 3 role dynamic delay mechanism e2e transport mode udpv4 show ptp counters {interface ethernet show ptp counters {interface ethernet interface name | domain domain id } \[command] show ptp counters { interface ethernet interface name | domain domain id } \[purpose] display ptp interface counters \[parameters] parameter description interface name interface name (eg 0/1) domain id specify the domain id, the range is \[0,127] \[view] privileged user view \[use cases] sonic# show ptp counters domain 127 interface ethernet18 recv packets send packets \ announce 41860 57 sync 83619 110 followup 0 0 delayreq 83459 83459 delayresp 83452 0 pdelayreq 0 0 pdelayresp 0 0 pdelayrespfollowup 0 0 signaling 0 0 managment 0 0 clear ptp counters clear ptp counters \[command] clear ptp counters \[purpose] clear ptp packet counters \[view] privileged user view \[use cases] sonic# clear ptp counters ptp config ptp config table 2 ptp config table 2 ptp config command purpose ptp loglevel {error|warning|notice|info|debug} configure the log level for the ptp4l process in ptp logs ptp domain domain id creat a ptp domain ptp profile {smpte 2059 2|1588v2|aes67|g8275 1|g8275 2} configure the ptp protocol ptp mode clock mode configure the ptp clock type ptp clock id xxxxxx xxxx xxxxxx configure the ptp clock id ptp clock step {one step|two step} configure the timestamping mode for ptp packets ptp class class configure the ptp clock class ptp accuracy accuracy configure the ptp clock accuracy ptp priority1 priority1 configure the ptp priority1 parameter ptp priority2 priority2 configure the ptp priority2 parameter ptp priority priority configure the ptp priority parameter ptp sm tlv enable enable sm tlv ptp sm tlv default frame rates numerator denominator configure the frame rate parameter ptp sm tlv time address flags drop frame enable the drop frame timecode ptp sm tlv time address flags color frame enable the color frame timecode ptp dscp dscp value configure the dscp value in the ip encapsulation of ptp packets ptp source ip { a b c d | a b } \[ vrf vrf name ] configure the source ip in the ip encapsulation of ptp packets ptp domain domain id bind the interface to a specific ptp domain ptp enable enable ptp on an interface ptp role {dynamic|slave|master} configure ptp role on an interface ptp delay mechanism {e2e|p2p} configure the ptp delay measurement mechanism ptp transport {{ipv4 |ipv6} {multicast|unicast|mixed}|layer2} configure the ptp packet encapsulation format ptp unicast master address { a b c d | a b } configure the destination ip in the ip unicast encapsulation of ptp packets ptp announce interval interval configure the announce message transmission interval ptp announce timeout times configure the announce message reception timeout multiplier ptp sync message interval interval configure the sync message transmission interval ptp delay req interval interval configure the delay req message transmission interval ptp pdelay req interval interval configure the pdelay req message transmission interval ptp local priority priority configure the ptp priority parameter on the interface 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 log level for the ptp4l process in ptp logs \[view] global configuration view \[notes] the default log level is notice run command no ptp loglevel to set the log level to default(notice) \[use cases] sonic# configure terminal sonic(config)# ptp loglevel info ptp domain ptp domain domain id \[command] ptp domain domain id \[purpose] creat a ptp domain \[parameters] parameter description domain id specify the domain id, the range is \[0,127] \[view] global configuration view \[notes] only one ptp domain can be configured run command no ptp domain domain id to delete the ptp domain \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 ptp profile {smpte 2059 2|1588v2|aes67|g8275 1|g8275 2} ptp profile {smpte 2059 2|1588v2|aes67|g8275 1|g8275 2} \[command] ptp profile {smpte 2059 2|1588v2|aes67|g8275 1|g8275 2} \[purpose] configure the ptp protocol \[view] ptp domain configuration view \[notes] only one ptp domain can be configured run command no ptp profile to delete the ptp protocol currently in use all ptp configurations under the current ptp domain will be removed after this operation \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 sonic(config ptp domain 127)# ptp profile smpte 2059 2 ptp mode ptp mode clock mode \[command] ptp mode clock mode \[purpose] configure the ptp clock type \[parameters] parameter description clock mode ptp clock type when the configured ptp profile is smpte 2059 2 , 1588v2 , or aes67 , the available clock types that can be configured are oc / bc / e2etc / p2ptc when the configured ptp profile is g 8275 1 , the available clock types that can be configured are t gm / t bc / t tsc / t tc when the configured ptp profile is g 8275 2 , the available clock types that can be configured are t gm / t bc p / t tsc p \[view] ptp domain configuration view \[notes] the default clock type is bc when the configured ptp profile is smpte 2059 2 , 1588v2 , or aes67 the default clock type is t bc when the configured ptp profile is g8275 1 the default clock type is t bc p when the configured ptp profile is g8275 2 run command no ptp mode to set the ptp clock type to default \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 sonic(config ptp domain 127)# ptp mode bc ptp clock id ptp clock id xxxxxx xxxx xxxxxx \[command] ptp clock id xxxxxx xxxx xxxxxx \[purpose] configure the ptp clock id \[parameters] parameter description xxxxxx xxxx xxxxxx ptp clock id \[view] ptp domain configuration view \[notes] the default ptp clock id is generated based on the mac address for example, if the mac address is 00 01 02 03 04 05, the default clock id will be 000102 fffe 030405 when manually configuring a clock id using a command, it is essential to ensure that the clock id is unique throughout the entire ptp domain run command no ptp clock id to set the ptp clock id to default \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 sonic(config ptp domain 127)# ptp clock id 000000 fffe 0000101 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 timestamping mode for ptp packets \[view] ptp domain configuration view \[notes] the default timestamping mode is one step run command no ptp clock step to set the timestamping mode to default \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 sonic(config ptp domain 127)# ptp clock step two step ptp class ptp class class \[command] ptp class class \[purpose] configure the ptp clock class \[parameters] parameter description class ptp clock class, the range is \[0,255] \[view] ptp domain configuration view \[notes] the default clock class is 248 when local class < 128, the device cannot act as a slave when local class > 248, the device cannot act as a master run command no ptp class to set the clock class to default \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 sonic(config ptp domain 127)# ptp class 200 ptp accuracy ptp accuracy accuracy \[command] ptp accuracy accuracy \[purpose] configure the ptp clock accuracy \[parameters] parameter description accuracy ptp clock accuracy, the range is \[0,255] \[view] ptp domain configuration view \[notes] the default clock class is 254 run command no ptp accuracy to set the clock accuracy to default \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 sonic(config ptp domain 127)# ptp accuracy 200 ptp priority1 ptp priority1 priority1 \[command] ptp priority1 priority1 \[purpose] configure the ptp priority1 parameter \[parameters] parameter description priority1 ptp priority1, the range is \[0,255] \[view] ptp domain configuration view \[notes] the default priority1 is 128 when the configured ptp profile is smpte 2059 2 , 1588v2 , or aes67 , the ptp priority1 parameter can be configured when the configured ptp profile is g 8275 1 or g 8275 2 , the ptp priority1 parameter is not supported run command no ptp priority1 to set the priority1 to default \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 sonic(config ptp domain 127)# ptp priority1 100 ptp priority2 ptp priority2 priority2 \[command] ptp priority2 priority2 \[purpose] configure the ptp priority2 parameter \[parameters] parameter description priority2 ptp priority2, the range is \[0,255] \[view] ptp domain configuration view \[notes] the default priority2 is 128 run command no ptp priority2 to set the priority2 to default \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 sonic(config ptp domain 127)# ptp priority2 100 ptp priority ptp priority priority \[command] ptp priority priority \[purpose] configure the ptp priority parameter \[parameters] parameter description priority ptp priority, the range is \[1,255] \[view] ptp domain configuration view \[notes] the default priority is 128 when the configured ptp profile is smpte 2059 2 , 1588v2 , or aes67 , the ptp priority parameter is not supported when the configured ptp profile is g 8275 1 or g 8275 2 , the ptp priority parameter can be configured run command no ptp priority to set the priority to default \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 sonic(config ptp domain 127)# ptp priority 100 ptp sm tlv enable ptp sm tlv enable \[command] ptp sm tlv enable \[purpose] enable sm tlv \[view] ptp domain configuration view \[notes] when the configured ptp profile is smpte 2059 2, the sm tlv is supported for other ptp profiles, sm tlv configuration is not supported run command no ptp sm tlv enable to disable sm tlv \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 sonic(config ptp domain 127)# ptp sm tlv enable ptp sm tlv default frame rates ptp sm tlv default frame rates numerator denominator \[command] ptp sm tlv default frame rates numerator denominator \[purpose] configure the frame rate parameter \[parameters] parameter description numerator the numerator of the frame rate parameter, the range is \[0, 4294967295] denominator the denominator of the frame rate parameter, the range is \[0, 4294967295] \[view] ptp domain configuration view \[notes] when the configured ptp profile is smpte 2059 2, the sm tlv is supported for other ptp profiles, sm tlv configuration is not supported frame rate = numerator / denominator this configuration is used when the device acts as a gm run command no ptp sm tlv default frame rates to set the frame rate to default \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 sonic(config ptp domain 127)# ptp sm tlv default frame rates 30000 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] enable the drop frame timecode \[view] ptp domain configuration view \[notes] when the configured ptp profile is smpte 2059 2, the sm tlv is supported for other ptp profiles, sm tlv configuration is not supported this configuration is used when the device acts as a gm run command no ptp sm tlv time address flags drop frame to disable the drop frame timecode \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 sonic(config ptp domain 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] enable the color frame timecode \[view] ptp domain configuration view \[notes] when the configured ptp profile is smpte 2059 2, the sm tlv is supported for other ptp profiles, sm tlv configuration is not supported this configuration is used when the device acts as a gm run command no ptp sm tlv time address flags color frame to disable the color frame timecode \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 sonic(config ptp domain 127)# ptp sm tlv time address flags color frame ptp dscp ptp dscp dscp value \[command] ptp dscp dscp value \[purpose] configure the dscp value in the ip encapsulation of ptp packets \[parameters] parameter description dscp value dscp value, the range is \[0, 63] \[view] ptp domain / physical interface configuration view \[notes] the default dscp value is 56 when the ptp dscp value is configured both at the ptp domain configuration view and the interface configuration view, the configuration under the interface view takes precedence for that specific interface run command no ptp dscp to set the dscp value to default \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 sonic(config ptp domain 127)# ptp dscp 40 ptp source ip { ptp source ip { a b c d | a b } \[vrf vrf name ] \[command] ptp source ip { a b c d | a b } \[ vrf vrf name ] \[purpose] configure the source ip in the ip encapsulation of ptp packets \[parameters] parameter description a b c d ipv4 address it need to be configured when using ipv4 multicast encapsulation for ptp packets a b ipv6 address it need to be configured when using ipv6 multicast encapsulation for ptp packets vrf name the name of the vrf where the ip is located \[view] ptp domain configuration view / physical interface configuration view \[notes] the default source ip is the interface address when there is an address in the interface run command no ptp source ip to delete source ip \[use cases] sonic# configure terminal sonic(config)# ptp domain 127 sonic(config ptp domain 127)# ptp source ip 172 16 1 100 ptp domain ptp domain domain id \[command] ptp domain domain id \[purpose] bind the interface to a specific ptp domain \[parameters] parameter description domain id specify the domain id, the range is \[0,127] \[view] physical interface configuration view \[notes] run command no ptp domain to remove the interface from the ptp domain \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/18 sonic(config if 0/18)# ptp domain 127 ptp enable ptp enable \[command] ptp enable \[purpose] enable ptp on an interface \[view] physical interface configuration view \[notes] run command no ptp enable to disable ptp on an interface \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/18 sonic(config if 0/18)# ptp enable ptp role {dynamic|slave|master} ptp role {dynamic|slave|master} \[command] ptp role {dynamic|slave|master} \[purpose] configure ptp role on an interface \[view] physical interface configuration view \[notes] the default role is dynamic , where the role is determined through the bmc or abmc algorithm run command no ptp role to set ptp role to default(dynamic) \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/18 sonic(config if 0/18)# ptp role slave ptp delay mechanism {e2e|p2p} ptp delay mechanism {e2e|p2p} \[command] ptp delay mechanism {e2e|p2p} \[purpose] configure the ptp delay measurement mechanism \[view] physical interface configuration view \[notes] the default delay mechanism is e2e when the configured ptp profile is smpte 2059 2 , 1588v2 , or aes67 , the e2e and p2p can be configured when the configured ptp profile is g 8275 1 or g 8275 2 , only the e2e is supported when the delay mechanism is p2p , the timestamping mode needs to be two step when the ptp function is enabled on multiple interfaces, the ptp delay mechanism configured on these interfaces must be consistent run command no ptp delay mechanism to set the delay mechanism to default \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/18 sonic(config if 0/18)# ptp delay mechanism e2e ptp transport {{ipv4 |ipv6} {multicast|unicast|mixed}|layer2} ptp transport {{ipv4 |ipv6} {multicast|unicast|mixed}|layer2} \[command] ptp transport {{ipv4 |ipv6} {multicast|unicast|mixed}|layer2} \[purpose] configure the ptp packet encapsulation format \[view] physical interface configuration view \[notes] when the configured ptp profile is smpte 2059 2 , the available packet encapsulation format is {ipv4|ipv6} {multicast|unicast|mixed} the default format is ipv4 multicast when the configured ptp profile is 1588v2 , the available packet encapsulation format is {{ipv4 |ipv6} {multicast|unicast}|layer2} the default format is ipv4 multicast when the configured ptp profile is aes67 , the available packet encapsulation format is ipv4 {multicast|unicast|mixed} the default format is ipv4 multicast when the configured ptp profile is g 8275 1 , the available packet encapsulation format is layer2 the default format is layer2 when the configured ptp profile is g 8275 2 , the available packet encapsulation format is {ipv4|ipv6}unicast the default format is ipv4 unicast when the ptp function is enabled on multiple interfaces, the ptp transport configured on these interfaces must be consistent run command no ptp transport to set the packet format to default \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/18 sonic(config if 0/18)# ptp transport ipv4 multicast ptp unicast master address { ptp unicast master address { a b c d | a b } \[command] ptp unicast master address { a b c d | a b } \[purpose] configure the destination ip in the ip unicast encapsulation of ptp packets \[parameters] parameter description a b c d ipv4 address it need to be configured when using ipv4 unicast encapsulation for ptp packets a b ipv6 address it need to be configured when using ipv6 unicast encapsulation for ptp packets \[view] physical interface configuration view \[notes] only slave ports need to configure the ptp unicast master address this configuration is only valid when the ptp transport is set to {ipv4|ipv6} unicast the configured ptp unicast master address must be in the same subnet as the interface ip address run command no ptp unicast master address { a b c d | a b } to remove the destination ip \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/18 sonic(config if 0/18)# ptp unicast master address 10 245 0 17 ptp announce interval ptp announce interval interval \[command] ptp announce interval interval \[purpose] configure the announce message transmission interval \[parameters] parameter description interval announce message transmission interval when the configured ptp profile is smpte 2059 2 , the range is \[ 3,1] the default value is 0 when the configured ptp profile is 1588v2 , the range is \[0,4] the default value is 1 when the configured ptp profile is aes67 , the range is \[0,4] the default value is 1 when the configured ptp profile is g 8275 1 , the interval cannot be modified the default value is 3 when the configured ptp profile is g 8275 2 , the range is \[ 3,0] the default value is 3 \[view] physical interface configuration view \[notes] interval duration = 2interval seconds run command no ptp announce interval to set the announce interval to default \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/18 sonic(config if 0/18)# ptp announce interval 0 ptp announce timeout ptp announce timeout times \[command] ptp announce timeout times \[purpose] configure the announce message reception timeout multiplier \[parameters] parameter description times announce message reception timeout multiplier, the range is \[2,10] the default value is 3 \[view] physical interface configuration view \[notes] when the configured ptp profile is smpte 2059 2,1588v2,aes67 , the announce message reception timeout multiplier can be modified for other ptp profiles, the configuration cannot be modified run command no ptp announce timeout to set the announce message reception timeout multiplier to default \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/18 sonic(config if 0/18)# ptp announce timeout 6 ptp sync message interval ptp sync message interval interval \[command] ptp sync message interval interval \[purpose] configure the sync message transmission interval \[parameters] parameter description interval sync message transmission interval when the configured ptp profile is smpte 2059 2 , the range is \[ 7,1] the default value is 3 when the configured ptp profile is 1588v2 , the range is \[ 7,1] the default value is 0 when the configured ptp profile is aes67 , the range is \[ 4,1] the default value is 3 when the configured ptp profile is g 8275 1 , the interval cannot be modified the default value is 4 when the configured ptp profile is g 8275 2 , the range is \[ 7,0] the default value is 4 \[view] physical interface configuration view \[notes] interval duration = 2interval seconds run command no ptp sync message interval to set the sync message interval to default \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/18 sonic(config if 0/18)# ptp sync message interval 0 ptp delay req interval ptp delay req interval interval \[command] ptp delay req interval interval \[purpose] configure the delay req message transmission interval \[parameters] parameter description interval delay req message transmission interval when the configured ptp profile is smpte 2059 2 , the range is \[ 3,5] the default value is 3 when the configured ptp profile is 1588v2 , the range is \[ 7,5] the default value is 0 when the configured ptp profile is aes67 , the range is \[ 4,5] the default value is 0 when the configured ptp profile is g 8275 1 , the interval cannot be modified the default value is 4 when the configured ptp profile is g 8275 2 , the range is \[ 7,0] the default value is 4 \[view] physical interface configuration view \[notes] interval duration = 2interval seconds run command no ptp delay req interval to set the delay req message interval to default \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/18 sonic(config if 0/18)# ptp delay req interval 0 ptp pdelay req interval ptp pdelay req interval interval \[command] ptp pdelay req interval interval \[purpose] configure the pdelay req message transmission interval \[parameters] parameter description interval pdelay req message transmission interval when the configured ptp profile is smpte 2059 2 , the range is \[ 3,5] the default value is 3 when the configured ptp profile is 1588v2 , the range is \[ 7,5] the default value is 0 when the configured ptp profile is aes67 , the range is \[ 4,5] the default value is 0 \[view] physical interface configuration view \[notes] interval duration = 2interval seconds run command no ptp pdelay req interval to set the pdelay req message interval to default \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/18 sonic(config if 0/18)# ptp pdelay req interval 0 ptp local priority ptp local priority priority \[command] ptp local priority priority \[purpose] configure the ptp priority parameter on the interface \[parameters] parameter description priority ptp priority, the range is \[1,255] \[view] physical interface configuration view \[notes] the default priority is 128 when the configured ptp profile is smpte 2059 2 , 1588v2 , or aes67 , the ptp priority parameter is not supported when the configured ptp profile is g 8275 1 or g 8275 2 , the ptp priority parameter can be configured run command no ptp local priority to set the priority to default \[use cases] sonic# configure terminal sonic(config)# interface ethernet 0/18 sonic(config if 0/18)# ptp local priority 10
