Questionable NTP Configuration

This Forum its to discuss the new Smart Home Devices.
Post Reply
GaryOkie
Posts: 418
Joined: Mon Apr 27, 2020 7:23 pm

Questionable NTP Configuration

Post by GaryOkie »

The hard-coded NTP Time server is 200.160.0.8 in both the AD110 & AD410 configuration (and probably other Amcrest cameras as well).

This is one of the NTP servers in the international standard pool.ntp.org and is located in Brazil! This is not ideal in terms of latency - unless you live in S.America. It can add over 100ms latency from the US. It's certainly odd Amcrest hardcoded this specific IP instead of the dynamic pool DNS name.

Amcrest has also hardcoded this NTP time check to be every 5 minutes. That short interval seems quite unnecessary just to keep the internal clock in sync.

The Time Zone is easily changed via the SmartHome app. Unfortunately, no other time settings are possible via this app.

If your router has the option to provide it's own time server as well as the option to intercept NTP requests, then that is a good way to keep the NTP traffic all local without changing anything in the doorbell.

However, it is simple to update the NTP configuration via the API...

You can review your current configuration via entering this command in your browser (and authenticating):
<ip_address>/cgi-bin/configManager.cgi?action=getConfig&name=NTP

table.All.NTP.Address=200.160.0.8
table.All.NTP.Enable=true
table.All.NTP.Port=123
table.All.NTP.TimeZone=26
table.All.NTP.TimeZoneDesc=Middletime
table.All.NTP.UpdatePeriod=5


Then to change the NTP address and update interval (in minutes):

<ip_address>/cgi-bin/configManager.cgi??action=setConfig&NTP.Address=pool.ntp.org ... (Or specify an NTP server on your LAN)
<ip_address>/cgi-bin/configManager.cgi??action=setConfig&NTP.UpdatePeriod=720

Note that it is also possible to adjust time settings via the configtool, Surveillance Pro, or NVR UI.
User avatar
Revo2Maxx
Site Admin
Posts: 5906
Joined: Sat Jun 15, 2019 3:05 pm

Re: Questionable NTP Configuration

Post by Revo2Maxx »

I can't say for sure why they pick things or code things a way they do. I can guess that the 5min thing might be Time out issue over time. If the time is to great the system times out or could be software limit? About the location for server my guess would be that Amcrest used that server because they needed to find one that could be spammed by many different devices from all over the world at all times day and night. Could be others have limits on times per day per device or so many other reasons.

Then one might ask well then why can we make changes to time and server location? In short because the limited number of people that would make changes more then likely wouldn't impact 1 NTP server in the way having all Amcrest or Dahua cameras designed to go to that Server to start with.. Starting in 2022 I turned off all mine anyway and will just use my recorders and computers logging into devices to keep time up to real time for now on.
Be Safe.
GaryOkie
Posts: 418
Joined: Mon Apr 27, 2020 7:23 pm

Re: Questionable NTP Configuration

Post by GaryOkie »

Revo, I wasn't expecting an explanation for why this illogical config exists. I can't believe there is any justification for hardcoding a single NTP server in Brazil. It has to be an oversight.

Just ping it. Then ping pool.ntp.org or clock.isc.org to compare. The latter NTP pool is what Dahua cameras are configured to use if NTP is enabled - perhaps Amcrest too - just not their Doorbells.

Still, the best advice is to go with a local NTP so that all home systems are in perfect sync.
User avatar
Revo2Maxx
Site Admin
Posts: 5906
Joined: Sat Jun 15, 2019 3:05 pm

Re: Questionable NTP Configuration

Post by Revo2Maxx »

Well after your reply I thought I would just Google it.. funny thing asking Google what server to use in USA and it points to the long ping server of pool.ntp.org..

So don't know, don't seem so Questionable to me.

Edit: So I am understood having cameras that are set at times default 24hrs to a doorbell that is pinging a server every 5 min is my guess why it isn't going to same server as the normal line of cctv cameras or recorders.
Be Safe.
GaryOkie
Posts: 418
Joined: Mon Apr 27, 2020 7:23 pm

Re: Questionable NTP Configuration

Post by GaryOkie »

pool.ntp.org is absolutely appropriate for USA and elsewhere. That's not a single server but a pool of MANY worldwide dynamically-chosen servers, of which this NTP Brazil server belongs. (source: https://www.pool.ntp.org/scores/200.160.0.8)

I don't know how many SmartHome devices are out there with this config hitting that Brazil server every 5 minutes, several thousand I suppose, but it sure sounds like abuse to me.

Here's an interesting article that reinforces my view. https://news.ycombinator.com/item?id=18753835

If you don't read it, here are 3 cherry-picked points it makes:

1. NEVER, ever hardcode an individual NTP server (in form of a IP or domain). DO NOT just go to a list of NTP servers, then copy a few into your code. DON'T ping pool.ntp.org and get its IP address written down. DON'T DO ANY OF THESE! PLEASE!

3. If the scale of your system is small, in hundreds, or in a few thousands, PLEASE USE pool.ntp.org, this is the NTP community cluster backed by DNS load balancer.

4. If the scale of your system is large, such as tens of thousand, or you are making a new system, you SHOULD request a customized prefix from pool.ntp.org, such as debian.pool.ntp.org, it helps the community to manage the traffic. If your system is a large commercial one, you ARE REQUIRED to donate some servers to the NTP Pool to compensate the community.

And here's important info for vendors from the ntpool.org site.. https://www.ntppool.org/vendors.html.

>>> Don't send excessively frequent queries. Reasonable query intervals are typically from once or twice a day to a 4-5 times an hour depending on the application.
User avatar
Revo2Maxx
Site Admin
Posts: 5906
Joined: Sat Jun 15, 2019 3:05 pm

Re: Questionable NTP Configuration

Post by Revo2Maxx »

Thanks for the read, I will pass it on to Amcrest maybe it can be fixed in Update.
Be Safe.
Post Reply