Why is internet time so critical, and how is it maintained

Why is internet time so critical, and how is it maintained

The right time

We don’t really question the time on the internet. We’ve just come to assume that it’s always going to be the right time. The Internet follows what is known as UTC, or Universal Coordinated Time. This is a fixed time that has no time zone and is unaffected by Daylight Saving Time. This is the agreed upon universal time of the internet. UTC is maintained and regulated to be within one second, give or take, from Solar Time. Solar Time is derived directly by measuring angles from the Sun – the hour angle of the mean Sun plus 12 hours. Here, the mean Sun is an imaginary Sun thought to be moving through the sky at a constant speed, equal to the mean rate of the actual Sun. Also, the ‘plus 12 hours’ here is because we like to start our day at midnight for some reason. This is basically the same as the GMT or Greenwich Mean Time.

NTP

The internet is able to maintain the same time across the globe via the Network Time Protocol or NTP. This is a network protocol created specifically for the synchronisation of clocks between computer systems and was first demonstrated way back in 1979. This makes it one of the oldest internet protocols to still be in use. It’s main use, of course, is to make sure that your computer, or rather, any device with access to the internet, is within only a few milliseconds of UTC.

NTP uses the intersection algorithm and a modified version of Marzullo’s algorithm to find accurate time servers for your system to ping. This is done to reduce the effect of network latency. If you’ve played online games, NTP is basically looking for the nearest server with the lowest ping. We won’t get too in-depth into those algorithms, but thanks to them, NTP can maintain time on a device within a few milliseconds from UTC. This latency is further reduced on Local Area Networks or LANs, and the error margin can come down to within a single millisecond. However, traffic on network routes, or uneven network routes can widen the margins of error to over 100s of milliseconds. There are a number of official UTC servers you can ping for the time, as long as you’re okay being a few milliseconds off. However, if you’re looking for time with sub-microsecond precision, that can be obtained from satellite signals. GPS time for example, is the time maintained by GPS satellites and is kept on atomic clocks. This is as accurate as it gets when it comes to telling the time.

Time and HFTs

There aren’t very many situations that require the use of atomic time. However, one that does come to mind is High Frequency Trades, or HFTs.

While the stock market has existed well before the advent of the internet, today, it’s a different kind of beast. Thanks to high-speed connections, it’s possible for investors to buy and sell stock in mere milliseconds, faster than the human mind can even comprehend. At this point, we use complex algorithms to trade stocks at incredible speeds, buying and selling at as little as a few cents, but a million times over. This way, millions of dollars can quickly change hands within a million small trades. 

These algorithms are tuned to find even the smallest of rises and dips in the market and immediately take action. When they sense even a small drop in a stock’s price, the algorithm’s initiate purchases till the prices normalise. Similarly, the moment they sense even a small rise, they’ll sell immediately. While the valuation for a single trade might be tiny, a few hundred thousand trades and the money starts adding up.

When the valuation of stocks can change at such small intervals (milliseconds!), it becomes essential to timestamp trades to make sure nobody is gaming the system.

Regulations

Understandably, since its inception, HFTs have caused a lot of problems in the market, which has caused regulators to take several steps to regulate HFTs. One such regulation in the EU is to not only timestamp trades, but to ensure that the systems that timestamp trades also have synchronised clocks with a maximum error margin of 100 microseconds.

The frequency of trades is only increasing over time. The MiFID II (Markets in Financial Instruments Directive) Clock Synchronization and Time Stamp requirements mandates that different trading venues maintain specific timestamp granularities depending on the speed of trades. Basically, the faster the trades, the smaller the unit of time to timestamp trades. Eventually, all HFTs will be logged in microseconds via synchronised atomic clocks.

Manish Rajesh

Manish Rajesh

Manish can usually be found fervently playing video games of all kinds or… no wait he’s pretty much always playing games View Full Profile

Digit.in
Logo
Digit.in
Logo