Cisco DS 1
Cisco DS 1
Cisco DS 1
Configuring PTP
This document describes Precision Time Protocol (PTP) and how to configure it on the Cisco Industrial Ethernet 2000U Series Switch,
CGS 2520 Switch, and CG Ethernet Switch Module (ESM). This document uses the term switch to refer to any of these platforms.
Why PTP?
Smart grid power automation applications such as peak-hour billing, virtual power generators, and outage monitoring and management,
require extremely precise time accuracy and stability. Timing precision improves network monitoring accuracy and troubleshooting
ability.
In addition to providing time accuracy and synchronization, the PTP message-based protocol can be implemented on packet-based
networks, such as Ethernet networks. The benefits of using PTP in an Ethernet network include:
• Low cost and easy setup in existing Ethernet networks
• Limited bandwidth is required for PTP data packets
Note To learn more about PTP clock devices and their role in a PTP network, refer to PTP Clocks, on page 7.
Message-Based Synchronization
To ensure clock synchronization, PTP requires an accurate measurement of the communication path delay between the time source
(master ) and the receiver (slave ). PTP sends messages between the master and slave device to determine the delay measurement.
Then, PTP measures the exact message transmit and receive times and uses these times to calculate the communication path delay.
2
PTP then adjusts current time information contained in network data for the calculated delay, resulting in more accurate time
information.
This delay measurement principle determines path delay between devices on the network, and the local clocks are adjusted for this
delay using a series of messages sent between masters and slaves. The one-way delay time is calculated by averaging the path delay
of the transmit and receive messages. This calculation assumes a symmetrical communication path; however, switched networks do
not necessarily have symmetrical communication paths, due to the buffering process.
PTP provides a method, using transparent clocks, to measure and account for the delay in a time-interval field in network timing
packets, making the switches temporarily transparent to the master and slave nodes on the network. An end-to-end transparent clock
forwards all messages on the network in the same way that a switch does.
To read a detailed description of synchronization messages, refer to PTP Event Message Sequences, on page 3. To learn more about
how transparent clocks calculate network delays, refer to Transparent Clock, on page 7.
The following figure shows a typical 1588 PTP network that includes grandmaster clocks, switches in boundary clock mode, and
Intelligent Electronic Device (IEDs) such as a digital relays or protection devices. In this diagram, Master 1 is the grandmaster clock.
If Master 1 becomes unavailable, the boundary clock slaves switch to Master 2 for synchronization.
Figure 1: PTP Network
3
Synchronizing with Boundary Clocks
The ordinary and boundary clocks configured for the delay request-response mechanism use the following event messages to generate
and communicate timing information:
• Sync
• Delay_Req
• Follow_Up
• Delay_Resp
After this sequence, the slave possesses all four timestamps. These timestamps can be used to compute the offset of the slave clock
relative to the master, and the mean propagation time of messages between the two clocks.
The offset calculation is based on the assumption that the time for the message to propagate from master to slave is the same as the
time required from slave to master. This assumption is not always valid on an Ethernet network due to asymmetrical packet delay
times.
4
Figure 2: Detailed Steps—Boundary Clock Synchronization
5
4. Port 2 returns timestamps t2 and t3 in the Pdelay_Resp and Pdelay_Resp_Follow_Up messages respectively.
5. Port 1 generates timestamp t4 after receiving the Pdelay_Resp message. Port 1 then uses the four timestamps (t1, t2, t3, and t4)
to calculate the mean link delay.
In addition to identifying the best master clock, the BMCA also ensures that clock conflicts do not occur on the PTP network by
ensuring that:
6
• Clocks do not have to negotiate with one another
• There is no misconfiguration, such as two master clocks or no master clocks, as a result of the master clock identification process
PTP Clocks
A PTP network is made up of PTP-enabled devices and devices that are not using PTP. The PTP-enabled devices typically consist
of the following clock types.
Grandmaster Clock
Within a PTP domain, the grandmaster clock is the primary source of time for clock synchronization using PTP. The grandmaster
clock usually has a very precise time source, such as a GPS or atomic clock. When the network does not require any external time
reference and only needs to be synchronized internally, the grandmaster clock can free run.
Ordinary Clock
An ordinary clock is a PTP clock with a single PTP port. It functions as a node in a PTP network and can be selected by the BMCA
as a master or slave within a subdomain. Ordinary clocks are the most common clock type on a PTP network because they are used
as end nodes on a network that is connected to devices requiring synchronization. Ordinary clocks have various interface to external
devices.
Boundary Clock
A boundary clock in a PTP network operates in place of a standard network switch or router. Boundary clocks have more than one
PTP port, and each port provides access to a separate PTP communication path. Boundary clocks provide an interface between PTP
domains. They intercept and process all PTP messages, and pass all other network traffic. The boundary clock uses the BMCA to
select the best clock seen by any port. The selected port is then set as a slave. The master port synchronizes the clocks connected
downstream, while the slave port synchronizes with the upstream master clock.
Transparent Clock
The role of transparent clocks in a PTP network is to update the time-interval field that is part of the PTP event message. This update
compensates for switch delay and has an accuracy of within one picosecond.
There are two types of transparent clocks:
End-to-end (E2E) transparent clocks measure the PTP event message transit time (also known as resident time ) for SYNC and
DELAY_REQUEST messages. This measured transit time is added to a data field (correction field) in the corresponding messages:
• The measured transit time of a SYNC message is added to the correction field of the corresponding SYNC or the FOLLOW_UP
message.
• The measured transit time of a DELAY_REQUEST message is added to the correction field of the corresponding
DELAY_RESPONSE message.
The slave uses this information when determining the offset between the slave’s and the master’s time. E2E transparent clocks do
not provide correction for the propagation delay of the link itself.
Peer-to-peer (P2P) transparent clocks measure PTP event message transit time in the same way E2E transparent clocks do, as
described above. In addition, P2P transparent clocks measure the upstream link delay. The upstream link delay is the estimated packet
propagation delay between the upstream neighbor P2P transparent clock and the P2P transparent clock under consideration.
7
These two times (message transit time and upstream link delay time) are both added to the correction field of the PTP event message,
and the correction field of the message received by the slave contains the sum of all link delays. In theory, this is the total end-to-end
delay (from master to slave) of the SYNC packet.
The following figure illustrates PTP clocks in a master-slave hierarchy within a PTP network.
Figure 4: PTP Clock Hierarchy
PTP Profiles
This section describes the following PTP profiles available on the switch:
• Power Profile
• Default Profile
• 802.1AS Profile (IE 4000 only)
The Power Profile is defined in PC37.238 - IEEE Draft Standard Profile for Use of IEEE 1588 Precision Time Protocol in Power
System Applications. This switch documentation uses the terms Power Profile mode and Default Profile mode when referring to this
IEEE 1588 profile and its associated configuration values.
The IEEE 1588 definition of a PTP profile is the set of allowed PTP features applicable to a device. A PTP profile is usually specific
to a particular type of application or environment and defines the following values:
• Best master clock algorithm options
• Configuration management options
• Path delay mechanisms (peer delay or delay request-response)
• Range and default values of all PTP configurable attributes and data set members
• Transport mechanisms that are required, permitted, or prohibited
• Node types that are required, permitted, or prohibited
• Options that are required, permitted, or prohibited
8
• The PTP mode of transport is Layer 3.
• The supported transparent clock mode is end-to-end (E2E).
Table 1: Configuration Values for the IEEE PTP Power Profile and Switch Modes , on page 9 lists the configuration values for the
switch in Default Profile mode.
The following table lists the configuration values defined by the IEEE 1588 Power Profile and the values that the switch uses for
each PTP profile mode.
Table 1: Configuration Values for the IEEE PTP Power Profile and Switch Modes
Message transmission Ethernet 802.3 with Ethertype Access Ports–Untagged Layer Layer 3 packets. By default,
0X88F7. PTP messages are sent 2 packets. Trunk Ports–802.1Q 802.1q tagging is disabled.
as 802.1Q tagged Ethernet tagged Layer 2 packets with
frames with a default VLAN 0 native VLAN on the port and
and default priority 4. default priority value of 4.
Domain number 0. 0. 0.
Path delay calculation Peer-to-peer transparent clocks. Peer-to-peer transparent clocks End-to-end transparent clocks
using the peer_delay using the delay_request
mechanism. mechanism.
9
PTP Field Power Profile Value Switch Configuration Value
Grandmaster ID and local time PTP-specific TLV (type, length, PTP-specific TLV to indicate PTP-specific type, length, and
determination value) to indicate Grandmaster Grandmaster ID. value to indicate Grandmaster
ID. ID.
Time accuracy over network Over 16 hops, slave device Over 16 hops, slave device Not applicable in this mode.
hops synchronization accuracy is synchronization accuracy is
within 1 usec (1 microsecond). within 1 usec (1 microsecond).
1
Epoch = Elapsed time since epoch start.
Trunk Port vlan dot1q tag Switch tags packets 7 Switch tags packets 7
native enabled
Trunk Port vlan dot1q tag PTP software tags 4 Untagged None
native disabled packets
Forward Mode
A switch configured for forward mode passes incoming PTP packets as normal multicast traffic.
10
E2E Transparent Clock Mode
A switch configured for end-to-end transparent clock mode does not synchronize its clock with the master clock. A switch in this
mode does not participate in master clock selection and uses the default PTP clock mode on all ports.
Note With the adaptive filter, the switch does not meet the time performance requirements specified in ITU-T G.8261.
Adaptive mode (ptp transfer filter adaptive) is not available in Power Profile mode.
For configuration information, see Configuring PTP on the Switch, on page 14 .
Prerequisites
Review Information About Precision Time Protocol , on page 2 and Guidelines and Limitations, on page 11.
PTP Messages
• The Cisco PTP implementation supports only the two-step clock and not the one-step clock. If the switch receives a one-step
message from the Grand Master Clock, it will convert it into a two-step message.
• Cisco PTP supports multicast PTP messages only.
11
PTP Mode and Profile
• The switch and the grandmaster clock must be in the same PTP domain.
• When Power Profile mode is enabled, the switch drops the PTP announce messages that do not include these two Type, Length,
Value (TLV) message extensions: Organization_extension and Alternate_timescale .
If the grandmaster clock is not compliant with PTP and sends announce messages without these TLVs, configure the switch to
process the announce message by entering the ptp allow-without-tlv command.
Refer to Configuring PTP Power Profile Mode on the Switch, on page 14 for a complete description of this command.
• When the switch is in Power Profile mode, only the peer_delay mechanism is supported.
To change to Boundary Clock Mode, on page 10 and the peer_delay mechanism, enter the ptp mode boundary pdelay-req
command.
• To disable Power Profile mode and return the switch to E2E Transparent Clock Mode, on page 11, enter the no ptp profile
power command.
Refer to Configuring Default Profile Mode on the Switch, on page 17 for a complete description of this command.
• In Default Profile mode, only the delay_request mechanism is supported.
To change to Boundary Clock Mode, on page 10 with the delay_request mechanism, enter the ptp mode boundary delay-req
command.
Packet Format
• The packet format for PTP messages can be 802.1q tagged packets or untagged packets.
• The switch does not support 802.1q QinQ tunneling.
• In switch Power Profile mode:
• When the PTP interface is configured as an access port, PTP messages are sent as untagged, Layer 2 packets.
• When the PTP interface is configured as a trunk port, PTP packets are sent as 802.1q tagged Layer 2 packets over the port
native VLAN.
VLAN Configuration
• Sets the PTP VLAN on a trunk port. The range is from 1 to 4094. The default is the native VLAN of the trunk port.
• In boundary mode, only PTP packets in PTP VLAN will be processed, PTP packets from other VLANs will be dropped.
• Before configuring the PTP VLAN on an interface, the PTP VLAN must be created and allowed on the trunk port.
• Most grandmaster clocks use the default VLAN 0. In Power Profile mode, the switch default VLAN is VLAN 1 and VLAN 0
is reserved. When you change the default grandmaster clock VLAN, it must be changed to a VLAN other than 0.
• When VLAN is disabled on the grandmaster clock, the PTP interface must be configured as an access port.
12
Clock Configuration
• All PHY PTP clocks are synchronized to the grandmaster clock. The switch system clock is not synchronized as part of PTP
configuration and processes.
• When VLAN is enabled on the grandmaster clock, it must be in the same VLAN as the native VLAN of the PTP port on the
switch.
• Grandmaster clocks can drop untagged PTP messages when a VLAN is configured on the grandmaster clock. To force the switch
to send tagged packets to the grandmaster clock, enter the global vlan dot1q tag native command.
Clock Modes
Note The 802.1AS profile does not have a clock mode setting.
• Forward Mode
• You can enable this mode when the switch is in Power Profile Mode, on page 9 (Layer 2) or in Default Profile Mode, on
page 8 (Layer 3).
• When the switch is in Forward mode, the only global configuration available is the CLI command to switch to a different
PTP mode (that is, boundary, e2etransparent, or p2ptransparent).
PDV Filtering
Adaptive mode (ptp transfer filter adaptive) is not available in Power Profile mode.
13
• boundary
Default Settings
• PTP is enabled on the switch by default.
• By default, the switch uses configuration values defined in the PTP Power Profile (Power Profile mode is enabled).
• The switch default PTP clock mode is P2P Transparent Clock Mode, on page 11
.
• The default BC synchronization algorithm is linear filter.
-1 2 -1 1/2
0 20 1
Procedure
14
Step 3 Specify the synchronization clock mode:
ptp mode {boundary pdelay-req | p2ptransparent | forward}
• mode boundary pdelay-req—Configures the switch for boundary clock mode using the delay-request mechanism.
In this mode, the switch participates in the selection of the most accurate master clock. Use this mode when
overload or heavy load conditions produce significant delay jitter.
• mode p2ptransparent—Configures the switch for peer-to-peer transparent clock mode and synchronizes all switch
ports with the master clock. The link delay time between the participating PTP ports and the message transit time
is added to the resident time. Use this mode to reduce jitter and error accumulation. This is the default in Power
Profile mode.
• mode forward—Configures the switch to pass incoming PTP packets as normal multicast traffic.
Preserving the time properties prevents slave clocks from detecting a variance in the time values when the redundant
GMC comes out of standby.
15
Step 10 (Optional) Enter interface configuration mode:
interface interface-id
Example
The following example configures the switch for P2P transparent mode, specifies allow-without-tlv PTP message processing,
and uses default values for all PTP interval settings:
The following example configures the switch for boundary clock mode using the peer delay request (pdelay-req) mechanism
and uses default values for all PTP interval settings:
16
Configuring Default Profile Mode on the Switch
This section describes how to configure the switch to operate in Default Profile mode.
When the grandmaster clock requires tagged packets, make one of the following configuration changes:
• Force the switch to send tagged frames by entering the global vlan dot1q tag native command.
• Configure the grandmaster clock to send and receive untagged packets. If you make this configuration change on the grandmaster
clock, you can configure the switch port as an access port.
These are some guidelines for configuring the Default Profile on the switch:
• When you enter no with PTP port configuration commands, the specified port property is set to the default value.
• To determine the value in seconds for the ptp global command interval variable, use a logarithmic scale. Below are examples
of the interval variable value converted to seconds with a logarithmic scale:
-1 2 -1 1/2
0 20 1
Procedure
Step 2 Configure the switch for Default Profile mode when the switch is in Power Profile mode. If the switch is already in
Default Profile mode, this command has no effect.
no ptp profile power
17
• mode e2etransparent—Configures the switch for end-to-end transparent clock mode. A switch clock in this mode
synchronizes all switch ports with the master clock. This switch does not participate in master clock selection and
uses the default PTP clock mode on all ports. This is the default clock mode. The message transit time is added
to the resident time. Use this mode to reduce jitter and error accumulation.
• mode forward—Configures the switch to pass incoming PTP packets as normal multicast traffic.
Preserving the time properties prevents slave clocks from detecting a variance in the time values when the redundant
GMC comes out of standby.
18
ptp {enable | sync {interval value | limit value}}
• announce interval value—Sets the logarithmic mean interval in seconds to send announce messages. The range
is 0 to 4. The default is 1 (2 seconds).
• announce timeout value— Sets the logarithmic mean interval in seconds to announce timeout messages. The
range is 2 to 10. The default is 3 (8 seconds).
• delay-req interval value—Sets the logarithmic mean interval in seconds for slave devices to send delay request
messages when the port is in the master clock state. The range is -2 to 6. The default is -5 (1 packet every 1/32
seconds, or 32 packets per second).
• enable—Enables PTP on the port base module.
• sync interval value—Sets the logarithmic mean interval in seconds to send synchronization messages. The range
is –2 to 1. The default is 1 second.
• sync limit value—Sets the maximum clock offset value before PTP attempts to resynchronize. The range is from
50 to 500000000 nanoseconds. The default is 500000000 nanoseconds.
• vlan value—Sets the PTP VLAN on a trunk port. The range is from 1 to 4094. The default is the native VLAN
of the trunk port. In boundary mode, only PTP packets in PTP VLAN will be processed, PTP packets from other
VLANs will be dropped. Before configuring the PTP VLAN on an interface, the PTP VLAN must be created and
allowed on the trunk port.
Example
The following example configures the switch to operate in Default Profile mode and end-to-end transparent mode and uses
default values for all PTP interval settings:
The following example configures the switch for Default Profile mode and boundary clock mode with the delay_request
mechanism, and uses default values for all PTP interval settings:
19
Verifying Configuration
Command Purpose
20
Empty
Interface FastEthernet0/4
Empty
Interface FastEthernet0/5
Empty
Interface FastEthernet0/6
Empty
Interface FastEthernet0/7
Empty
Interface FastEthernet0/8
Empty
Interface FastEthernet0/9
Empty
Interface FastEthernet0/10
Empty
Interface FastEthernet0/11
Empty
Interface FastEthernet0/12
Empty
Interface FastEthernet0/13
Empty
Interface FastEthernet0/14
Empty
Interface FastEthernet0/15
Empty
Interface FastEthernet0/16
Empty
Interface FastEthernet0/17
Empty
Interface FastEthernet0/18
Empty
Interface FastEthernet0/19
Empty
Interface FastEthernet0/20
Empty
Interface FastEthernet0/21
Empty
Interface FastEthernet0/22
Empty
Interface FastEthernet0/23
Empty
Interface FastEthernet0/24
Foreign master port identity: clock id: 0xA4:C:C3:FF:FE:BF:B4:0
Foreign master port identity: port num: 23
Number of Announce messages: 4
Message received port: 24
Time stamps: 2718923059, 2717917723
Interface GigabitEthernet0/1
Empty
Interface GigabitEthernet0/2
Empty
switch#
switch# show ptp ?
clock show ptp clock information
foreign-master-record show PTP foreign master records
parent show PTP parent properties
port show PTP port properties
time-property show PTP clock time property
switch# show ptp time-property
PTP CLOCK TIME PROPERTY
Current UTC offset valid: 0
Current UTC offset: 35
Leap 59: 0
Leap 61: 0
21
Time Traceable: 16
Frequency Traceable: 32
PTP Timescale: 1
Time Source: Internal Osciliator
Time Property Persistence: 300 seconds
switch# show ptp port FastEthernet 0/23
PTP PORT DATASET: FastEthernet0/23
Port identity: clock identity: 0xA4:C:C3:FF:FE:BF:E0:80
Port identity: port number: 23
PTP version: 2
Port state: MASTER
Delay request interval(log mean): 5
Announce receipt time out: 3
Peer mean path delay(ns): 507
Announce interval(log mean): 0
Sync interval(log mean): 0
Delay Mechanism: Peer to Peer
Peer delay request interval(log mean): 0
Sync fault limit: 500000000
switch# show ptp port FastEthernet 0/24
PTP PORT DATASET: FastEthernet0/24
Port identity: clock identity: 0xA4:C:C3:FF:FE:BF:E0:80
Port identity: port number: 24
PTP version: 2
Port state: SLAVE
Delay request interval(log mean): 5
Announce receipt time out: 3
Peer mean path delay(ns): 745
Announce interval(log mean): 0
Sync interval(log mean): 0
Delay Mechanism: Peer to Peer
Peer delay request interval(log mean): 0
Sync fault limit: 500000000
switch#
Configuration Example
The following example configures the switch for P2P transparent mode, specifies allow-without-tlv PTP message processing, and
uses default values for all PTP interval settings:
The following example configures the switch for boundary clock mode using the peer delay request (pdelay-req) mechanism and
uses default values for all PTP interval settings:
The following example configures the switch to operate in Default Profile mode and end-to-end transparent mode and uses default
values for all PTP interval settings:
The following example configures the switch for Default Profile mode and boundary clock mode with the delay_request mechanism,
and uses default values for all PTP interval settings:
22
Related Documents
• Cisco CGS 2520 switch product documentation:
www.cisco.com/go/cgs2520
• Cisco Connected Grid Ethernet Switch Module Interface Card Software Configuration Guide
• Cisco IE 2000U switch product documentation:
Cisco Industrial Ethernet 2000U Series Switches
Feature History
Feature Name Release Feature Information
Time Service Enhancements 15.2(4)EA Addition of support for Feedforward BC and PDV Filtering.
Precision Time Protocol 15.0(2)EK Addition of support for Default Profile Mode and End-to-End Transparent
Clock Mode on the IE 2000U.
12.2(58)Y and 15.0(2)SE Initial support of the feature on the CGS 2520.
23
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: www.cisco.com
go trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any
other company. (1721R)
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network
topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional
and coincidental.
© 2014–2018 Cisco Systems, Inc. All rights reserved.
Americas Headquarters Asia Pacific Headquarters Europe Headquarters
Cisco Systems, Inc. CiscoSystems(USA)Pte.Ltd. CiscoSystemsInternationalBV
San Jose, CA 95134-1706 Singapore Amsterdam,TheNetherlands
USA
Cisco has more than 200 offices worldwide. Addresses, phone numbers, and fax numbers are listed on the
Cisco Website at www.cisco.com/go/offices.