< Home

ntp-service

Function

The ntp-service command configures the maximum polling interval, the timestamp difference between packets sent by the clock server and received by the client, the maximum interval at which the clock of the client is synchronized.

The undo ntp-service command restores the default value.

By default, the maximum polling interval is 217s, the timestamp difference between packets sent by the clock server and received by the client is 128 ms, the maximum interval at which the clock of the client is synchronized is 600 seconds.

Format

ntp-service { max-sys-poll max-sys-poll-value | spike-offset spike-offset-value | sync-interval interval } *

undo ntp-service { max-sys-poll | spike-offset | sync-interval } *

Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support max-sys-poll max-sys-poll-value and spike-offset spike-offset-value parameters.

Parameters

Parameter Description Value
max-sys-poll max-sys-poll-value Specifies the maximum polling rate. The value is an integer ranging from 6 to 17.
spike-offset spike-offset-value Specifies the timestamp difference between packets sent by the clock server and received by the client. The value is an integer ranging from 32 to 128, in milliseconds.
sync-interval interval Sets the maximum interval for clock synchronization. The value is an integer, in seconds. The value ranges from 180 to 600.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The NTP polling interval is expressed in nth power of 2 (n is an integer). For example, run the ntp-service max-sys-poll 6 command, the system sends polling packets every 64s. In other words, the device monitors the clock change on the server every 64s.

To decrease the timestamp difference between packets sent by the clock server and received by the client, run the ntp-service spike-offset command. If the time offset of the server is greater than the configured timestamp difference, NTP sets the system clock after the interval for time synchronization elapses.

When the clock of the server changes, the clock of the client is required to be synchronized with the clock of the server. If the clock of the server is unstable, you can run the ntp-service sync-interval command on the client to reduce the interval.

The ntp-service max-distance command is applied to only the NTP client. The NTP client calculates the distance with each NTP server, and compares the calculated distance with the distance threshold configured using the ntp-service max-distance command. If the calculated distance is longer than the threshold, the NTP client does not synchronize the clock from this NTP server.

Precautions

The NTP poll interval must be an integer power of 2; therefore, the interval for the client synchronization is configured as a value closest to the integer power of 2. For example, if the interval configured by the user is 180 seconds, the client is synchronized at any time after 128 seconds.

If you run the ntp-service command repeatedly, the latest configuration overrides the previous configurations.

Example

# Set the maximum interval to 200 seconds for clock synchronization.

<HUAWEI> system-view
[HUAWEI] ntp-service sync-interval 200
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >