Network Management And Monitoring
Mirror Configuration
Section titled “Mirror Configuration”show mirror session
Section titled “show mirror session”[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 |+--------------+------------------+-------------+------+-----------+
mirror session
Section titled “mirror session”[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]
Parameter | Description |
---|---|
session_id | mirror session ID, value range: 1-6 |
port_name | Interface 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# configuresonic(config)# mirror session 1 span direction bothsonic(config)# mirror session 1 span src-ethernet 1 dst-ethernet 20
mirror session rspan
Section titled “mirror session rspan”[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]
Parameter | Description |
---|---|
id | Mirror session ID, valid range: 1-6. |
port_name | Interface name, supports VLAN interfaces and Ethernet interfaces. |
direction {rx|tx|both} | Traffic direction to be mirrored.rx: Inbound direction.tx: Outbound direction. |
both | Both directions, mirroring all traffic. |
{src-ethernet|src-vlan} | Interface to be mirrored. |
{dst-ethernetdst-link-aggregation} | Destination interface for mirrored traffic. |
vlan_id | RSPAN 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# configuresonic(config)# mirror session 1 rspan direction rxsonic(config)# mirror session 1 rspan src-ethernet 1 dst-ethernet 20 remote vlan 200
mirror session erspan
Section titled “mirror session erspan”[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]
Parameter | Description |
---|---|
id | Mirror 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::B | Source IP for GRE encapsulation. |
gre-dst-ip A.B.C.D/A::B | Destination IP for GRE encapsulation. |
vrf_name | VRF 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# configuresonic(config)# mirror session 1 erspan direction rx gre-src-ip 10.1.1.1 gre-dst-ip 30.1.1.2 src-vlan 20
SFLOW Configuration
Section titled “SFLOW Configuration”show sflow
Section titled “show sflow”[Command]
show sflow
[Purpose]
Display sFLOW configuration information
[View]
System configuration view
[Use Cases]
sonic# show sflowsFlow 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
show sflow interface ethernet
Section titled “show sflow interface ethernet”[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 19sFlow interface configurations+-------------+-----------------+----------------------+| Interface | Sampling Rate | Sampling Direction |+=============+=================+======================++-------------+-----------------+----------------------+
sflow enable
Section titled “sflow enable”[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# configuresonic(config)# sflow enable
sflow collector
Section titled “sflow collector”[Command]
sflow collector name A.B.C.D [rf vrf_name| port ]
no sflow collector name
[Purpose]
Configure sFlow collector address
[Parameter]
Parameter | Description |
---|---|
name | Collector name, used for internal identification |
A.B.C.D | Collector IP address |
port | The UDP destination port number for sending sFlow packets,the default value is 6343 |
[View]
System configuration view
[Use Cases]
sonic# configuresonic(config)# sflow collector test 192.168.0.100 6364
sflow agent-id
Section titled “sflow agent-id”[Command]
sflow agent-id {ethernet|vlan|loopback|link-aggregation} id
no sflow agent-id
[Purpose]
Configure the IP address of the sFlow Agent
[Parameter]
Parameter | Description |
---|---|
{ethernet|vlan|loopback} id | Specify a Layer 3 interface and use its IP address as the Agent IP address. |
[View]
System configuration view
[Use Cases]
sonic# configuresonic(config)# sflow agent-id loopback 0
sflow polling-interval
Section titled “sflow polling-interval”[Command]
sflow polling-interval { number |0}
no sflow polling-interval
[Purpose]
Configure sFlow Counter sampling interval
[Parameter]
Parameter | Description |
---|---|
number | Valid range: 5-300, Unit: seconds |
0 | disable counter sample |
[View]
System configuration view
[Use Cases]
sonic# configuresonic(config)# sflow polling-interval 100
sflow sample-rate
Section titled “sflow sample-rate”[Command]
sflow sample-rate number
no sflow sample-rate
[Purpose]
Configure sFlow sampling rate
[Parameter]
Parameter | Description |
---|---|
number | Valid range: 8000-100000, The number of data packets sampled within a specified time interval |
[View]
Interface view
[Use Cases]
sonic(config)# interface ethernet 19sonic(config-if-19)# sflow sample-rate 8500
sflow sample-direction {rx|tx|both}
Section titled “sflow sample-direction {rx|tx|both}”[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
SNMP Configuration
Section titled “SNMP Configuration”show snmp-agent trap-target
Section titled “show snmp-agent trap-target”[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 -
show snmp-agent source
Section titled “show snmp-agent source”[Command]
show snmp-agent source
[Purpose]
Display the SNMP source address and port configuration
[View]
System view
[Use Cases]
sonic# show snmp-agent sourceListenIP ListenPort ListenVrf---------- ------------ -----------30.11.0.82
show snmp-agent user
Section titled “show snmp-agent user”[Command]
show snmp-agent user
[Purpose]
Display SNMPv3 user configuration
[View]
System view
[Use Cases]
sonic# show snmp-agent userUser Type AuthType EncryptionType------ ------------ ---------- ----------------test noAuthNoPriv
show snmp-agent threshold
Section titled “show snmp-agent threshold”[Command]
show snmp-agent threshold
[Purpose]
Display SNMP alarm threshold configuration
[View]
System view
[Use Cases]
sonic# show snmp-agent thresholdThreshold-Type Threshold-Value---------------- -----------------cpu-usage 80%memory-usage 80%
snmp-agent enable
Section titled “snmp-agent enable”[Command]
snmp-agent enable
no snmp-agent enable
[Purpose]
Enable SNMP function
[View]
System configure view
[Use Cases]
sonic(config)# snmp-agent enable
snmp-agent community
Section titled “snmp-agent community”[Command]
snmp-agent community community_name
no snme-agent community community_name
[Purpose]
Add SNMP community
[Parameter]
Parameter | Description |
---|---|
community_name | community 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
snmp-agent user
Section titled “snmp-agent user”[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]
Parameter | Description |
---|---|
name | User name |
AuthNoPriv | Specify the security level as requiring authentication, and specify the authentication method as: MD5/SHA |
noAuthNoPriv | Specify 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 87654321sonic(config)# snmp-agent user user4 noauthnoprivsonic(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]
Parameter | Description |
---|---|
cpu-usage | CPU utilization |
memory-usage | Memory Utilization |
value | Alarm Threshold |
[View]
System configuration view
[Use Cases]
sonic(config)# snmp-agent trap-target threshold system-usage memory-usage 70
snmp-agent trap-target {1|2|3}
Section titled “snmp-agent trap-target {1|2|3}”[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]
Parameter | Description |
---|---|
address | IP address |
portnum | Port number, default 162 |
vrfname | vrf name |
name | agent 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 terminalsonic(config)# snmp-agent trap-target v1 10.250.0.221sonic(config)# snmp-agent trap-target v2c 10.250.0.221 udp-port 163 community comm1
snmp-agent source udp-port
Section titled “snmp-agent source udp-port”[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]
Parameter | Description |
---|---|
A.B.C.D/A::B | IP address |
Interface_name | interface name ,can only be configured as Loopback0 |
loopback | Loopback |
portnum | The port number, default is 161 |
[View]
System configuration view
[Use Cases]
sonic# configure terminalsonic(config)# snmp-agent source 10.250.0.221
Syslog Configuration
Section titled “Syslog Configuration”syslog source-interface
Section titled “syslog source-interface”[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]
Parameter | Description |
---|---|
{etherent|loopback|vlan|mgmt} interface_name | Specify the source as a service interface or a specific Loopback port |
[View]
System configuration view
[Use Cases]
sonic(config)# syslog source-interface loopback 0Syslog source interface set to Loopback0Restarting rsyslog-config service...sonic(config)#
syslog
Section titled “syslog”[Command]
syslog ip_address
no syslog ip_address
[Purpose]
Specify the syslog server
[Parameter]
Parameter | Description |
---|---|
ip_address | IPv4 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
syslog protocol-port
Section titled “syslog protocol-port”[Command]
syslog protocol-port port
no syslog protocol-port
[Purpose]
Set syslog protocol port configuration, default 514
[Parameter]
Parameter | Description |
---|---|
port | protocol port configuration, default 514,range 0-65535 |
[View]
System configuration view
[Use Cases]
sonic(config)# syslog protocol-port 513
PTP Configuration
Section titled “PTP Configuration”show ptp clock
Section titled “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: 0Profile: smpte-2059-2Clock Type: OCClock Step: one_stepDelay Mode: E2ETransport Mode: udpv4Dscp: 56Source IP Address: 0.0.0.0Local Clock Identity: 000217.0000.000023Local Clock Accuracy: 0xFELocal Clock Class: 248Local Clock Priority1: 20Local Clock Priority2: 128ports: Ethernet23Grandmaster Clock Identity: 000217.0000.000023Grandmaster Clock Accuracy: 0xfeGrandmaster Clock Class: 248Grandmaster Clock Priority1: 20Grandmaster Clock Priority2: 128Parent Port Identity: 0Servo State: unlockedOffset To Master: 0Path Delay: 0Max Steps Removed: 255Local Time: 432962822290957
show ptp clock sm-tlv
Section titled “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-tlvDefault Frame Rate: 0/0GM Lock Status: 0Time Address Flags: 3Current Local Offset: 0Jump Seconds: 0Time Of Next Jump: 0Time Of Next Jam: 0Time Of Previous Jam: 0Previous Jam Local Offset: 0Daylight Saving: 0Leap Second Jump: 0
show ptp counter [interface] [instance]
Section titled “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 countersInterface: 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
Section titled “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 1Ethernet: Ethernet1Enable: trueDomain: 1Index: 2Dscp: 56Source IP Address: 10.1.10.2Announce Interval: 1Announce Receipt Timeout: 3Delay Req Interval: 0Pdelay Req Interval: 0Sync Interval: 0Mode: slaveDelay Mode: E2EUnicat Master Address: ['10.1.10.1']
ptp source ip
Section titled “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
Section titled “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 1sonic(config-if-1)# ptp instance 0sonic(config-if-ptp-0)# ptp enable
ptp clock-id
Section titled “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}
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]
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}
Section titled “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}
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]
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
Section titled “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 64sonic(config)# interface ethernet 1sonic(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]
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-2Deleted 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]
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}
Section titled “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
Section titled “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
Section titled “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
Section titled “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
Section titled “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}
Section titled “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 1sonic(config-if-1)# ptp instance 127sonic(config-if-ptp-127)# ptp mode master
ptp unicast master address
Section titled “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 1sonic(config-if-1)# ptp instance 127sonic(config-if-ptp-127)# ptp unicast master address 10.1.1.1
ptp announce-interval
Section titled “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 1sonic(config-if-1)# ptp instance 127sonic(config-if-ptp-127)# ptp announce-interval 1
ptp announce-receipt-timeout
Section titled “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 1sonic(config-if-1)# ptp instance 127sonic(config-if-ptp-127)# ptp announce-receipt-timeout 2
ptp sync-interval
Section titled “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 1sonic(config-if-1)# ptp instance 127sonic(config-if-ptp-127)# ptp sync-interval -2
ptp delay-req-interval
Section titled “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 1sonic(config-if-1)# ptp instance 127sonic(config-if-ptp-127)# ptp delay-req-interval -3
ptp pdelay-req-interval
Section titled “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 1sonic(config-if-1)# ptp instance 127sonic(config-if-ptp-127)# ptp pdelay-req-interval -3
ptp dscp
Section titled “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 1sonic(config-if-1)# ptp instance 127sonic(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]
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 1sonic(config-if-1)# ptp instance 127sonic(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]
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
Section titled “ptp reset”[Command]
ptp reset
[Purpose]
Clear all PTP configurations
[View]
System configuration view
[Use Cases]
sonic(config)# ptp reset
SyncE Configuration
Section titled “SyncE Configuration”show synce interface
Section titled “show synce interface”[Command]
show synce interface interface_num
[Purpose]
Display the synce information of the interface
[View]
Interface view
[Use Cases]
sonic# show ptp interface 12SyncE Enable: trueSyncE Mode: slaveSyncE Priority: 1
show synce status
Section titled “show synce status”[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
synce enable
Section titled “synce enable”[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 1sonic(config-if-1)# synce enable
synce mode {master|slave}
Section titled “synce mode {master|slave}”[Command]
synce mode {master|slave}
[Purpose]
Configure the synce mode of interface to master or slave
[Parameter]
Parameter | Description |
---|---|
master | Clock signal sender |
slave | Clock 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 1sonic(config-if-1)# synce mode slave
synce priority
Section titled “synce priority”[Command]
synce priority value
[Purpose]
Configure the synce priority of interface
[Parameter]
Parameter | Description |
---|---|
value | Value 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 1sonic(config-if-1)# synce priority 1