Professional Documents
Culture Documents
01-15 PTP Configuration
01-15 PTP Configuration
01-15 PTP Configuration
Ethernet Switches
Configuration Guide - Device Management 15 PTP Configuration
15 PTP Configuration
Purpose
On wireless networks, clock synchronization is critical in enabling successful
communication between the mobile bearer network and base stations. A number
of methods, such as the global positioning system (GPS), Network Time Protocol
(NTP), and synchronous Ethernet, can be used to implement time and frequency
synchronization. However, GPS requires antennas to be deployed at each base
station, leading to high deployment and maintenance costs. NTP provides only
sub-second precision time synchronization, which is unable to meet precise
synchronization requirements. Synchronous Ethernet supports only high-precision
frequency synchronization but not time synchronization.
Benefits
● Provides sub-microsecond precision time synchronization for transmission
devices.
● Reduces network construction and maintenance costs because a GPS receiver
does not need to be deployed or maintained for each base station.
● Frequency synchronization
Frequency synchronization indicates that signals have the same frequency and
a fixed phase difference. That is, signals are sent or received at an average
rate. All devices on a communications network operate at the same rate.
● Phase synchronization
Phase synchronization, also called time synchronization, indicates that both
frequencies and phases of signals are consistent. That is, the phase offset
between signals is always 0.
Basic Concepts
● PTP domain
A PTP domain is a logical area that runs PTP. More than one PTP domains
may exist on a network. Each PTP domain is an independent PTP clock
synchronization system and has only one clock source. All devices in a PTP
domain synchronize their clocks with the clock source.
● 1588v2 clock nodes
Clock nodes are nodes in a PTP domain. PTP defines the following types of
clock nodes:
– Ordinary clock (OC) device: provides only one physical port to participate
in time synchronization in a PTP domain. An OC device uses this port to
synchronize time with an upstream device or to send time to a
downstream device.
– Boundary clock (BC) device: provides two or more physical ports to
participate in time synchronization in a PTP domain. One port
synchronizes time with an upstream device, and the others send the time
to downstream devices. A clock node is also a BC device if it functions as
the clock source and sends time to downstream devices through multiple
PTP ports.
– Transparent clock (TC) device: forwards PTP messages between its PTP
ports and measures the link delay of the messages. Different from an OC
device and a BC device, a TC device does not synchronize time with other
devices through ports.
● 1588v2 clock types
– OC: ordinary clock
– BC: boundary clock
– End to end transparent clock (E2ETC) for the delay mechanism: is a TC
using a delay measurement mechanism in delay mode. A device that
functions as an E2ETC does not need to have the delay measurement
mechanism mode configured.
● Grandmaster clock
All clock nodes in a PTP domain are organized into a master-slave hierarchy.
The grandmaster clock (GMC) is at the top of the hierarchy and serves as the
reference clock. Clock nodes exchange PTP messages to synchronize the time
of the GMC to the entire PTP domain. Therefore, the GMC is also called the
clock source. The GMC can be statically configured or dynamically elected
through the best master clock (BMC) algorithm.
● PTP message
Nodes exchange PTP messages to establish the master-slave hierarchy and
implement time and frequency synchronization. PTP messages are classified
into event messages and general messages depending on timestamps:
– Event message: is tagged with a timestamp when reaching or leaving a
port. PTP devices calculate the link delay based on the timestamps
carried in event messages. Event messages include Sync, Delay_Req,
Pdelay_Req, and Pdelay_Resp messages.
– General message: is used to establish master-slave hierarchy, and to
request and send time information. General messages are not tagged
with timestamps. General messages include Announce, Follow_Up,
Delay_Resp, Pdelay_Resp_Follow_Up, Management, and Signaling
messages. Currently, devices do not support Management and Signaling
messages.
Messa 1588 G. Function
ge v2 8275.
1
Sync Supp Supp A Sync message is sent from the master to the
orted orted slave and carries the t1 timestamp sent by the
master.
A Sync message can be sent in either one-step or
two-step mode.
● one-step: In this mode, a Sync message
contains the transmit timestamp.
● two-step: In this mode, a Sync message records
the time when the message is sent, instead of
containing the transmit timestamp. Such a
transmit timestamp is carried in a Follow-Up
message.
Delay Supp Supp A Delay_Req message is sent from the slave to the
_Req orted orted master during delay time synchronization and
carries the t3 timestamp sent by the slave.
1588v2 messages can be encapsulated using the MAC or UDP encapsulation mode
for transmission at Layer 2 or Layer 3, respectively.
● MAC encapsulation
This mode applies to 1588v2 messages that are transmitted over a Layer 2
link. In MAC encapsulation, the VLAN ID and 802.1p priority can be carried in
1588v2 messages, and the Ethernet type 0x88F7 is used.
● UDP encapsulation
This mode applies to 1588v2 messages that are transmitted over a Layer 3
link. In UDP encapsulation, the VLAN ID, 802.1p priority, and DSCP priority
can be carried in 1588v2 messages, and the destination UDP port number is
319 (for non-Announce messages) or 320 (for Announce messages).
2. Frequency synchronization
PTP synchronizes the frequency of the slave node with that of the master
node.
3. Time synchronization
PTP synchronizes the time of the slave node with that of the master node.
BMC Algorithm
The BMC algorithm is used to select the GMC and determine port states in a PTP
domain. It compares the data sets carried in the Announce messages exchanged
between clock nodes to select the GMC and determine the PTP port states.
The BMC algorithm compares the following attributes in Announce messages in
sequence:
● Priority1: indicates clock priority 1. The value is configurable and ranges from
0 to 255. A smaller value indicates a higher priority.
● ClockClass: defines the traceability of the International Atomic Time (TAI) of
the clock time or frequency.
● ClockAccuracy: defines the accuracy of a clock. A smaller value indicates a
higher accuracy.
● OffsetScaledLogVariance: defines the stability of a clock.
● Priority2: indicates clock priority 2. The value is configurable and ranges from
0 to 255. A smaller value indicates a higher priority.
When the BMC algorithm is used by a PTP device for GMC selection, Priority1 of
each candidate time source is compared first, then ClockClass, ClockAccuracy,
OffsetScaledLogVariance, and Priority2. If Priority1 of candidate time sources is
the same, ClockClass is compared, and so on. The time source with the highest
priority, class, and accuracy is selected as the GMC.
You can change the preceding attributes to influence the way the PTP master
clock is selected, and finally select the clock signals to receive. The BMC algorithm
can allocate PTP clock sources and implement protective switchover.
Implementation
The master node periodically sends a Sync message to the slave node. This
message carries the timestamp of when the master node sends the Sync message.
Upon receipt of a Sync message, the slave node generates a timestamp. If the
slave node receives two Sync messages, it compares the difference between the
two timestamps of when the messages are received with the difference between
the two timestamps of when the messages are sent. The slave node uses the
comparison result to adjust its frequency.
Assume that clock B is the master clock, clock A is the slave clock, and frequency
synchronization needs to be performed between clock A and clock B. If the link
delay and resident time are not considered and the frequencies of clock A and
clock B are the same, clock A and clock B should have the same accumulated time
difference within a specified period. That is, t2N-t20 = t1N-t10. If t2N-t20 is greater
than t1N-t10, the frequency of clock A is higher than the frequency of clock B and
needs to be reduced. Conversely, if t2N-t20 is smaller than t1N-t10, the frequency of
clock A is lower than that of clock B and needs to be increased. t1n is the time
when clock B sends the nth Syn message. t2n is the time when clock A receives the
nth Sync message.
TOn a PTP synchronization system, the link delay and resident time must be
considered in frequency synchronization. The Follow_Up message shown in the
preceding figure is a general message sent in two-step clock mode and carries the
timestamp of when a Sync message is sent.
Delay Mechanism
Figure 15-9 shows the process of calculating the link delay and time offset
between the master and slave devices using the delay mechanism.
1. The master device sends a Sync message at t1. If the master device works in
one-step mode, t1 is sent to the slave device through the Sync message. If the
master device works in two-step mode, t1 is sent to the slave device through
the subsequent Follow_Up message.
2. The slave device receives the Sync message at t2 and obtains t1 from the Sync
message in one-step mode or from the Follow_Up message in two-step mode.
3. The slave device sends a Delay_Req message to the master device at t3.
4. The master device receives the Delay_Req message at t4.
5. The master device sends a Delay_Resp message containing t4 to the slave
device.
In the preceding process, the timestamps of when the messages are sent or
received are generated based on the system clock of the devices. PTP defines
the timestamp length as 80 bits in a message.
By exchanging messages with the master device, the slave device obtains t1,
t2, t3, and t4, and calculates the average link delay and time offset between
the master and slave devices. The slave device can then adjust the local time
according to the calculated time offset to synchronize with the master device.
The formulas for calculating the link delay and time offset are as follows:
– Average link delay = [(t4 - t1) - (t3 - t2)]/2
t2 = t1 + Delay + Offset = t1 + [(t4 - t1) - (t3 - t2)]/2 + Offset
– Offset = [(t2 - t1) + (t3 - t4)]/2
In Figure 15-10, the time offset between the local clock and current time is
calculated by PTP, and then the local clock is adjusted based on the time
offset.
Pdelay Mechanism
The Pdelay mechanism calculates the transmission time (link delay) between two
communication ports that support the P2P mechanism using Pdelay_Req,
Pdelay_Resp, and possible Pdelay_Resp_Follow_Up messages. The P2P mechanism
is similar to the E2E mechanism except that it measures the delay of each link and
transmits the link delay and resident time of a message on a transparent clock
(TC) in a Pdelay_Resp or Pdelay_Resp_Follow_Up message to downstream devices.
The P2P mechanism calculates the average link delay of the master and slave
nodes based on the delay of each link and resident time on the TC.
In the Pdelay mechanism, the link delay can be measured between two connected
ports that support the Pdelay mechanism regardless of their port states.
Timestamps t1 and t2 indicate the time when the Pdelay_Req message is sent and
received. Timestamps t3 and t4 indicate the time when the Pdelay_Resp message is
sent and received. The formula for calculating the delay of each link is as follows:
Link delay = [(t2 - t1) + (t4 - t3)]/2 = [(t2 - t3) + (t4 - t1)]/2
Network Protection
PTP supports protective switchover between devices and between components on
the same device to prevent single-point failures. In Figure 15-13, the solid lines
identify the primary clock tracing path. The time source is provided by GPS-1 and
is transmitted to the lower layers in the direction shown by the blue arrows. The
dashed lines identify the protection path. When the primary path is faulty, GPS-2
can replace GPS-1 to provide the time source rapidly.
Licensing Requirements
PTP is a basic feature of a switch and is not under license control.
NOTE
For details about software mappings, visit Hardware Center and select the desired product
model.
The S5731-L and S5731S-L are remote units and do not support web-based management,
YANG, or commands. They can be configured only through configuration delivery by the
central device. For details, see "Simplified Architecture Configuration (the Solar System
Solution)" in the S300, S500, S2700, S5700, and S6700 V200R023C00 Configuration Guide -
Device Management.
Feature Limitations
PTP Constraints
● All the intermediate devices on the PTP synchronization path must support
PTP.
● Frequency signals are transmitted bidirectionally, and time signals are
transmitted unidirectionally. For frequency signals, a crossover cable is
required; for time signals, a straight-through cable is required.
● PTP Announce messages contain the clock attributes of the peer device to
establish the master-slave hierarchy of interfaces. Therefore, prohibit a PTP
interface from receiving Announce messages from different devices.
PTP Precautions
NOTE
Before configuring PTP for time synchronization, ensure frequency synchronization on the
entire network. To implement frequency synchronization, configure synchronous Ethernet.
This chapter describes only PTP time synchronization. For details about how to configure
PTP for frequency synchronization, see "Synchronous Ethernet Configuration" in Device
Management.
● PTP messages are Layer 2 broadcast messages by default. If incorrect
configuration is performed, loops or broadcast storms occur and downstream
devices are seriously affected. To avoid broadcast storms or loops, configure
VLAN or STP before enabling PTP on an interface.
● By default, a device obtains frequency signals through synchronous Ethernet
and obtains time signals through PTP. When PTP is used for clock
synchronization, you are advised to configure the device to obtain frequency
signals and time signals through PTP.
● The switch supports PTP only after its working mode has been set to
enhanced mode using the set service-mode command.
OC Deployment
As shown in Figure 15-14, when two devices transmit wireless data on the IP
bearer network, low-delay transmission must be guaranteed for real-time wireless
services. The two devices function as OCs and transmit clock information through
1588v2 messages to ensure clock synchronization between them. OCs use 1588v2
messages to synchronize clock signals.
Pre-configuration Tasks
Before configuring 1588v2 on an OC, complete the following tasks:
● Set link layer protocol parameters for interfaces to ensure that the link layer
protocol status of the interfaces is Up.
● Configure a grandmaster clock to correctly obtain clock and time signals from
the external clock source.
● Configure synchronous Ethernet to synchronize the clock frequency on the
network.
Configuration Procedure
The process of configuring 1588v2 on an OC is as follows.
Context
After external time signal input is configured on multiple 1588v2 devices, you can
configure clock source attributes to allow the 1588v2 clock sources to participate
in BMC calculation. The BMC algorithm allows the 1588v2 devices to dynamically
determine the master clock. The master clock provides time signals to the entire
1588v2 network so that the 1588v2 devices use 1588v2 to obtain clock
information from the grandmaster clock.
After dynamic BMC calculation is implemented, the 1588v2 devices select a clock
source based on the following order: priority1 > clock-class > clock-accuracy >
priority2. That is, priority1 of the clock sources is compared first. If the priority1
values of these 1588v2 devices are the same, the clock-class is compared. The
clock source with the highest priority is selected as the master clock.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Configure clock source attributes on all nodes. Generally, clock source attributes
need to be configured only on the grandmaster. After the grandmaster selects the
optimal clock source, the associated attributes are transmitted to lower-layer
devices through Announce messages. In case of special requirements, configure
time source attributes for other nodes.
● Run ptp clock-source local time-source time-source slot slot-id
Context
In a PTP domain, a PTP device functioning as an OC can synchronize time with an
upstream device or send time to a downstream device. To configure a PTP device
as an OC, enable PTP globally on the device, configure the device type as OC, and
perform OC configurations in the system view.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ptp enable
PTP is enabled globally.
By default, PTP is not enabled globally.
Step 3 Run ptp device-type oc slot slot-id
The device type is configured as OC.
By default, no device type is configured for a PTP device.
Step 4 (Optional) Run ptp slaveonly slot slot-id
The OC is configured to work in slave-only mode.
By default, an OC port can be a master or slave port. When a device functions as
an OC to synchronize with other clocks, configure the device to work in slave-only
mode. After the device is configured to work in slave-only mode, ports of the
device are in slave state. This indicates that the device can only function as a slave
clock to receive clock signals from other clocks but cannot function as a master
clock to provide clock signals for other clocks.
Step 5 (Optional) Run ptp domain domain-value
The PTP domain to which the device belongs is configured.
By default, a PTP device belongs to domain 0.
NOTE
Devices that perform clock synchronization through PTP messages must belong to the same
PTP domain.
NOTE
When running the ptp virtual-clock-id command, ensure that the configured virtual clock ID is
unique in the entire PTP domain.
----End
Context
On an interface, you can enable PTP and configure the delay measurement
mechanism, method to process Announce messages, and mode in which PTP
messages carry timestamps.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The view of the interface on which PTP needs to be configured is displayed.
Step 3 Run ptp delay-mechanism { delay | pdelay }
A delay measurement mechanism is configured.
By default, no delay measurement mechanism is configured for an OC.
NOTE
Different delay measurement mechanisms are not compatible. Therefore, PTP interfaces on
a link must have the same delay measure mechanism configured.
----End
NOTE
By default, an interface does not drop Announce messages.
NOTE
Devices that perform clock synchronization through 1588v2 messages must use the same
encapsulation mode of 1588v2 messages. Otherwise, the devices cannot communicate.
You can configure unicast or multicast encapsulation for 1588v2 messages based
on the topology of the master and slave devices:
● Unicast encapsulation: applies to point-to-point clock signal synchronization.
This mode is used when a single device needs to synchronize with the master
clock. If the destination MAC address or IP address of 1588v2 messages to be
sent is set to a unicast address, 1588v2 messages are encapsulated in unicast
encapsulation mode.
Procedure
● Configure the MAC encapsulation mode.
a. Run system-view
Context
1588v2 devices periodically send or receive 1588v2 messages to establish the
master-slave hierarchy and transmit time information. 1588v2 messages include
Announce messages and Delay messages. Announce messages are used to
exchange time synchronization information between 1588v2 devices and establish
the master-slave hierarchy. Delay messages are event messages, which are
timestamped when reaching or leaving a 1588v2 device to measure the link delay.
If a 1588v2 device requires high-precision clock synchronization and needs to trace
the master clock frequency, reduce the interval for sending 1588v2 messages.
However, this consumes more bandwidth resources. If the sending link delay and
receiving link delay are different, you can configure correction for sending or
receiving 1588v2 messages to correct the link delay.
Procedure
● Configure attributes for Announce messages.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run ptp announce-interval announce-interval
The interval for sending Announce messages on the interface is set to
2announce-interval, in milliseconds.
The default value of announce-interval is 7, indicating that the interval
for sending Announce messages on an interface is 128 ms.
If announce-interval is set to a small value, 1588v2 devices frequently
exchange 1588v2 messages, consuming more bandwidth resources. If
announce-interval is set to a large value, high-precision clock
synchronization cannot be guaranteed; however, clock synchronization
accuracy can be guaranteed.
d. Run ptp announce receipt-timeout timeout-value
The maximum number of timeouts for receiving Announce messages is
set.
By default, the maximum number of timeouts for receiving Announce
messages is 3.
● Configure attributes for 1588v2 Delay messages.
a. Run system-view
The system view is displayed.
----End
Context
In a PTP clock synchronization network, all clock nodes work in the master-slave
relationship. By default, the master-slave relationships between clock nodes are
calculated through the BMC algorithm. To manually determine the master-slave
relationship between clock nodes, specify the clock status of various interfaces
excluding the TC interface.
Procedure
Step 1 Run system-view
BC Deployment
As shown in Figure 15-15, NodeBs need to synchronize clocks with an external
clock source. All devices on the bearer network support 1588v2. Each device on
the bearer network receives clock signals from an upstream device and sends
clock signals to a downstream device. In this manner, NodeBs can synchronize
clocks with the external clock source. Devices are configured as BC nodes to
connect to the external clock source, synchronize with the external clock source,
and send clock information to other devices on the bearer network. Other
backbone nodes on the bearer network are deployed as BCs, which can
synchronize with the external clock source and send clock information to
downstream devices.
Pre-configuration Tasks
Before configuring 1588v2 on a BC, complete the following tasks:
● Set link layer protocol parameters for interfaces to ensure that the link layer
protocol status of the interfaces is Up.
● Ensure that the BC obtains the clock signal and time signal from the external
clock source.
● Configure synchronous Ethernet to synchronize the clock frequency on the
network.
Configuration Procedure
The procedure of configuring 1588v2 on a BC is as follows.
Context
After external time signal input is configured on multiple 1588v2 devices, you can
configure clock source attributes to allow the 1588v2 clock sources to participate
in BMC calculation. The BMC algorithm allows the 1588v2 devices to dynamically
determine the master clock. The master clock provides time signals to the entire
1588v2 network so that the 1588v2 devices use 1588v2 to obtain clock
information from the grandmaster clock.
After dynamic BMC calculation is implemented, the 1588v2 devices select a clock
source based on the following order: priority1 > clock-class > clock-accuracy >
priority2. That is, priority1 of the clock sources is compared first. If the priority1
values of these 1588v2 devices are the same, the clock-class is compared. The
clock source with the highest priority is selected as the master clock.
Procedure
Step 1 Run system-view
Step 2 Configure clock source attributes on all nodes. Generally, clock source attributes
need to be configured only on the grandmaster. After the grandmaster selects the
optimal clock source, the associated attributes are transmitted to lower-layer
devices through Announce messages. In case of special requirements, configure
time source attributes for other nodes.
● Run ptp clock-source local time-source time-source slot slot-id
The type of the clock source to be traced is configured.
NOTE
The time-source parameter can be configured only on the grandmaster clock and
must be set according to the clock source connected to the device. For details about
the time-source parameter and corresponding clock source, see Command Reference.
----End
Context
To enable the master clock to transmit clock signals to multiple devices, configure
a device as a BC. A BC provides multiple physical interfaces to participate in PTP
clock synchronization. One interface receives clock signals from an upstream
device, and the other interfaces send the clock signals to downstream devices.
To configure a PTP device as a BC, enable PTP globally on the device, configure
the device type as BC, and perform BC configurations in the system view.
Procedure
Step 1 Run system-view
PTP is enabled.
NOTE
Devices that perform clock synchronization through PTP messages must belong to the same
PTP domain.
By default, no virtual clock ID is configured for a PTP device, and the system
generates a clock ID based on the MAC address of the device. You can also
configure a virtual clock ID to identify the device.
NOTE
When running the ptp virtual-clock-id command, ensure that the configured virtual clock ID is
unique in the entire PTP domain.
----End
Procedure
Step 1 Run system-view
The mode in which PTP devices timestamp PTP messages to perform clock
synchronization is configured.
----End
NOTE
By default, an interface does not drop Announce messages.
NOTE
Devices that perform clock synchronization through 1588v2 messages must use the same
encapsulation mode of 1588v2 messages. Otherwise, the devices cannot communicate.
You can configure unicast or multicast encapsulation for 1588v2 messages based
on the topology of the master and slave devices:
● Unicast encapsulation: applies to point-to-point clock signal synchronization.
This mode is used when a single device needs to synchronize with the master
clock. If the destination MAC address or IP address of 1588v2 messages to be
sent is set to a unicast address, 1588v2 messages are encapsulated in unicast
encapsulation mode.
● Multicast encapsulation: applies to point-to-multipoint clock signal
synchronization. By default, devices that reside in the same PTP domain and
use the same delay measurement mechanism join the same multicast group.
Therefore, when multicast encapsulation is used, the destination MAC address
or IP address does not need to be configured for 1588v2 messages.
Procedure
● Configure the MAC encapsulation mode.
a. Run system-view
The system view is displayed.
Context
1588v2 devices periodically send or receive 1588v2 messages to establish the
master-slave hierarchy and transmit time information. 1588v2 messages include
Announce messages and Delay messages. Announce messages are used to
Procedure
● Configure attributes for Announce messages.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run ptp announce-interval announce-interval
The interval for sending Announce messages on the interface is set to
2announce-interval, in milliseconds.
The default value of announce-interval is 7, indicating that the interval
for sending Announce messages on an interface is 128 ms.
If announce-interval is set to a small value, 1588v2 devices frequently
exchange 1588v2 messages, consuming more bandwidth resources. If
announce-interval is set to a large value, high-precision clock
synchronization cannot be guaranteed; however, clock synchronization
accuracy can be guaranteed.
d. Run ptp announce receipt-timeout timeout-value
The maximum number of timeouts for receiving Announce messages is
set.
By default, the maximum number of timeouts for receiving Announce
messages is 3.
● Configure attributes for 1588v2 Delay messages.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run ptp sync-interval sync-interval
The interval for sending Sync messages is configured on an interface.
By default, the interval for sending Sync messages is 8 ms.
d. Run ptp min-delayreq-interval min-delayreq-interval
The interval for sending DelayReq messages on the interface is set to
2min-delayreq-interval, in milliseconds.
----End
Context
In a PTP clock synchronization network, all clock nodes work in the master-slave
relationship. By default, the master-slave relationships between clock nodes are
calculated through the BMC algorithm. To manually determine the master-slave
relationship between clock nodes, specify the clock status of various interfaces
excluding the TC interface.
Procedure
Step 1 Run system-view
Step 4 Run ptp port-state { slave | passive | master | premaster | listening | faulty |
disabled | initializing }
----End
TC Deployment
As shown in Figure 15-16, NodeBs synchronize with the external clock and
support 1588v2. Core devices on the bearer network synchronize clocks with the
grandmaster clock and send clock signals to downstream devices. Devices
functioning as TCs transmit PTP messages between BCs or OCs. In this manner,
BCs and OCs can synchronize their clocks. This deployment allows devices that do
not have high clock requirements to only transmit 1588v2 messages, ensures
synchronization precision, and improves synchronization efficiency.
Pre-configuration Tasks
Before configuring 1588v2 on a TC, complete the following tasks:
● Set link layer protocol parameters for interfaces to ensure that the link layer
protocol status of the interfaces is Up.
● Ensure that the Grandmaster clock correctly receives clock and time signals
from the external clock source.
● Configure synchronous Ethernet to synchronize the clock frequency on the
network.
Configuration Procedure
The process of configuring 1588v2 on a TC is as follows.
Context
In certain scenarios, a device may need to transmit multi-channel clock signals
without needing to synchronize with multiple clock sources. You can configure the
device as a transparent clock (TC), which then transmits clock signals and
measures the link delay without needing to synchronize with the clock signals.
Procedure
Step 1 Run system-view
Step 3 Run ptp device-type { e2etc | e2etcoc | p2ptc | p2ptcoc } slot slot-id
By default, no virtual clock ID is configured for a PTP device, and the system
generates a clock ID based on the MAC address of the device. You can also
configure a virtual clock ID to identify the device.
NOTE
When running the ptp virtual-clock-id command, ensure that the configured virtual clock ID is
unique in the entire PTP domain.
----End
Context
On an interface, you can enable PTP and configure the delay measurement
mechanism, method to process Announce messages, and mode in which PTP
messages carry timestamps.
Procedure
Step 1 Run system-view
----End
NOTE
Devices that perform clock synchronization through 1588v2 messages must use the same
encapsulation mode of 1588v2 messages. Otherwise, the devices cannot communicate.
You can configure unicast or multicast encapsulation for 1588v2 messages based
on the topology of the master and slave devices:
● Unicast encapsulation: applies to point-to-point clock signal synchronization.
This mode is used when a single device needs to synchronize with the master
clock. If the destination MAC address or IP address of 1588v2 messages to be
sent is set to a unicast address, 1588v2 messages are encapsulated in unicast
encapsulation mode.
● Multicast encapsulation: applies to point-to-multipoint clock signal
synchronization. By default, devices that reside in the same PTP domain and
use the same delay measurement mechanism join the same multicast group.
Therefore, when multicast encapsulation is used, the destination MAC address
or IP address does not need to be configured for 1588v2 messages.
Procedure
● Configure the MAC encapsulation mode.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run ptp mac-egress destination-mac destination-mac
The 1588v2 messages to be sent from the interface are encapsulated in
MAC encapsulation mode, and the destination MAC address is
configured.
By default, the multicast destination MAC address is 011B-1900-0000 if
the delay request-response mechanism is used; the multicast destination
MAC address is 0180-C200-000E if the Pdelay mechanism is used.
d. (Optional) Run ptp mac-egress vlan vlan-id [ priority priority-value ]
The VLAN ID and 802.1p priority are configured for MAC-encapsulated
1588v2 messages.
Context
1588v2 devices periodically send or receive 1588v2 messages to establish the
master-slave hierarchy and transmit time information. 1588v2 messages include
Announce messages and Delay messages. Announce messages are used to
exchange time synchronization information between 1588v2 devices and establish
the master-slave hierarchy. Delay messages are event messages, which are
timestamped when reaching or leaving a 1588v2 device to measure the link delay.
If a 1588v2 device requires high-precision clock synchronization and needs to trace
the master clock frequency, reduce the interval for sending 1588v2 messages.
However, this consumes more bandwidth resources. If the sending link delay and
receiving link delay are different, you can configure correction for sending or
receiving 1588v2 messages to correct the link delay.
Procedure
● Configure attributes for Announce messages.
a. Run system-view
The system view is displayed.
----End
Procedure
● Run the display ptp all [ state | config ] [ slot slot-id ] command to check
the PTP running status and configuration.
● Run the display ptp interface interface-type interface-number command to
check PTP information on the specified interface.
----End
TCandBC Deployment
In Figure 15-17, all devices on the bearer network and NodeBs support 1588v2.
CarrierA has NodeBs and an external clock source2, but does not have bearer
network devices. CarrierB leases its bearer network to CarrierA. Devices on the
bearer network synchronize with the external clock source1 of CarrierB. To ensure
that clock synchronization is implemented independently on devices of CarrierA
and CarrierB, you can deploy the network as follows:
● BC1 and OC1 connect to clock1 and clock2 respectively, and send clock
synchronization information to downstream devices through 1588v2
messages.
● TCandBC1 directly connects to BC1 through a BC interface and participates in
clock synchronization in Domain 1. The user-side interface of TCandBC1 is a
TC interface.
● TCandBC2 directly connects to BC1 through a BC interface and participates in
clock synchronization in Domain 1. The user-side interface of TCandBC2 is a
TC interface.
● Interfaces that directly connect TCandBC2 to OC2, TCandBC2 to TCandBC1,
and TCandBC1 to OC1 provide the TC function. OC2 receives 1588v2
messages sent from TCandBC1 through the PW channel between TCandBC1
and TCandBC2, synchronizes clock information with TCandBC1, and then
sends clock information to NodeB using traditional synchronization methods
such as synchronous Ethernet.
● The bearer network has two PTP domains: Domain 1 and Domain 2. All
devices in Domain 1 function as BCs to implement PTP synchronization and
transmit messages between TCandBC1 and TCandBC2. For Domain 2, the
entire bearer network functions as a large TC, which transparently transmits
clock2 information to NodeB.
Pre-configuration Tasks
Before configuring 1588v2 on a TCandBC, complete the following tasks:
● Set link layer protocol parameters for interfaces to ensure that the link layer
protocol status of the interfaces is Up.
● Ensure that the OC1 and OC2 correctly receive clock and time signals from
the clock.
● Configure synchronous Ethernet to synchronize the clock frequency on the
network.
Configuration Procedure
The process of configuring 1588v2 on a TCandBC is as follows.
Context
After external time signal input is configured on multiple 1588v2 devices, you can
configure clock source attributes to allow the 1588v2 clock sources to participate
in BMC calculation. The BMC algorithm allows the 1588v2 devices to dynamically
determine the master clock. The master clock provides time signals to the entire
1588v2 network so that the 1588v2 devices use 1588v2 to obtain clock
information from the grandmaster clock.
After dynamic BMC calculation is implemented, the 1588v2 devices select a clock
source based on the following order: priority1 > clock-class > clock-accuracy >
priority2. That is, priority1 of the clock sources is compared first. If the priority1
values of these 1588v2 devices are the same, the clock-class is compared. The
clock source with the highest priority is selected as the master clock.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Configure clock source attributes on all nodes. Generally, clock source attributes
need to be configured only on the grandmaster. After the grandmaster selects the
optimal clock source, the associated attributes are transmitted to lower-layer
devices through Announce messages. In case of special requirements, configure
time source attributes for other nodes.
● Run ptp clock-source local time-source time-source slot slot-id
The type of the clock source to be traced is configured.
NOTE
The time-source parameter can be configured only on the grandmaster clock and
must be set according to the clock source connected to the device. For details about
the time-source parameter and corresponding clock source, see Command Reference.
● Run ptp clock-source local clock-accuracy clock-accuracy slot slot-id
The clock accuracy of the clock source is configured.
● Run ptp clock-source local clock-class clock-class slot slot-id
The class of the clock source is configured.
NOTE
A smaller clock-class value indicates a higher class. A device whose clock class value is
smaller than 128 cannot function as a slave clock. Therefore, do not set a high clock
class for a slave clock. Otherwise, the PTP interface of the slave clock cannot enter the
slave state, and the device cannot synchronize with the master clock.
● Run ptp clock-source local priority1 priority1 slot slot-id
The priority1 value is set for the clock source.
● Run ptp clock-source local priority2 priority2 slot slot-id
The priority2 value is set for the clock source.
----End
Context
If different carriers synchronize clocks with clients through the switch, configure
the switch as a TCandBC. On a TCandBC, a BC interface receives clock signals from
the master clock and sends the clock signals to a downstream device, and a TC
interface only transmits clock signals. A TC interface on a TCandBC is responsible
for forwarding PTP messages of PTP domains.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ptp enable
PTP is enabled globally.
By default, PTP is not enabled globally on a device.
Step 3 Run ptp device-type tcandbc slot slot-id
The device type is configured as TCandBC.
By default, no device type is configured for a PTP device.
Step 4 Run ptp domain domain-value
The domain to which the BC interface of the TCandBC belongs is configured.
By default, a PTP device belongs to domain 0.
NOTE
Devices that perform clock synchronization through PTP messages must belong to the same
PTP domain.
NOTE
When running the ptp virtual-clock-id command, ensure that the configured virtual clock ID is
unique in the entire PTP domain.
----End
----End
NOTE
By default, an interface does not drop Announce messages.
NOTE
Devices that perform clock synchronization through 1588v2 messages must use the same
encapsulation mode of 1588v2 messages. Otherwise, the devices cannot communicate.
You can configure unicast or multicast encapsulation for 1588v2 messages based
on the topology of the master and slave devices:
● Unicast encapsulation: applies to point-to-point clock signal synchronization.
This mode is used when a single device needs to synchronize with the master
clock. If the destination MAC address or IP address of 1588v2 messages to be
sent is set to a unicast address, 1588v2 messages are encapsulated in unicast
encapsulation mode.
● Multicast encapsulation: applies to point-to-multipoint clock signal
synchronization. By default, devices that reside in the same PTP domain and
use the same delay measurement mechanism join the same multicast group.
Therefore, when multicast encapsulation is used, the destination MAC address
or IP address does not need to be configured for 1588v2 messages.
Procedure
● Configure the MAC encapsulation mode.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run ptp mac-egress destination-mac destination-mac
The 1588v2 messages to be sent from the interface are encapsulated in
MAC encapsulation mode, and the destination MAC address is
configured.
By default, the multicast destination MAC address is 011B-1900-0000 if
the delay request-response mechanism is used; the multicast destination
MAC address is 0180-C200-000E if the Pdelay mechanism is used.
d. (Optional) Run ptp mac-egress vlan vlan-id [ priority priority-value ]
The VLAN ID and 802.1p priority are configured for MAC-encapsulated
1588v2 messages.
● Configure the UDP encapsulation mode.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run ptp udp-egress source-ip source-ip [ destination-ip destination-ip ]
The 1588v2 messages to be sent from the interface are encapsulated in
UDP encapsulation mode, and the source and destination IP addresses
are configured.
By default, if UDP encapsulation is configured, the destination IP address
is multicast address 224.0.1.129 when the delay request-response
Context
1588v2 devices periodically send or receive 1588v2 messages to establish the
master-slave hierarchy and transmit time information. 1588v2 messages include
Announce messages and Delay messages. Announce messages are used to
exchange time synchronization information between 1588v2 devices and establish
the master-slave hierarchy. Delay messages are event messages, which are
timestamped when reaching or leaving a 1588v2 device to measure the link delay.
If a 1588v2 device requires high-precision clock synchronization and needs to trace
the master clock frequency, reduce the interval for sending 1588v2 messages.
However, this consumes more bandwidth resources. If the sending link delay and
receiving link delay are different, you can configure correction for sending or
receiving 1588v2 messages to correct the link delay.
Procedure
● Configure attributes for Announce messages.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run ptp announce-interval announce-interval
The interval for sending Announce messages on the interface is set to
2announce-interval, in milliseconds.
The default value of announce-interval is 7, indicating that the interval
for sending Announce messages on an interface is 128 ms.
If announce-interval is set to a small value, 1588v2 devices frequently
exchange 1588v2 messages, consuming more bandwidth resources. If
announce-interval is set to a large value, high-precision clock
synchronization cannot be guaranteed; however, clock synchronization
accuracy can be guaranteed.
Context
In a PTP clock synchronization network, all clock nodes work in the master-slave
relationship. By default, the master-slave relationships between clock nodes are
calculated through the BMC algorithm. To manually determine the master-slave
relationship between clock nodes, specify the clock status of various interfaces
excluding the TC interface.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ptp set-port-state enable slot slot-id
The function to statically specify the interface status is enabled.
Step 3 Run interface interface-type interface-number
The view of the interface whose status is to be statically configured is displayed.
Step 4 Run ptp port-state { slave | passive | master | premaster | listening | faulty |
disabled | initializing }
The interface status is statically specified.
----End
Pre-configuration Tasks
Before configuring G.8275.1, complete the following tasks:
● Configure link layer protocol parameters for interfaces to ensure that the link
layer protocol status on the interfaces is Up.
● T-BC has correctly introduced external clock and time signals.
Configuration Procedure
The process of configuring G.8275.1 is as follows:
Context
After external time signal input is configured on multiple G.8275.1 devices, you
can configure clock source attributes for BMC source selection to allow the G.
8275.1 clock sources to participate in BMC calculation. The BMC algorithm allows
the G.8275.1 devices to dynamically determine the master clock. The master clock
provides time signals to the entire G.8275.1 network so that the G.8275.1 devices
use G.8275.1 to obtain clock information from the grandmaster clock.
After dynamic BMC calculation is implemented, the G.8275.1 devices select a clock
source based on the following order: priority2 > local-priority. That is, priority2 of
the clock sources is compared first. If the priority2 values of these G.8275.1 devices
are the same, the local-priority is compared. The clock source with the highest
priority is selected as the master clock.
Procedure
Step 1 Run system-view
The type of the clock source to be traced is configured. The time-source parameter
can be configured only on the grandmaster clock and must be set according to the
clock source connected to the device. For details about the time-source parameter
and corresponding clock source, see Command Reference.
----End
Context
TO configure G.8275.1 globally, enable it in the system view and set the device
type to T-BC. Perform the following operations on T-BC:
Procedure
Step 1 Run system-view
PTP is enabled.
NOTE
Devices that perform clock synchronization through G.8275.1 messages must belong to the
same PTP domain.
By default, no virtual clock ID is configured for a PTP device. In this case, the
system automatically generates clock IDs based on device MAC addresses. You can
manually configure a virtual clock ID to identify a PTP device.
NOTE
Ensure that the virtual clock ID configured using the ptp virtual-clock-id command is unique in
the entire PTP domain.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run ptp delay-mechanism delay
The delay measurement mechanism is configured as delay.
By default, no delay measurement mechanism is configured for interfaces.
Step 4 Run ptp notslave disable
The G.8275.1 interface is configured to work in slave state.
Step 5 Run ptp enable
PTP is enabled on the interface.
By default, PTP is not enabled on an interface.
Step 6 (Optional) Run ptp announce-drop enable
The interface of the G.8275.1 device is configured to discard the received
Announce messages.
By default, an interface does not discard Announce messages. Announce messages
are used for PTP clock synchronization. If an interface is configured to drop
Announce messages, the device cannot receive clock signals from other devices
through the interface. Generally, a user-side interface is configured to drop
Announce messages.
Step 7 (Optional) Run ptp asymmetry-correction { positive | negative } asymmetry-
correction
The asymmetric correction time for sending G.8275.1 messages on the interface is
set.
Step 8 (Optional) Run ptp clock-step { one-step | two-step }
The mode in which the G.8275.1 device timestamps G.8275.1 messages to perform
clock synchronization is configured.
By default, G.8275.1 messages are timestamped in one-step mode.
Step 9 (Optional) Run ptp local-priority local-priority-value
A local priority is configured for the G.8275.1 interface.
By default, the local priority of a G.8275.1 interface is 128. If multiple clock
sources participate in clock source selection, clock source switching can be
achieved through the local priorities configured for interfaces.
----End
Context
G.8275.1 devices periodically send or receive G.8275.1 messages to establish the
master-slave hierarchy and transmit time information. G.8275.1 messages include
Announce messages and Delay messages. Announce messages are used to
exchange time synchronization information between G.8275.1 devices and
establish the master-slave hierarchy. Delay messages are event messages, which
are timestamped when reaching or leaving a G.8275.1 device to measure the link
delay.
If a G.8275.1 device requires high-precision clock synchronization and needs to
trace the master clock frequency, reduce the interval for sending G.8275.1
messages. However, this consumes more bandwidth resources. If the sending link
delay and receiving link delay are different, you can configure correction for
sending or receiving G.8275.1 messages to correct the link delay.
Procedure
● Configure attributes for Announce messages.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run ptp announce-interval announce-interval
The interval for sending Announce messages on the interface is set to
2announce-interval, in milliseconds.
The default value of announce-interval is 7, indicating that the interval
for sending Announce messages on an interface is 128 ms.
If announce-interval is set to a small value, G.8275.1 devices frequently
exchange G.8275.1 messages, consuming more bandwidth resources. If
announce-interval is set to a large value, high-precision clock
synchronization cannot be guaranteed; however, clock synchronization
accuracy can be guaranteed.
d. Run ptp announce receipt-timeout timeout-value
The maximum number of timeouts for receiving Announce messages is
set.
By default, the maximum number of timeouts for receiving Announce
messages is 3.
● Configure attributes for G.8275.1 Delay messages.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The interface view is displayed.
c. Run ptp sync-interval sync-interval
The interval for sending Sync messages is configured on an interface.
----End
Context
In a PTP clock synchronization network, all clock nodes work in the master-slave
relationship. By default, the master-slave relationships between clock nodes are
calculated through the BMC algorithm. To manually determine the master-slave
relationship between clock nodes, specify the clock status of various interfaces
excluding the TC interface.
Procedure
Step 1 Run system-view
Step 4 Run ptp port-state { slave | passive | master | premaster | listening | faulty |
disabled | initializing }
----End
Procedure
● Run the display ptp all [ state | config ] [ slot slot-id ] command to check
the PTP running status and configuration.
● Run the display ptp interface interface-type interface-number command to
check PTP information on the specified interface.
----End
Context
In routine maintenance, you can run the following command in any view to view
the PTP running status.
Procedure
● Run the display ptp { all [ config | state ] [ slot slot-id ] | interface
interface-type interface-number } command to check the PTP configuration
and running status.
----End
Context
NOTICE
PTP message statistics cannot be restored after being cleared. Confirm your
operation before clearing them.
Procedure
● Run the reset ptp statistics { all [ slot slot-id ] | interface interface-type
interface-number } command in the user view to clear PTP message statistics
on the interface.
----End
Networking Requirements
In Figure 15-19, the bearer network carries wireless services between NodeBs, and
all bearer network nodes support 1588v2. IN addition, NodeB1 and NodeB2
support 1588v2. In this way, wireless base stations and bearer network devices
achieve frequency and time synchronization. Because all the devices on the bearer
network support 1588v2, clock information can be transmitted in network-wide BC
mode.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure input of external clock signals.
2. Configure the type of 1588v2-capable devices on the bearer network as BC.
3. Configure PE1 and PE2 as system master clocks and connect them to external
clocks. PE1 and PE2 back up each other.
4. Set the delay mechanism to Pdelay.
Procedure
Step 1 Configure a clock source.
# Configure PE1 to input clock signals from the PTP clock source to implement
frequency synchronization. The configurations of PE2, CE1, and CE2 are similar to
the configuration of PE1.
<HUAWEI> system-view
[HUAWEI] sysname PE1
[PE1] clock ethernet-synchronization enable
[PE1] clock source ptp synchronization enable slot 0
[PE1] clock source ptp priority 10 slot 0
[PE1] clock source ptp ssm prc slot 0
Step 2 Globally enable PTP and configure the device type as BC.
# Configure PE1. The configurations of PE2, CE1, and CE2 are similar to the
configuration of PE1.
[PE1] ptp enable
[PE1] ptp device-type bc slot 0
Port info
Name State Delay-mech Ann-timeout Type Domain
------------------------------------------------------------------------------
XGigabitEthernet0/0/1 master delay 4 BC 0
XGigabitEthernet0/0/2 slave delay 4 BC 0
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
clock ethernet-synchronization enable
clock source ptp priority 10 slot 0
clock source ptp ssm prc slot 0
clock source ptp synchronization enable slot 0
#
ptp enable
ptp device-type bc slot 0
#
interface XGigabitEthernet0/0/1
ptp delay-mechanism pdelay
ptp enable
#
interface XGigabitEthernet0/0/2
ptp delay-mechanism pdelay
ptp enable
#
return
ptp enable
ptp device-type bc slot 0
#
interface XGigabitEthernet0/0/1
ptp delay-mechanism pdelay
ptp enable
#
interface XGigabitEthernet0/0/2
ptp delay-mechanism pdelay
ptp enable
#
return
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure input of external clock signals.
2. Configure the type of G.8275.1-capable devices on the bearer network as T-
BC.
3. Configure PE1 and PE2 as system master clocks and connect them to external
clocks. PE1 and PE2 back up each other.
Procedure
Step 1 Configure input of external clock signals.
# Configure PE1 to input clock signals from the line clock source to implement
frequency synchronization. The configuration of PE2 is similar to the configuration
of PE1.
<HUAWEI> system-view
[HUAWEI] sysname PE1
[PE1] clock ethernet-synchronization enable
[PE1] interface XGigabitEthernet 0/0/1
[PE1-XGigabitEthernet0/0/1] clock synchronization enable
[PE1-XGigabitEthernet0/0/1] quit
[PE1] interface XGigabitEthernet 0/0/2
[PE1-XGigabitEthernet0/0/2] clock synchronization enable
[PE1-XGigabitEthernet0/0/2] quit
[PE1] interface XGigabitEthernet 0/0/3
[PE1-XGigabitEthernet0/0/3] clock synchronization enable
[PE1-XGigabitEthernet0/0/3] clock ssm ssua
[PE1-XGigabitEthernet0/0/3] clock priority 1
[PE1-XGigabitEthernet0/0/3] quit
Step 2 Globally enable PTP, set the PTP protocol to G.8275.1, and set the device type to T-
BC.
# Configure PE1. The configurations of PE2, CE1, and CE2 are similar to the
configuration of PE1.
[PE1] ptp enable
[PE1] ptp profile g-8275-1 enable
[PE1] ptp device-type t-bc slot 0
Port info
Name State Delay-mech Ann-timeout Type Domain
------------------------------------------------------------------------------
XGigabitEthernet0/0/1 slave delay 4 T-BC 0
XGigabitEthernet0/0/2 master delay 4 T-BC 0
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
clock ethernet-synchronization enable
#
ptp enable
ptp profile g-8275-1 enable
ptp device-type t-bc slot 0
#
interface XGigabitEthernet0/0/1
clock synchronization enable
ptp delay-mechanism delay
ptp enable
#
interface XGigabitEthernet0/0/2
clock ssm ssua
clock priority 1
clock synchronization enable
ptp delay-mechanism delay
ptp notslave disable
ptp enable
#
return
#
return