NtpServerOptions Class

Configuration options for NtpServer.

public sealed class NtpServerOptions

Constructors

NameDescription
NtpServerOptions()

NtpServerOptions()

NtpServerOptions.cs
public NtpServerOptions()

No documentation is available.

Properties

NameDescription
BindAddressGets or sets the address to bind to. Default is IPAddress.Any, which serves every network interface. Use IPAddress.Loopback to serve only the local machine.
MaxRequestsPerSecondGets or sets the maximum number of requests answered per second per source address. Default is 100. Set to 0 to disable rate limiting.
PortGets or sets the port to listen on. Default is 0 (auto-assign).
ReferenceIdentifierGets or sets the reference identifier, up to four ASCII characters. Default is LOCL, the conventional identifier for an undisciplined local clock.
RootDispersionGets or sets the maximum error the server advertises for its own clock (the root dispersion). Default is 100 milliseconds.
StratumGets or sets the stratum level to advertise. Default is 2.
TimeProviderGets or sets the time provider used to answer queries. Default is TimeProvider.System.

Gets or sets the address to bind to. Default is IPAddress.Any, which serves every network interface. Use IPAddress.Loopback to serve only the local machine.

public IPAddress BindAddress { get; set; }

Property value

IPAddress

MaxRequestsPerSecond

NtpServerOptions.cs

Gets or sets the maximum number of requests answered per second per source address. Default is 100. Set to 0 to disable rate limiting.

public int MaxRequestsPerSecond { get; set; }

Property value

int

Remarks

The limit is approximate: source addresses are mapped onto a fixed number of buckets so that memory cannot grow with the number of distinct (and easily spoofed) source addresses seen, and colliding addresses share a budget.

Rate limiting is measured against the real system clock rather than NtpServerOptions.TimeProvider, so that a simulated or frozen clock cannot disable it or wedge it permanently.

Gets or sets the port to listen on. Default is 0 (auto-assign).

public int Port { get; set; }

Property value

int

ReferenceIdentifier

NtpServerOptions.cs

Gets or sets the reference identifier, up to four ASCII characters. Default is LOCL, the conventional identifier for an undisciplined local clock.

public string ReferenceIdentifier { get; set; }

Property value

string

RootDispersion

NtpServerOptions.cs

Gets or sets the maximum error the server advertises for its own clock (the root dispersion). Default is 100 milliseconds.

public TimeSpan RootDispersion { get; set; }

Property value

TimeSpan

Remarks

Clients use this as the error bound on the offset they compute. Zero claims a perfectly accurate clock, which is never true, so the default is a deliberately conservative bound for an undisciplined software clock. Lower it if the underlying NtpServerOptions.TimeProvider is disciplined and you know its accuracy.

Gets or sets the stratum level to advertise. Default is 2.

public byte Stratum { get; set; }

Property value

byte

Remarks

Stratum 1 claims a directly attached reference clock such as GPS. A server answering from NtpServerOptions.TimeProvider has no such clock, so the honest value is 2 or higher; set NtpServerOptions.ReferenceIdentifier to match if you do attach one.

Gets or sets the time provider used to answer queries. Default is TimeProvider.System.

public TimeProvider TimeProvider { get; set; }

Property value

TimeProvider