Why High-frequency trading Systems use PTP instead of NTP?

Photo by Adora Goodenough on Unsplash

Introduction

Unit of time

  • Seconds (s)
  • Milliseconds (ms)
  • Microseconds (µs)
  • Nanoseconds (ns)
1 s   = 1,000 ms  = 1,000,000 µs = 1,000,000,000 ns
0.1 s = 100 ms = 100,000 µs = 100,000,000 ns
0.01 s = 10 ms = 10,000 µs = 10,000,000 ns
0.001 s = 1 ms = 1,000 µs = 1,000,000 ns
0.0001 s = 0.1 ms = 100 µs = 100,000 ns
0.00001 s = 0.01 ms = 10 µs = 10,000 ns
0.000001 s = 0.001 ms = 1 µs = 1,000 ns
  • For 1 second and 10 seconds, 1 second is 10 times faster.
  • For 1ms and 10ms, 1ms is 10 times faster.
  • For 1 microsecond and 10 microseconds, 1 microsecond is 10 times faster

What is NTP?

  • NTP stands for Network Time Protocol.
  • The goal is to achieve synchronization accuracy of a few milliseconds.
  • Sync your device over the internet
  • There is a leap second

leap second

X : 59 : 58
X : 59 : 59
X : 59 : 60 <- leap second
X : 00 : 00
X : 00 : 01

Announced leap seconds to date

2016  Dec 31   +1
2015 Jun 30 +1
2012 Jun 30 +1
2008 Dec 31 +1
2005 Dec 31 +1
1998 Dec 31 +1
1997 Jun 30 +1
1995 Dec 31 +1
1994 Jun 30 +1
1993 Jun 30 +1
(snip)

What is PTP?

  • PTP stands for Precision Time Protocol.
  • Achieved synchronization accuracy in sub-milliseconds, assuming use within a LAN
  • Requires PTP switch(BC mode is generally required)
  • Physical server NIC for hardware synchronization. A virtual guest operating system is not available due to PTP hardware synchronization

PTP Hardware time stamp and Software time stamp

Software time stamp:
PTP synchronizes system with accuracy within tens of milliseconds. This is a way to sync without dedicated hardware.

How to use PTP

(1)Use the PTP service of the data center

(2)Set up a GPS for the data center and set up a GrandMaster

Time synchronization comparison

Time synchronization comparison

Clock synchronization under MIFID II

  • Time reference: Synchronized with UTC (Coordinated Universal Time)
  • Time accuracy (offset from UTC): Within 100 μsec (in the case of high-frequency algorithmic trading)
  • Time particle size (time display digit): 1 μsec or more (in the case of high-frequency algorithmic trading)

http://www.edmae.org/wp-content/uploads/2017/01/EDMA-Briefing-doc-on-MiFID-II-clock-sync-Nov-2016.pdf

Conclusion

References

--

--

Server/Network/Storage at Trading Systems | Low Latency (https://cmdref.net/)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store