Configuring PTP

Principle

The PicOS  supports PTP function since 2.9.2.

Introduction to PTP

On a modern communication network, most telecommunications services require that the frequency offset or time difference between devices is within an acceptable range. To meet this requirement, network clock synchronization must be implemented.

Network clock synchronization includes phase synchronization and frequency synchronization.

Phase synchronization

Phase synchronization, also called time synchronization, refers to the consistency of both frequencies and phases between signals. That is to say, the phase difference between signals is always 0.

Frequency synchronization

Frequency synchronization refers to constant phase difference between signals. It ensures that signals are sent or received at the same rate at a moment so that all devices on the communication network operate at the same rate.

Figure 1 Difference between phase synchronization and frequency synchronization


PTP (Precision Time Protocol) is a time synchronization protocol, which is not only used for high-precision time synchronization between devices, but can also be used to synchronize the frequency between devices. Compared to the existing time synchronization mechanism, PTP has the following advantages:

  • Compared to NTP (Network Time Protocol), PTP can meet the more accurate time synchronization requirements, NTP generally can only achieve sub-second time synchronization accuracy, and PTP can reach sub-microsecond.
  • Compared to GPS (Global Positioning System), PTP has lower construction and maintenance costs, and because it can get rid of the dependence on GPS, it has special meaning in national security.

Basic Concepts

PTP domain

A PTP domain is a logical grouping of clocks that synchronize to each other using the protocol IEEE 1588v2, but that are not necessarily synchronized to clocks in another domain. Each PTP domain is an independent PTP clock synchronization system and has only one clock source.

Clock node

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 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.
    • E2ETC (End-to-End Transparent Clock): forwards packets of non-P2P (non-Peer-to-Peer) types directly on the network and participates in the calculation of the entire link Time.

     E2ETC calculate the residence time of the device, which is the time it takes the event message from ingress port to egress port, then add the calculated residence time to the correctionfield of the event message.

    • P2PTC (Peer-to-Peer Transparent Clock): forwards only Sync messages, Follow_Up messages and Announce messages, and terminates other PTP packets, and participates in the calculation the delay of each link on the entire link.

PTP port

A PTP port is a port running PTP. PTP ports are classified into the following types based on roles:

  • Master port: The port is the source of time on the path served by the port, located on a BC or OC device.
  • Slave port: The port synchronizes to the device on the path with the port that is in the MASTER state, located on a BC or OC device.
  • Passive port: The port is not the master on the path nor does it synchronize to a master. It is an idle port on a BC device and does not receive or send synchronization clock signals.

Master-slave hierarchy

Nodes in a PTP domain establish the master-slave hierarchy for clock synchronization. Master nodes send synchronization clock signals, while slave nodes receive synchronization clock signals. A device may receive synchronization clock signals from an upstream node and then send the synchronization clock signals to a downstream device.
If two clock nodes synchronize time with each other:

  • The node that sends synchronization clock signals is the master node, and the node that receives synchronization clock signals is the slave node.
  • The clock on the master node is the master clock, and the clock on the slave node is the slave clock.
  • The port that sends synchronization clock signals is the master port, and the port that receives synchronization clock signals is the slave port.

Grandmaster clock

All clock nodes in a PTP domain are organized into the master-slave hierarchy. The grandmaster clock (GMC) is at the top of the hierarchy and is the reference clock in the PTP domain. 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.

NOTE:
Currently, devices support only E2ETC function, and uses Sync, Delay_Req and Delay_Resp PTP messages.


Delay Request-Response Mechanism

Figure 2 shows the process of calculating the average link delay and time offset between the master and slave devices using the E2E mechanism.

Figure 2 Delay request-response mechanism


  1. The master sends a Sync message to the slave and notes the time t1 at which it was sent.
  2. The slave receives the Sync message and notes the time of reception t2.
  3. The master conveys to the slave the timestamp t1 by:
    a) Embedding the timestamp t1 in the Sync message. This requires some sort of hardware
    processing for highest accuracy and precision.
    b) Embedding the timestamp t1 in a Follow_Up message.
  4. The slave sends a Delay_Req message to the master and notes the time t3 at which it was sent.
  5. The master receives the Delay_Req message and notes the time of reception t4.

The master conveys to the slave the timestamp t4 by embedding it in a Delay_Resp 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. Then the slave device can 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
Offset = [(t2- t1) + (t3- t4)]/2

Product Support

The table below shows the model and the corresponding switch ASIC that support the PTP function, others do not support.

Switch ASIC 

Model

Trident3AS7726-32X
AS7326-56X
AS5835-54T
AS5835-54X
AS4630-54NPE
AS4630-54PE
S5232F-ON
S5296F-ON
S5248F-ON
S5224F-ON
S5212F-ON
N3248P-ON
N3248TE-ON
N3224P-ON
N3224T-ON
N3224F-ON
N3248PXE-ON
N3224PX-ON
N3248X-ON

Helix4

as4610-30t

as4610_30p

as4610_54t

as4610_54p

Trident2

pronto5101

pronto5401

as6701-32x

as6712-32x

pronto5101

as5712-54x

s4048

arctica4806xp

Trident2Plus

as5812-54t

as5812-54x

Tomahawk

dcs7032q28

z9100

as7312

as7712-32x

PTP Configuration

Configure the device interface as the E2ETC node type, enable the PTP function on the interface, and implement the device to forward the PTP packets directly.

Procedure

Step 1.   Configure the device interface as the E2ETC node type, enable the PTP function on the interface.

set interface gigabit-ethernet <port> ptp mode {e2etransparent | none}

By default, PTP is disabled on an interface.

NOTE:

  • The PTP function can only be configured on the physical interface.
  • On the TC device, PTP must be enabled on all the interfaces that receive and send PTP messages. Otherwise, the PTP function will work inproperly.

Configuration Example

Procedure

Step 1.   Configure the port te-1/1/25 that receiving PTP messages and the port te-1/1/26 that sends PTP packets as E2ETC node.

       admin@Xorplus#set interface gigabit-ethernet te-1/1/25 ptp mode e2etransparent

       admin@Xorplus#set interface gigabit-ethernet te-1/1/26 ptp mode e2etransparent

Step 2.   Verify the configuration.

       After the configuration is complete, run the run show interface detail command to view the configuration of PTP.

     admin@Xorplus# run show interface gigabit-ethernet te-1/1/25 detail
     Physical interface: te-1/1/25, Enabled, error-discard False, Physical link is Down 
     Interface index: 25, Mac Learning Enabled 
     Port mode: access
     Description: 
     Link-level type: Ethernet, MTU: 1514, Speed: Auto, Duplex: Full 
     Source filtering: Disabled, Flow control: Disabled, Auto-negotiation: Enabled 
     Interface flags: Hardware-Down SNMP-Traps Internal: 0x0 
     Interface rate limit ingress:0, egress:0 
     Precision Time Protocol mode:e2etransparent 
     Current address: 48:6e:73:01:00:61, Hardware address: 48:6e:73:01:00:61 
     Traffic statistics: 
     5 sec input rate 0 bits/sec, 0 packets/sec 
     5 sec output rate 0 bits/sec, 0 packets/sec 
       -More- 

Copyright © 2024 Pica8 Inc. All Rights Reserved.