Performance Evaluation of Low-cost GPS Time Server based on NTP

Time synchronization is required to maintain a precise clock. In this paper, a low-cost GPS NTP server has been realized using inexpensive arduino, GPS receiver, and ethernet shield. The performance of low cost GPS NTP server has been compared with the performance of commercial GPS NTP server (TM1000A). The results showed that both time server has synchronization success rate of 100% with average clock offset -8,69 ms for low cost GPS NTP server and -10,1538 ms for TM1000A. However, TM1000A have better clock offset deviation area compared with low cost GPS NTP server. TM1000A has a smaller clock offset deviation area, which is between -8 ms to -12 ms while low cost GPS NTP server has larger clock offset deviation area, which is between -20 ms to +10 ms. With production costs of less than 29 USD, we offer cheap GPS NTP servers as an alternative GPS NTP server for time synchronization on computer networks.


Introduction
In a computer network based systems, time is very important [1].All of the activity or process requires the correct timing reference [2].Reliable and accurate time is required for distribution systems, transportation, financial and legal transactions, and many other applications involving widely distributed resources [3][4][5][6][7].Although every computer has an internal clock, but many of them are imprecise and have a time shift.In addition, these clocks is prone to errors and improper resets [8].It causes a time difference on each computer.The difference in clock rate can reach 40 microseconds per second [9].Therefore, time synchronization is required for computers in computer network to maintain a precise clock in an accurate time needing system.
Global positioning system (GPS) has been widely used both in scientific study activities as well as in business activities, such as navigating for accurate traffic flow prediction, surveys for errors in road measurements, high altitude UAV tracking and surveillance, mobile operation, interfacing with GPRS as wireless data collection and more [10].GPS is a global satellite navigation system that provides three main functions such as positioning, time transfer and speed measurement [11].Time synchronization based on satellite navigation systems has become an effective means [12].GPS satellites can be used as an very accurate clock source because equipped with multiple atomic clocks.Calculation of GPS receiver locations can be done when the GPS receiver locks the signals from at least four GPS satellites.With the GPS receiver's ability to receive highly accurate data from GPS satellites, accurate information about position and time can be obtained anywhere [13].By using GPS system, every hour on local computer can be synchronized to GPS clock [14].
Network Time Protocol (NTP) is a protocol that allows the exchange of time data between server and client in computer network.NTP has been widely used on the Internet to synchronize clocks on computers, more recently, on a wide variety of handheld devices [15].NTP is used to handle computer networks with large and varied message delays.In LANs, the accuracy of time provided by NTP is submillisecond, and tens of milliseconds in the WAN [16].An NTP implementation operates as a primary server, secondary server or client.A primary server is synchronized to a reference clock directly traceable to UTC (e.g., Galileo, GPS, etc).A ISSN: 1693-6930  Performance Evaluation of Low-cost GPS Time Server based on NTP (Heri Andrianto) 2529 client synchronizes to one or more upstream servers.In order to maintain synchronization, the time difference between server and client is less than 128 ms [17].
The focus of time synchronization research from most researchers is on the use of hardware and software, offset calculation, compensation for clock drifts and message exchange design to achieve time synchronization [16], but less attention to the development of inexpensive GPS NTP server and performance evaluation of GPS NTP server.Several studies have been conducted to develop a low cost GPS based time synchronization board.Refan [8] proposed a simple and low cost GPS based computer network time synchronization board, using NTP Protocol.Refan [18] proposes time synchronization boards that are able to synchronize computer network time using NTP with redundant schemes embedded in the board to provide more reliability.The board has been tested by connecting it to a computer that installed Windows XP via an Ethernet cable.The board also tested using in the virtual network consisting of three Computers using "Sun virtual box" freeware, NTP server successfully synchronized them all [8,18].However, the performance of low-cost GPS NTP server compared to commercial GPS NTP server has not been reported in previous research conducted by Refan [8,18].This study is primarily interested in developing a cheap GPS time server based on NTP as a stratum 1-NTP server for time synchronization using arduino, ethernet shield [19] and GPS receiver [20].The performance of a low-cost GPS time server is also compared to more expensive GPS time server (TM1000A), with a cost fraction -USD 29 compared to USD 299.9.

Research Method
The research method has four stages.The first stage is designing a time synchronization system architecture.Time synchronization systems architecture based on GPS consists of two main parts, namely the low-cost GPS NTP server and NTP client.Architecture of the system is depicted in Figure 1.Time data comes from United States GPS satellites and received by GPS receiver (u-Bblox GPS module Neo 6M).GPS receiver uses a GPS antenna to receive signals from GPS satellites.The time data from GPS receiver processed by Arduino Mega 2560.If there is a client requesting time data, then Arduino Mega 2560 will send time data to the client via Ethernet.The second stage is developing a low-cost GPS NTP server by integrating the arduino, ethernet shield, and u-Bblox GPS module Neo 6M.The third stage is testing the low cost GPS NTP server and commercial GPS NTP server (TM1000A) that has been available in the market using NetTime application.The fourth stage is evaluating the performance of low cost GPS NTP server and TM1000A.

GPS NTP Server Flowchart
Figure 2 describes the flowchart of main program, which starts from enabling Ethernet shield and UDP function as data communication channel.The GPS receiver checks the incoming data.If the GPS receiver has received data from the GPS satellites, the data will be converted into time data (year, month, date, hour, minute, and second), and if the time data is valid then proceed to the process of compiling and sending NTP message to the client.If the data received by the GPS receiver is invalid, then back again to the data checking process performed by the GPS receiver.
Figure 3 describes the flowchart of process NTP, which begins with the checking of the NTP client request received via ethernet shield.If the request of the NTP client does not exist, it will return to the main program.If there is a request from the NTP client, then continued with the process of reading the IP address and NTP port number.The next step is filling NTP message that contains time data.Then NTP message is sent to the client who has made the request, via IP address and NTP port number.The next process is returned to the main program, which is the process of checking the data from the GPS receiver.2531 programmed using the Arduino programming language, which is similar to the C++ programming language [21].Design of low cost GPS NTP server by integrating the arduino, ethernet shield, and u-Bblox GPS module Neo 6M.Connection between arduino and ethernet shield via ICSP (In-Circuit Serial Programming) or ISP (In-System Programming).While the connection between arduino and GPS receiver through UART (Universal Asynchronous Receiver Transmitter).The connection between the components is depicted in Table 1. Figure 4 shows the realization of NTP GPS Server based on Arduino Mega 2560.

Performance Evaluation of Low Cost GPS NTP Server
In this study, low cost GPS NTP server has been tested using eight computers as NTP client that is connected to a low-cost GPS NTP server via computer network.The experiment has been done in 3 stages.The first stage is observing the time on eight computers when the GPS NTP server is showing of time at 02:30:00 pm.Table 2 shows a time difference on each client.The second stage, eight computer units make a request to the GPS NTP server almost at the same time when the GPS NTP Server showing the time at 02:32:00 pm.The third stage is observing the time on eight computers when the GPS NTP Server showing the time at 02:40:00 pm.Table 3 shows the test results, that the low-cost GPS NTP server successfully synchronizes all clients, these results in accordance with other reports [8,18].However, the GPS NTP server testing of this research is better than the previous research because it was tested using eight real computers on a computer network.

Clock Offset
One of the variables obtained from the relationship between client and server for the estimation system used by NTP is the clock offset [22].Figure 5 shows NTP time synchronization packet exchange between client and server.Clock offset, is the time difference between the client's local time to server time that becomes variable in making corrections to the time in the client.This correction will be brought in sync between the two devices.The clock offset is computed as (1) [23].
Defining T1 as the Client transmit time, T2 as the Server receive time, T3 as the Server transmit time, and T4 as the Client receive time.In this study, testing TM1000A and low-cost GPS NTP servers has been tested using NetTime application with interval pooling every 10 minutes.

Testing the TM1000A
Figure 6 shows, TM1000A GPS NTP server.Testing the TM1000A began on Tuesday, September 20, 2016 at 03:14:49 pm until Wednesday, September 21, 2016 at 03:14:41 pm.As shown in Figure 7, time synchronization has been done only for one day because the results are shown that TM1000A has been stable over time synchronizing with average clock offset -10,1538 ms. Figure 7 shows, all synchronization process can take place properly.The success rate of synchronization is 100%, because there are no failures in the synchronization process.Most clock offset deviations are in the area between -8 ms to -12 ms.Only two times outside that area, which occurred at the beginning of synchronization.As shown in Figure 8, Figure 9, Figure 10, Figure 11, the success rate of clock synchronization is 100%, because there are no failures in the synchronization process.Low cost GPS NTP server has been fairly stable over time synchronizing.Most clock offset deviations are in the area between -20 ms to +10 ms. Figure 8 shows the average clock offset on the first day of -9,4 ms.Only three times offset outside the area between -20 ms to +10 ms, which occurred twice at the beginning of synchronization and once during synchronization.Figure 9 shows the average clock offset on the second day of -8,83 ms. Figure 10 shows the average clock offset on the third day of -8,03 ms.Only three times offset outside the area between -20 ms to +10 ms, which occurred during synchronization.Figure 11 shows the average clock offset on the first day of -8,47 ms.Only one times offset outside the area between -20 ms to +10 ms, which occurred during synchronization.

Conclusion and Future Work
We have successfully developed a low-cost GPS NTP server for time synchronization using a low-cost arduino, ethernet shield and GPS receiver module.We have also compared the performance of low-cost GPS NTP servers with TM1000A performance.Both GPS NTP server can work well in synchronizing time with a success rate of 100%.However, the clock offset deviation area of TM1000A is better than low cost GPS NTP server because TM1000A has a smaller clock offset deviation area.In our future work, this research will be further developed to reduce clock offset deviation area on low-cost GPS NTP servers.

Figure 1 .
Figure 1.GPS based time synchronization system architecture

Figure 2 .
Figure 2. Flowchart of main program Figure 3. Flowchart of process NTP

Figure 4 .
Figure 4. GPS NTP server based on arduino mega 2560

Figure 5 .
Figure5.NTP time synchronization packet exchange between client and server[22]

Figure 8 .Figure 9 .Figure 10 .Figure 11 .
Figure 8.The first day of low cost GPS NTP server testing

Table 1 .
Connections Among Devices

Table 2 .
Before Time Synchronization