Background technology
It is the development trend of future network and business that IP (Internet Protocol) changes, take synchrodata system SDH (Synchronous Digital Hierarchy) as basic transmission network is to take IP as basic grouping conveying network evolution, and a key technology is exactly clock and the time synchronization problem how solving in IP packet network.IEEE 1588v2 ether time interface and 1 pulse per second (PPS)+Time of Day (1Per PulseSecond+Time Of Day, abbreviation 1PPS+TOD) time interface becomes the time synchronizing standard of industry main flow gradually, and being subject to the abundant attention of Ge great operator, ITU-T is also applied to the multinomial technical standard of field of telecommunications at research IEEE 1588v2 ether time interface and 1PPS+ToD time interface.
In communication system precise synchronization scheme, between the global position system of dissimilar or different manufacturers, time synchronism equipment, load bearing equipment, base station equipment, have multiple time docking application scenarios, these docking application scenarioss all likely can relate to the intercommunication of 1PPS+ToD time interface.
IEEE1588v2 Protocol Design is for the real-time clock of each node of precise synchronization distribution network communication.Its basic conception is by hardware and software, the internal clock of the network equipment to be realized and being synchronizeed with the master clock of main control computer, provides and can meet the utilization of wireless base station to frequency and time synchronized requirement.IEEE1588v2 is divided into two kinds by the clock in whole network, ordinary clock OC (Ordinary Clock) and boundary clock BC (Boundary Clock), only having the clock of a Precision Time Protocol PTP (Precise Time Clock) communication port is ordinary clock, having the clock of an above PTP communication port is boundary clock, and each PTP port provides independently PTP communication.From correspondence, clock can be divided into master clock MC (Master Clock) again and from clock SC (Slave Clock), any clock can be realized master clock and from the function of clock in theory, but can only have a master clock in a PTP communication subnet.
OC: only have the same network service of physical interface, the subdomain at place is only supported single PTP agreement and PTP state, both can be highest clock GMC (Grandmaster Clock), can be also from clock SC (Slave Clock), can regard the network terminal as.
BC: have the same network service of a plurality of physical interfaces, each physical port behavior is similar to the port of OC, can be used for a plurality of subdomains and connects, and can regard the network equipments such as repeater, switch, router as.
Each port of OC and BC is safeguarded an independently PTP state machine, and state machine has defined the state of port permission and the transformation rule between state.Port has following three kinds of states:
Major state MASTER: port provides time source for the upstream device on this path;
From state SLAVE: the upstream equipment that port and this path are MASTER status port is synchronous;
Passive state PASSIVE: port is neither MASTER state on path, and the MASTER that also gets along well is synchronous.
Optimum clock in whole system is GMC, has best stability, accuracy, certainty etc.According to the characteristics such as trackability of the precision of clock on each node and rank and universal coordinated time UTC (Universal TimeCoordination), by best master clock algorithm BMC (Best Master Clock), automatically select the master clock in each subnet.In only having the system of a subnet, master clock is exactly GMC.Each system only has a GMC, and in each subnet, only has a master clock, from clock and master clock, keeps synchronizeing.
When the network equipment adopts the BMC of IEEE1588v2 to select source algorithm picks clock source, owing to cannot obtaining the relevant clock source selection parameter of 1PPS+ToD time interface, therefore can not adopt unified mode to select source, if need 1PPS+ToD time interface to participate in clock source selection, must locally configure relevant parameter, force to allow 1PPS+ToD time interface participate in selecting source.This mode has not only increased and has configured required workload, has improved the technical ability requirement to device operator, easily causes clock source to follow the tracks of into ring.
Summary of the invention
The present invention will solve current 1PPS+ToD time interface need to be configured that force to participate in the configuration effort amount that IEEE1588v2 selects source to cause large, require high, because not adopting unified mode to select source easily to cause the problem of clock tracing Cheng Huan.
Specific embodiments of the invention provide a kind of method of processing clock information on the one hand, comprising:
Receive the message of very first time interface protocol definition, described message comprises clock information, described clock information is by the second time interface protocol definition, in order to characterize clock corresponding to temporal information transmitting according to described very first time interface protocol, described very first time interface protocol and described the second time interface agreement are different agreements;
Described in decapsulation, message obtains described clock information;
According to described the second time interface agreement, utilize described clock information to select source.
On the other hand, specific embodiments of the invention also provide a kind of communicator, and for the treatment of clock information, described device comprises:
Receiving element, for receiving the message of very first time interface protocol definition, described message comprises clock information, described clock information is by the second time interface protocol definition, in order to characterize clock corresponding to temporal information transmitting according to described very first time interface protocol, described very first time interface protocol and described the second time interface agreement are different agreements;
Decapsulation unit, obtains described clock information for message described in decapsulation;
Select source unit, for according to described the second time interface agreement, utilize described clock information to select source.
On the one hand, embodiments of the invention also provide a kind of communication system again, and in order to processing clock information, this system comprises:
First communication device and secondary communication device;
The acquisition unit of first communication device is used for obtaining clock information, described clock information is by the second time interface protocol definition, be used for characterizing clock corresponding to temporal information transmitting according to very first time interface protocol, described very first time interface protocol and described the second time interface agreement are different agreements;
The encapsulation unit of first communication device is for being encapsulated in described clock information the message of described very first time interface protocol definition;
The transmitting element of first communication device is for sending to secondary communication device by described message;
The receiving element of secondary communication device is used for receiving described message;
The decapsulation unit of secondary communication device is for the message described in decapsulation and obtain described clock information;
Secondary communication device select source unit for according to described the second time interface agreement, utilize described clock information to select source.
From the above embodiment of the present invention, with the clock information of the second time interface protocol definition, characterize a clock, this clock is clock corresponding to temporal information transmitting according to very first time interface protocol, described clock information can send another equipment to from an equipment according to very first time interface protocol in network, described another equipment can be from receiving to such an extent that obtain described clock information message, thereby configuration effort amount and configuring technical requirement have been reduced, when selecting source according to described the second time interface agreement, can utilize this clock information to carry out clock source selection to comprising the clock unification of described clock, reduced the possibility that clock source is followed the tracks of into ring.
Embodiment
One embodiment of the present of invention provide a kind of method of processing clock information, and its flow process as shown in Figure 1, comprises the following steps:
Step 101, receive the message of very first time interface protocol definition, described message comprises clock information, described clock information is by the second time interface protocol definition, in order to characterize clock corresponding to temporal information transmitting according to described very first time interface protocol, described very first time interface protocol and described the second time interface agreement are different agreements;
Step 103, message obtains described clock information described in decapsulation;
Step 105, according to described the second time interface agreement, utilizes described clock information to select source.
Further, very first time interface protocol comprises 1PPS+TOD interface protocol, and the message of 1PPS+TOD definition comprises TOD temporal information message.
Further, the second time interface agreement comprises IEEE 1588v2 time interface agreement, and clock information can be one of the multiple combination of stability, priority two, clock identifier information, port numbers and the clock grade of the priority one that defines in IEEE 1588v2, clock accuracy grade, clockwork.Comprise above-mentioned other information except the stability of clockwork, another kind of compound mode comprises above-mentioned full detail.Concrete compound mode is wanted to provide the information of selecting source algorithm required.When selecting source according to IEEE1588v2, the source algorithm that selects of employing can be best master clock algorithm BMC (Best MasterClock) algorithm.
As shown in Figure 2, message comprises frame head 1, frame head 2, classes of messages, message id, message field length, net load territory and verification territory, passing time information and state information to the message frame form defining in precise synchronization 1PPS+ToD time interface standard.In the net load territory of TOD temporal information message, comprise pulse per second (PPS) state information.The first-class clock information of the priority that defines in above-mentioned IEEE1588v2 can be in this message, encapsulated, described clock information can be obtained after receiving this message decapsulation.
The clock grade of IEEE1588v2 protocol definition can be converted to by the pulse per second (PPS) state in TOD temporal information message, and a kind of feasible transformational relation is as shown in table 1.Therefore, clock grade and pulse per second (PPS) state are equal to, and clock grade can transmit by the pulse per second (PPS) stastus format of 1PPS+TOD time interface protocol definition.
Table 1TOD informational message pulse per second (PPS) state and IEEE 1588v2 clock grade corresponding relation
ToD informational message pulse per second (PPS) state |
IEEE 1588v2 clock grade |
0x00=is normal |
6 |
0x01=time synchronism equipment (atomic clock) keeps |
7 |
0x02=is unavailable |
255 |
0x03=time synchronism equipment (high stability crystal oscillator) keeps |
52 |
0x04=transmission bearer equipment keeps |
187 |
Further, in TOD temporal information message, if the net load territory defining in above-mentioned time interface standard can not all hold described clock information, can expand this net load territory, table 2 is described a kind of TOD temporal information message content through expanding in detail, in table, data type row U represents unsigned int, and I represents integer, the numeral byte number after U or I.Shown in table 2, in message, used the reserved field in net load territory in above-mentioned precise synchronization 1PPS+TOD time interface standard, also expanded net load territory, increased the length in net load territory simultaneously.
The stability of table 2 medium priority one, priority two, clock accuracy grade, clockwork, clock identifier and port numbers are not defined in 1PPS+TOD time interface standard, but the clock information defining in IEEE1588v2, in order to characterize a clock.These clock informations are encapsulated in and in TOD temporal information message, characterize clock corresponding to time in this time message.Pulse per second (PPS) state in table can be converted to clock grade, therefore there is no other clock grade field, and clock grade information exchange is crossed the transmission of pulse per second (PPS) stastus format.
Table 2 TOD temporal information message content through expansion
Another embodiment of the present invention provides a kind of method of processing clock information, and its flow process as shown in Figure 3, comprises the following steps:
Step 301, receive TOD temporal information message, TOD temporal information message comprises clock information, clock information comprises stability, priority two, clock identifier information, port numbers and the clock grade of priority one, clock accuracy grade, clockwork, in order to characterize clock corresponding to time in TOD temporal information message;
Step 303, decapsulation TOD temporal information message obtains above-mentioned clock information;
Step 305, according to IEEE 1588v2 time interface agreement, utilizes above-mentioned clock information to select source to comprising the clock unification of described clock.
In said method, step 301 and step 303 can complete by real-time clock (RTC) RTC (Real Time Clock) logic, and RTC logic offers software by logic register and reads after described clock information is extracted.Step 305 can be passed through processor, read described clock information after software program for execution complete the source of selecting.
Described clock information can also continue to pass to another equipment by TOD temporal information message, and another equipment also utilizes this clock information to carry out clock source selection.
From the above embodiment of the present invention, IEEE 1588v2 time interface protocol definition comprise priority one, clock accuracy grade, the stability of clockwork, priority two, clock identifier and port numbers are at interior clock information, clock corresponding to temporal information that utilizes above-mentioned clock information to characterize to transmit in 1PPS+TOD time interface, thereby using 1PPS+ToD interface as another form of expression of 1588v2 ether time interface, described clock information transmits in network, upstream device receives this clock information, therefore workload and the configuring technical requirement of these information have been reduced to configure, while selecting source according to IEEE 1588v2 time interface agreement, use described clock information, make 1PPS+TOD interface and 1588v2 ether time interface adopt IEE E1588v2BMC algorithm to unify to select source, reduced the possibility that clock source is followed the tracks of into ring.
When embodiments of the invention also provide a kind of processing clock information, clock information is carried out the method for safeguard protection, the present embodiment is to increase following steps when processing clock information, as shown in Figure 4, comprising:
Step 41, adopts secret communication method to be decrypted processing to the described message of receiving.
Further, described secret communication method can be symmetric cryptography method or asymmetric cryptography method.
While adopting symmetric cryptography method, the decryption method in step 41 can be according to wildcard and secret algorithm, and whether checking Message Authentication Code MAC (Message Authentication Code) field is correct, if correct, carry out subsequent treatment, if incorrect, abandon this message.
Further, described wildcard and secret algorithm can obtain by the mode of pre-configured or online negotiation, and described MAC can be 2 bytes or 4 bytes.
Further, the input of calculating MAC can be included in message pulse per second (PPS) state, priority one, the clock accuracy grade of carrying in 1PPS+ToD message, the stability of clockwork, clock identifier and port number information, MAC information can be arranged in table 1 and load after other fields of content.
Further, asymmetric cryptography method can be certificate mode.When adopting certificate mode, the private key compute signature SIG that transmit leg certificate of utility is corresponding, recipient utilizes the certification authentication signature SIG of transmit leg.
From the above embodiment of the present invention, by clock information is carried out to safeguard protection, can prevent that these information are tampered, guarantee correctly choosing of clock source, thereby reduce Denial of Service attack or reduce the risk that service quality is attacked.
Embodiments of the invention also provide a kind of communicator, and this installs for the treatment of clock information.This device as shown in Figure 5, comprising:
Receiving element, for receiving the message of very first time interface protocol definition, described message comprises clock information, described clock information is by the second time interface protocol definition, in order to characterize clock corresponding to temporal information transmitting according to described very first time interface protocol, described very first time interface protocol and described the second time interface agreement are different agreements;
Decapsulation unit, the clock information for the message described in decapsulation and described in obtaining;
Select source unit, for according to described very first time interface protocol, utilize described clock information to select source.
In said apparatus, as shown in Figure 6, receiving element, receives the TOD time message of coming from 1PPS+TOD time interface, and receiving element can adopt RTC logic realization; Decapsulation unit deblocking from TOD time message takes on priority one, clock accuracy grade isochronon information, after these key messages are extracted, can offer software by logic register and read, and decapsulation unit can adopt RTC logic realization; Select source unit, can read out clock information by software program for execution in processor, carry out and select source algorithm.1588v2 time interface processing module in Fig. 6 is processed message bag next from IEEE1588v2 time interface, obtain after mutually deserved clock information and pass to and select source module, therefore, select the source module can be to comprising that clock in IEEE1588v2 time interface and the clock unification in 1PPS+TOD time interface select source.
Embodiments of the invention also provide a kind of communication system, and this system can be for the treatment of clock information, and the schematic diagram of this system as shown in Figure 7, comprising:
First communication device and secondary communication device;
The acquisition unit of first communication device is used for obtaining clock information, described clock information is by the second time interface protocol definition, be used for characterizing clock corresponding to temporal information transmitting according to very first time interface protocol, described very first time interface protocol and described the second time interface agreement are different agreements;
The encapsulation unit of first communication device is for being encapsulated in described clock information the message of described very first time interface protocol definition;
The transmitting element of first communication device is for sending to secondary communication device by described message;
The receiving element of secondary communication device is used for receiving described message;
The decapsulation unit of secondary communication device is for the message described in decapsulation and obtain described clock information;
Secondary communication device select source unit for according to described the second time interface agreement, utilize described clock information to select source.
Further, in above-mentioned communication system: very first time interface protocol comprises 1PPS+TOD time interface agreement, the second time interface agreement comprises IEEE 1588v2 time interface agreement, described message comprises TOD temporal information message, and described clock information comprises stability, priority two, clock identifier, port numbers and the clock grade of priority one, clock accuracy grade, clockwork.
In above-described embodiment, with 1PPS+TOD agreement and IEE E1588v2 agreement, describe as an example, in fact, also can from SDH message, receive the clock information of IEEE 1588v2 definition, when IEEE1588v2 selects source, utilize described information to unify to select source to comprising the clock of the clock that SDH transmits.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add essential hardware platform by software and realize, and can certainly all by hardware, implement.Understanding based on such, what technical scheme of the present invention contributed to background technology can embody with the form of software product in whole or in part, this computer software product can be stored in storage medium, as ROM/RAM, magnetic disc, CD etc., comprise that some instructions are with so that a computer equipment (can be personal computer, server, or the network equipment etc.) carry out the method described in some part of each embodiment of the present invention or embodiment.
The above; be only the present invention's embodiment preferably, but protection scope of the present invention is not limited to this, is anyly familiar with in technical scope that those skilled in the art disclose in the present invention; the variation that can expect easily or replacement, within all should being encompassed in protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of claim.