D
D
dantinhio2021-10-25 16:36:52
NTP
dantinhio, 2021-10-25 16:36:52

Which time from the NTP packet is correct? Or how to calculate it based on what comes in the package?

Good afternoon)
You need to find out the exact time by requesting an NTP server
. The package comes with 4 time values, which one is the most correct to use?
Or how to calculate it based on what is in the package?
Thank you)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2021-10-25
@dantinhio

The offset (t) for the local clock is calculated using the formula:

Timestamp Name ID When Generated
---------------------------------------------------- ---------------
Originate Timestamp T1 time request sent by client
Receive Timestamp T2 time request received by server
Transmit Timestamp T3 time reply sent by server
Destination Timestamp T4 time reply received by client
The roundtrip delay d and system clock offset t are defined as:
d = (T4 - T1) - (T3 - T2)
t = ((T2 - T1) + (T3 - T4)) / 2.

Source:
https://datatracker.ietf.org/doc/html/rfc4330#section-5

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question