connectivity/networking/api/ptp.html · connectivity/networking/api/ptp.rst 공식 원문 ↗

Zephyr 3.7.0 · Connectivity · Networking API

Precision Time Protocol(PTP)

Hardware timestamp를 이용해 network clock을 microsecond 미만 정밀도로 동기화합니다.

Official pathconnectivity/networking/api/ptp.html
Source fileconnectivity/networking/api/ptp.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

IEEE 1588-2019 기반 PTP stack 구성, 지원 clock·transport 기능과 51개 management ID를 정리합니다.

Standard

IEEE 1588-2019

Accuracy

< 1 microsecond

Management

51 TLV IDs

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 6AE859D984C2CB192364C2A40FF3B9AD6EF0FD52BBE834DE27CCCE265289C0CC
.. _ptp_interface:

Precision Time Protocol (PTP)
#############################

.. contents::
    :local:
    :depth: 2

Overview
********

PTP is a network protocol implemented in the application layer, used to synchronize
clocks in a computer network. It's accurate up to less than a microsecond.
The stack supports the protocol and procedures as defined in the `IEEE 1588-2019 standard`_
(IEEE Standard for a Precision Clock Synchronization Protocol
for Networked Measurement and Control Systems). It has multiple profiles,
and can be implemented on top of L2 (Ethernet) or L3 (UDP/IPv4 or UDP/IPv6).
Its accuracy is achieved by using hardware timestamping of the protocol packets.

Zephyr's implementation of PTP stack consist following items:

* PTP stack thread that handles incoming messages and events
* Integration with ptp_clock driver
* PTP stack initialization executed during system init

The implementation automatically creates PTP Ports (each PTP Port corresponds to unique interface).

Supported features
******************

Implementation of the stack doesn't support all features specified in the standard.
In the table below all supported features are listed.

.. csv-table:: Supported features
   :header: Feature, Supported
   :widths: 50,10

    Ordinary Clock, yes
    Boundary Clock, yes
    Transparent Clock,
    Management Node,
    End to end delay mechanism, yes
    Peer to peer delay mechanism,
    Multicast operation mode,
    Hybrid operation mode,
    Unicast operation mode,
    Non-volatile storage,
    UDP IPv4 transport protocol, yes
    UDP IPv6 transport protocol, yes
    IEEE 802.3 (Ethernet) transport protocol,
    Hardware timestamping, yes
    Software timestamping,
    TIME_RECEIVER_ONLY PTP Instance, yes
    TIME_TRANSMITTER_ONLY PTP Instance,

Supported Management messages
*****************************

Based on Table 59 from section 15.5.2.3 of the IEEE 1588-2019 following management TLVs
are supported:

.. csv-table:: Supported management message's IDs
   :header: Management_ID, Management_ID name, Allowed actions
   :widths: 10,40,25

    0x0000, NULL_PTP_MANAGEMENT, GET SET COMMAND
    0x0001, CLOCK_DESCRIPTION, GET
    0x0002, USER_DESCRIPTION, GET
    0x0003, SAVE_IN_NON_VOLATILE_STORAGE, -
    0x0004, RESET_NON_VOLATILE_STORAGE, -
    0x0005, INITIALIZE, -
    0x0006, FAULT_LOG, -
    0x0007, FAULT_LOG_RESET, -
    0x2000, DEFAULT_DATA_SET, GET
    0x2001, CURRENT_DATA_SET, GET
    0x2002, PARENT_DATA_SET, GET
    0x2003, TIME_PROPERTIES_DATA_SET, GET
    0x2004, PORT_DATA_SET, GET
    0x2005, PRIORITY1, GET SET
    0x2006, PRIORITY2, GET SET
    0x2007, DOMAIN, GET SET
    0x2008, TIME_RECEIVER_ONLY, GET SET
    0x2009, LOG_ANNOUNCE_INTERVAL, GET SET
    0x200A, ANNOUNCE_RECEIPT_TIMEOUT, GET SET
    0x200B, LOG_SYNC_INTERVAL, GET SET
    0x200C, VERSION_NUMBER, GET SET
    0x200D, ENABLE_PORT, COMMAND
    0x200E, DISABLE_PORT, COMMAND
    0x200F, TIME, GET SET
    0x2010, CLOCK_ACCURACY, GET SET
    0x2011, UTC_PROPERTIES, GET SET
    0x2012, TRACEBILITY_PROPERTIES, GET SET
    0x2013, TIMESCALE_PROPERTIES, GET SET
    0x2014, UNICAST_NEGOTIATION_ENABLE, -
    0x2015, PATH_TRACE_LIST, -
    0x2016, PATH_TRACE_ENABLE, -
    0x2017, GRANDMASTER_CLUSTER_TABLE, -
    0x2018, UNICAST_TIME_TRANSMITTER_TABLE, -
    0x2019, UNICAST_TIME_TRANSMITTER_MAX_TABLE_SIZE, -
    0x201A, ACCEPTABLE_TIME_TRANSMITTER_TABLE, -
    0x201B, ACCEPTABLE_TIME_TRANSMITTER_TABLE_ENABLED, -
    0x201C, ACCEPTABLE_TIME_TRANSMITTER_MAX_TABLE_SIZE, -
    0x201D, ALTERNATE_TIME_TRANSMITTER, -
    0x201E, ALTERNATE_TIME_OFFSET_ENABLE, -
    0x201F, ALTERNATE_TIME_OFFSET_NAME, -
    0x2020, ALTERNATE_TIME_OFFSET_MAX_KEY, -
    0x2021, ALTERNATE_TIME_OFFSET_PROPERTIES, -
    0x3000, EXTERNAL_PORT_CONFIGURATION_ENABLED,
    0x3001, TIME_TRANSMITTER_ONLY, -
    0x3002, HOLDOVER_UPGRADE_ENABLE, -
    0x3003, EXT_PORT_CONFIG_PORT_DATA_SET, -
    0x4000, TRANSPARENT_CLOCK_DEFAULT_DATA_SET, -
    0x4001, TRANSPARENT_CLOCK_PORT_DATA_SET, -
    0x4002, PRIMARY_DOMAIN, -
    0x6000, DELAY_MECHANISM, GET
    0x6001, LOG_MIN_PDELAY_REQ_INTERVAL, GET SET

Enabling the stack
******************

The following configuration option must me enabled in :file:`prj.conf` file.

- :kconfig:option:`CONFIG_PTP`

Testing
*******

The stack has been informally tested using the
`Linux ptp4l <http://linuxptp.sourceforge.net/>`_ daemons.
The :zephyr:code-sample:`PTP sample application <ptp>` from the Zephyr
source distribution can be used for testing.

.. _IEEE 1588-2019 standard:
   https://standards.ieee.org/ieee/1588/6825/

API Reference
*************

.. doxygengroup:: ptp

Part 3

한국어 전문 번역

개요

PTP는 computer network의 clock을 동기화하는 application layer network protocol이며 microsecond보다 작은 오차까지 정확합니다. Zephyr stack은 networked measurement and control system용 precision clock synchronization protocol인 IEEE 1588-2019 standard의 protocol과 procedure를 지원합니다.

PTP에는 여러 profile이 있으며 L2(Ethernet) 또는 L3(UDP/IPv4나 UDP/IPv6) 위에서 구현할 수 있습니다. Protocol packet의 hardware timestamp를 사용해 높은 정확도를 얻습니다.

Zephyr PTP stack 구현은 다음 요소로 구성됩니다.

  • Incoming message와 event를 처리하는 PTP stack thread
  • ptp_clock driver와의 integration
  • System init 중 실행되는 PTP stack initialization

구현은 PTP Port를 자동 생성하며, 각 PTP Port는 고유한 network interface 하나에 대응합니다.

지원 기능

Stack 구현은 standard에 명시된 모든 기능을 지원하지 않습니다. 지원 여부 전체는 다음 표와 같습니다.

FeatureSupported
Ordinary Clockyes
Boundary Clockyes
Transparent Clock- (미지원)
Management Node- (미지원)
End to end delay mechanismyes
Peer to peer delay mechanism- (미지원)
Multicast operation mode- (미지원)
Hybrid operation mode- (미지원)
Unicast operation mode- (미지원)
Non-volatile storage- (미지원)
UDP IPv4 transport protocolyes
UDP IPv6 transport protocolyes
IEEE 802.3 (Ethernet) transport protocol- (미지원)
Hardware timestampingyes
Software timestamping- (미지원)
TIME_RECEIVER_ONLY PTP Instanceyes
TIME_TRANSMITTER_ONLY PTP Instance- (미지원)

지원 Management message

IEEE 1588-2019 section 15.5.2.3의 Table 59를 기준으로 다음 총 51개 management ID의 TLV를 지원합니다. Allowed actions가 '-'이거나 비어 있는 항목은 현재 action을 제공하지 않습니다.

Management_IDManagement_ID nameAllowed actions
0x0000NULL_PTP_MANAGEMENTGET SET COMMAND
0x0001CLOCK_DESCRIPTIONGET
0x0002USER_DESCRIPTIONGET
0x0003SAVE_IN_NON_VOLATILE_STORAGE-
0x0004RESET_NON_VOLATILE_STORAGE-
0x0005INITIALIZE-
0x0006FAULT_LOG-
0x0007FAULT_LOG_RESET-
0x2000DEFAULT_DATA_SETGET
0x2001CURRENT_DATA_SETGET
0x2002PARENT_DATA_SETGET
0x2003TIME_PROPERTIES_DATA_SETGET
0x2004PORT_DATA_SETGET
0x2005PRIORITY1GET SET
0x2006PRIORITY2GET SET
0x2007DOMAINGET SET
0x2008TIME_RECEIVER_ONLYGET SET
0x2009LOG_ANNOUNCE_INTERVALGET SET
0x200AANNOUNCE_RECEIPT_TIMEOUTGET SET
0x200BLOG_SYNC_INTERVALGET SET
0x200CVERSION_NUMBERGET SET
0x200DENABLE_PORTCOMMAND
0x200EDISABLE_PORTCOMMAND
0x200FTIMEGET SET
0x2010CLOCK_ACCURACYGET SET
0x2011UTC_PROPERTIESGET SET
0x2012TRACEBILITY_PROPERTIESGET SET
0x2013TIMESCALE_PROPERTIESGET SET
0x2014UNICAST_NEGOTIATION_ENABLE-
0x2015PATH_TRACE_LIST-
0x2016PATH_TRACE_ENABLE-
0x2017GRANDMASTER_CLUSTER_TABLE-
0x2018UNICAST_TIME_TRANSMITTER_TABLE-
0x2019UNICAST_TIME_TRANSMITTER_MAX_TABLE_SIZE-
0x201AACCEPTABLE_TIME_TRANSMITTER_TABLE-
0x201BACCEPTABLE_TIME_TRANSMITTER_TABLE_ENABLED-
0x201CACCEPTABLE_TIME_TRANSMITTER_MAX_TABLE_SIZE-
0x201DALTERNATE_TIME_TRANSMITTER-
0x201EALTERNATE_TIME_OFFSET_ENABLE-
0x201FALTERNATE_TIME_OFFSET_NAME-
0x2020ALTERNATE_TIME_OFFSET_MAX_KEY-
0x2021ALTERNATE_TIME_OFFSET_PROPERTIES-
0x3000EXTERNAL_PORT_CONFIGURATION_ENABLED
0x3001TIME_TRANSMITTER_ONLY-
0x3002HOLDOVER_UPGRADE_ENABLE-
0x3003EXT_PORT_CONFIG_PORT_DATA_SET-
0x4000TRANSPARENT_CLOCK_DEFAULT_DATA_SET-
0x4001TRANSPARENT_CLOCK_PORT_DATA_SET-
0x4002PRIMARY_DOMAIN-
0x6000DELAY_MECHANISMGET
0x6001LOG_MIN_PDELAY_REQ_INTERVALGET SET

Stack 활성화

prj.conf에서 CONFIG_PTP를 활성화해야 합니다.

Testing

Stack은 Linux ptp4l daemon으로 비공식 시험되었습니다. Zephyr source distribution의 PTP sample application을 test에 사용할 수 있습니다.

API Reference

Doxygen group ptp가 API reference를 제공합니다.

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.