I have an application that's running a REST API and recently a requirement came up to have an NTP server associated with the application. My question is whether or not it makes sense to have an endpoint on the API that users can query (i.e. api/ntp/time
) which returns NTP packets, and what are the implications of a setup like this?
I've been trying to connect to this endpoint using ntp clients like ntpdate
and Python's ntplib
, but those clients are making the assumption that there will be an NTP server running on the IP address at port 123, and the past few days of research have shown that this assumption largely holds true for most any NTP client software.
I'm using an endpoint to serve this information for a few reasons:
- I don't have any control over the webserver configuration for the application, so I can't proxy pass from port 123 or anything like that
- I have no control over what ports any of the web applications run on
- I have no real access to any stratum 1 device; we're running off of the assumption that the host serve is keeping its clock appropriately synched to a stratum 1 device (which is actually a safe assumption in our case).