Time synchronization method, time synchronization system
The method stabilizes time synchronization in ring-type networks by using a master node to send 'Sync' and 'Follow-Up' messages to calculate and correct slave clock errors, addressing the instability caused by unequal transmission delays in PTP, thus enhancing synchronization accuracy and efficiency.
Patent Information
- Application Number
- JP2020159213
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-09-24
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2040-09-24
Smart Images

Figure 0007622386000031 
Figure 0007622386000032 
Figure 0007622386000033
Abstract
Description
[Technical field]
[0001] The present invention relates to time synchronization between nodes in the communications field. [Background technology]
[0002] PTP (Precision Time Protocol) defined in IEEE1588 basically aims at time synchronization between two nodes, a master and a slave (see Patent Document 1 and Non-Patent Document 1).
[0003] PTP time synchronization is achieved through one-to-one processing between master and slave, so while it has the advantage of having no topology constraints, as the number of slaves increases, traffic concentration on the master becomes an issue.
[0004] Furthermore, time synchronization using PTP is premised on the fact that the transmission delays on the outbound and inbound routes between the master and slave are identical, but in a typical Ethernet network, this premise is not guaranteed to hold true, making the quality of time synchronization prone to instability.
[0005] (1) Basic Concept of Time Synchronization The master clock and slave clock in Figure 1 refer to the clocks built into the master and slave, and the deviation between the two clocks is "Δt." Since the master clock is used as the reference clock here, the deviation "Δt" can be considered an "error" on the slave clock side.
[0006] For example, if the time of the master clock is "T" and the time of the slave clock is "T'", it can be expressed as "T' = T + Δt". Furthermore, if "Δt > 0", the time of the slave clock is advanced, and if "Δt < 0", the time of the slave clock is delayed.
[0007] Therefore, "time synchronization" means "Δt = 0 (as close as possible to 0)." If the slave can calculate the "Δt" of its own clock, it can synchronize with the master clock by correcting the time advance / delay by that amount.
[0008] (2) Conventional time synchronization In the conventional time synchronization method shown in Fig. 2, a synchronization message, a "SYNC message," is sent from the master to the slave. This message is stamped with the sending time T1.
[0009] A slave that receives a "SYNC message" measures the reception time "T" of the message using its own slave clock. If the propagation time of the "SYNC message" is sufficiently small compared to the required accuracy, then "Δt" can be calculated as shown in formula (1).
[0010]
number
[0011] However, to stamp the sending time of the "SYNC message", a certain degree of advanced hardware (HW) is required. Therefore, in the case of a node that does not have the hardware, the sending time is notified by a following "FOLLOW-UP message" as shown in Figure 3.
[0012] (3) Transmission Delay Problem The above-mentioned conventional time synchronization is based on the premise that the propagation time of the "SYNC message" is sufficiently small compared to the required accuracy. Figure 4 shows a case where this prerequisite is not met.
[0013] If the transmission delay between the master and slave in Figure 3 is "D1 ≠ 0," then equation (1) contains an extra transmission delay component D1, and the equality can be established by subtracting the extra component (D1), as shown in equation (2).
[0014]
number
[0015] In this case, the value of "D1" is needed to calculate "Δt". The value of "D1" is "T´2-T´1", so we get equation (3). In this equation (3), the variable "Δt" remains on the right-hand side.
[0016]
number
[0017] As a result, to calculate "Δt", the correct value of "D1" is required, but to calculate the value of "D1", "Δt" is required. This is the "chicken and egg" paradox. In other words, from a mathematical point of view, two equations are required to determine the values of two variables, but only one equation can be set up, resulting in a problem that cannot be solved.
[0018] (4) Solution to PTP In order to solve the above problem, PTP assumes that "the transmission delay is the same on the outbound and inbound routes" and executes the process shown in Figure 5. Here, the following process is added to the conventional time synchronization method. The slave sends a "DELAY REQ message" to the master. The slave measures the sending time of this message, "T´3", using its own slave clock. The master that receives the "DELAY REQ message" replies to the slave with the time of receipt, "T4", as a "DELAY RES" message. The slave that receives this reply obtains the time of the message, "T4".
[0019] As a result, it becomes possible to set up a new equation, "Δt = T4 - T´3 - D2". This results in "2 unknown variables" x "2 equations", and the deviation "Δt" is found based on the transmission delay "D1 = D2 = D".
[0020] To specifically explain how to calculate the deviation "Δt", it is clear that "D1" and "D2" are as shown in equations (4) and (5).
[0021]
number
[0022]
number
[0023] Next, from the definition of the master clock-slave clock deviation “Δt” (T´=T+Δt), equations (6) and (7) hold.
[0024]
number
[0025]
number
[0026] Then, by substituting equations (6) and (7) into equations (4) and (5), equations (8) and (9) hold.
[0027]
number
[0028]
number
[0029] Here, since it is assumed that the transmission delays are D1 = D2 = D, equation (10) holds.
[0030]
number
[0031] If the value of equation (10) is “D”, equations (8) and (9) can be expressed as equations (11) and (12).
[0032]
number
[0033]
number
[0034] When "Equation (12) - Equation (11)" is evaluated, "D" on the left side cancels out, and when "Δt" is solved, Equation (13) is obtained. The slave synchronizes with the master by correcting its own clock based on this deviation "Δt".
[0035]
number
[0036] [Patent Document 1] Patent Publication 2018-174445 [Non-patent literature]
[0037] [Non-Patent Document 1] “Endrum IEEE 1588 PTP Grandmaster Clock”, [online], searched on September 11, 2020, Internet<URL:http: / / www.shoshin.co.jp / c / endrum / 1588ptp.html> Summary of the Invention [Problem to be solved by the invention]
[0038] As mentioned above, PTP calculates the deviation "Δt" on the assumption that the transmission delay is "D1 = D2 = D." However, in Ethernet, it is not guaranteed, nor can it be expected, that the transmission delays on the outbound and inbound routes between nodes are the same.
[0039] Fluctuations in transmission delay in Ethernet are mainly caused by the forwarding process of Ethernet switches. That is, when a PTP packet passes through an Ethernet switch, the delay varies depending on whether or not there is a packet being sent to the forwarding destination port.
[0040] If there is no packet being sent to the destination port, the packet is forwarded without waiting to be sent. On the other hand, if there is a packet being sent to the destination port, the subsequent packets are forced to wait until the packet is completely sent. This is true even if the packet has a priority.
[0041] Therefore, the transmission delay varies depending on whether or not a preceding packet exists at the forwarding port (or the length of the preceding packet), and it cannot be expected that the transmission delay will be the same on the forward and return paths. In PTP, the inclusion of such sudden errors (the presence or absence of a preceding packet) is essentially unavoidable, so it is necessary to implement a smoothing mechanism such as a moving average. This smoothing function can smooth out the errors that are suddenly included between the measured values before and after, but the trade-off is that the time required for time synchronization may increase.
[0042] The fundamental reason why PTP must assume that the transmission delays on the outbound and return routes are the same is the paradox mentioned above. In other words, there is a contradiction in the very fact that the time difference between the master clock and the slave clock must be measured in order to calculate the error between the two clocks.
[0043] This invention has been made to solve such conventional problems, and its problem to be solved is to stabilize the quality of time synchronization by measuring the transmission delay only with the master clock, rather than with each of the master and slave clocks, in a situation where it is not guaranteed that the round-trip transmission delay between nodes is the same. [Means for solving the problem]
[0044] (1) One aspect of the present invention is a method for time-synchronizing a group of slaves on a ring network with a master, comprising the steps of: The synchronization message transmitted by the master is sequentially forwarded and relayed by each slave, and then received by the master, thereby circulating the message on the network; Calculating a transmission delay of the synchronization message based on a transmission time and a reception time of the synchronization message measured by the master clock; The clock error between the slave and the master is calculated using the transmission delay, and the slave clock is corrected based on the calculated error.
[0045] (2) Another aspect of the present invention is a method for time-synchronizing a group of slaves on a ring network with a master, comprising the steps of: a step of circulating the synchronization message transmitted by the master on the network by each of the slaves sequentially forwarding and relaying the synchronization message and then receiving the message at the master; calculating a transmission delay of the synchronization message based on a transmission time and a reception time of the synchronization message measured by an internal clock of the master; using the transmission delay to calculate an error between the built-in clock of the slave and the built-in clock of the master, and correcting the built-in clock of the slave based on the calculated error to synchronize with the built-in clock of the master. Effect of the Invention
[0046] According to the present invention, in a situation where it is not guaranteed that the round-trip transmission delay between nodes is the same, the transmission delay is measured only by the master clock, not by the master and slave clocks, thereby stabilizing the quality of time synchronization. [Brief description of the drawings]
[0047] [Figure 1] Schematic diagram of the time deviation between the master and slave. [Diagram 2] FIG. 1 is a schematic diagram showing conventional time synchronization. [Diagram 3] FIG. 13 is a schematic diagram showing a follow-up notification of a "FOLLOW-UP message." [Figure 4] Schematic diagram of a case where "transmission delay = 0" cannot be assumed. [Diagram 5] FIG. 1 is a schematic diagram showing a time synchronization process of PTP. [Figure 6] FIG. 2 is an explanatory diagram showing the transmission of a "SYNC message" in the time synchronization method according to the embodiment of the present invention. [Figure 7] An explanatory diagram showing the sending of the "FOLLOW-UP message". [Figure 8] Master block diagram. [Figure 9] Slave block diagram. [Figure 10] (a) is a diagram of the Ethernet frame making up the "SYNC message", "FOLLOW-UP message", and "PROBE message", (b) is a diagram of the Ethernet frame payload of the "SYNC message", (c) is a diagram of the Ethernet frame payload of the "FOLLOW-UP message", (d) is an explanatory diagram of "FLAGS" in (c), and (e) is a diagram of the Ethernet payload of the "PROBE message". [Figure 11] State transition diagram for each mode. [Figure 12] 11 is a graph showing measurement results of ring circumnavigation time. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0048] The following describes a time synchronization method according to an embodiment of the present invention. This time synchronization method is limited to a ring topology, and aims to avoid the root cause of the conventional problem, that is, "measuring transmission delay with two clocks (master clock and slave clock) with errors."
[0049] This will provide more efficient and reliable time synchronization than existing technology (PTP), making it particularly suitable for application to TSN (Time Sensitive Networking).
[0050] Specifically, the time synchronization method is used on the circular transmission path of a ring network (ring type LAN, ring topology, system: hereafter abbreviated as ring), and a master node on the network transmits a "SYNC message" from one of its ring ports (two ports connected to the ring) to an adjacent slave.
[0051] Then, the slave that receives the "SYNC message" forwards it to the adjacent slaves in turn by hardware forwarding, causing the "SYNC message" to circulate around the ring, where it is received by the other ring port of the master. This means that the transmission delay it takes to go around the ring can be measured only by the grandmaster clock of the master node, eliminating any room for clock errors between the slave clocks.
[0052] In addition, the round-trip delay when there is no transmission delay variation is measured in advance, and "SYNC messages" that are delayed beyond the acceptable range during operation are discarded to avoid incorrect time synchronization and reduce deterioration of synchronization accuracy. EXAMPLES
[0053] <Network configuration> A network configuration of an embodiment of the time synchronization method will be described with reference to Figures 6 and 7. In Figures 6 and 7, 10 indicates a ring, in which a master node (hereinafter abbreviated as master) 1 and slave nodes (hereinafter abbreviated as slaves) 1a to 1i are communicatively connected to a circular transmission path.
[0054] In this ring 10, as shown in Figure 1, the master 1 periodically transmits a "SYNC message" 7, which circulates around the ring 10. After the "SYNC message" 7 has circulated, the master 1 transmits a "FOLLOW-UP message" 8, which circulates around the ring 10. The circulation of these two messages 7 and 8 constitutes one synchronization processing unit.
[0055] The transmission of the "SYNC message" 7 and the "FOLLOW-UP message" 8 by the master 1 is preferably bidirectional, but may be unidirectional. The end point of the loop is the master 1, and the master 1 configures the switching operation so that general traffic does not circulate endlessly.
[0056] This corresponds to what is called a "blocking port" in "STP." However, since putting the ring port into a blocking state would also block the aforementioned messages 7 and 8, this is achieved by a different method.
[0057] <Master 1, slave 1a~1i configuration> The configuration of the master 1 and slaves 1a to 1i will be described with reference to Figures 8 and 9. The master 1 and slaves 1a to 1i each have a similar structure to a general PTP-compatible switching hub (switch).
[0058] That is, it is equipped with a CPU 2 that executes the synchronous ring protocol of ring 10, a switch engine 3 that forwards packets, a clock (built-in clock) 4 to be synchronized, timestamp registers 5a, 5b that detect the sending and receiving of "SYNC messages" and record the time, and ring ports 6a, 6b consisting of Ethernet ports connected to ring 10.
[0059] However, the switch engine 3 of the master 1 applies existing mechanisms such as VLAN (Virtual LAN) and ACL (Access Control List) to prevent general packets from circulating endlessly.
[0060] In addition, in PTP, the function of directly stamping the "SYNC message" 7 in the time stamp registers 5a and 5b is also used, but in this embodiment, since it is always necessary to send the "FOLLOW-UP message" 8, said direct stamping is not necessary.
[0061] <Frame composition> An example of the configuration of the "SYNC message" 7 and the "FOLLOW-UP message" 8 necessary for the time synchronization process of the embodiment will be described with reference to Figs.
[0062] Specifically, both messages 7 and 8 are composed of the Ethernet frame shown in Fig. 10(a). Fig. 10(b) and (c) show the fields of the Ethernet payload "PAYLOAD" of both messages 7 and 8. Table 1 shows the message format of the above fields.
[0063] [Table 1]
[0064] Moreover, the flags shown in Fig. 7(d) are set in the "FLAGS" of the "FOLLOW-UP message" 8. Table 2 shows the details of the flags in Fig. 7(d).
[0065] [Table 2]
[0066] <<Operation Processing>> As shown in FIG. 11, the operation of the entire ring in this embodiment includes (1) a calibration mode, (2) a synchronization mode, and (3) a normal operation mode.
[0067] That is, the ring characteristics are measured in the calibration mode, time synchronization is achieved in the synchronous mode based on the measurement results, and then the normal operation mode is switched to and general traffic starts passing while maintaining the time synchronization state.
[0068] In order to maintain the time synchronization state, the time synchronization processing that was performed in the synchronous mode is continued even in the normal operation mode. The only difference between the two is whether or not general traffic is allowed to flow onto the ring.
[0069] In normal operating mode, if it becomes difficult to maintain the synchronization quality of time synchronization due to the influence of general traffic, it is possible to temporarily fall back to the synchronous mode to re-establish time synchronization, and then transition back to the normal operating mode to resume the passage of general traffic.
[0070] [Calibration Mode] In the calibration mode, the ring characteristics are measured after setting the ring so that general traffic does not flow into the ring.
[0071] Methods for preventing the inflow of general traffic include: - Blocking in STP blocking state -Isolate ring ports with VLANs - Filter general packets with ACL Shut down common ports -Unplug the LAN cable from the general port A variety of implementations are possible.
[0072] In the calibration mode, the following two items are measured: Measurement item 1: Ring rotation time Tr Measurement item 2: Slave position H (1) Measurement item 1: Ring rotation time Tr In the calibration mode, general traffic is completely removed from the ring 10. Therefore, it is reasonably expected that the transfer delay time in the switch will be shortest and stable. The measurement process steps (S01 to S06) for the ring round time Tr will be described below. S01: Sending "SYNC message" 7 The master 1 sends a "SYNC message" 7 from the ring port 6a to the adjacent slave 1a. Table 3 shows the contents of the fields in the Ethernet payload of the "SYNC message" 7. Here, "F" stands for "FLAGS".
[0073] [Table 3]
[0074] When the "SYNC message" 7 passes through the ring port 6a of the master 1, the time of transmission is recorded by the time stamp register 5a. In PTP, a function for directly stamping the transmission time into the "SYNC message" 7 may be used, but as described above, in this embodiment, the transmission of the "FOLLOW-UP message" 8 is essential, so the direct stamping function is not necessary. In other words, the master 1 retrieves the transmission time of the "SYNC message" 7 from the register 5a and records it. The time value recorded here is "T1".
[0075] S02: "SYNC Message" 7 broadcast The slave 1a receives the “SYNC message” 7 sent by the master 1, and relays it to the neighbor slave 1b by hardware forwarding using the switch engine 3. This relay is repeated in turn by the slaves 1b to 1i, causing the message 7 to circulate on the ring 10.
[0076] That is, each of the slaves 1a to 1i transmits the "SYNC message" 7 received at one ring port 6a from the opposite ring port 6b without processing it. This is a flooding operation for multicast frames, and can be executed by any general switch engine.
[0077] At this time, in the ring port 6a, the time stamp register 5a records the passing time of the "SYNC message" 7. The times recorded here are designated as "Ta to Ti" for each of the slaves 1a to 1i. The values of "Ta to Ti" are referenced when a "FOLLOW-UP message" 8, which will be described later, is received.
[0078] The "SYNC message" 7 is mirrored (replicated) to the CPU 2 of each of the slaves 1a to 1i. A typical switch engine has a function for catching a reservation multicast packet at the CPU 2, so that it is easy to realize reception of this at the CPU 2.
[0079] When the "SYNC message" 7 is received by the CPU 2, each slave 1a to 1i refers to the "QUIET bit" and "QUIET TIMER" in the message 7 and sets itself accordingly so that no traffic occurs on the ring ports 6a and 6b. Note that not only does it stop the inflow of general traffic, but it also stops transmission from its own CPU.
[0080] S03: "SYNC Message" 7th Return The "SYNC message" 7 goes around the ring by being relayed by S02, and is finally received by the opposite ring port 6b of the master 1. At this time, the timestamp register 5b records the reception time. The time value recorded here is "T2".
[0081] As a result, the master 1 can calculate the ring circulation time Tr based on the transmission time T1 recorded in the time stamp register 5a in S01 and the reception time T2 recorded in the time stamp register 5b, as shown in equation (14).
[0082]
number
[0083] Both "T1" and "T2" in equation (14) are values measured by the clock 4 of the master 1. Therefore, for the ring orbit time Tr calculated by equation (14), there is no room for calculation error due to deviation between the clocks of the master 1 and the slaves 1a to 1i.
[0084] S04: Sending "FOLLOW-UP message" 8 After calculating the ring rotation time Tr of S03, the master 1 transmits a "FOLLOW-UP message" 8 from the ring port 6a to the adjacent slave 1a.
[0085] Table 4 shows the contents of the Ethernet payload fields of the "FOLLOW-UP message" 8. Here, "F" stands for "FLAGS." In the calibration mode, the clock 4 synchronization is not performed, so the flag "SYNC_FAIL" is always set to "1."
[0086] [Table 4]
[0087] S05: "FOLLOW-UP Message" 8 Relay / Return Slave 1a receives the "FOLLOW-UP message" 8 in the same way as the "SYNC message" 7, catches it with its own CPU 2, and forwards it to neighbor slave 1b. This operation process is repeated in sequence by slaves 1b to 1i, causing message 8 to circulate around ring 10, and after the message has circulated, master 1 receives it.
[0088] At this time, each of the slaves 1a to 1i refers to the "SYNC_FAIL" flag in the "FOLLOW-UP message" 8, detects that the flag is "1", and discards the reception time of the previously received "SYNC message" 7. Note that since time synchronization is not started in the calibration mode, the reception time of the "SYNC message" 7 may be discarded regardless of the value of the "SYNC_FAIL" flag.
[0089] If the discard condition for the reception time of the "SYNC message" 7 is logically expanded, it becomes "(SYNC_FAIL)||(MODE=CALIBRATION)", where "||" represents a logical sum.
[0090] S06: Repeated measurements In this embodiment, the ring round time Tr is measured by steps S01 to S05. Since the inflow of general traffic is blocked at this time, the measured value is expected to be correct, but to further improve accuracy, the measurement is repeated a predetermined number of times as shown in FIG.
[0091] In Figure 12, the minimum time "Tmin" is at the left base, and a distribution peak with an extremely small width is obtained.
[0092] The width "σ" of this peak must be sufficiently small compared to the required synchronization accuracy. If this is not the case with a poor switching engine, the method of this embodiment cannot be realized.
[0093] The X-coordinate value of the peak of this mountain is defined as the standard ring rotation time "Tstd." The standard ring rotation time "Tstd" can be said to be the time it takes for a "SYNC message" 7 to go around the ring 10 without waiting for transmission when it is transferred.
[0094] The calibration mode continues until the standard ring orbit time "Tstd" is obtained. The number of measurements can be determined according to the quality of the switching engine, the scale of the topology, the network administrator's way of thinking, and past experience. Note that if the network configuration of ring 10 changes, the calibration should be performed again.
[0095] (2) Measurement item 2: Slave position H In the calibration mode, in addition to measuring the standard ring rotation time "Tstd", the position of each of the slaves 1a to 1i on the ring 10 is also measured. Here, the position of the slaves 1a to 1i is the number of hops that elapse from the master 1 to each of the slaves 1a to 1i.
[0096] When the network configurations shown in Figs. 6 and 7 are evaluated counterclockwise, Slave 1a = 1 hop (1st machine from Master 1) Slave 1b = 2 hops (second slave) Slave 1c = 3 hops (3rd machine) Slave 1d = 4 hops (4th machine) Slave 1e = 5 hops (5th machine) Slave 1f = 6 hops (6th machine) Slave 1g = 7 hops (7th machine) Slave 1h = 8 hops (8th unit) Slave 1i = 9 hops (9th unit) On the other hand, if you evaluate it clockwise, Slave 1i = 1 hop (from Master 1 to the 1st slave) Slave 1h = 2 hops (second machine) Slave 1g = 3 hops (3rd machine) Slave 1f = 4 hops (4th machine) Slave 1e = 5 hops (5th machine) Slave 1d = 6 hops (6th machine) Slave 1c = 7 hops (7th machine) Slave 1b = 8 hops (8th unit) Slave 1a = 9 hops (9th machine) It becomes.
[0097] Each of the slaves 1a to 1i needs to know its own location (number of hops). Although the master 1 does not need to know the locations of the slaves 1a to 1i, it transmits a "PROBE message" 9 shown in Fig. 10(a)(e) from one of the ring ports 6a and 6b to allow each of the slaves 1a to 1i to detect its own location.
[0098] Table 5 shows the contents of the Ethernet payload fields of the "PROBE message" 9.
[0099] [Table 5]
[0100] The "PROBE message" 9 differs from other messages in that the destination Ethernet address is "01:80:C2:00:00:00". This is a frame called a "BPDU", and is not flooded but is received only by CPU2. In other words, it is transferred by a bucket relay by CPU2 of each of slaves 1a to 1i on ring 10.
[0101] The slaves 1a to 1i that receive the "PROBE message" 9 record the value in the "NODES" field in Fig. 10(e) plus 1 as their own location (number of hops from the master 1). The value recorded here is called "H". That is, the slaves 1a to 1i overwrite the "NODES" field with the hop count H and transfer the packet to the neighbor. As a result, the value of the "NODES" field is incremented by 1 each time the packet passes through each of the slaves 1a to 1i. By repeating this bucket brigade, all slaves 1a to 1i can grasp their own positions. This measurement is performed for both the clockwise and counterclockwise directions of the ring 10. However, if both messages 7 and 8 are limited to one direction, it is sufficient to perform the measurement only for that direction. The "PROBE message" 9 is ultimately received and returned to the other of the ring ports 6a, 6b of the master 1. At this time, the value of the "NODES" field written in the message 9 becomes the total number of slaves 1a to 1i on the ring 10, which is designated as "N." The master 1 writes the value of "N" in the "NODES" field of each of the messages 7 and 8 and advertises it to the entire ring 10. After measuring "N", the master 1 and slaves 1a to 1i perform the following verification. Note that "N'" and "H'" shown below respectively indicate the values of "N" and "H" in the counterclockwise direction. (Master 1 verification) Master 1 checks whether the number of nodes “N” and “N'” match in the clockwise and counterclockwise directions, i.e., whether equation (15) holds.
[0102]
number
[0103] (Checking slaves 1a to 1i) The slaves 1a to 1i check whether the sum of the clockwise and counterclockwise positions H, H' coincides with the number of nodes N, that is, whether the formula (16) holds.
[0104]
number
[0105] If the above-mentioned calculation result is an error, that is, if the formulas (15) and (16) do not hold, the positions of the slaves 1a to 1i are measured again.
[0106] [Synchronous mode] (1) When the standard link rotation time “Tstd” and the number of nodes “N” are determined in the calibration mode, the mode transitions to the synchronization mode (DONE transition in FIG. 11).
[0107] Only the master 1 has the authority to transition the operation mode. That is, the master 1 writes its own decision in the “MODE” field of each of the messages 7 and 8 and announces it to the entire ring 10. In the synchronous mode, similarly to the calibration mode, the processes using the messages 7 and 8 are periodically executed. The frequency of execution is set according to the required accuracy, the scale of the ring, or the idea of the network administrator. However, the synchronous mode differs from the calibration mode in the method of determining the "SYNC_FAIL" flags in both messages 7 and 8. That is, in the calibration mode, the "SYNC_FAIL" flag is always set to "1." In contrast, in the synchronous mode, the value of the "SYNC_FAIL" flag is adjusted according to the following evaluation: (A) Periodically execute the processes using both messages 7 and 8, and calculate the ring rotation time "Tr" each time using equation (14). (B) Calculate the excess delay "Trx" of each ring round trip time "Tr" using equation (17).
[0108]
number
[0109] The value of the excess delay "Trx" is the total time that the "SYNC message" 7 is forced to wait due to the influence of a preceding frame being transmitted when it is forwarded by the switch. (C) If the excess delay time "Trx" becomes a negative value, the standard ring rotation time "Tstd" obtained in the calibration mode is considered to be inaccurate, so fall back to the calibration mode (BREAK transition in Figure 11). (5) When the excess delay time "Trx" becomes a positive value, it is compared with the cutoff line setting determined based on the required accuracy. As a result of this comparison, the "SYNC_FAIL" flag is determined as follows: If it is below the cutoff line: Set the "SYNC_FAIL" flag to "0". If it is above the cutoff line: Set the "SYNC_FAIL" flag to "1".
[0110] This makes it possible to reliably detect whether an unacceptable level of delay occurred anywhere on the ring 10 when the most recent “SYNC message” 7 circulated around the ring 10 .
[0111] Moreover, by advertising the result of the detection on the ring 10, it is possible to discard the reception time of the most recent "SYNC message" 7 and prevent the deterioration of the synchronization quality. Except for this adjustment of the "SYNC_FAIL" flag, the master 1 executes the same process as in the calibration mode.
[0112] (2) The slaves 1a to 1i execute the same operation process as in the calibration mode when the "SYNC_FAIL" flag is "1." On the other hand, when the "SYNC_FAIL" flag is "0," the slaves 1a to 1i execute the following operation process.
[0113] That is, the slaves 1a to 1i that receive the "FOLLOW-UP message" 7 with the "SYNC_FAIL" flag set to "0" calculate the error (deviation) "Δt" of their own clocks 4.
[0114] Here, the "SYNC_TIMESTAMP" written in the "FOLLOW-UP message" 7 is "T1", and the reception time of the most recent "SYNC message" 7 measured by each of the slaves 1a to 1i using its own clock 4 is "Ts". In this case, the error "Δt" can be expressed by equation (18).
[0115]
number
[0116] In equation (18), "D S " indicates the time it takes for the "SYNC message" 7 to propagate from the master 1 to the slaves 1a to 1i. The evaluation formula for formula (18) at this stage is the same as that of PTP, and "D S" is calculated differently.
[0117] In this embodiment, "D S To explain the calculation method and basis of "Tr", first, the round trip time "Tr" that it took for the most recent "SYNC message" 7 to go around the ring 10 is recorded in the "LAP_DELAY" field of the "FOLLOW-UP message" 8. This round trip time "Tr" can be said to be the standard ring round trip time "Tstd" plus the excess delay "Trx", as shown in equation (19).
[0118]
number
[0119] Next, as described above, the excess delay time "Trx" is measured with high accuracy by the master 1. Also, when the "SYNC_FAIL" flag is "0", it is confirmed that the excess delay time "Trx" is sufficiently small compared to the required accuracy.
[0120] In this case, in terms of the required order of accuracy, the excess delay time "Trx" approximates "0" ("Trx ≒ 0"), and equation (20) holds.
[0121]
number
[0122] Furthermore, the standard link round trip time "Tstd" is calculated as the time required when there is zero delay and no fluctuation in the switching engine 3 in the calibration mode. Therefore, the delay "Dhop" occurring for each hop can be estimated to be uniform for each of the slaves 1a to 1i and is approximated as shown in equation (21).
[0123]
number
[0124] "N" in equation (21) indicates the total number of slaves 1a to 1i on the ring 10. The value of "N" is written in the "NODES" fields of both messages 7 and 8, and therefore can always be read out.
[0125] At this time, the slaves 1a to 1i know the number of hops H from the master 1 to themselves from the "PROBE message" 9. Using the value of this number of hops H, the time "D S " can be calculated as shown in equation (22).
[0126]
number
[0127] Then, equation (23) can be obtained from equations (18) and (22).
[0128]
number
[0129] From the above, the error "Δt" can be calculated using equation (24).
[0130]
number
[0131] As a result, the slaves 1a to 1i can achieve time synchronization with the master 1 by subtracting the error "Δt" from their own clocks 4, as shown in equation (25).
[0132]
number
[0133] In PTP, in order to mitigate the effects of sudden errors, it is necessary to implement some sort of smoothing mechanism, such as a moving average. In contrast, in this embodiment, the mixed error "Δt" is accurately measured by the master 1, and a synchronization process in which a delay exceeding the required accuracy occurs can be reliably discarded when the "SYNC_FAIL" flag is "1". Therefore, according to this embodiment, a nearly perfect time synchronization state can be obtained in one synchronization process without the need for a smoothing mechanism.
[0134] However, in order to obtain a reliable time synchronization state, it is preferable to maintain the synchronous mode state until the conditions set by the network administrator are met. For example, examples of conditions for transitioning to the normal operation mode are as follows: - 3 consecutive successful synchronizations Repeat the synchronization process for about 3 minutes, and if the number of times that the "SYNC_FAIL" flag is "1" is less than the preset value It is preferable to set safety standards such as the following.
[0135] This safety standard may be determined according to the quality of the switch engine 3, the scale of the ring 10, and the network administrator's opinion. When this safety standard is satisfied, a transition to the normal operation mode occurs (SYNCED transition in FIG. 11).
[0136] <Normal operation mode> When time synchronization is established in the synchronous mode, the above-mentioned SYNCED transition causes a transition to the normal operation mode.
[0137] Even in the normal operation mode, the master 1 and the slaves 1a to 1i periodically execute the processes using the messages 7 and 8. The frequency of execution can be determined according to the required accuracy, the scale of the ring, and the network administrator's ideas.
[0138] The master 1 sets an integer value representing the normal operation mode in the "MODE" field of both messages 7 and 8 that it transmits, and advertises to the entire ring 10 that it has switched to the normal operation mode.
[0139] At this time, the master 1 and the slaves 1a to 1i that have detected the transition to the normal operation mode change the settings of the switch engine 3 to allow general traffic to pass through the ring 10. This establishes a system in which time synchronization is maintained while sharing the line with general traffic.
[0140] <<Fallback operation mode>> The three operation modes (calibration mode, synchronization mode, normal operation mode) are the same in that the processes using the two messages 7 and 8 are continuously performed, but differ in the implementation of the synchronization process / permission of inflow of general traffic.
[0141] Normally, the state transition is one-way, in the order of "calibration mode → synchronization mode → normal operation mode." However, a fallback transition to calibration mode due to poor calibration / time synchronization is also possible. The transition conditions to return to this calibration (BREAK in Figure 11) are as follows: (1) When the network configuration changes (2) If the excess delay "Trx" of the ring rotation time Tr is found to be a negative value The transition condition (RESYNC) from the normal operation mode back to the synchronous mode is assumed to be when a yellow light turns on to maintain the synchronization quality, which will be described later.
[0142] <Observation of time synchronization quality> In this embodiment, we propose a measure to monitor the quality of time synchronization. It is preferable that the network administrator defines the fallback conditions to the synchronous mode based on the results of this monitoring.
[0143] (1) Continuous failures If the processes using the two messages 7 and 8, which are periodically performed, fail consecutively, the system is caused to fall back to the synchronous mode according to the number of failures.
[0144] For example, let us assume that the network administrator has set this to 3 times. Master 1 fails to process both messages 7 and 8, and sets "SYNC_FAIL" to "1". In this case, it adds "1" to the failure counter C. On the other hand, if the processing by both messages 7 and 8 is successful, it resets failure counter C to "0".
[0145] Then, every time the process is performed using the messages 7 and 8, it checks whether the "failure counter C ≥ 3" is satisfied, and if so, it transitions to synchronous mode. At this time, the "MODES" fields of the messages 7 and 8 sent by the master 1 from the next time onwards are set to synchronous mode, and this is advertised to the entire ring 10.
[0146] (2) Continuous failure time If the time elapsed since the last successful processing of both messages 7 and 8 exceeds a preset threshold, the mode is allowed to fall back to synchronous mode.
[0147] (3) Error correction amount As described above, the slaves 1a to 1i calculate and correct the error "Δt" each time by processing the two messages 7 and 8. However, if the error "Δt" becomes a value that suggests a synchronization failure, the slaves 1a to 1i request the master 1 to transition to the synchronous mode.
[0148] The criteria for determining poor synchronization are as follows: - When the error "Δt" exceeds the preset threshold - When the error "Δt" value has changed by a percentage (%) greater than the threshold value compared to the previous time If the error "Δt" continues to be "0" The following are anticipated:
[0149] The following are some possible possibilities:
[0150] Network administrators can configure fallback conditions by combining these criteria alone or in combination to stabilize the quality of time synchronization.
[0151] <Action and effect> According to this embodiment, the following advantageous effects can be obtained.
[0152] (1) Reducing the load on CPU2 and network bandwidth by simplifying procedures In the existing technology (PTP), two round trips of messages were required between the master 1 and the slaves 1a to 1i. In contrast, in this embodiment, a one-way message transmission from the master 1 is sufficient, and the load on the CPU 2 of the master 1 and the network bandwidth can be reduced.
[0153] For example, in the network configurations of FIGS. 6 and 7, since there are nine slaves 1a to 1i, the processing units of the master 1 generated in one synchronization process according to the conventional technology are as follows (one message is one unit): Sending one "SYNC message" 7 (flooding the entire network via multicast) 9 "DELAY_REQ messages" received from slaves 1a to 1i -Replying 9 "DELAY_RES messages" to slaves 1a~1i Total of 19 credits (20 credits if you send "FOLLOW-UP message" 8) is required.
[0154] In contrast, in this embodiment, Sending one "SYNC message" 7 (flooding the entire ring 10 via multicast) Sending one "FOLLOW-UP message" 8 (flooding the entire ring 10 via multicast) Only 2 credits required.
[0155] In particular, in the prior art, the processing unit of the master 1 increases in proportion to the number of slaves, whereas in this embodiment, two units are always sufficient regardless of the number of slaves.
[0156] (2) Stabilizing the quality of time synchronization In the existing technology, the synchronization accuracy is easily affected by fluctuations in each synchronization process. In contrast, according to the present embodiment, the ring orbit time Tr can be measured with high accuracy, so that a synchronization process with a large error "Δt" can be reliably discarded, and the quality of the time synchronization can be easily maintained. In other words, since the processing structure is simple, there is no large fluctuation in the synchronization accuracy, and in this respect, the accuracy of the time synchronization can be stabilized.
[0157] (3) Synchronization takes a short time In the existing technology, the introduction of a smoothing mechanism increases the time required to achieve a synchronized state. In contrast, in the present embodiment, in theory, synchronization can be achieved in one try, minimizing the time required to achieve a synchronized state. [Explanation of symbols]
[0158] 1…Masternode (Master) 1a~1i...Slave node (slave) 2. CPU 3. Switch engine 4. Clock (built-in clock) 5a, 5b...Time stamp register 6a, 6b…Ring port 7...SYNC message (synchronization message) 8…FOLLOW-UP message (follow-up notification) 9. PROBE message 10…Ring network
Claims
1. By executing a calibration mode for measuring the characteristics of a ring network and a synchronization mode based on the results of said measurement, A method for time-synchronizing a group of slaves on the ring network with a master, comprising: In the calibration mode, Under a setting where general traffic does not flow in, a synchronization message transmitted by the master is sequentially forwarded and relayed by each of the slaves, and then the message is received by the master. This ring circulates multiple times, the master measures a ring orbit time for each of the rings, and calculates a standard ring orbit time based on the measured ring orbit times and a minimum time according to a required accuracy; In the synchronous mode, The master periodically circulates the synchronization message in the same manner as in the calibration mode, Calculating an excess delay time as a difference between a ring rotation time of the periodically circulated synchronization message and the standard ring rotation time; If the excess delay time exceeds a preset tolerance level, the excess delay time is notified to each of the slaves. Each of the slaves calculates a transmission delay of the synchronization message based on a transmission time and a reception time of the synchronization message measured by a clock of the master in response to the advertisement; Calculating an error between the clock of the slave and the clock of the master using the transmission delay, and correcting the clock of the slave based on the calculated error. A time synchronization method characterized by the above.
2. In the calibration mode, the master calculates the number of hops from the master to each of the slaves, In the synchronous mode, a transit delay time per slave is estimated using the ring circulation time; The transmission delay to each slave is calculated by multiplying the estimated result by the number of hops.
2. The time synchronization system according to claim 1.
3. In the synchronous mode, the master By the advertisement, 3. The time synchronization system according to claim 1, wherein the reception time of the synchronization message in which the excessive delay time occurs is discarded.
4. In the synchronization mode, the master notifies the slave of the circulation time of the synchronization message in a trailing manner; 3. The time synchronization system according to claim 2, wherein a message is transmitted to inform the slave of the number of hops.
5. 5. The time synchronization method according to claim 1, further comprising: transitioning to a normal mode in which general traffic can flow into the ring network after completion of time synchronization in the synchronous mode.
6. 6. The time synchronization method according to claim 5, wherein a fallback transition to the calibration mode or the synchronization mode is possible after the transition to the normal mode.
7. By executing a calibration mode for measuring the characteristics of a ring network and a synchronization mode based on the results of the measurement, A method for time-synchronizing a group of slaves on the ring network with a master, comprising the steps of: The calibration mode includes: A step of performing a ring rotation a plurality of times in which the synchronization message transmitted by the master is sequentially forwarded and relayed by each of the slaves under a setting that does not allow general traffic to flow, and the synchronization message is then received by the master; a step of the master measuring a ring orbit time for each of the rings and calculating a shortest time according to a required accuracy from a group of the measured ring orbit times as a standard ring orbit time; having The synchronous mode is the master periodically circulates the synchronization message in the same manner as in the calibration mode; calculating a difference between a ring rotation time of the periodically circulated synchronization message and the standard ring rotation time as an excess delay time; notifying each of the slaves if the excess delay time exceeds a preset tolerance level; each of the slaves calculates a transmission delay of the synchronization message based on a transmission time and a reception time of the synchronization message measured by a clock of the master in response to the advertisement; calculating an error between the clock of the slave and the clock of the master using the transmission delay, and correcting the clock of the slave based on the calculated error; A time synchronization method comprising:
Citation Information
Patent Citations
Time control system for lan
JP1993167589A
Communication system, communication system control method, master device, maser device control method, master device control program, slave device, slave device control method, and slave device control program
JP2013146006A
Time synchronization method for virtual LAN
JP2018174445A
Communication device, synchronized communication system, and synchronized communication method
WO2008123272A1
Communication system, management apparatus, communication apparatus and computer program
WO2008129593A1