Skip to content

Network Management And Monitoring

[Command]
show mirror session [ number ]

[Purpose]
Show configuration related to mirror

[View]
System view

[Use Cases]

sonic# show mirror session
+--------------+------------------+-------------+------+-----------+
| Session Name | Destination Port | Source Port | Type | Direction |
+==============+==================+=============+======+===========+
| 1 | Ethernet1 | Ethernet2 | SPAN | BOTH |
+--------------+------------------+-------------+------+-----------+

[Command]
mirror session session_id span [direction {rx|tx|both}] {src-ethernet|src-vlan} port_name {dst-ethernet|dst-vlan|dst-link-aggregation} port_name
no mirror session id span

[Purpose]
Create a mirror session or add port to the mirror session

[Parameter]

ParameterDescription
session_idmirror session ID, value range: 1-6
port_nameInterface name, support VLAN interface and Ethernet interface
direction {rx|tx|both}Direction of traffic to be mirroredrx is the entry directiontx is the outgoing directionboth is mirror in both directions
{src-ethernet|src-vlan}The interface on which traffic needs to be mirrored
{dst-ethernet|dst-vlan|dst-link-aggregation}The destination interface for mirrored traffic

[View]
System configuration view

[Use Cases]

sonic# configure
sonic(config)# mirror session 1 span direction both
sonic(config)# mirror session 1 span src-ethernet 1 dst-ethernet 20

[Command]
mirror session id rspan [direction {rx|tx|both}] {src-ethernet|src-vlan} port_name {dst-ethernet|dst-link-aggregation} port_name remote vlan vlan_id
no mirror session id rspan

[Purpose]
Create a remote mirroring session or add source/destination interfaces to an existing mirroring session

[Parameter]

ParameterDescription
idMirror session ID, valid range: 1-6.
port_nameInterface name, supports VLAN interfaces and Ethernet interfaces.
direction {rx|tx|both}Traffic direction to be mirrored.rx: Inbound direction.tx: Outbound direction.
bothBoth directions, mirroring all traffic.
{src-ethernet|src-vlan}Interface to be mirrored.
{dst-ethernetdst-link-aggregation}Destination interface for mirrored traffic.
vlan_idRSPAN dedicated VLAN for mirroring traffic

[View]
System view

[Usage Scenario]
RSPAN’s main function is to copy the traffic of ports on one switch to an analysis port on another remote switch, allowing network administrators to monitor and analyze traffic on the remote switch without direct access to the target device. Remote Switched Port Analyzer (RSPAN) builds upon local port mirroring by encapsulating packets with a specified VLAN, transmitting them through intermediate devices, and ultimately reaching the destination switch. The VLAN is then stripped off at the destination switch before being forwarded to the backend analyzer.

[Notes] As the RSPAN dedicated VLAN, “remote vlan” is not recommended for other purposes. The destination interface needs to be added to the “remote vlan.”

[Use Cases]

sonic# configure
sonic(config)# mirror session 1 rspan direction rx
sonic(config)# mirror session 1 rspan src-ethernet 1 dst-ethernet 20 remote vlan 200

[Command]
mirror session id erspan [direction {rx|tx|both}] {src-ethernet|src-vlan} port_name gre-src-ip A.B.C.D/A::B gre-dst-ip A.B.C.D/A::B [gre-vrf vrf_name ]
no mirror session id erspan

[Purpose]
Create a remote mirroring session and add the source and destination addresses for GRE encapsulation

[Parameter]

ParameterDescription
idMirror session ID, valid range: 1-6.
direction {rx|tx|both}Traffic direction to be mirrored.rx: Inbound direction.tx: Outbound direction.
{src-ethernet|src-vlan}Interface to be mirrored.
gre-src-ip A.B.C.D/A::BSource IP for GRE encapsulation.
gre-dst-ip A.B.C.D/A::BDestination IP for GRE encapsulation.
vrf_nameVRF for GRE encapsulation, with the default VRF set to “default”

[View]
System view

[Usage Scenario]
ERSPAN is a Layer 3 remote mirroring technology that duplicates packets from specified ports or VLANs. It sends the duplicated packets to a remote data monitoring device through a GRE tunnel, allowing users to analyze these packets using the monitoring device for network monitoring and troubleshooting.

[Notes]
To configure encapsulation parameters for Layer 3 remote mirroring, you only need to specify the mirror source and destination port on the source device. Additionally, all devices must have a unicast routing protocol configured, ensuring a seamless Layer 3 network between the devices.

[Use Cases]

sonic# configure
sonic(config)# mirror session 1 erspan direction rx gre-src-ip 10.1.1.1 gre-dst-ip 30.1.1.2 src-vlan 20

[Command]
show sflow

[Purpose]
Display sFLOW configuration information

[View]
System configuration view

[Use Cases]

sonic# show sflow
sFlow Global Information:
sFlow Admin State: up
sFlow Sample Direction: rx
sFlow Polling Interval: 0
sFlow AgentID: Ethernet12
1 Collectors configured:
Name: 1 IP addr: 10.1.1.1 UDP port: 6343

[Command]
show sflow interface ethernet interface_name

[Purpose]
Display the packet sampling rate for FLOW sampling

[View]
System configuration view

[Use Cases]

sonic# show sflow interface ethernet 19
sFlow interface configurations
+-------------+-----------------+----------------------+
| Interface | Sampling Rate | Sampling Direction |
+=============+=================+======================+
+-------------+-----------------+----------------------+

[Command]
sflow enable

[Purpose]
Enable sFLOW function

[View]
System configuration view

[Usage Scenario]
The sFlow Agent offers two sampling methods for analyzing network traffic conditions from different perspectives: Flow sampling and Counter sampling. Flow sampling involves the sFlow Agent device sampling and analyzing packets on specified interfaces based on specific sampling directions and ratios. It aims to capture detailed information about packet data content, facilitating monitoring and analysis of network behaviors. Counter sampling, on the other hand, involves the sFlow Agent device periodically collecting traffic statistics information from interfaces. The sampling data collected by Counter sampling is detailed in the table below. Unlike Flow sampling, Counter sampling focuses solely on the quantity of traffic on interfaces, rather than the specifics of traffic content.

[Use Cases]

sonic# configure
sonic(config)# sflow enable

[Command]
sflow collector name A.B.C.D [rf vrf_name| port ]
no sflow collector name

[Purpose]
Configure sFlow collector address

[Parameter]

ParameterDescription
nameCollector name, used for internal identification
A.B.C.DCollector IP address
portThe UDP destination port number for sending sFlow packets,the default value is 6343

[View]
System configuration view

[Use Cases]

sonic# configure
sonic(config)# sflow collector test 192.168.0.100 6364

[Command]
sflow agent-id {ethernet|vlan|loopback|link-aggregation} id
no sflow agent-id

[Purpose]
Configure the IP address of the sFlow Agent

[Parameter]

ParameterDescription
{ethernet|vlan|loopback} idSpecify a Layer 3 interface and use its IP address as the Agent IP address.

[View]
System configuration view

[Use Cases]

sonic# configure
sonic(config)# sflow agent-id loopback 0

[Command]
sflow polling-interval { number |0}
no sflow polling-interval

[Purpose]
Configure sFlow Counter sampling interval

[Parameter]

ParameterDescription
numberValid range: 5-300, Unit: seconds
0disable counter sample

[View]
System configuration view

[Use Cases]

sonic# configure
sonic(config)# sflow polling-interval 100

[Command]
sflow sample-rate number
no sflow sample-rate

[Purpose]
Configure sFlow sampling rate

[Parameter]

ParameterDescription
numberValid range: 8000-100000, The number of data packets sampled within a specified time interval

[View]
Interface view

[Use Cases]

sonic(config)# interface ethernet 19
sonic(config-if-19)# sflow sample-rate 8500

[Command]
sflow sample-direction {rx|tx|both}

[Purpose]
Configure sflow sample-direction

[View]
Interface view and system configuration view

[Use Cases]

sonic(config)# sflow sample-direction rx

[Command]
show snmp-agent trap-target

[Purpose]
Display SNMP trap server configuration

[View]
System view

[Use Cases]

sonic# show snmp-agent trap-target
Version TrapReceiverIP Port VRF Community User
--------- ---------------- ------ ----- ----------- ------
2 1.1.1.1 162 None testa -

[Command]
show snmp-agent source

[Purpose]
Display the SNMP source address and port configuration

[View]
System view

[Use Cases]

sonic# show snmp-agent source
ListenIP ListenPort ListenVrf
---------- ------------ -----------
30.11.0.82

[Command]
show snmp-agent user

[Purpose]
Display SNMPv3 user configuration

[View]
System view

[Use Cases]

sonic# show snmp-agent user
User Type AuthType EncryptionType
------ ------------ ---------- ----------------
test noAuthNoPriv

[Command]
show snmp-agent threshold

[Purpose]
Display SNMP alarm threshold configuration

[View]
System view

[Use Cases]

sonic# show snmp-agent threshold
Threshold-Type Threshold-Value
---------------- -----------------
cpu-usage 80%
memory-usage 80%

[Command]
snmp-agent enable
no snmp-agent enable

[Purpose]
Enable SNMP function

[View]
System configure view

[Use Cases]

sonic(config)# snmp-agent enable

[Command]
snmp-agent community community_name
no snme-agent community community_name

[Purpose]
Add SNMP community

[Parameter]

ParameterDescription
community_namecommunity name

[View]
System configuration view

[Usage Scenario]
The community name like a password, and devices within the community use this name for authentication during communication. Only devices with the same configured community name can access each other. By default, the community name is set to public.

[Use Cases]

sonic(config)# snmp-agent community snmptest

[Command]
snmp-agent user name AuthNoPriv {MD5|SHA} password
snmp-agent user name Priv {MD5|SHA} {DES|AES} password
snmp-agent user name noAuthNoPriv
no snmp-agent user name

[Purpose]
Create SNMPv3 users

[Parameter]

ParameterDescription
nameUser name
AuthNoPrivSpecify the security level as requiring authentication, and specify the authentication method as: MD5/SHA
noAuthNoPrivSpecify the security level as no authentication required
Priv {MD5|SHA}Specify the security level as encryption
{DES|AES}Specify the encryption algorithm

[View]
System configuration view

[Usage Scenario]
SNMPv3 provides encryption and authentication mechanisms to safeguard the management information of network devices from unauthorized access. Therefore, in high-security network environments, using SNMPv3 can better protect the security of network devices.

[Use Cases]

sonic(config)# snmp-agent user user3 priv md5 12345678 des 87654321
sonic(config)# snmp-agent user user4 noauthnopriv
sonic(config)# snmp-agent user user5 authnopriv md5 12345678

snmp-agent trap-target threshold system-usage

Section titled “snmp-agent trap-target threshold system-usage”

[Command]
snmp-agent trap-target threshold {reset|system-usage} {cpu-usage|memory-usage} value
snmp-agent trap-target threshold reset system-usage

[Purpose]
Enable specific utilization alarm switch

[Parameter]

ParameterDescription
cpu-usageCPU utilization
memory-usageMemory Utilization
valueAlarm Threshold

[View]
System configuration view

[Use Cases]

sonic(config)# snmp-agent trap-target threshold system-usage memory-usage 70

[Command]
snmp-agent trap-target {1|2|3} address [udp-port portname ] [vrf vrfname ] [community community_name ]
no snmp-agent trap-target {1|2|3}

[Purpose]
Configure the server for agent trap

[Parameter]

ParameterDescription
addressIP address
portnumPort number, default 162
vrfnamevrf name
nameagent community

[View]
System configuration view

[Usage Scenario]
Devices send alarm messages that can be uploaded to a trap server using the trap command. In this case, the SNMP trap server needs to be configured. However, the reliability of trap messages is lower because the sender cannot confirm whether the trap message has been received, as the recipient does not send acknowledgment messages.

[Use Cases]

sonic# configure terminal
sonic(config)# snmp-agent trap-target v1 10.250.0.221
sonic(config)# snmp-agent trap-target v2c 10.250.0.221 udp-port 163 community comm1

[Command]
snmp-agent source { A.B.C.D/A::B|interface_name|loopback} [udp-port portnum |vrf vrf_name ]

[Purpose]
Configure the source IP address of the device to send SNMP protocol packets

[Parameter]

ParameterDescription
A.B.C.D/A::BIP address
Interface_nameinterface name ,can only be configured as Loopback0
loopbackLoopback
portnumThe port number, default is 161

[View]
System configuration view

[Use Cases]

sonic# configure terminal
sonic(config)# snmp-agent source 10.250.0.221

[Command]
syslog source-interface {etherent|loopback|vlan|mgmt} interface_name
no syslog source-interface

[Purpose]
Configure the source interface for the device to send syslog packets

[Parameter]

ParameterDescription
{etherent|loopback|vlan|mgmt} interface_nameSpecify the source as a service interface or a specific Loopback port

[View]
System configuration view

[Use Cases]

sonic(config)# syslog source-interface loopback 0
Syslog source interface set to Loopback0
Restarting rsyslog-config service...
sonic(config)#

[Command]
syslog ip_address
no syslog ip_address

[Purpose]
Specify the syslog server

[Parameter]

ParameterDescription
ip_addressIPv4 or IPv6 address

[View]
System configuration view

[Usage Scenario]
Syslog can be used to log messages locally in files or sent over the network to a syslog server. The syslog server can centrally store syslog messages from multiple devices.

[Use Cases]

sonic(config)# syslog 10.1.1.10

[Command]
syslog protocol-port port
no syslog protocol-port

[Purpose]
Set syslog protocol port configuration, default 514

[Parameter]

ParameterDescription
portprotocol port configuration, default 514,range 0-65535

[View]
System configuration view

[Use Cases]

sonic(config)# syslog protocol-port 513

[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

[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

[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

[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']

[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

[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

[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}

Section titled “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]

ParameterDescription
accuracyValue range: 0 to 255, default value: 254
classValue range: 0 to 255, default value: 248
priority1Value range: 0 to 255, default value: 128, it’s only supported when profile is smpte-2059-2, 1588v2 or aes67
priority2Value 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

[Command]
ptp clock-step {one_step|two_step}

[Purpose]
Configure the mode for carrying timestamps

[Parameter]

ParameterDescription
one_stepSpecifies to one-step mode
two_stepSpecifies 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}

Section titled “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]

ParameterDescription
bcBoundary clock
ocOrdinary clock
tcTransparent Clock
t-gmTelecom Grandmaster
t-bcTelecom Boundary Clock
t-tcTelecom Transparent Clock
t-tscTelecom Time Slave Clock
t-bc-pPartial-Support Telecom Boundary Clock
t-tsc-pPartial-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

[Command]
ptp instance domain_id

[Purpose]
Create a PTP domain or interface to join a PTP domain

[Parameter]

ParameterDescription
domain_idPTP 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 >

Section titled “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]

ParameterDescription
smpte-2059-2Standard protocol for clock synchronization SMPTE ST-2059-2
1588v2Standard protocol for clock synchronization 1588V2
g8275.1Standard protocol for clock synchronization ITU_T G8275.1
g8275.2Standard protocol for clock synchronization ITU_T G8275.2
aes67Standard 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]

Section titled “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]

ParameterDescription
udpv4IPv4+UDP encapsulation
udpv6IPv6+UDP encapsulation
ethernetMAC encapsulation
unicastCommunicate with unicast address
multicastCommunicate with multicast address
mixedCommunicate 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

[Command]
ptp delay-mode {E2E|P2P}

[Purpose]
Configure delay measurement mechanism

[Parameter]

ParameterDescription
E2EEnd-to-End delay mechanism
P2PPeer-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

[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

[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]

ParameterDescription
numeratorConfigure the sm-tlv default system frame rate
denominatorConfigure 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

[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

[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

[Command]
ptp mode {master|slave}

[Purpose]
Configure PTP Interface Role

[Parameter]

ParameterDescription
masterPrimary Interface, Broadcasting Time Information to Other Devices
slaveSecondary 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

[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]

ParameterDescription
A.B.C.DIPv4 address
A::BIPv6 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

[Command]
ptp announce-interval interval

[Purpose]
Configure the transmission period of Announce messages

[Parameter]

ParameterDescription
IntervalThe 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

[Command]
ptp announce-receipt-timeout time

[Purpose]
Configure the receive timeout multiplier for announce messages

[Parameter]

ParameterDescription
timeValue 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

[Command]
ptp sync-interval interval

[Purpose]
Configure the transmission period of Sync messages

[Parameter]

ParameterDescription
intervalThe 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

[Command]
ptp delay-req-interval interval

[Purpose]
Configure the transmission period of Delay-req messages

[Parameter]

ParameterDescription
intervalThe 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

[Command]
ptp pdelay-req-interval interval

[Purpose]
Configure the transmission period of Pdelay-req messages

[Parameter]

ParameterDescription
intervalThe 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

[Command]
ptp dscp value

[Purpose]
Configure the dscp of ptp packet

[Parameter]

ParameterDescription
valueSet 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}

Section titled “ptp asymmetry-correction {positive|negative}”

[Command]
ptp asymmetry-correction {positive|negative} time

[Purpose]
Configure Asymmetric Delay Compensation for PTP on the Interface

[Parameter]

ParameterDescription
positiveNeed to Add Compensation Value
negativeCompensation Value Needs to Be Subtracted
timeCompensation 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}

Section titled “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]

ParameterDescription
errorConfigure loglevel to error
warningConfigure loglevel to warning
noticeConfigure loglevel to notice
infoConfigure loglevel to info, the default level is info
debugConfigure loglevel to debug

[View]
System configuration view

[Use Cases]

sonic(config)# ptp loglevel debug

[Command]
ptp reset

[Purpose]
Clear all PTP configurations

[View]
System configuration view

[Use Cases]

sonic(config)# ptp reset

[Command]
show synce interface interface_num

[Purpose]
Display the synce information of the interface

[View]
Interface view

[Use Cases]

sonic# show ptp interface 12
SyncE Enable: true
SyncE Mode: slave
SyncE Priority: 1

[Command]
show synce status

[Purpose]
Display the synce status of the device

[View]
System configuration view

[Use Cases]

sonic# show synce status
Interface Enable Mode Priority Selected
----------- -------- ------ ---------- ------------
Ethernet1 true slave 1 selected
Ethernet2 true slave 2 non-selected
Ethernet3 true slave 3 non-selected
Ethernet4 true slave 4 non-selected

[Command]
synce enable
no synce enable

[Purpose]
Enable synce function

[View]
Interface view

[Usage Scenario]
Synce is a synchronization technique based on carrying and recovering frequency information from physical layer code streams. The implementation confirms through an election whether the device uses its own crystal frequency or the crystal frequency obtained from the peer-to-peer interface.

[Use Cases]

sonic(config)# interface ethernet 1
sonic(config-if-1)# synce enable

[Command]
synce mode {master|slave}

[Purpose]
Configure the synce mode of interface to master or slave

[Parameter]

ParameterDescription
masterClock signal sender
slaveClock signal receiver

[View]
Interface view

[Usage Scenario]
The default synce mode is master. The synce mode is recommended to be the same as the PTP mode on interafce

[Use Cases]

sonic(config)# interface ethernet 1
sonic(config-if-1)# synce mode slave

[Command]
synce priority value

[Purpose]
Configure the synce priority of interface

[Parameter]

ParameterDescription
valueValue range:0 to 255

[View]
Interface view

[Usage Scenario]
When more than one interface is present to enable synce, the interface with the highest priority is selected.

[Use Cases]

sonic(config)# interface ethernet 1
sonic(config-if-1)# synce priority 1