PTP의 정확도(Precision)과 지연(Latency)

1.
DMA서비스를 제공하는 증권사나 선물사는 거의 대부분 PTP서비스를 제공합니다. 이 때 DMA용 매매서버를 구축할 때 ptp설정을 해주어야 합니다. 이와 관련한 글은 Mellanox, Chelsio 카드와 PTP 프로토콜에서 다루었습니다.

최근 ptp때문에 고민하고 있습니다. 질문은 이렇습니다.

A사와 B사 모두 ptp를 이용하여 시간을 동기화합니다.시간상으로 보면 A가 빠른데 체결율은 B사가 빠르네요. 왜 그럴까요?

ptp라고 하지만 ptp도 오차가 있습니다. 오차를 발생하도록 하는 요인을 찾아보면서 눈에 들어온 자료입니다. 조금 옛날 자료입니다만 흥미롭게 읽었습니다.

Delivering Sub-Microsecond Accurate Time to Linux Applications Around the World

자료중 ‘The Four Sources of Time Error’와 관련한 부분입니다.




여기서 Network Path Delay는 금융투자회사가 확인해주어야 할 몫입니다. Master Clock과 매매서버가 어떻게 네트워킹되어 있는지를 파악하여야 합니다. 그렇지만 현실적으로 쉽지않습니다. 두번째는 Linux Stack Delay입니다.

PTP와 관련해서는 Hardware Timestamping과 Software Timestamping으로 나누어 살펴볼 수 있을 듯 합니다. ptp 어플리케이션만 놓고 보면 ptp4l만으로 가능한지, 아니면 php2sys까지 사용하는지에 따라 당연히 지연이 다릅니다. 누구가 짐작하시겠지만 Hardware Timestamping이 지연을 줄여서 좀더 정확한 숫자입니다.

Download (PDF, 2.84MB)

2.
이상과 조금 다른 자료입니다. 2016년 자료입니다. 유명한 Jupiter사의 발표자료입니다.ATIS’ Workshop on Synchronization and Timing Systems (WSTS)에서 발표한 자료네요.

Time Synchronization in Financial Services Industry – A deep dive

자료중 관심은 ‘Precision Timing – Challenges and Architecture solution’입니다. 크게 6가지의 과제를 제시합니다. 이중에서

Challenge 1 – Packet Delay Variation
Challenge 2 – Scale : Number of PTP clients support
Challenge 3 – Number of hops between Grand Master and PTP clients

가 과제인데… 과제라는 말은 정확도에 영향을 미친다는 뜻이겠죠. 첫째는 앞서 자료와 겹치는데 둘째와 셋째는 좀더 현실적인 접근법입니다. 자료중 Boundary Clock (BC)와 Transparent Clock (TC)라는 약어가 나옵니다. 그리고 GM(Grand Master) Clock도 등장합니다. 이와 관련한 설명을 먼저 소개합니다. 저도 생소한 분야라 배웁니다.

The original IEEE 1588-2002 standard for a precision clock synchronization protocol describes Ordinary Clocks, which are either Grandmaster Clocks or Slave Clocks. An Ordinary Clock (OC) always has a single port.

IEEE 1588-2002 also describes Boundary Clocks. A Boundary Clock (BC) is a clock node that has two or more ports. For example, a router or Ethernet switch might be capable of operating as a BC.

A BC generally has one port in the role of a slave clock and the remaining ports in the role of master clocks. In this case, the BC recovers the time of day within the slave clock function and relays it as a reference to the master clock functions.

A practical synchronization network might consist of a Grandmaster Clock, a tree of BCs, and many Slave Clocks.

IEEE 1588-2008 introduces a new type of clock called a Transparent Clock (TC). A TC is a multi-port device that forwards precision time protocol messages, measuring the time taken for event messages to pass through the device, and accounts for this so-called residence time by modifying the message, or by sending a separate follow-up message. The other clocks in the system use the delay measured by the TC to compensate for the additional latency introduced between master and slave clocks. In this sense, the TC can be made to “disappear”, hence the name.

In a typical telecommunications network with “full on-path support” every network node or transmission system must be either a BC or a TC so that the delay through that node or transmission system does not degrade the synchronization performance.

So, which is better? The short answer is that both are capable of very high performance in a synchronization network, and one is not consistently more accurate than the other.

In some applications, a TC is significantly easier to implement because the latency measurements and residence time compensation can be done in hardware, and the node does not need to provide a full slave clock implementation. Also, in a TC there is almost nothing to configure or to tune.

There are also some advantages in using BCs:

The BC can provide a simple synchronization output (for example, one pulse per second) at an intermediate node in a network, allowing an operator to check and calibrate synchronization.
The BC can provide a selection between two or more Grandmaster Clocks in a network with redundancy.
BCs can be used to segment the timing network, providing distributed processing of 1588 protocols, and protecting the Grandmaster from overload.

In PTP 650 and PTP 700 the simpler implementation and ease of configuration make the TC an obvious choice. The Transparent Clock function in PTP 650 and PTP 700 provide accurate and robust correction of residence time with constant time error less than 100 ns per link regardless of traffic load, modulation mode or channel bandwidth, controlled by a simple enable/disable control.

A very attractive approach in a practical precision synchronization network is to use switches or routers functioning as BCs at each major node, interconnected by wireless links operating as TCs. This takes maximum advantages of the two types of node.
IEEE 1588: What’s the difference between a Boundary Clock and Transparent Clock?중에서




Download (PDF, 1.22MB)

결론이 없는 글입니다. 무언가 시험해보고 작업을 해야 하는데 사용자인 입장에선 할 수 있는 일이 없습니다. 금융투자회사가 좀더 고민해서 정확한 정보를 제공해주기 바랄 뿐입니다.

Leave a Comment

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.