Time Slave Component Requirements#
Time Slave Requirements
|
status: valid
security: NO
safety: QM
|
||||
Functional Requirements#
Initialization and Lifecycle#
Component Startup
|
status: valid
security: NO
safety: QM
|
||||
On startup the time_slave component shall determine its configuration, initialize the gPTP engine and IPC publisher, bind to the configured network interface, and attempt to enable hardware timestamping on the network interface during initialization. Any (unrecoverable) error shall terminate the startup procedure and end the time_slave process. |
|||||
Component Configuration
|
status: valid
security: NO
safety: QM
|
||||
If the defined file is not present or its parsing fails (due to malformed content), a warning shall be generated and predefined default values shall be used for the configuration items. Likewise, if certain configuration items are missing in the file, their predefined default values shall be used. |
|||||
Component Shutdown
|
status: valid
security: NO
safety: QM
|
||||
On receiving a stop signal the time_slave component shall stop message processing threads, close network sockets, and release IPC resources. |
|||||
gPTP Message Processing#
Domain Number Filtering
|
status: valid
security: NO
safety: QM
|
||||
According to IEEE 802.1AS, the time_slave component shall only process received gPTP Sync and FollowUp messages matching the configured domain number (0-127 per IEEE 802.1AS). The time_slave component shall ignore the domain number contained in received gPTP Pdelay messages. It shall set the domain number to 0 in sent gPTP Pdelay messages (see IEEE 802.1AS-2011, section 8.1 and IEEE 802.1AS-2020, section 11.1.2, 2nd paragraph). |
|||||
Ethernet address usage
|
status: valid
security: NO
safety: QM
|
||||
The time_slave component shall receive the IEEE 802.1AS messages Sync, Follow_Up, PdelayReq, Pdelay_Resp, and Pdelay_Resp_Follow_Up sent to the Ethernet address specified in the IEEE 801.1AS standard. It shall send outgoing Pdelay messages (Pdelay_Req, Pdelay_Resp, and Pdelay_Resp_Follow_Up) to the same address. |
|||||
Sync Message Reception
|
status: valid
security: NO
safety: QM
|
||||
The time_slave component shall receive IEEE 802.1AS Sync messages from the network Grand Master via the IEEE 802.1AS-specified Ethernet address and determine the receive timestamp using hardware timestamping when available, otherwise using software timestamping as a fallback. |
|||||
Follow_Up Message Processing
|
status: valid
security: NO
safety: QM
|
||||
The time_slave component shall process IEEE 802.1AS Follow_Up messages, match them to the corresponding Sync message by sequence ID, and extract the precise origin timestamp. |
|||||
Offset Calculation
|
status: valid
security: NO
safety: QM
|
||||
The time_slave component shall compute the clock offset as the difference between the local receive timestamp and the Grand Master origin timestamp, accounting for the correction fields from both the Sync and Follow_Up messages per IEEE 802.1AS. |
|||||
PDelayReq Transmission
|
status: valid
security: NO
safety: QM
|
||||
After the configured initial warmup delay (default: 2000 milliseconds), the time_slave component shall periodically transmit IEEE 802.1AS PDelayReq messages at the configured interval (default: 1000 milliseconds) and record the transmit timestamp. |
|||||
PDelayReq Response
|
status: valid
security: NO
safety: QM
|
||||
The time_slave component shall receive IEEE 802.1AS PDelayReq messages from peer nodes, record the receive timestamp, and respond with PDelayResp and PDelayRespFollowUp messages containing the requestReceiptTimestamp and responseOriginTimestamp per IEEE 802.1AS peer delay mechanism. |
|||||
PDelayResp Message Reception
|
status: valid
security: NO
safety: QM
|
||||
The time_slave component shall receive IEEE 802.1AS PDelayResp messages in response to transmitted PDelayReq messages and extract the requestReceiptTimestamp from the message. |
|||||
PDelayRespFollowUp Message Reception
|
status: valid
security: NO
safety: QM
|
||||
The time_slave component shall receive IEEE 802.1AS PDelayRespFollowUp messages, match them to the corresponding PDelayResp message by sequence ID, and extract the responseOriginTimestamp. |
|||||
Peer Delay Computation
|
status: valid
security: NO
safety: QM
|
||||
The time_slave component shall compute network propagation delay from PDelayResp and PDelayRespFollowUp timestamps using the IEEE 802.1AS propagation delay formula: ((t4 - t1) - (t3 - t2)) / 2, where t2 is the requestReceiptTimestamp and t3 is the responseOriginTimestamp each corrected by the correctionField of the corresponding PdelayResp or PdelayRespFollowUp message. |
|||||
Clock Synchronization#
PHC Offset Adjustment
|
status: valid
security: NO
safety: QM
|
||||
The time_slave component shall step-adjust the PTP hardware clock (PHC - the network interface hardware clock used for timestamping per IEEE 1588/802.1AS) offset when the absolute value of the computed offset exceeds the configured step threshold (configurable, default 1 second). |
|||||
PHC Frequency Adjustment
|
status: valid
security: NO
safety: QM
|
||||
The time_slave component shall slew-adjust the PTP hardware clock frequency based on the neighbor rate ratio computed from consecutive Sync/Follow_Up pairs with positive time intervals per IEEE 802.1AS Clause 11.4.1. |
|||||
Data Publishing#
Time Sync Data Publishing
|
status: valid
security: NO
safety: QM
|
||||
The time_slave component shall publish synchronized time data (PTP assumed time, offset correction, rate deviation, peer delay, status flags) via the ts_client IPC interface at a fixed interval of 50 milliseconds to provide consistent read latency for VehicleTime clients. |
|||||
Platform Abstraction#
Platform Support
|
status: valid
security: NO
safety: QM
|
||||
The time_slave component shall support POSIX and QNX 8.0 SDP platforms for Ethernet frame transmission/reception with hardware timestamping and PTP hardware clock control. |
|||||
Error Handling#
Error Reporting
|
status: valid
security: NO
safety: QM
|
||||
The time_slave component shall log messages via the score::mw::log interface when initialization fails (error level), network operations fail (error level), protocol errors occur (error level), or hardware timestamping is unavailable (warning level). |
|||||
Diagnostics and Debugging#
Synchronization Diagnostics
|
status: valid
security: NO
safety: QM
|
||||
The time_slave component shall provide optional runtime instrumentation to record gPTP synchronization events (peer delay completion, offset thresholds, time leaps) to a CSV file for debugging and diagnostics when enabled via the GptpEngineOptions diagnostics configuration parameter. |
|||||
Assumption of Use Requirements#
Network Interface Configuration
|
status: valid
security: NO
safety: QM
|
||||
The user shall configure a network interface and ensure the interface has an assigned link-layer address and the link is operationally up (IFF_UP and IFF_RUNNING flags set) before starting time_slave. |
|||||
Single Instance per Interface
|
status: valid
security: NO
safety: QM
|
||||
The user shall run exactly one time_slave instance only. Multiple instances are not supported and will cause failures or conflicts on the single IPC interface to the TimeDaemon. |
|||||
Hardware Timestamping Support
|
status: valid
security: NO
safety: QM
|
||||
If the user has high demands regarding the synchronization accuracy and precision, they must configure a NIC providing hardware timestamping and driver software support. |
|||||