CN104092528A - Clock synchronization method and device - Google Patents

Clock synchronization method and device Download PDF

Info

Publication number
CN104092528A
CN104092528A CN201410333987.9A CN201410333987A CN104092528A CN 104092528 A CN104092528 A CN 104092528A CN 201410333987 A CN201410333987 A CN 201410333987A CN 104092528 A CN104092528 A CN 104092528A
Authority
CN
China
Prior art keywords
port
clock
equipment
node equipment
topology message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410333987.9A
Other languages
Chinese (zh)
Other versions
CN104092528B (en
Inventor
张为
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201410333987.9A priority Critical patent/CN104092528B/en
Publication of CN104092528A publication Critical patent/CN104092528A/en
Application granted granted Critical
Publication of CN104092528B publication Critical patent/CN104092528B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a clock synchronization method. The method comprises the steps of sending Topology messages to other clock node devices through ports on two sides according to a preset low sending frequency; receiving Topology messages sent by the other clock node devices through the ports on two sides; constructing a network topology table according to the received Topology messages, wherein the network topology table contains the priority vector of each port through which the Topology messages are sent; determining whether the device is an optimal clock node device according to the priority vector of each port; if yes, releasing synchronous clocks to the other clock node devices through a main port; if not, determining the main port and a slave port from the ports on two sides according to the network topology table, and receiving the synchronous clock released by the optical clock node device through the slave port to achieve the updating of a local clock; forwarding the synchronous clock to a next hop of node device through the main port. By the adoption of the clock synchronization method, convergence time of port role calculation can be reduced, and the stability of a system can be improved.

Description

A kind of clock synchronizing method and device
Technical field
The present invention relates to communication technical field, relate in particular to a kind of clock synchronizing method and device.
Background technology
In communication network, permitted multiple services normal operation and all required clock synchronization of ad, the time between each equipment of whole network or difference on the frequency remain in rational error level.Clock synchronization of ad comprises time synchronized and Frequency Synchronization, and so-called time synchronized refers to that frequency and the phase place between signal is all consistent, and the phase difference perseverance between signal is zero; Described Frequency Synchronization, refer to and between signal, in frequency or phase place, keep certain strict particular kind of relationship, signal occurred with same Mean Speed in its corresponding significant instant, to guarantee that all devices in communication network all moves with identical speed, keeps constant phase difference between signal.For example, refer to Fig. 1, if having two table Clock A and Clock B, if the time of these two tables is all consistent all the time, this state is exactly time synchronized; If the Time Inconsistency of these two tables, but keep a constant difference (always if the Clock B in figure was than late 6 hours of Clock A), this state is exactly Frequency Synchronization.
PTP (Precision Time Protocol, Precision Time Protocol) agreement is a kind of agreement of time synchronized, and for the precise synchronization between equipment, we are called PTP territory by the network of having applied PTP agreement.In PTP territory, have and only have a synchronised clock, all devices in territory all keeps synchronizeing with this clock.Node in PTP territory is called clock node, and the port that has moved PTP agreement on clock node is called PTP port.In PTP territory, the clock node of issuing lock in time is called host node (Master Node), and the clock on host node is called master clock (Master Clock), and the PTP port of issuing lock in time on clock node is called master port; The clock node that receives lock in time is called from node (Slave Node), and the clock from node is called from clock (Slave Clock), and the PTP port that receives lock in time is called from port (Slave Port).
Refer to Fig. 2, clock nodes all in PTP territory are all pressed certain hierarchical organization together, and the reference time in whole territory is exactly optimum clock (Grandmaster Clock, GM), the i.e. clock of highest level.Mutual by PTP protocol massages between each clock node, the time of optimum clock is synchronized in whole PTP territory the most at last, is therefore also called clock source.Optimum clock can pass through the static appointment of manual configuration, also can pass through the election of BMC (Best Master Clock, best master clock) protocol dynamic, and its process of dynamically electing is as follows:
Between each clock node by information such as optimum clock priority entrained in mutual Announce message, time grade, time precisions, finally select a node as the optimum clock in PTP territory, meanwhile, the principal and subordinate's port on the master slave relation between each node and each node has also been determined.By this process, in whole PTP territory, set up a loop free, full-mesh, and take the spanning tree that optimum clock is root.After this, host node can regularly send Announce message to from node, if within a period of time, from node, does not receive the Announce message that host node is sent, just think that this host node lost efficacy, so re-start the selection of optimum clock.
In PTP annular networking, link occurs fault between equipment or recovery, all can trigger relevant device and use BMC algorithm to recalculate port role, and transmit the information after upgrading step by step, after series of computation, obtain final stable master slave relation, then the time started is synchronous.For example, refer to Fig. 3, suppose that C0 is optimum clock, C0 is C0-C5-C4-C3 to the path of C3 lock in time, the link failure between C0 and C5, and C5 detects and triggers BMC algorithm after fault and recalculate port role, sends the Announce message of renewal.In like manner, C4 receives that also triggering BMC algorithm after this message recalculates port role, sends Announce message after renewal to C3, and C3 selects the Slave port-for-port 32 making new advances, and starts the lock in time from C2.Now C0 is C0-C1-C2-C3 to new path lock in time of C3.
Yet, for PTP annular networking, because the more time of common needs is restrained in the time synchronized path that link failure or recovery cause again, especially in the more situation of the equipment in the looped network, need to notify one by one fault and recalculate port role, therefore time synchronized will be interrupted the longer time, thereby may cause the asynchronism(-nization) step between equipment.
Summary of the invention
In view of this, the present invention proposes a kind of clock synchronizing method, is applied to the clock synchronization compliant with precision time protocol node device in annular networking, and described method comprises:
By both sides port, to other clock node equipment, according to default slow transmission frequency, send Topology message respectively;
By both sides port, receive respectively the Topology message that described other clock node equipment send;
According to the Topology message receiving, build network topology table, described network topology table comprises the priority vector of each port that sends described Topology message;
According to the priority vector of described each port, determine whether this equipment is optimum clock node equipment;
If so, by master port, to other clock node equipment, issue synchronised clock;
If not, according to described network topology table, determine master port in the port of described both sides and from port, by receive the synchronised clock of described optimum clock node equipment issue from port, complete the renewal of local clock; By master port, described synchronised clock is transmitted to next-hop node equipment.
Preferably, described priority vector comprises some subvectors of arranging according to preset order;
Described in described basis, the priority vector of other each ports determines whether this equipment is that optimum clock node equipment comprises:
Each subvector in the priority vector of the both sides port of this equipment and described other each ports is compared successively according to described preset order, take and determine whether the priority vector of this equipment is optimal vector;
If so, this equipment is optimum clock node equipment;
If not, this equipment is not optimum clock node equipment.
Preferably, described Topology message comprises original jumping figure, current jumping figure and neighbor device mode field; Described neighbor device mode field comprises east orientation and the western port status to port of the transmit port of described Topology message;
The Topology message that described basis receives builds network topology table and comprises:
Jumping figure according to the difference confirmation of described original jumping figure and described current jumping figure with other clock node equipment;
According to described neighbor device mode field, confirm described east orientation and the western port status to port;
The ports zone that receives described Topology message according to this equipment separates the sending direction of described Topology message in looped network.
Preferably, described method also comprises:
When described current jumping figure be 0 or the Topology message received send for this equipment Topology message time, stop by described master port described Topology message repeating to next-hop node equipment.
Preferably, describedly according to described network topology table, determine the master port in the port of described both sides and comprise from port:
The jumping figure of more described both sides port and described optimum clock node equipment respectively;
Selecting the port less with the jumping figure of described optimum clock node equipment is from port; Another is master port.
Preferably, describedly according to described network topology table, determine the master port in the port of described both sides and also comprise from port:
When the jumping figure of described both sides port and described optimum clock node equipment is identical, respectively each subvector in the priority vector of the upstream transmit port of described both sides port is compared successively according to described preset order;
Select the clock node equipment at the more excellent transmit port place, upstream of priority vector as upstream clock source device, the port that connects this equipment is from port; Another is master port.
Preferably, described method also comprises:
When link failure being detected, from the opposite side port of faulty link, according to quick transmission frequency, send described Topology message immediately, so that other clock nodes are received, the described network topology table of this locality upgraded after this Topology message and redefined master port in the port of described both sides and from port; Wherein, described quick transmission frequency is greater than described default slow transmission frequency.
The present invention also proposes a kind of clock synchronization apparatus, is applied to the clock synchronization compliant with precision time protocol node device in annular networking, and described device comprises:
Sending module, for sending Topology message to other clock node equipment according to default slow transmission frequency respectively by both sides port;
Receiver module, the Topology message sending for receive respectively described other clock node equipment by both sides port;
Build module, for building network topology table according to the Topology message receiving, described network topology table comprises the priority vector of each port that sends described Topology message;
Determination module, for determining according to the priority vector of described each port whether this equipment is optimum clock node equipment; If so, by master port, to other clock node equipment, issue synchronised clock; If not, according to described network topology table, determine master port in the port of described both sides and from port, by receive the synchronised clock of described optimum clock node equipment issue from port, complete the renewal of local clock; By master port, described synchronised clock is transmitted to next-hop node equipment.
Preferably, described priority vector comprises some subvectors of arranging according to preset order;
Described determination module is further used for:
Each subvector in the priority vector of the both sides port of this equipment and described other each ports is compared successively according to described preset order, take and determine whether the priority vector of this equipment is optimal vector;
If so, this equipment is optimum clock node equipment;
If not, this equipment is not optimum clock node equipment.
Preferably, described Topology message comprises original jumping figure, current jumping figure and neighbor device mode field; Described neighbor device mode field comprises east orientation and the western port status to port of the transmit port of described Topology message;
Described structure module is further used for:
Jumping figure according to the difference confirmation of described original jumping figure and described current jumping figure with other clock node equipment;
According to described neighbor device mode field, confirm described east orientation and the western port status to port;
The ports zone that receives described Topology message according to this equipment separates the sending direction of described Topology message in looped network.
Preferably, described determination module is further used for:
Described current jumping figure be 0 or the Topology message received send for this equipment Topology message time, stop by described master port described Topology message repeating to next-hop node equipment.
Preferably, described determination module is further used for:
The jumping figure of more described both sides port and described optimum clock node equipment respectively;
Selecting the port less with the jumping figure of described optimum clock node equipment is from port; Another is master port.
Preferably, described Topology message also comprises the port priority of the transmit port of this Topology message;
Described determination module is further used for:
When the jumping figure of described both sides port and described optimum clock node equipment is identical, respectively each subvector in the priority vector of the upstream transmit port of described both sides port is compared successively according to described preset order;
Select the clock node equipment at the more excellent transmit port place, upstream of priority vector as upstream clock source device, the port that connects this equipment is from port; Another is master port.
Preferably, described sending module is further used for:
When link failure being detected, from the opposite side port of faulty link, according to quick transmission frequency, send described Topology message immediately, so that other clock nodes are received, the described network topology table of this locality upgraded after this Topology message and redefined master port in the port of described both sides and from port; Wherein, described quick transmission frequency is greater than described default slow transmission frequency.
Compared to existing program, the present invention determines optimum clock and port role by mutually mutual Topology message between the clock node equipment in looped network, between clock node equipment in looped network, no longer by mutual Announce message and BMC port role algorithm, determine optimum clock and port role, because described Topology message forwards based on hardware, can realize nearly all equipment and receive simultaneously and process described Topology message, thereby reduced the convergence time that port role calculates, increased the stability of system.
Accompanying drawing explanation
Fig. 1 is time synchronized and Frequency Synchronization schematic diagram in prior art;
Fig. 2 is fundamental clock node schematic diagram in prior art;
Fig. 3 is PTP annular networking figure in prior art;
Fig. 4 is the clock synchronizing method flow chart shown in the exemplary a kind of execution mode of the present invention;
Fig. 5 is the message format of the Topology message shown in the exemplary a kind of execution mode of the present invention;
Fig. 6 is the form of the edgeStatus field of the Topology message shown in the exemplary a kind of execution mode of the present invention;
Fig. 7 be the exemplary a kind of execution mode of the present invention illustrate message transmitting party in loop network to schematic diagram;
Fig. 8 is the schematic diagram of PTP port role election in the loop network shown in the exemplary a kind of execution mode of the present invention;
The schematic diagram of PTP port role election when Fig. 9 is the loop network link fault shown in the exemplary a kind of execution mode of the present invention;
Figure 10 is the structural representation of the clock synchronization apparatus shown in the exemplary a kind of execution mode of the present invention;
Figure 11 is the hardware configuration schematic diagram of the described clock synchronization apparatus clock synchronization compliant with precision time protocol of the carrying node device shown in the exemplary a kind of execution mode of the present invention.
Embodiment
The present invention sends respectively Topology message by the both sides port of clock node equipment from looped network, and the Topology message sending according to other clock node equipment in the looped network receiving constructs ring-network topology, then according to the described ring-network topology constructing, determine optimum clock in looped network and the port role in the port of described both sides; Due in the present invention, between clock node equipment, no longer by mutual Announce message and BMC port role algorithm, determine optimum clock and port role, described Topology message forwards based on hardware, can realize nearly all equipment and receive simultaneously and process described Topology message, therefore can reduce the convergence time that port role calculates, increase the stability of system.
Below in conjunction with the accompanying drawing embodiment that develops simultaneously, describe the present invention.
Refer to Fig. 4, Fig. 4 is according to a kind of clock synchronizing method shown in an exemplary embodiment, is applied to the clock synchronization compliant with precision time protocol node device in annular networking, and described method is carried out following steps:
Step S401, by both sides port respectively to other clock node equipment according to default slow transmission frequency transmission Topology message;
Step S402, by both sides port, receive respectively the Topology message that described other clock node equipment send;
The Topology message that step S403, basis receive builds network topology table, and described network topology table comprises the priority vector of each port that sends described Topology message;
Step S404, according to the priority vector of described each port, determine whether this equipment is optimum clock node equipment; If so, by master port, to other clock node equipment, issue synchronised clock; If not, according to described network topology table, determine master port in the port of described both sides and from port, by receive the synchronised clock of described optimum clock node equipment issue from port, complete the renewal of local clock, by master port, described synchronised clock is transmitted to next-hop node equipment.
In the present embodiment, for the existing PTP agreement of compatibility, can transform the Announce message in PTP agreement, in reserved field, introduce after new available fields as described Topology message;
Particularly, refer to the message format that 5, Fig. 5 is Topology message, on the basis of the message format of described Announce message, introduced following content:
One, introduces a new value 0x04 in the type of message messageType field in message header, represents that this message is Topology message.
Its two, the reserved byte of message 64,65 is defined as respectively to ttl and ttlBase field, the value of described ttl field represents current jumping figure, the value of described ttlBase field represents original jumping figure; The every value through an equipment ttl field of described Topology message subtracts 1, and the value of described ttlBase field remains unchanged.Wherein, the initial value of ttl field and ttlBase field, can specifically arrange according to the quantity of equipment in actual networking, for example, the initial value of described ttl field and ttlBase field all can be set to 255.
Its three, the reserved byte of message 66 is defined as to edgeStatus field, i.e. neighbor device mode field.Refer to Fig. 6, Fig. 6 is the concrete form of edgeStatus field, described esw field (edge state, west) and described ese field (edge state, east) west of transmit port that represents respectively current this Topology message is to the port status of port and east orientation port, when specific implementation, can by described field value, be to represent fault at 1 o'clock, value is within 0 o'clock, to represent normally.
Wherein, refer to Fig. 6, described west to, refer to the clockwise direction in looped network; Described east orientation, refers to the counter clockwise direction in looped network.The west of the transmit port of described Topology message represents respectively described transmit port clockwise direction and anticlockwise next port in looped network to port and east orientation port.For example, as shown in Figure 7, if port one is the transmit port of described Topology message, the east orientation port that port 2 is described port one so; 8 of ports are that the west of port one is to port.
What deserves to be explained is, in described Topology message, except the above content of new introducing, the concrete meaning of other fields is identical with the concrete meaning in described Announce message.
In the present embodiment, when described Topology message has built, described clock node equipment sends described Topology message to other clock node equipment according to default slow transmission frequency by both sides port.Described both sides port, the equipment that refers to is to east orientation in looped network and west to the port that sends respectively message; For example, as shown in Figure 7, for C0 equipment, it is by port one and 8 respectively to the east orientation in looped network and west to sending respectively message, so port one and 8 is the both sides port of described C0.
In the present embodiment, described Topology message comprises the priority vector of this message source mouth; Wherein, described priority vector comprises some subvectors of arranging according to preset order, and those subvectors are for determining whether this equipment is optimum clock node equipment.When specific implementation, can select the existing parameter of carrying in described Topology message as described subvector, also can not adopt the existing parameter in Topology message to specify separately.
For example, in a kind of preferred version, described priority vector can be to arrange according to the order in Topology message, comprises Priority1, ClockQuality, Priority2, ClockId, SrcPortId and the combination of the isoparametric subvector of RcvPortIndex of appointment separately in described Topology message.Wherein, PTP agreement regulation Priority1 and Priority2 are referred to as the priority facility of the transmit port of Topology message; SrcPortId is the port id of the transmit port of Topology message, by the MAC Address of this port, is calculated, and has uniqueness (joining in detail IEEE802.1AS-2011); ClockQuality is clock attribute, and ClockId is clock ID; RcvPortIndex is the port index numbering of Topology message sink mouth, for distinguishing with described SrcPortId.
Further, described clock node equipment, when sending described Topology message, can send according to different transmission frequency according to network condition; For example, the in the situation that of network stabilization, described clock node equipment can send described Topology message according to described default slow transmission frequency, now can be referred to as slow transmission pattern; When equipment Inspection link failure, enable immediately quick sending mode, from the opposite side port of faulty link, according to the quick transmission frequency that is greater than described slow transmission frequency, send described Topology message.
Wherein, the concrete value size of described default slow transmission frequency and described quick transmission frequency is not particularly limited in the present embodiment, and those skilled in the art can specifically arrange according to actual network state; For example, can be 100ms by described default slow transmission frequency default setting, by described quick transmission frequency default setting, be 10ms.
Meanwhile, described clock node equipment is by the described Topology message that in the port collecting ring net of both sides, other clock node equipment send.Described both sides port the Topology message hardware receiving is forwarded and simultaneously on give described clock node equipment control plane process.
On the one hand, after described clock node equipment has been collected the Topology message that in looped network, other clock node equipment send, can be according to the ttl carrying in each Topology message and ttlBase field, and the value of edgeStatus field (neighbor state field) generates the network topology table of current looped network.
Particularly, in the Topology message that can receive by calculating, the value of ttl and ttlBase field is poor, calculates the jumping figure between the port and the port of this Topology message of transmission; Can, according to the concrete value of edgeStatus field in the Topology message of receiving, confirm east orientation and the western port status to port of the port; Can also distinguish the sending direction of this Topology message in looped network according to the port (being RcvPortIndex) that receives described Topology message in this equipment.When specific implementation, described priority vector also can corresponding write in the network topology table of generation.
On the other hand, after described clock node equipment has been collected the Topology message that in looped network, other clock node equipment send, also can determine whether this equipment is optimum clock node equipment according to the priority vector of carrying in each Topology message.
Particularly, can compare one by one according to the preset order of each subvector in described priority vector, confirm whether the priority vector of this equipment is the optimal vector in looped network, if so, this equipment is optimum clock node; Otherwise, be not.
For example, suppose priorities subvector comprises Priority1, ClockQuality, Priority2, ClockId, SrcPortId and RcvPortIndex, when determining optimal vector, can compare one by one according to preset order, when arbitrary subvector hour, be optimal vector; If identical, more next according to described order continuation, until would confirm optimal vector.
Wherein, when the arbitrary port of this equipment receive the value of ttl field in Topology message be 0 or the Topology message received send for this equipment Topology message time, stop by described master port described Topology message repeating to next-hop node equipment.
When finally confirming that this equipment is optimum clock node equipment, now both sides port is all defaulted as master port, clock on this equipment is the optimum clock in looped network, this equipment by master port to other clock node equipment issue synchronised clock in looped network, so that other clock node equipment complete the renewal of local clock according to the described synchronised clock receiving.Concrete methods of realizing by from master port to other the described optimum clock of clock node equipment issue in looped network, please refer to prior art, in the application, no longer describes in detail.
When finally confirming that this equipment is not optimum clock node equipment, the network topology table that this equipment also needs to complete according to structure is so carried out master port and from the election of port in this locality.
Particularly, respectively relatively the east orientation of this equipment in looped network and west to the jumping figure between port (being described both sides ports) and optimum clock node equipment, select with the port of the jumping figure minimum of optimum clock node equipment as from port, another is master port; Wherein, if looped network has a sidelinks to disconnect, the opposite side port of directly selecting disconnecting link is from port.
When described east orientation is identical with jumping figure between optimum clock node equipment to port with west, can further described east orientation and west be compared according to described preset order successively to each subvector in the priority vector of the upstream transmit port of port, to confirm upstream clock source device.
Particularly, suppose priorities subvector comprises Priority1, ClockQuality, Priority2, ClockId, SrcPortId and RcvPortIndex, can first compare the port priority Priority1 of the upstream transmit port of Topology message according to the default sequence of above-mentioned priority vector, select the equipment at the transmit port place, upstream that Priority1 is less as upstream clock source device, the local port that connects upstream clock source device is from port, and another is master port; When Priority1 is identical, then ClockQuality relatively, selects the equipment at the transmit port place, upstream that ClockQuality is less as upstream clock source device, and the local port that connects upstream clock source device is from port, and another is master port; The like, until elect upstream clock source device.
Wherein, due to PTP agreement regulation, in the Topology message that different ports sends, SrcPortId value has uniqueness (being generated by port mac address computation), while therefore stating in the use method election upstream clock source device, can there is not the unsuccessful problem of election all unanimously causing due to each subvector value relatively.
In the present embodiment, when link failure is arrived in equipment Inspection, enable immediately quick sending mode, from the opposite side port of fault two-way, according to described quick transmission frequency, send Topology message immediately, so that other clock node equipment in looped network are received after this Topology message, local network topology table is upgraded and carried out master port and from the election of port; Because Topology message forwards based on hardware, this fast notification mechanism can just make the port role that on looped network, the synchronous election of all devices makes new advances within the extremely short time, restarts PTP time synchronized.
Below, by a concrete application example, technique scheme is further described.
Refer to Fig. 8, Fig. 8 is the networking diagram of a looped network, comprises six node devices of C0~C5.In looped network as shown in Figure 8, carry out clock synchronization compliant with precision time protocol when synchronous, each node device in this looped network by both sides port respectively to the east orientation in looped network and west to sending Topology message.For example, for node device C0, by port 01 and 02 respectively to the east orientation in looped network and west to sending Topology message.
Each node device is collected the Topology message that in looped network, other node devices send, after collection completes, and the election that builds network topology table and carry out optimum clock node according to the Topology message of collecting.For example, for C1 equipment, by processing the Topology message that in looped network, both sides port is received, the topology table on the looped network finally calculating is as follows:
Wherein, each subvector in upper table medium priority vector, except RcvPortIndex is all from the information of carrying in Topology message.
When carrying out optimum clock node election, every node device can, to each subvector in the priority vector of carrying in the Topology message sending on the port of both sides, after comparing successively, be confirmed optimal vector according to preset order.For example, for C1 equipment, can be by each subvector Priority1, ClockQuality, Priority2, ClockId, SrcPortId and RcvPortIndex in the priority vector of local port, according to preset order, compare one by one, when arbitrary subvector hour, be optimal vector; If identical, more next according to described order continuation, until would confirm optimal vector.If the priority vector of C1 local port is optimal vector, C1 equipment is optimum clock node (in C1 local port 11 and port one, the priority vector of any port is optimal vector, and C1 equipment is optimum clock node) so.
After optimum clock node in confirming looped network, other node devices carry out the master port of local port according to the network topology table that built and from the election of port.Suppose, in this looped network, C0 equipment is optimum clock node equipment, and now two ports on C0 equipment are master port; The network topology table that now C1~C5 equipment need to build according to this locality is carried out master port and from the election of port.
Particularly, take C1 equipment as example, the first more local east orientation of C1 equipment and west be to the jumping figure between port and optimum clock node equipment, select described east orientation and western in port with the minimum port of described optimum clock node jumping figure as from port, another is master port.As shown in Figure 7, the port one 1 of C1 equipment and the jumping figure between optimum clock node are minimum, and port one 1 is from port so, and 2 of port ones are master port.
Suppose that in current looped network, the optimum clock of optimum clock node equipment is C4, so now the port one 1 of C1 equipment and port one 2 are identical with the jumping figure between C4 equipment, when jumping figure is identical, further each subvector in the priority vector of the upstream transmit port of the port one of C1 equipment 1 and port one 2 is compared successively according to described preset order, to confirm the upstream clock source device of C1 equipment.
Particularly, the upstream port of port one 1 is the port 21 of C2 equipment, the port 01 of the upstream port C0 equipment of port one 2, when port one 1 and port one 2 by the Topology message up sending sending from described port 21 and port 01 receiving after control plane, can compare the Priority1 in message, when Priority1 is identical, compare again ClockQuality, when ClockQuality is identical, compare again Priority2, the like, until the equipment of selecting the port place that subvector value is less is as upstream clock source device, the port that connects upstream clock source device is from port, another is master port.
Generation link failure in looped network, for example, referring to Fig. 9, link failure between C0 and C1 equipment now, C0 and C1 equipment start quick sending mode from faulty link opposite side port 02 and port one 2 respectively, to other node devices in looped network, send Topology message, other node devices receive after this Topology message, again re-start according to the method described above local port port role election and upgrade local network topology table.
In sum, the present invention determines optimum clock and port role by mutually mutual Topology message between the clock node equipment in looped network, between clock node equipment in looped network, no longer by mutual Announce message and BMC port role algorithm, determine optimum clock and port role, because described Topology message forwards based on hardware, and calculating and forwarding by software based on hop-by-hop not, can realize nearly all equipment and receive simultaneously and process described Topology message, thereby reduced the convergence time that port role calculates, increased the stability of system.
Refer to Figure 10, the present invention also proposes a kind of clock synchronization apparatus 100, be applied to the clock synchronization compliant with precision time protocol node device in annular networking, wherein, refer to Figure 11, in the hardware structure relating to as the clock synchronization compliant with precision time protocol node device that carries described clock synchronization apparatus 100, generally include CPU, internal memory, nonvolatile memory, network interface and internal bus etc.With software, be embodied as example, apparatus of the present invention 100 can be understood as the computer program being carried in internal memory conventionally, the logic device that the software and hardware forming after moving by CPU combines; Described device 100 comprises:
Sending module 1001, for sending Topology message to other clock node equipment according to default slow transmission frequency respectively by both sides port;
Receiver module 1002, the Topology message sending for receive respectively described other clock node equipment by both sides port;
Build module 1003, for building network topology table according to the Topology message receiving, described network topology table comprises the priority vector of each port that sends described Topology message;
Determination module 1004, for determining according to the priority vector of described each port whether this equipment is optimum clock node equipment; If so, by master port, to other clock node equipment, issue synchronised clock; If not, according to described network topology table, determine master port in the port of described both sides and from port, by receive the synchronised clock of described optimum clock node equipment issue from port, complete the renewal of local clock; By master port, described synchronised clock is transmitted to next-hop node equipment.
In the present embodiment, described priority vector comprises some subvectors of arranging according to preset order;
Described determination module 1004 is further used for:
Each subvector in the priority vector of the both sides port of this equipment and described other each ports is compared successively according to described preset order, take and determine whether the priority vector of this equipment is optimal vector;
If so, this equipment is optimum clock node equipment;
If not, this equipment is not optimum clock node equipment.
In the present embodiment, described Topology message comprises original jumping figure, current jumping figure and neighbor device mode field; Described neighbor device mode field comprises east orientation and the western port status to port of the transmit port of described Topology message;
Described structure module 1003 is further used for:
Jumping figure according to the difference confirmation of described original jumping figure and described current jumping figure with other clock node equipment;
According to described neighbor device mode field, confirm described east orientation and the western port status to port;
The ports zone that receives described Topology message according to this equipment separates the sending direction of described Topology message in looped network.
In the present embodiment, described determination module 1004 is further used for:
Described current jumping figure be 0 or the Topology message received send for this equipment Topology message time, stop by described master port described Topology message repeating to next-hop node equipment.
In the present embodiment, described determination module 1004 is further used for:
The jumping figure of more described both sides port and described optimum clock node equipment respectively;
Selecting the port less with the jumping figure of described optimum clock node equipment is from port; Another is master port.
In the present embodiment, described Topology message also comprises the port priority of the transmit port of this Topology message;
Described determination module 1004 is further used for:
When the jumping figure of described both sides port and described optimum clock node equipment is identical, respectively each subvector in the priority vector of the upstream transmit port of described both sides port is compared successively according to described preset order;
Select the clock node equipment at the more excellent transmit port place, upstream of priority vector as upstream clock source device, the port that connects this equipment is from port; Another is master port.
In the present embodiment, described sending module 1001 is further used for:
When link failure being detected, from the opposite side port of faulty link, according to quick transmission frequency, send described Topology message immediately, so that other clock nodes are received, the described network topology table of this locality upgraded after this Topology message and redefined master port in the port of described both sides and from port; Wherein, described quick transmission frequency is greater than described default slow transmission frequency.
It will be appreciated by those skilled in the art that the unit in the device in embodiment can be distributed in the device of embodiment according to embodiment description, also can carry out respective change and be arranged in the one or more devices that are different from the present embodiment.A unit can be merged in the unit of above-described embodiment, also can further split into a plurality of submodules.Foregoing invention embodiment sequence number, just to describing, does not represent the quality of embodiment.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of making, be equal to replacement, improvement etc., within all should being included in the scope of protection of the invention.

Claims (14)

1. a clock synchronizing method, is applied to the clock synchronization compliant with precision time protocol node device in annular networking, it is characterized in that, described method comprises:
By both sides port, to other clock node equipment, according to default slow transmission frequency, send Topology message respectively;
By both sides port, receive respectively the Topology message that described other clock node equipment send;
According to the Topology message receiving, build network topology table, described network topology table comprises the priority vector of each port that sends described Topology message;
According to the priority vector of described each port, determine whether this equipment is optimum clock node equipment;
If so, by master port, to other clock node equipment, issue synchronised clock;
If not, according to described network topology table, determine master port in the port of described both sides and from port, by receive the synchronised clock of described optimum clock node equipment issue from port, complete the renewal of local clock; By master port, described synchronised clock is transmitted to next-hop node equipment.
2. the method for claim 1, is characterized in that, described priority vector comprises some subvectors of arranging according to preset order;
Described in described basis, the priority vector of other each ports determines whether this equipment is that optimum clock node equipment comprises:
Each subvector in the priority vector of the both sides port of this equipment and described other each ports is compared successively according to described preset order, take and determine whether the priority vector of this equipment is optimal vector;
If so, this equipment is optimum clock node equipment;
If not, this equipment is not optimum clock node equipment.
3. the method for claim 1, is characterized in that,
Described Topology message comprises original jumping figure, current jumping figure and neighbor device mode field; Described neighbor device mode field comprises east orientation and the western port status to port of the transmit port of described Topology message;
The Topology message that described basis receives builds network topology table and comprises:
Jumping figure according to the difference confirmation of described original jumping figure and described current jumping figure with other clock node equipment;
According to described neighbor device mode field, confirm described east orientation and the western port status to port;
The ports zone that receives described Topology message according to this equipment separates the sending direction of described Topology message in looped network.
4. the method for claim 1, is characterized in that, described method also comprises:
When described current jumping figure be 0 or the Topology message received send for this equipment Topology message time, stop by described master port described Topology message repeating to next-hop node equipment.
5. the method for claim 1, is characterized in that, describedly according to described network topology table, determines the master port in the port of described both sides and comprises from port:
The jumping figure of more described both sides port and described optimum clock node equipment respectively;
Selecting the port less with the jumping figure of described optimum clock node equipment is from port; Another is master port.
6. method as claimed in claim 5, is characterized in that, describedly according to described network topology table, determines the master port in the port of described both sides and also comprises from port:
When the jumping figure of described both sides port and described optimum clock node equipment is identical, respectively each subvector in the priority vector of the upstream transmit port of described both sides port is compared successively according to described preset order;
Select the clock node equipment at the more excellent transmit port place, upstream of priority vector as upstream clock source device, the port that connects this equipment is from port; Another is master port.
7. the method for claim 1, is characterized in that, described method also comprises:
When link failure being detected, from the opposite side port of faulty link, according to quick transmission frequency, send described Topology message immediately, so that other clock nodes are received, the described network topology table of this locality upgraded after this Topology message and redefined master port in the port of described both sides and from port;
Wherein, described quick transmission frequency is greater than described default slow transmission frequency.
8. a clock synchronization apparatus, is applied to the clock synchronization compliant with precision time protocol node device in annular networking, it is characterized in that, described device comprises:
Sending module, for sending Topology message to other clock node equipment according to default slow transmission frequency respectively by both sides port;
Receiver module, the Topology message sending for receive respectively described other clock node equipment by both sides port;
Build module, for building network topology table according to the Topology message receiving, described network topology table comprises the priority vector of each port that sends described Topology message;
Determination module, for determining according to the priority vector of described each port whether this equipment is optimum clock node equipment; If so, by master port, to other clock node equipment, issue synchronised clock; If not, according to described network topology table, determine master port in the port of described both sides and from port, by receive the synchronised clock of described optimum clock node equipment issue from port, complete the renewal of local clock; By master port, described synchronised clock is transmitted to next-hop node equipment.
9. device as claimed in claim 8, is characterized in that, described priority vector comprises some subvectors of arranging according to preset order;
Described determination module is further used for:
Each subvector in the priority vector of the both sides port of this equipment and described other each ports is compared successively according to described preset order, take and determine whether the priority vector of this equipment is optimal vector;
If so, this equipment is optimum clock node equipment;
If not, this equipment is not optimum clock node equipment.
10. device as claimed in claim 8, is characterized in that, described Topology message comprises original jumping figure, current jumping figure and neighbor device mode field; Described neighbor device mode field comprises east orientation and the western port status to port of the transmit port of described Topology message;
Described structure module is further used for:
Jumping figure according to the difference confirmation of described original jumping figure and described current jumping figure with other clock node equipment;
According to described neighbor device mode field, confirm described east orientation and the western port status to port;
The ports zone that receives described Topology message according to this equipment separates the sending direction of described Topology message in looped network.
11. devices as claimed in claim 8, is characterized in that, described determination module is further used for:
Described current jumping figure be 0 or the Topology message received send for this equipment Topology message time, stop by described master port described Topology message repeating to next-hop node equipment.
12. devices as claimed in claim 8, is characterized in that, described determination module is further used for:
The jumping figure of more described both sides port and described optimum clock node equipment respectively;
Selecting the port less with the jumping figure of described optimum clock node equipment is from port; Another is master port.
13. devices as claimed in claim 12, is characterized in that, described determination module is further used for:
When the jumping figure of described both sides port and described optimum clock node equipment is identical, respectively each subvector in the priority vector of the upstream transmit port of described both sides port is compared successively according to described preset order;
Select the clock node equipment at the more excellent transmit port place, upstream of priority vector as upstream clock source device, the port that connects this equipment is from port; Another is master port.
14. devices as claimed in claim 8, is characterized in that, described sending module is further used for:
When link failure being detected, from the opposite side port of faulty link, according to quick transmission frequency, send described Topology message immediately, so that other clock nodes are received, the described network topology table of this locality upgraded after this Topology message and redefined master port in the port of described both sides and from port; Wherein, described quick transmission frequency is greater than described default slow transmission frequency.
CN201410333987.9A 2014-07-14 2014-07-14 A kind of clock synchronizing method and device Active CN104092528B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410333987.9A CN104092528B (en) 2014-07-14 2014-07-14 A kind of clock synchronizing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410333987.9A CN104092528B (en) 2014-07-14 2014-07-14 A kind of clock synchronizing method and device

Publications (2)

Publication Number Publication Date
CN104092528A true CN104092528A (en) 2014-10-08
CN104092528B CN104092528B (en) 2017-06-06

Family

ID=51640210

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410333987.9A Active CN104092528B (en) 2014-07-14 2014-07-14 A kind of clock synchronizing method and device

Country Status (1)

Country Link
CN (1) CN104092528B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016192399A1 (en) * 2015-06-05 2016-12-08 中兴通讯股份有限公司 Method and apparatus for implementing alternate bmc
WO2017157170A1 (en) * 2016-03-18 2017-09-21 华为技术有限公司 Method of updating clock synchronization topology, method of determining clock synchronization path, and apparatus
CN107528657A (en) * 2016-06-20 2017-12-29 恩智浦有限公司 Use the integrated circuit and method of hardware synchronous circuit processing synchronizing network frame
WO2018223962A1 (en) * 2017-06-05 2018-12-13 中兴通讯股份有限公司 Method and system for clock control in aggregated link
CN110958504A (en) * 2019-12-13 2020-04-03 中国电子科技集团公司第五十四研究所 High-stability high-reliability time frequency network implementation method based on optical fiber ring network architecture
CN112152745A (en) * 2019-08-07 2020-12-29 中兴通讯股份有限公司 Time synchronization method, time synchronization sending end, time synchronization receiving end and time synchronization system
CN116684024A (en) * 2023-05-31 2023-09-01 中国科学院空间应用工程与技术中心 FC-AE-1553 boundary clock port state configuration method and system

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7280550B1 (en) * 2002-12-18 2007-10-09 Cirrus Logic, Inc. Bandwidth optimization of ring topology through propagation delay compensation
CN101170373A (en) * 2007-11-27 2008-04-30 上海自动化仪表股份有限公司 Clock synchronization realization method for loop network
CN101873243A (en) * 2010-06-21 2010-10-27 中兴通讯股份有限公司 Method and device for realizing coordinated time synchronization of 1588 message
CN102158335A (en) * 2011-04-21 2011-08-17 中兴通讯股份有限公司 Method and device for processing time synchronization port
CN102195766A (en) * 2010-03-01 2011-09-21 杭州华三通信技术有限公司 Time synchronization method and clock device
KR20120051632A (en) * 2012-05-08 2012-05-22 성균관대학교산학협력단 Method for clock synchronization in distributed system having ring topology and apparatus for the same
EP2645638A1 (en) * 2012-03-29 2013-10-02 Robert Bosch Gmbh Communication system with chain or ring topology
CN103428086A (en) * 2012-05-25 2013-12-04 北京东土科技股份有限公司 PTP protocol-based transparent clock passive port voting method and apparatus
CN103634208A (en) * 2013-11-26 2014-03-12 杭州华三通信技术有限公司 Method and device for preventing loop in PTP (precision time protocol) TC (transparent clock) looped network

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7280550B1 (en) * 2002-12-18 2007-10-09 Cirrus Logic, Inc. Bandwidth optimization of ring topology through propagation delay compensation
CN101170373A (en) * 2007-11-27 2008-04-30 上海自动化仪表股份有限公司 Clock synchronization realization method for loop network
CN102195766A (en) * 2010-03-01 2011-09-21 杭州华三通信技术有限公司 Time synchronization method and clock device
CN101873243A (en) * 2010-06-21 2010-10-27 中兴通讯股份有限公司 Method and device for realizing coordinated time synchronization of 1588 message
CN102158335A (en) * 2011-04-21 2011-08-17 中兴通讯股份有限公司 Method and device for processing time synchronization port
EP2645638A1 (en) * 2012-03-29 2013-10-02 Robert Bosch Gmbh Communication system with chain or ring topology
KR20120051632A (en) * 2012-05-08 2012-05-22 성균관대학교산학협력단 Method for clock synchronization in distributed system having ring topology and apparatus for the same
CN103428086A (en) * 2012-05-25 2013-12-04 北京东土科技股份有限公司 PTP protocol-based transparent clock passive port voting method and apparatus
CN103634208A (en) * 2013-11-26 2014-03-12 杭州华三通信技术有限公司 Method and device for preventing loop in PTP (precision time protocol) TC (transparent clock) looped network

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016192399A1 (en) * 2015-06-05 2016-12-08 中兴通讯股份有限公司 Method and apparatus for implementing alternate bmc
WO2017157170A1 (en) * 2016-03-18 2017-09-21 华为技术有限公司 Method of updating clock synchronization topology, method of determining clock synchronization path, and apparatus
CN107204928A (en) * 2016-03-18 2017-09-26 华为技术有限公司 The method of the synchronous topology of refresh clock, the method and apparatus for determining clock synchronous path
US10892884B2 (en) 2016-03-18 2021-01-12 Huawei Technologies Co., Ltd. Method for updating clock synchronization topology, method for determining clock synchronization path, and device
CN107528657A (en) * 2016-06-20 2017-12-29 恩智浦有限公司 Use the integrated circuit and method of hardware synchronous circuit processing synchronizing network frame
CN107528657B (en) * 2016-06-20 2020-09-11 恩智浦有限公司 Integrated circuit and method for processing synchronous network frames using hardware synchronization circuit
WO2018223962A1 (en) * 2017-06-05 2018-12-13 中兴通讯股份有限公司 Method and system for clock control in aggregated link
CN112152745A (en) * 2019-08-07 2020-12-29 中兴通讯股份有限公司 Time synchronization method, time synchronization sending end, time synchronization receiving end and time synchronization system
CN112152745B (en) * 2019-08-07 2021-09-28 中兴通讯股份有限公司 Time synchronization method, time synchronization sending end, time synchronization receiving end and time synchronization system
CN110958504A (en) * 2019-12-13 2020-04-03 中国电子科技集团公司第五十四研究所 High-stability high-reliability time frequency network implementation method based on optical fiber ring network architecture
CN116684024A (en) * 2023-05-31 2023-09-01 中国科学院空间应用工程与技术中心 FC-AE-1553 boundary clock port state configuration method and system

Also Published As

Publication number Publication date
CN104092528B (en) 2017-06-06

Similar Documents

Publication Publication Date Title
CN104092528A (en) Clock synchronization method and device
US20160013876A1 (en) Time synchronization method and system
CN102833061B (en) Based on method and the node of the raising clock accuracy of seamless redundant looped network
CN104052589B (en) Fault tolerant clock network
CN101511042B (en) Data synchronization method and device
WO2009071029A1 (en) Synchronization system and method of time information and related equipment
EP3352392B1 (en) Time synchronization packet processing method and device
CN103248445A (en) Clock synchronization method and device
CN103001759B (en) A kind of network method for synchronizing time, system and device
CN109155788A (en) The method of GM clock is quickly reconfigured in TSN network by clear tear down message
CN103490840B (en) A kind of apparatus and method for carrying out Precision Time Protocol Message processing
CN103428086A (en) PTP protocol-based transparent clock passive port voting method and apparatus
CN102457346A (en) Time synchronization realizing method and clock node
CN104767582A (en) Ethernet synchronization method, device and system
CN102342051B (en) For coming the method for synchronised clock and relevant system and module by separating transmission first and second data via at least one time distribution protocol
CN103634208A (en) Method and device for preventing loop in PTP (precision time protocol) TC (transparent clock) looped network
WO2016119362A1 (en) Clock synchronization method, router and cluster routing system
JP2015192246A (en) Transmission system, transmission device, and clock synchronization method
CN103236894B (en) Clock synchronizing method and device in a kind of seamless redundant network
CN106533597B (en) A kind of selection method and network element node of time source
CN105099646A (en) Synchronization link determination method and apparatus
KR101192896B1 (en) Distributed synchronization method and apparatus for fault tolerance
US11876609B2 (en) Time sync device, time sync method, and program
CN113346974A (en) Method, apparatus, communication system and storage medium for clock synchronization
CN108462548B (en) Time synchronization method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant after: Xinhua three Technology Co., Ltd.

Address before: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant before: Huasan Communication Technology Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant