Background technology
In a lot of Distributed Calculation were used, more specifically for the real-time application in the packet switching network, it was very important that information and fiducial time (for example producing the time of this information) accurately are complementary.For example, in packet-based network, can produce data in real time by sending networking component, so that this transfer of data is used for further acquisition to receiving networking component.For this reason, data acquisition system is become grouping, each grouping comprises partial data, and the reception networking component is submitted in these groupings, in receiving networking component data division is lumped together.
Because the variation of transmission path and queuing delay (queuing hold-up), the transmission delay that different grouping experienced can change significantly in the uncertainty mode.In extreme case, early the grouping that sends may be than the more late arrival of the grouping of later transmission.To receive networking component and can correctly handle grouping in order to make, can stab each additional period of dividing into groups, this timestamp is corresponding with the fiducial time of packaged data division.In this case, receiving networking component can make data division accurately be complementary with corresponding fiducial time.
For above-mentioned example, making and sending networking component is necessary with the clock synchronization that receives networking component.Put it briefly, the split-second precision measurement is the crucial prerequisite that enables to develop any high-performance distributed computing application.According to application, must keep accurate absolute time benchmark (for example, the zebra time of coordination or UTC time) or relative time benchmark.
In addition, the flow control of host-host protocol and congested control greatly depend on send networking component (or transmitter) and the measured two-way time (RTT) that receives the packet that exchanges between the networking component (or receiver) and/or transit time (one-way latency, OWD).Information fiducial time of timestamp form spends a certain constant or variable time quantum owing to for example supply, so the estimation of this transmission of Information duration is the subject matter of time synchronized on the packet switching network between transmitter and receiver.In order to handle this problem, at D.L.Mill, " TheNetwork Time Protocol (Version 3) Specification; Implementation andAnaylsis ", RFC 1305, IEFT, at length disclosed so-called NTP (Network Time Protocol) (NTP) has been designed to make on the packet switching network local clock of networking component synchronous among the March 1992.
The core component of NTP is based on the clock offset calculation routine of so-called Cristian algorithm (CA), below will summarize this Cristian algorithm.The request networking component is at transmitting time T
SComprise the time request in interior packet to answering the networking component transmission.Answer the fast as far as possible answer of networking component and will be encapsulated in the time of reception of answering in the grouping and stab T
RBeam back, this answer is grouped in answers time of reception T
RRBe received.According to the following calculating forward transition delay of these time values (or one-way latency of forward direction) (OWD
f) and back to transition delay (or the back is to one-way latency of direction) (OWD
b): OWD
f=T
R-T
SAnd OWD
b=T
RR-T
RIn addition, suppose that the actual one-way latency on this both direction equates, make OWD
fWith OWD
bBetween difference only give the credit to the request networking component clock with the answer networking component clock between side-play amount.This synchronisation offset is calculated as (OWD
f-OWD
b)/2.
The Cristial algorithm has significant disadvantage: only equal actual back during to transition delay when actual forward transition delay, the estimation of synchronisation offset is only accurately.That is, when the communication between two networking components be the symmetry the time.Yet in the situation of asymmetric delays occurring, this calculating will be wrong.In live network, because asymmetrical network topology (postponing such as the random packet in asymmetrical digital subscriber line road (adsl line) and asymmetric route and/or the networking component), one-way latency is normally asymmetrical.Herein, for real-time application, the error key that the systematic error that is caused by the asymmetrical network topology is not caused by the random packet delay, wherein this random packet postpones to be caused by variable one-way latency, for example causes owing to variable queueing delay.
Summary of the invention
Thereby the purpose of this invention is to provide a kind of method and networking component, make it possible to achieve the more precise synchronization between the clock of heterogeneous networks assembly in network.
Utilization make according to independent claims 1 a kind of the clock of networking component and other networking component clock synchronization method and satisfy this purpose according to the networking component of independent claims 8.
According to an aspect of the present invention, clock that a kind of method the makes networking component method with the clock synchronization of the other networking component that communicates to connect with this networking component is provided, described method comprises the following steps: to be identified for from the forward transition delay set of described networking component to described other networking component message transfer, and is used for gathering to transition delay to the independently back of described networking component message transfer from described other networking component; From the set of forward direction transition delay, select minimum forward transition delay; To the transition delay set, select minimum back to transition delay from the back; To transition delay, derive the estimated value of the side-play amount between the clock of the clock of described networking component and described other networking component from selected minimum forward transition delay and minimum back; And the clock of adjusting described networking component according to the estimated value that side-play amount is estimated.
According to another aspect of the present invention, provide a kind of networking component, having comprised: clock; Communicator, be configured to provide with network in being connected of at least one other networking component; Request unit is connected with described communicator, is configured to generate request and sends described request to described other networking component; Receiving system is connected with described communicator, is configured to receive answer to described request from described other networking component; Analytical equipment is connected with described clock with described receiving system, be configured to analyze described reception answer, determine transition delay set and the estimation of calculating the clock synchronization side-play amount; Memory is connected with described analytical equipment, is configured to store the transition delay set; And the clock adjusting device, be connected with described analytical equipment, be configured to estimate to adjust described clock according to institute's offset calculated.
An advantage with respect to prior art of the present invention is: carry out the repeatedly measurement of transit time is gathered to obtain transit time, select minimum value from this transit time set.Therefore, can minimize the error that side-play amount that the variation owing to independent measurement causes is estimated.This change may be owing to be used to make the variation of message by the transmission path of network to cause, perhaps this variation may be owing to for example in the input and output queue of networking component the different retention time of message cause.Another notable feature is that the minimum transition delays of forward and backward direction is to select independently from their set separately.This means minimum forward transition delay not necessarily with minimum after to the corresponding forward transition delay of transition delay.This is because the message of experience minimum forward transition delay not necessarily also experiences minimum back to transition delay usually.Therefore, the advantage that has of the present invention is: the estimation that can calculate side-play amount with error boundary more closely.
Refer to forward transition delay for the back to transition delay and the discussion of forward transition delay accordingly and belong to the same communication cycle that comprises request message and answer message to transition delay with the back.For example, if be sent to the message experience particular forward transition delay of networking component, then the transition delay at the answer message experience of this message is that corresponding back is to transition delay.In addition, being used for processing messages and generating the processing time of answering in the hypothetical network assembly is negligible, then forward transition delay can be obtained two-way time with corresponding back mutually to transition delay.
In advantageous embodiment of the present invention, determine that forward transition delay set and corresponding back also comprise step to the described step that transition delay is gathered: be identified for continuous two-way time of between described networking component and described other networking component, communicating by letter, come down to corresponding forward transition delay and corresponding back wherein said two-way time to the transition delay sum, comprise pre-adopted number up to finding, continuously the two-way time of the two-way time of Que Dinging in interior stable set two-way time makes described set two-way time with depart from less than the maximum deviation of being scheduled to the minimum two-way time in described two-way time of the set till, corresponding forward transition delay two-way time in forward transition delay set in login and set two-way time, and in the back in the transition delay set in login and set two-way time two-way time corresponding back to transition delay.
Thereby determine minimum two-way time and the stability region around this minimum two-way time.Obtaining the stability region has guaranteed to utilize corresponding forward direction and back calculating to transition delay to have more other side-play amount estimation of high accuracy level.By selecting enough little predetermined maximum deviation, can determine two-way time and corresponding forward direction and the back influence that is not subjected to the possible basic change of two communications between the networking component to transition delay in the stability region.For example, in the situation of packet-based communication, predetermined maximum deviation can be chosen as several milliseconds magnitude, this is much smaller than owing to fill or transition delay that the flush packet formation is caused changes (this variation can be 10 to 30 milliseconds a magnitude), and even less than because communication path changes the transition delay variation (this variation can be the magnitude of a few tens of milliseconds) that causes.
In another exploitation of the present invention, determine that forward transition delay and corresponding back comprise to the step of transition delay: send request from described networking component to described other networking component at request time, send answer to described request from described other networking component to described networking component in the time for replying, receive described answer at the described networking component of answer time of reception, calculate forward transition delay by from the described time for replying, deducting the described request time, and calculate corresponding back to transition delay by from described answer time of reception, deducting the described time for replying.Thereby provide a kind of definite forward direction and back straightforward procedure to transition delay.
Favourable improvement of the present invention also is included in the step that encapsulates timestamp from described other networking component to each answer that described networking component sends, and described timestamp comprises the time for replying.Timestamp is to be provided for the further simple and effective instrument of the time for replying of calculating to networking component.This timestamp can be the main information in answering.Alternatively, answer can comprise out of Memory or data and the time for replying that networking component is asked.
Advantageous embodiment of the present invention also comprises the step that sends described request with equal time at interval.In favourable exploitation of the present invention, described request and described answer send as packet.
In another embodiment of the present invention, upgrading forward transition delay set and back continuously gathers to transition delay.Upgrading set herein can comprise: abandon whole set and redefine the new set with new clauses and subclauses.Alternatively, renewal process can comprise: when carrying out new measurement, with the new value of determining of interpolation in set of the continuous time interval.
Embodiment
Below, the known method of the side-play amount between the clock of the clock of a kind of estimation network assembly (network node A or node A) and other networking component (network node B or Node B) is at first described.This method generally is called the Cristian algorithm.Node A is connected on network is connected with Node B and for example communicates via packet in internet environment.
Fig. 1 shows the sequential chart of the packet that sends between node A and B.Has time variable t
ATimeline belong to the clock of node A, have time variable t simultaneously
BAnother timeline belong to the clock of Node B.The arrow that points to another timeline from a timeline has been indicated the transmitted in packets from a node to another node.As shown in Figure 1, node A is in time T
S (A)Send the packet that comprises the time request to Node B.Node B is in time T
R1 (B)Receive this packet.After handling this request grouping, Node B gets quick answer and at time for replying T
R2 (B)To comprise time of reception T
R1 (B)In addition the time of reception of mark stabs and sends it back transmitter node A in interior packet.In time T
RR (A)Node A receives the packet with this timestamp.T
R1 (B)And T
R2 (B)Between time difference be on the Node B processing time and usually than time T
RR (A)And T
S (A)Between time difference want much shorter, and be negligible.Therefore can suppose T
R1 (B)=T
R2 (B)=T
R (B)Figure 2 illustrates this relation.
The time of noticing institute's reference is to be measured by the corresponding clock of node A and B.That is, the clock by node A comes Measuring Time T
RRAnd T
S, come Measuring Time T by the clock of Node B
R (B)Usually, because the side-play amount and the deflection (skew) of corresponding clock, node A measures the different time with B at identical some place fiducial time.By using different time variable t among Fig. 1 and Fig. 2
AAnd t
BCan clearly be seen that this point.Therefore, if at the particular point in time place, the clock deviation of the clock of Node B and node A side-play amount K, this deviation affects T
R (B)Measurement.Subsequently, if use T
S (A), T
R (B)And T
RR (A)Come computation migration to postpone or one-way latency (OWD), then it and actual or true OWD difference K mutually.In order to use this Cristian algorithm, must suppose that the true OWD on the forward direction equals the true OWD of back on direction, this is opposite with measured OWD.
Below, the time offset of being calculated between node A and Node B is expressed as Δ.This means that Δ is the estimation of K.In addition, the one-way latency of measuring on the forward and backward direction is expressed as OWD respectively
fAnd OWD
bCan calculate OWD according to following equation (1) and (2)
fAnd OWD
b
OWD
f=T
R(B)-T
S(A) (1)
OWD
b=T
RR(A)-T
R(B) (2)
According to the Cristian algorithm, can shown in following equation (3), calculate Δ.
Δ
CA=(OWD
f-OWD
b)/2 (3)
Only notice when the forward direction that satisfies symmetry and back during Δ to the hypothesis of one-way latency
CAJust equal K.Yet, in real forward direction and back under the situation of the unequal asymmetric delays of OWD, the result that this estimation will lead to errors.As mentioned above, OWD is normally asymmetrical in live network.Therefore for real-time application, much more inessential than the error that causes by variable OWD by the systematic error that the asymmetrical network topology causes.Owing to can not provide the assurance to symmetrical one-way latency in live network, so the time causality (that is, node A sends grouping, and Node B receives this grouping and sends answers grouping) of three incidents only can be provided, this causes inequality T
S (A)<T
R (B)<T
RR (A)Therefore, if with T
R (B)Be estimated as at time point T
RR (A)And T
S (A)Between the centre, then max calculation error or the error boundary δ according to the estimated synchronisation offset of Cristian algorithm will satisfy following equation (4).
δ=(T
RR(A)-T
S(A))/2=RTT/2 (4)
In order to carry out the measurement of following method, advantageously satisfy some prerequisites.At first, network topology should not change in measuring period.Secondly, the time drift that causes owing to the difference of the clock frequency of the clock of node A and Node B should be very little, makes not change in the time difference between the internal clock during measuring period.If be several seconds magnitude measuring period, then almost satisfy these prerequisites forever.
For time synchronized, carry out measurement repeatedly according to Fig. 2.Fig. 3 shows in order to carry out this measurement sends a series of requests and answers the sequential chart of grouping between node A and Node B example.For the needs that illustrate, four communication cycles have only been described, each cycle comprises: divide into groups to Node B transmission request from node A, and answer grouping from Node B to node A transmission.The request grouping that is sent by node A is in time T as shown in Figure 3
S (A) 1, T
S (A) i, T
S (A) kAnd T
S (A) 1Send.Though the one-way latency that can calculate each communication cycle according to top equation (1) and (2), two-way time (RTT) can be calculated as corresponding OWD's and, perhaps alternatively and more simply be calculated as RTT=T
RR (A) i-T
S (A) iThe number of the communication cycle of measuring in fact can be bigger, a for example hundreds of measurement.
Between node A and Node B, exchange and ask and the answer grouping, till the approaching RTT of minimum minRTT two-way time of definite and measurement gathers.This set is called minRTT stability region on every side.For this reason, at first must select to be suitable for the maximum deviation d of given network topology
MaxAnd Minimum Area width W
MinStability region around the minRTT means the W at least that comprises the sampling with the RTT that equals minRTT
MinIndividual continuous sampling has to depart from minRTT and is less than or equal to d
MaxThe RTT value.
Can find the stability region by following process.At first, in initialization procedure, minRTT is set to infinity.Then, for each RTT communication cycle or request with to answer grouping right, calculate RTT and this RTT is compared with the minRTT value of being stored.If measured RTT is less than the minRTT that is stored, then minRTT is set to measured RTT.In addition, record departs from less than d with current minRTT
MaxThe number of measured RTT value.Depart from less than d in case write down with minRTT
MaxW at least
MinIndividual continuous RTT just logs on as these RTT values and stablizes the RTT value set.Also login corresponding one-way latency and in further calculating, use the estimation of this corresponding one-way latency with the synchronisation offset between the clock that obtains node A and Node B.
In next procedure, calculate minimal forward one-way latency (minF) and minimum back to one-way latency (minB) according to following equation (5) and (6).Thereby the minimal forward one-way latency is the minimum value of login in forward direction one-way latency set, and minimum back is to login the minimum value in the one-way latency set in the back to one-way latency.Along with the number of data packets purpose growth that exchanges between node A and the Node B, packet increases through the probability of waiting list, and wherein said waiting list is empty fully and the processing time cause minimum at intranodal.Therefore the physics limit in the one-way latency is represented in the minimum one-way latency on might forward and backward direction.Physics limit means that the element such as waiting list does not influence delay.
minF=min(T
R(B)j-T
S(A)j),1<=j<=W
min(5)
minB=min(T
RR(A)n-T
R(B)n),1<=n<=W
min(6)
Utilize following equation (7) to calculate so-called virtual minimum RTT (VirtMinRTT) then.
VirtMinRTT=minF+minB (7)
Therefore, suppose minF and minB be the packet minimum that may experience, possible one-way latency physically, VirtMinRTT is at being sent to Node B from node A and defining the minimum two-way time that is subjected to the physical boundary restriction from the grouping that Node B sends it back node A.
Fig. 5 shows from node A and is sent to Node B and sends it back the minRTT of series of data packets of node A and the figure of VirtMinRTT from Node B.Herein, abscissa shows the number of measurement.Use the process of above-mentioned searching stability region and calculating minRTT and VirtMinRTT to carry out measurement each time.Usually, VirtMinRTT is not equal to minRTT.This means the grouping of minimum queuing of the forward path from node A to Node B experience or processing delay be not same grouping in back grouping to the path experience minimum delay from Node B to node A.As shown in Figure 5, VirtMinRTT is lower than minRTT all the time.
Owing to the constant network topology on measuring period is assumed to precondition, so minF and minB equal or be approximately equal to the bounded above minimum one-way latency of physics at least.Yet, because the clock of the clock of Node B and node A is asynchronous, so minF and minB represent measured one-way latency, rather than true or actual delay.If the clock of Node B has unknown clock synchronization side-play amount K with respect to the clock of node A, then can use following equation (8) and (9) to calculate real one-way latency minF
rAnd minB
rThis means minF
rAnd minB
rRespectively the actual minimum one-way latency on the forward and backward direction when correcting by synchronisation offset K.
minF
r=minF-K (8)
minB
r=minB+K (9)
Can be with equation (8) and (9) substitution equation (7) obtaining following equation (10), this equation shows the value with the irrelevant VirtMinRTT of synchronisation offset.
VirtMinRTT=minF+minB=minF
r+minB
r (10)
Utilize with the corresponding forward direction of VirtMinRTT and back to one-way latency minF and minB, the estimation that can calculate synchronisation offset according to equation (11).
Δ=(minF-minB)/2 (11)
Fig. 6 shows the figure of the calculated value (dotted line) of Δ.Can provide estimation approach to be called improved Cristian algorithm (ICA) with this to synchronisation offset.This algorithm is different significantly with above-described Cristian algorithm (CA).At first, based on a series of measurements, and CA is based on single measurement according to the method for ICA.In addition, according to the calculating of ICA based on determining forward direction and back minimum value minF and minB independently to one-way latency, and among the CA employed forward direction and back to one-way latency OWD
fAnd OWD
bBe to send it back the value that node A determines from the B node same communication cycle by sending grouping and will divide into groups to Node B from node A.As a result of, Δ compares Δ
CAHave more consistency, and therefore provide estimation more accurately, as shown in Figure 6, in Fig. 6, drawn the Δ that calculates at identical measuring assembly synchronisation offset K
CAFor comparing.
As alternative, can use with the corresponding forward direction of minimum RTT two-way time and back to one-way latency, rather than use with as the corresponding one-way latency of the VirtMinRTT among the ICA, calculate the difference estimation Δ of synchronisation offset
CAminThis method will be called the CAmin method.In Fig. 7, drawn this result of calculation at measuring assembly, and the Δ that uses ICA to calculate at this measuring assembly.As shown in Figure 7, Δ has all the time and is lower than (meaning more the mean value near Δ) or equals Δ
CAminBorder (dotted line).
The calculating of Δ is measured leg-of-mutton centre based on estimation is placed on.Therefore, as shown in Figure 4, the certainty border δ of the error of calculation
1Based on postpone T
S (A), T
R (B)And T
RR (A)The time causality of relevant incident.Can use equation (12) to calculate certainty border δ
1
δ
1=VirtMinRTT/2 (12)
For VirtMinRTT, minRTT and RTT
i(represent any single two-way time value), following inequality (13) is set up.
VirtMinRTT<=minRTT<=RTT
i (13)
This inequality is hinting error boundary δ
1The same at least good with the error boundary that uses traditional C ristian algorithm to estimate.In addition, if VirtMinRTT is not equal to minRTT, then compare acquisition error boundary more closely with using any other measurement point.Owing to this conclusion certainty ground can be applied to the algorithm that proposed, so with δ
1Be called the ascertainment error border.
Fig. 8 shows the error boundary δ that estimates according to the side-play amount of traditional C ristian algorithm
CAFigure, Fig. 9 shows the error boundary δ of the estimation that obtains according to above-mentioned CAmin method and ICA method respectively
CAmin(thick dashed line) and δ
ICAThe figure of (fine dotted line).Can see that by comparison diagram 8 and Fig. 9 the Cristian algorithm causes high level error boundary graph, and the ICA method causes the minimum error boundary graph, thereby the most accurate estimation to synchronisation offset is provided.
From angle at random, can be with the time range combination of incident tightr.If minF and minB represent the hypothesis of the physical boundary of one-way latency and set up, then can define error boundary as following equation (14), it equals half of difference of minRTT and VirtMinRTT.Then this error boundary is called statistical error bound.
δ
2=(minRTT-VirtMinRTT)/2(14)
Figure 10 shows the figure of the statistical error bound of being calculated.Statistical error bound has following meaning.Estimated synchronisation offset Δ is at the statistical error bound δ of distance real synchronisation offset K
2In the probability value of being greater than or equal to minF and minB be the probability of the bounded above one-way latency of physics really.In other words, even minF and minB are not the minimum physics possibility one-way latencys of transmitted in packets, δ
2For the error boundary of estimated synchronisation offset Δ, also be useful numeral.Can see by comparison diagram 9 and Figure 10, with ascertainment error border δ
1That is advised compares, according to statistical error bound δ
2, estimated synchronisation offset Δ can be the better estimation to K.
In the above description, the feature of the present invention that discloses in the claim and in the accompanying drawing is for separately and to implement different embodiments of the invention with the form of any required combination be important.