They are delay measurement mechanism, which one is the best?
-
P2P
best in engineered network (1588 guaranteed, all switches/routers are either transparent clocks or boundary clocks) -
E2E
best if there are non-1588 aware switches
P2P delay
Master send sync and Follow_Up msg to slave, NO delay_request and delay_response
slave calculate its clock offset:
slave time = master time + network delay
How to caculate network delay without "delay request/response" message?
peer-delay measurement message.
image.png
P2P模式下, 每个设备的每个port上都定期的交换(exchange) peer-delay message. 然后设备收到sync message后都会更新sync/follow_up message中的correction field. 具体做法就是减去保存的上游设备的peer-delay值.
Pdelay_Req, Pdelay_Resp和Pdelay_Resp_Follow_Up用于测量两个时钟端口port
如果是switch, 出口不用减, 因为下游设备的入口会减, 这样就避免了减两次.
delay的计算方法, 里面的t1, t2, t3, t4表示如下:
image.png
1588报文对时原理:
- A发出Pdelay_req, 同时记录下发送时间t1
- B记录下接收到Pdelay_req的时间t2
- 不久, B发送Pdelay_Resp, 其中包含t2同时记录发送时间t3
- A收到Pdelay_Resp, 记录时间t4
- 接着, B继续发送Pdelay_Resp_Follow_Up, 里面包含t3
至此, clock A得到了t1, t2, t3, t4共4个时间点. 就可以计算delay了. 当然一个前提假设是, 来回的时间是一样的. 这样就可以计算平均链路延时了. (注意, 记录tx都是从A的角度去看的. )
delay = (t2-t1+t4-t3)/2
E2E delay
Master send sync
and Follow_Up
msg to slave
offset=(t2+t3–t1–t4)/2
相比于E2E, P2P有如下几个好处:
- 因为总是在做周期检查, master和slave之间的delay始终是可知的.
- 因为本身没有delay_request消息, 所以也不用担心sync和delay_request走不同的路径.
- 因为没有delay_request, master也就不必向所有slave发送delay_response. 只需要发送sync和follow_up就可以了.
原文:
- All links are periodically measured, so delay between the master and slave are already known when the network path changes. Note that peer-delay messages are exchanged even on ports blocked to prevent loops, such as by the Rapid Spanning Tree Protocol.
- There is no chance of Sync and Delay_Request messages taking different paths, since there are no Delay_Request messages.
- There is no need to worry about the master clocks ability to respond to Delay_Request messages when there are a lot of slaves, it only has to send the Sync and Follow_Up.
原文链接
https://blog.meinbergglobal.com/2013/09/19/end-end-versus-peer-peer/
网友评论