gpt4 book ai didi

synchronization - NTP 往返延迟

转载 作者:行者123 更新时间:2023-12-03 21:37:50 24 4
gpt4 key购买 nike

NTP 如何计算往返延迟时间和偏移量。

最佳答案

要将其时钟与远程服务器同步,NTP 客户端必须计算往返延迟时间和偏移量。往返延迟计算为

delta = (t_3 - t_0) - (t_2- t_1)

在哪里
t0 is the client's timestamp of the request packet transmission,
t1 is the server's timestamp of the request packet reception,
t2 is the server's timestamp of the response packet transmission and
t3 is the client's timestamp of the response packet reception.

所以
t3 − t0 is the time elapsed on the client side between the emission 
of the request packet and the reception of the response packet and
t2 − t1 is the time the server waited before sending the answer.

偏移θ由下式给出
theta = ((t_1 - t_0) + (t_2 - t_3))/2

当客户端和服务器之间的传入和传出路由具有对称的标称延迟时,NTP 同步是正确的。如果路线没有共同的标称延迟,则同步具有向前和向后旅行时间差一半的系统偏差。

必须有两种方式的通信以允许同步。使用 NTP 时间作为来自 NTP 服务器的广播会及时留下未知错误。

关于synchronization - NTP 往返延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18755614/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com