NtpServerOptions Class
Configuration options for NtpServer.
public sealed class NtpServerOptionsConstructors
| Name | Description |
|---|---|
| NtpServerOptions() |
NtpServerOptions()
NtpServerOptions.cspublic NtpServerOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| BindAddress | 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. |
| MaxRequestsPerSecond | Gets or sets the maximum number of requests answered per second per source address. Default is 100. Set to 0 to disable rate limiting. |
| Port | Gets or sets the port to listen on. Default is 0 (auto-assign). |
| ReferenceIdentifier | Gets or sets the reference identifier, up to four ASCII characters. Default is LOCL, the conventional identifier for an undisciplined local clock. |
| RootDispersion | Gets or sets the maximum error the server advertises for its own clock (the root dispersion). Default is 100 milliseconds. |
| Stratum | Gets or sets the stratum level to advertise. Default is 2. |
| TimeProvider | Gets or sets the time provider used to answer queries. Default is TimeProvider.System. |
BindAddress
NtpServerOptions.csGets 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
MaxRequestsPerSecond
NtpServerOptions.csGets 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
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.
ReferenceIdentifier
NtpServerOptions.csRootDispersion
NtpServerOptions.csGets 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
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.
Stratum
NtpServerOptions.csGets or sets the stratum level to advertise. Default is 2.
public byte Stratum { get; set; }Property value
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.
TimeProvider
NtpServerOptions.csGets or sets the time provider used to answer queries. Default is TimeProvider.System.
public TimeProvider TimeProvider { get; set; }