# PTP

## 1. Function Overview

PTP (Precision Time Protocol) is a protocol for synchronizing the time of multiple devices in measurement and control systems with high accuracy on the nanosecond timescale.
Time is synchronized by sending and receiving PTP messages between a time transmitter clock, which distributes the reference time within the network, and a time receiver clock, which synchronizes with the distributed time.
If a PTP-incompatible switch is used to relay the time transmitter clock and time receiver clock, the forwarded PTP message will arrive at each device with a delay equal to the time it took the switch to forward the message (relay delay time).
In order to synchronize time with high precision, this relay delay time cannot be ignored.

- In relaying with a PTP-incompatible switch

In relaying with a PTP-compatible switch, the relay delay time of the switch is added to the PTP message to be forwarded by the switch. Therefore, the receiving device can correct the time including the relay delay time of the switch.
Such devices are called transparent clocks (TCs).

- In relaying with a PTP-compatible switch

In addition to relaying, the switch itself also functions as both a time transmitter clock and a time receiver clock, allowing it to synchronize with the time transmitter clock on one port and distribute the time to the time receiver clock on another port.
Such a device is called a boundary clock (BC).
In this case, if synchronization with the time transmitter clock is complete, the time can continue to be distributed to the time receiver clock with a certain degree of accuracy even if the time transmitter clock is temporarily disconnected.

- When synchronizing and distributing time using a PTP-compatible switch

This product supports PTPv2 (IEEE1588-2008).

The transparent clock of this product can only be used in configurations that employ the 1-step or 2-step end-to-end mechanism.

The boundary clock of this product can only be used in configurations employing an end-to-end mechanism. Even in configurations without a Grandmaster clock, it can function as a time transmitter clock using the machine’s own clock.

The transparent clock and boundary clock of this product do not work in a configuration that uses the peer-to-peer mechanism.

## 2. Definition of Terms Used

Time Transmitter Clock

A PTP-compatible device that distributes the reference time with which PTP-compatible devices on the communication path are synchronized.

Time Receiver Clock

A PTP-compatible device that synchronizes with the time distributed by a time transmitter clock.

Transparent Clock (TC)

A device that measures the time taken for a PTP message to pass through the device and reflects that information in the PTP message before relaying it.

Boundary Clock (BC)

A device that combines the functions of a time transmitter clock and a time receiver clock. It synchronizes with the time distributed from the upstream time transmitter clock and distributes the time to the downstream time receiver clock.

End-to-end Mechanism (E2E)

A mechanism for measuring the transmission delay time between a time transmitter clock and a time receiver clock.
The boundary clock measures the transmission delay time between the opposing device and each port as a time transmitter clock or a time receiver clock.
The transparent clock adds only the relay delay time to the PTP message when it is transmitted.

1-step

A method of acquiring time information when sending a PTP message and notifying of the time information with the same message.

Two Steps

A method of saving time information when sending a PTP message and notifying the time information in a separate message.

Best Time Transmitter Clock Algorithm (BTCA)

An algorithm for selecting the best clock from multiple time transmitter clocks.

## 3. Function Details

This product supports the following functions.

- Setting the operation mode

- Setting the PTP message transport protocol

- Setting the clock priority

- Configuring the clock domain number

- Setting the PTP message transmission interval

- Setting the PTP message reception timeout

- Setting the VLAN used to send and receive PTP messages

### 3.1. Set the operation mode

This product provides transparent clock and boundary clock functions compatible with PTPv2 (IEEE1588-2008).
When the operation mode is set to transparent clock, the delay time generated inside the switch is added to the Sync message and Delay_Request message that pass through the switch.
When the operation mode is set to boundary clock, the internal clock of the switch is synchronized with the time transmitter clock. The switch also uses its internal clock to distribute time to the time receiver clock.
The operation mode is set using the ptp mode command.

### 3.2. Setting the PTP message transport protocol

PTP messages can be forwarded using a variety of frame formats.
For switches to correctly process PTP messages, they must use the same frame format as the time transmitter clock and time receiver clock.
This product supports IPv4 UDP, IPv6 UDP, and L2 Ether frames.
You can set the transport protocol with the ptp transport protocol command.

### 3.3. Setting the clock priority

When multiple time transmitter clocks exist, PTP uses the best time transmitter clock algorithm to determine which clock should be synchronized.
The parameters compared in the best time transmitter clock algorithm include priority1 and priority2, so you must set these values to control the priorities to ensure the desired selection.
In the boundary clock mode of this product, the clock priority can be changed within the range of 0 to 255.
The clock priority is set using the ptp priority1 and ptp priority2 commands.

### 3.4. Configuring the clock domain number

A domain is a logical group of PTP-enabled devices that interact with each other to synchronize time.
For PTP-compatible devices to synchronize correctly, the domain numbers, which are domain identifiers, must match.
In the boundary clock mode of this product, the clock domain number can be changed within the range of 0 to 127.
The clock domain number is set with the ptp domain command.

### 3.5. Setting the PTP message transmission interval

PTP-compatible devices periodically transmit multiple PTP messages according to their respective roles.
The transmission interval is standardized within the domain for each PTP message, and each device must adhere to this transmission interval.
In the boundary clock mode of this product, the transmission interval for each PTP message is set to the values shown in the table below.

- Setting Value and Transmission Interval Correspondence Table

  Setting value | -4 | -3 | -2 | -1 | 0 | 1 | 2 | 3 | 4
  --- | --- | --- | --- | --- | --- | --- | --- | --- | ---
  Transmission interval | 1/16 sec. | 1/8 sec. | 1/4 sec. | 1/2 sec. | 1 sec. | 2 sec. | 4 sec. | 8 sec. | 16 sec.

The transmission interval for Sync messages is set using the ptp sync interval command.
The transmission interval for Delay-Request messages is set using the ptp delay-req interval command.
The transmission interval for Announce messages is set using the ptp announce interval command.

### 3.6. Setting the PTP message reception timeout

PTP-compatible devices have their state transitions affected by the reception status of Announce messages.
The Announce message reception timeout setting specifies the number of times that consecutive Announce messages are tolerated without being received.
In the boundary clock mode of this product, the receive timeout for Announce messages can be changed within the range of 2 to 10.
The Announce message reception timeout is set using the ptp announce timeout-interval command.

### 3.7. Setting the VLAN used to send and receive PTP messages

The boundary clock mode of this product normally operates in native VLAN.
If you want to send and receive PTP messages on a VLAN other than the native VLAN on a trunk port, use the ptp vlan command.

## 4. Supported Profiles

PTP has profiles defined for specific applications and requirements.
A profile is a collection of required options, prohibited options, and the range and default values of configurable attributes.
By using devices that support the profiles defined for each application and matching the settings, you can achieve performance that meets your requirements.
This product supports the following profiles:

### 4.1. Default Profile

This is the basic profile defined in IEEE Std 1588-2008.
The transparent clock of this product supports the Default profile.
The boundary clock also supports the Default profile within the following setting ranges.

Item | Supported setting values | Default profile value
--- | --- | ---
BTCA | Default | -
Transport protocol | Layer2, IPv4, IPv6 | -
Transmission delay measurement mechanism | delay request-responce (E2E) | -
priority1 | 0 - 255 | 128
priority2 | 0 - 255 | 128
Domain number | 0 - 127 | 0
Announce message transmission interval | 0 - 4 | 1
Announce message reception timeout | 2 - 10 | 3
Sync message transmission interval | -1 - 1 | 0
Delay-Request message transmission interval | 0 - 4 | 0

### 4.2. SMPTE Profile

This profile is defined in ST 2059-2:2015 and is intended for the video distribution field.
The transparent clock of this product supports the SMPTE profile.
The boundary clock also supports the SMPTE profile within the following setting ranges.

Item | Supported setting values | Default profile value
--- | --- | ---
BTCA | Default | -
Transport protocol | IPv4, IPv6 | -
Transmission delay measurement mechanism | delay request-responce (E2E) | -
priority1 | 0 - 255 | 128
priority2 | 0 - 255 | 128
Domain number | 0 - 127 | 127
Announce message transmission interval | -3 - 1 | -2
Announce message reception timeout | 2 - 10 | 3
Sync message transmission interval | -4 - -1 | -3
Delay-Request message transmission interval | -4 - 4 | -3

## 5. Related Commands

Related commands are indicated below.
For details on the commands, refer to the Command Reference.

Operations | Operating commands
--- | ---
Set the PTP for a system | ptp
Set the PTP for an interface | ptp
Set the operation mode | ptp mode
Set the transport protocol for PTP messages | ptp transport protocol
Set PTP Clock Priority 1 | ptp priority1
Setting PTP Clock Priority 2 | ptp priority2
Set the domain number for the PTP clock | ptp domain
Set the PTP Sync message transmission interval | ptp sync interval
Set the PTP Delay-Request message transmission interval | ptp delay-req interval
Set the PTP Announce message transmission interval | ptp announce interval
Set the PTP Announce message reception timeout | ptp announce timeout-interval
Setting the VLAN used to send and receive PTP messages | ptp vlan
Display the system’s PTP setting status | show ptp
Show PTP configuration information for an interface | show ptp interface
Display system clock information | show ptp data
Display the clock information of the interface | show ptp port-data
Display interface statistics | show ptp statistics
Sync-E input port settings | sync-e input-source

## 6. Examples of Command Execution

### 6.1. Setting the end-to-end transparent clock

IPv4 UDP is used as the transport protocol for PTP messages.
Enable the PTP function on the interface to which the time transmitter clock and time receiver clock are connected.
The PTP function of the interface connected to the PTP-incompatible device should be kept disabled.

1. Set the transport protocol for PTP messages to IPv4 UDP.

       Yamaha(config)#ptp transport protocol ipv4-udp

2. Enable the PTP function for the system.

       Yamaha(config)#ptp enable

3. Enable the PTP function for the interface.

       Yamaha(config)#interface port1.1
       Yamaha(config-if)#ptp enable (1)
       Yamaha(config-if)#exit
       Yamaha(config)#interface port1.7
       Yamaha(config-if)#ptp enable (2)
       Yamaha(config-if)#exit
       Yamaha(config)#interface port1.8
       Yamaha(config-if)#ptp enable (3)
       Yamaha(config-if)#exit

   1 | Enable the PTP function for port1.1
   2 | Enable the PTP function for port1.7
   3 | Enable the PTP function for port1.8

4. Check the PTP settings.

       Yamaha#show ptp
         PTP State                 : Enabled
         PTP Mode                  : Transparent Clock
         Delay Mechanism           : End to End
         Step Mode                 : One-step
         Transport Protocol        : UDP (IPv4)

5. Check the PTP settings for the interface.

       Yamaha#show ptp interface
       AI: Anounce Interval     AT: Announce Receipt Timeout
       SI: Sync Interval        DI: Delay Request Interval

       Interface  PTP       AI   AT   SI   DI
       -----------------------------------------
       port1.1    Enable     1    3    0    0
       port1.2    Disable    1    3    0    0
       port1.3    Disable    1    3    0    0
       port1.4    Disable    1    3    0    0
       port1.5    Disable    1    3    0    0
       port1.6    Disable    1    3    0    0
       port1.7    Enable     1    3    0    0
       port1.8    Enable     1    3    0    0

### 6.2. End-to-End Boundary Clock Configuration

Assuming a SMPTE profile (ST 2059-2) configuration, the basic settings are as follows:

- System settings

  - PTP message transfer protocol: IPv4 UDP (default value)

  - Domain number: 127

- Interface settings

  - Sync message transmission interval: -3 (1/8 seconds)

  - Delay-Request message transmission interval: -3 (1/8 seconds)

  - Announce message transmission interval: -2 (1/4 seconds)

  - Announce message reception timeout: 3 (default value)

- VLAN Configuration

  - IP address: 192.168.100.x /24 (x is the same as priority1)

In addition, when a failure occurs in the Grandmaster clock, the switch directly under the Grandmaster clock will have the following priority to become the time transmitter clock.

- Switch #A’s priority1: 10

- Switch #B’s priority1: 20

1. [Switch #A] Set to BC mode.

       Yamaha(config)#ptp mode boundary delay-mechanism e2e

2. [Switch #A] Set the transport protocol to IPv4 UDP.

       Yamaha(config)#ptp transport protocol ipv4-udp

3. [Switch #A] Set the domain number to 127.

       Yamaha(config)#ptp domain 127

4. [Switch #A] Set priority 1 to 10.

       Yamaha(config)#ptp priority1 10

5. [Switch #A] Set the message transmission intervals and reception timeouts for LAN ports #1 and #2, and enable PTP.

       Yamaha(config)#interface port1.1
       Yamaha(config-if)#ptp sync interval -3               ... Syncメッセージの送信間隔を -3 (1/8秒) にする
       Yamaha(config-if)#ptp delay-req interval -3          ... DelayRequestメッセージの送信間隔を -3 (1/8秒) にする
       Yamaha(config-if)#ptp announce interval -2           ... Announceメッセージの送信間隔を -2 (1/4秒) にする
       Yamaha(config-if)#ptp announce timeout-interval 3    ... Announceメッセージの受信タイムアウトを 3 にする
       Yamaha(config-if)#ptp enable
       (上記設定をLANポート #2に対しても行います。)

6. [Switch #A] Set the VLAN IP address.

       Yamaha(config)#interface vlan1
       Yamaha(config-if)#ip address 192.168.100.10/24

7. [Switch #A] Enable the PTP function for the system.

       Yamaha(config-if)#exit
       Yamaha(config)#ptp enable

8. [Switch #B] Set to BC mode.

       Yamaha(config)#ptp mode boundary delay-mechanism e2e

9. [Switch #B] Set the transport protocol to IPv4 UDP.

       Yamaha(config)#ptp transport protocol ipv4-udp

10. [Switch #B] Set the domain number to 127.

        Yamaha(config)#ptp domain 127

11. [Switch #B] Set priority 1 to 20.

        Yamaha(config)#ptp priority1 20

12. [Switch #B] Set the message transmission intervals and reception timeouts for LAN ports #1 and #2, and enable PTP.

        Yamaha(config)#interface port1.1
        Yamaha(config-if)#ptp sync interval -3               ... Syncメッセージの送信間隔を -3 (1/8秒) にする
        Yamaha(config-if)#ptp delay-req interval -3          ... DelayRequestメッセージの送信間隔を -3 (1/8秒) にする
        Yamaha(config-if)#ptp announce interval -2           ... Announceメッセージの送信間隔を -2 (1/4秒) にする
        Yamaha(config-if)#ptp announce timeout-interval 3    ... Announceメッセージの受信タイムアウトを 3 にする
        Yamaha(config-if)#ptp enable
        (上記設定をLANポート #2に対しても行います。)

13. [Switch #B] Configure the VLAN IP address.

        Yamaha(config)#interface vlan1
        Yamaha(config-if)#ip address 192.168.100.20/24

14. [Switch #B] Enable the PTP function for the system.

        Yamaha(config-if)#exit
        Yamaha(config)#ptp enable

15. Connect the LAN cable.

16. [Switch #A] Display the Default Data set of the system clock information and confirm that the domain number and priority 1 settings are reflected.

        Yamaha#show ptp data default
        CLOCK(Boundary Clock)
           Two Step Flag           : Yes
           Clock Identity          : 00:00:5e:ff:fe:00:53:0a
           Number Of Ports         : 30
           Clock Quality
             Class                 : 248
             Accuracy              : 39
             Offset (log variance) : ffff
           Priority1               : 10          ... 10 であることを確認する
           Priority2               : 128
           Domain Number           : 127         ... 127 であることを確認する
           Slave Only              : No

17. [Switch #A] Check the Port State of LAN ports #1 and #2 in the interface clock information.
    If it is currently adjusting to synchronize with the Grandmaster Clock, LAN port #1 will display [PTP_UNCALIBRATED], so wait a while (usually a few seconds) until it synchronizes.
    If synchronization with the Grandmaster Clock is successful, LAN port #1 will display [PTP_TIMERECEIVER] and LAN port #2 will display [PTP_TIMETRANSMITTER].

        Yamaha#show ptp port-data
        ===========================================
        Interface port1.1

          Port State [PTP_TIMERECEIVER]
          Port Clock Identity                      : 00:00:5e:ff:fe:00:53:0a
          Port Number                              : 1
          Mean Path Delay                          : 0
          Announce interval (log base 2)           : -2
          Announce Receipt Timeout                 : 3
          Sync Interval (log base 2)               : -3
          Delay Mechanism                          : End to end
          Delay Request Interval (log base 2)      : -3
          PTP version                              : 2
        ===========================================
        Interface port1.2

          Port State [PTP_TIMETRANSMITTER]
          Port Clock Identity                      : 00:00:5e:ff:fe:00:53:0a
          Port Number                              : 2
          Mean Path Delay                          : 0
          Announce interval (log base 2)           : -2
          Announce Receipt Timeout                 : 3
          Sync Interval (log base 2)               : -3
          Delay Mechanism                          : End to end
          Delay Request Interval (log base 2)      : -3
          PTP version                              : 2

18. [Switch #A] Display the Parent Data set of the system clock information and confirm that the Clock Identity of Parent Port Identity is the clock ID of the Grandmaster clock.
    Also, make sure that the Grandmaster 's Clock Identity is the clock ID of the Grandmaster clock.

        Yamaha#show ptp data parent
        CLOCK(Boundary Clock)
           Parent Port Identity
             Clock Identity                        : 00:00:5e:ff:fe:00:53:00          ... グランドマスタークロックのクロックIDであることを確認する
             Port Number                           : 1
           Parent Stats                            : No
           Observed Parent Offset (log variance)   : ffff
           Observed Parent Clock Phase Change Rate : 7fffffff
           Grandmaster
             Clock Identity                        : 00:00:5e:ff:fe:00:53:00          ... グランドマスタークロックのクロックIDであることを確認する
             Clock Quality
               Class                               : 6
               Accuracy                            : 33
               Offset (log variance)               : ffff
             Priority1                             : 1
             Priority2                             : 128

19. [Switch #A] Display the Current Data set of the system clock information and check the current clock status.
    Offset From timeTransmitter is the time difference from the Grandmaster clock in nanoseconds.
    Mean Path Delay is the average propagation time to and from the Grandmaster clock in nanoseconds.

        Yamaha#show ptp data current
        CLOCK(Boundary Clock)
           Steps Removed      : 1
           Offset From timeTransmitter : -2
           Mean Path Delay    : 52

20. [Switch #B] Display the Default Data set of the system clock information and confirm that the domain number and priority 1 settings are reflected.

        Yamaha#show ptp data default
        CLOCK(Boundary Clock)
           Two Step Flag           : Yes
           Clock Identity          : 00:00:5e:ff:fe:00:53:0b
           Number Of Ports         : 30
           Clock Quality
             Class                 : 248
             Accuracy              : 39
             Offset (log variance) : ffff
           Priority1               : 20          ... 20 であることを確認する
           Priority2               : 128
           Domain Number           : 127         ... 127 であることを確認する
           Slave Only              : No

21. [Switch #B] Check the Port State of LAN ports #1 and #2 using the interface clock information.
    If it is currently adjusting to synchronize with Switch #A, LAN port #1 will display [PTP_UNCALIBRATED], so wait a while (usually a few seconds) until it synchronizes.
    If synchronization with Switch #A is successful, LAN port #1 will display [PTP_TIMERECEIVER] and LAN port #2 will display [PTP_TIMETRANSMITTER].

        Yamaha#show ptp port-data
        ===========================================
        Interface port1.1

          Port State [PTP_TIMERECEIVER]
          Port Clock Identity                      : 00:00:5e:ff:fe:00:53:0b
          Port Number                              : 1
          Mean Path Delay                          : 0
          Announce interval (log base 2)           : -2
          Announce Receipt Timeout                 : 3
          Sync Interval (log base 2)               : -3
          Delay Mechanism                          : End to end
          Delay Request Interval (log base 2)      : -3
          PTP version                              : 2
        ===========================================
        Interface port1.2

          Port State [PTP_TIMETRANSMITTER]
          Port Clock Identity                      : 00:00:5e:ff:fe:00:53:0b
          Port Number                              : 2
          Mean Path Delay                          : 0
          Announce interval (log base 2)           : -2
          Announce Receipt Timeout                 : 3
          Sync Interval (log base 2)               : -3
          Delay Mechanism                          : End to end
          Delay Request Interval (log base 2)      : -3
          PTP version                              : 2

22. [Switch #B] Display the Parent Data set of the system clock information and confirm that the Clock Identity of Parent Port Identity is the clock ID of Switch #A.
    Also, make sure that the Grandmaster 's Clock Identity is the clock ID of the Grandmaster clock.

        Yamaha#show ptp data parent
        CLOCK(Boundary Clock)
           Parent Port Identity
             Clock Identity                        : 00:00:5e:ff:fe:00:53:0a          ... Switch #A のクロックIDであることを確認する
             Port Number                           : 2
           Parent Stats                            : No
           Observed Parent Offset (log variance)   : ffff
           Observed Parent Clock Phase Change Rate : 7fffffff
           Grandmaster
             Clock Identity                        : 00:00:5e:ff:fe:00:53:00          ... グランドマスタークロックのクロックIDであることを確認する
             Clock Quality
               Class                               : 6
               Accuracy                            : 33
               Offset (log variance)               : ffff
             Priority1                             : 1
             Priority2                             : 128

23. [Switch #B] Display the Current Data set of the system clock information to check the current clock status.
    Offset From timeTransmitter is the time difference from Switch #A in nanoseconds.
    Mean Path Delay is the average propagation time to and from Switch #A in nanoseconds.

        Yamaha#show ptp data current
        CLOCK(Boundary Clock)
           Steps Removed      : 2
           Offset From timeTransmitter : 3
           Mean Path Delay    : 127

## 7. Points of Caution

- This function only supports communication speeds of 1G, 10G, 25G, and 100Gbps.

- This function cannot be used in conjunction with the stack function.

- PTPv2 messages are always flooded even if IGMP/MLD snooping is enabled.

- PTPv1 messages are transmissive.

- The boundary clock for this function uses the time obtained from the system at startup as the initial value of the PTP clock, so we recommend that you synchronize the system time in advance using NTP or similar.

- This function does not correct the system time.

- This function is not supported in conjunction with link aggregation.

- For ports where the boundary clock of this function is operating, it is recommended that unnecessary functions not be used in combination as much as possible to ensure accuracy and stable operation.

- It is not recommended to use this function in conjunction with spanning tree.

- This product does not support Sync-E.

## 8. Related Documentation

- PTP

  - IEEE1588-2008

Search result
No more search results.
There are no topics that match your search query.