NtpResponse Class

Represents the response from an NTP server query.

public sealed class NtpResponse

Properties

NameDescription
ClockOffsetGets the estimated clock offset between the client and the server.
DestinationTimestampGets the local time at which the reply was received by the client.
IsKissOfDeathGets a value indicating whether this is a Kiss-o'-Death packet: the server is refusing service and its timestamps carry no time. NtpResponse.KissCode says why.
KissCodeGets the four-character Kiss-o'-Death code (for example RATE when the client is being rate limited, or DENY when it is not allowed to query the server), or null when this is not a Kiss-o'-Death packet.
LeapIndicatorGets the leap indicator from the server.
OriginateTimestampGets the time at which the request was sent by the client (copied from the client's transmit timestamp).
PollIntervalGets the maximum interval between successive messages, in log2 seconds.
PrecisionGets the precision of the server clock, in log2 seconds.
ReceiveTimestampGets the time at which the request arrived at the server.
ReferenceIdentifierGets the raw 32-bit reference identifier. For stratum 1 it names the reference clock and for stratum 0 it carries the Kiss-o'-Death code; see NtpResponse.ReferenceIdentifierText.
ReferenceIdentifierTextGets the reference identifier decoded as four ASCII characters (for example GPS or PPS), or null when it does not hold printable ASCII. For stratum 2 and above the field holds an address rather than text, so this is normally null.
ReferenceTimestampGets the time when the server clock was last set or corrected, or null when the server did not supply one because its clock has never been synchronized.
RootDelayGets the total round-trip delay from the server to the reference clock.
RootDispersionGets the server's own estimate of the maximum error of its clock. Use it as the error bound on NtpResponse.ClockOffset: a large value means the server does not vouch for its own accuracy.
RoundTripDelayGets the estimated round-trip delay between the client and the server.
StratumGets the stratum level of the server (0 = Kiss-o'-Death, 1 = primary reference, 2-15 = secondary).
TransmitTimestampGets the time at which the reply was sent from the server.
VersionGets the NTP version used by the server.

ClockOffset

NtpResponse.cs

Gets the estimated clock offset between the client and the server.

public TimeSpan ClockOffset { get; }

Property value

TimeSpan

DestinationTimestamp

NtpResponse.cs

Gets the local time at which the reply was received by the client.

public DateTimeOffset DestinationTimestamp { get; }

Property value

DateTimeOffset

IsKissOfDeath

NtpResponse.cs

Gets a value indicating whether this is a Kiss-o'-Death packet: the server is refusing service and its timestamps carry no time. NtpResponse.KissCode says why.

public bool IsKissOfDeath { get; }

Property value

bool

Remarks

This is only ever true when NtpClientOptions.ValidateResponse is disabled; otherwise the client rejects such a response instead of returning it.

Gets the four-character Kiss-o'-Death code (for example RATE when the client is being rate limited, or DENY when it is not allowed to query the server), or null when this is not a Kiss-o'-Death packet.

public string? KissCode { get; }

Property value

string?

LeapIndicator

NtpResponse.cs

Gets the leap indicator from the server.

public NtpLeapIndicator LeapIndicator { get; }

Property value

NtpLeapIndicator

OriginateTimestamp

NtpResponse.cs

Gets the time at which the request was sent by the client (copied from the client's transmit timestamp).

public DateTimeOffset OriginateTimestamp { get; }

Property value

DateTimeOffset

PollInterval

NtpResponse.cs

Gets the maximum interval between successive messages, in log2 seconds.

public sbyte PollInterval { get; }

Property value

sbyte

Gets the precision of the server clock, in log2 seconds.

public sbyte Precision { get; }

Property value

sbyte

ReceiveTimestamp

NtpResponse.cs

Gets the time at which the request arrived at the server.

public DateTimeOffset ReceiveTimestamp { get; }

Property value

DateTimeOffset

ReferenceIdentifier

NtpResponse.cs

Gets the raw 32-bit reference identifier. For stratum 1 it names the reference clock and for stratum 0 it carries the Kiss-o'-Death code; see NtpResponse.ReferenceIdentifierText.

public uint ReferenceIdentifier { get; }

Property value

uint

ReferenceIdentifierText

NtpResponse.cs

Gets the reference identifier decoded as four ASCII characters (for example GPS or PPS), or null when it does not hold printable ASCII. For stratum 2 and above the field holds an address rather than text, so this is normally null.

public string? ReferenceIdentifierText { get; }

Property value

string?

ReferenceTimestamp

NtpResponse.cs

Gets the time when the server clock was last set or corrected, or null when the server did not supply one because its clock has never been synchronized.

public DateTimeOffset? ReferenceTimestamp { get; }

Property value

DateTimeOffset?

Gets the total round-trip delay from the server to the reference clock.

public TimeSpan RootDelay { get; }

Property value

TimeSpan

RootDispersion

NtpResponse.cs

Gets the server's own estimate of the maximum error of its clock. Use it as the error bound on NtpResponse.ClockOffset: a large value means the server does not vouch for its own accuracy.

public TimeSpan RootDispersion { get; }

Property value

TimeSpan

RoundTripDelay

NtpResponse.cs

Gets the estimated round-trip delay between the client and the server.

public TimeSpan RoundTripDelay { get; }

Property value

TimeSpan

Gets the stratum level of the server (0 = Kiss-o'-Death, 1 = primary reference, 2-15 = secondary).

public byte Stratum { get; }

Property value

byte

TransmitTimestamp

NtpResponse.cs

Gets the time at which the reply was sent from the server.

public DateTimeOffset TransmitTimestamp { get; }

Property value

DateTimeOffset

Gets the NTP version used by the server.

public NtpVersion Version { get; }

Property value

NtpVersion