CN115150017A - PTP message returning method and device - Google Patents

PTP message returning method and device Download PDF

Info

Publication number
CN115150017A
CN115150017A CN202210755182.8A CN202210755182A CN115150017A CN 115150017 A CN115150017 A CN 115150017A CN 202210755182 A CN202210755182 A CN 202210755182A CN 115150017 A CN115150017 A CN 115150017A
Authority
CN
China
Prior art keywords
message
original
ptp
ptp message
sending
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.)
Pending
Application number
CN202210755182.8A
Other languages
Chinese (zh)
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.)
Fiberhome Telecommunication Technologies Co Ltd
Wuhan Fisilink Microelectronics Technology Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
Wuhan Fisilink Microelectronics Technology 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 Fiberhome Telecommunication Technologies Co Ltd, Wuhan Fisilink Microelectronics Technology Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN202210755182.8A priority Critical patent/CN115150017A/en
Publication of CN115150017A publication Critical patent/CN115150017A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The invention relates to the technical field of 5G bearing network chip supporting time synchronization, and provides a PTP message returning method and a PTP message returning device. Wherein the method comprises: when detecting that the first identifier word return mark is set and the first byte of the original PTP message is being sent, the sending module sends a return completion indication to the return processing module, and continues to read the message at the same time, thereby completing the subsequent sending processing of the original PTP message; the return processing module also receives the compensated sending timestamp sent by the sending module, and writes the compensated sending timestamp and the original PTP message into a return cache for waiting; when the return processing module receives the return completion indication sent by the sending module, the return processing module sends the original PTP message and the compensated sending timestamp to the processor. The invention reduces the time for the processor to acquire the synchronous information, so that the processor is easier to support large capacity and multi-interface interaction to realize high-precision time synchronization and support PTP frequency synchronization.

Description

PTP message returning method and device
[ technical field ] A method for producing a semiconductor device
The invention relates to the technical field of 5G bearing network chip supporting time synchronization, in particular to a PTP message returning method and a PTP message returning device.
[ background of the invention ]
With the development and evolution of the 5G technology, various bearer service ports bring application requirements of the time synchronization technology, the types of service interfaces supported by SPN/MTN/OTN/OSU of the 5G bearer network are numerous, and the FlexE (flexible Ethernet) and FlexO (flexible optical transport network) technologies have been widely applied to the 5G bearer network, so that the support of the high-precision time synchronization technology is required by emerging rate interfaces including the FlexE and FlexO interfaces and various OTN service interfaces as well as OTU25 and OTU50, and the like, becoming a necessary trend.
At present, time synchronization and frequency synchronization are mainly achieved through a Precision Time Protocol (PTP) message, and respective clocks corresponding to two ports are adjusted through a Time difference between sending and receiving the PTP message between the two ports to achieve Time synchronization or frequency synchronization.
With the development of the 5G technology, the bandwidth of synchronization information including PTP messages and timestamps in a 5G bearer network chip is higher and higher, in the prior art, an interrupt register or a timestamp pipeline is usually adopted to store the synchronization information, and a processor actively accesses and reads the synchronization information to acquire the synchronization information, both of the two modes have the disadvantages of higher load for the processor and slow acquisition of the synchronization information, and for processing PTP messages and timestamp information of a 5G bearer network with large capacity, multiple ports and high frequency (greater than an interaction frequency of 16 packets/s), a CPU running an IEEE1588 synchronization protocol under a large load can hardly support a single-step clock mode and a two-step clock mode and processing of the synchronization information reaching an interaction frequency of 256 packets/s, and can hardly support an application scenario of synchronization of PTP frequencies.
In view of the above, overcoming the drawbacks of the prior art is an urgent problem in the art.
[ summary of the invention ]
The invention aims to solve the technical problems that the acquisition mode of the synchronous information in the prior art has high load and low acquisition speed.
The invention adopts the following technical scheme:
in a first aspect, the present invention provides a PTP message returning method, including:
when detecting that the first identifier word return mark is set and the first byte of the original PTP message is being sent, the sending module sends a return completion indication to the return processing module, and continues to read the message at the same time, thereby completing the subsequent sending processing of the original PTP message;
the return processing module also receives the compensated sending timestamp sent by the sending module, and writes the compensated sending timestamp, the original PTP message and other synchronous information into a return cache for waiting;
when the return processing module receives the return completion indication sent by the sending module, the return processing module sends the original PTP message, the compensated sending timestamp and other synchronous information to the processor, so that the processor completes corresponding synchronous operation.
Preferably, the returning processing module sends the original PTP message, the compensated sending timestamp, and other synchronization information to the processor, and specifically includes:
the return processing module sends the original PTP message, the compensated sending timestamp and other synchronous information to the normalization receiving module, the normalization receiving module generates a return PTP message according to the original PTP message, the compensated sending timestamp and other synchronous information, and sends the return PTP message and the message received by a normal path to the processor according to the priority.
Preferably, the sending module, when detecting that the first identifier word return flag is set, specifically includes:
the method comprises the steps that a processor packages an original PTP message into a self-defined message, sets a first marker word return mark in the self-defined message, and sends the self-defined message to a sending module, and the sending module detects whether the self-defined message carries the set first marker word return mark or not;
or the processor sends the original PTP message to the sending module, and the sending module judges whether to record the set first marker word return mark corresponding to the original PTP message in the register or not according to the original PTP message to be sent.
Preferably, the sending the returned PTP message and the message received by the normal path to the processor according to the priority includes:
the return PTP message carries a set first marker word return mark, and the normalization receiving module preferentially sends the message carrying the set first marker word return mark to the processor;
when a plurality of returned PTP messages exist in the normalization receiving module at the same time, the normalization receiving module determines a priority sequence according to the size of the virtual port ID carried in the returned PTP messages, and sends the returned PTP messages to the processor according to the priority sequence.
Preferably, the compensated transmission timestamp is obtained by compensating the original transmission timestamp obtained when the original PTP packet is transmitted, and specifically includes:
the sending module records an original sending timestamp when the original PTP message is sent, and then performs numerical correction on the original sending timestamp according to a first compensation value preset by a person skilled in the art or a second compensation value calculated according to an accurate time synchronization protocol to obtain a compensated sending timestamp.
Preferably, the enabling of the processor to complete the corresponding synchronization operation specifically includes:
when the processor is positioned on one side of the master clock, the processor generates a corresponding message according to the original PTP message, the compensated sending timestamp and other synchronization information, and sends the corresponding message to the slave clock, so that the slave clock corrects the local clock to realize time synchronization or frequency synchronization with the master clock;
when the processor is positioned at one side of the slave clock, the processor obtains the master-slave clock deviation and the transmission delay according to the original PTP message, the compensated sending timestamp and other synchronization information, and corrects the local clock according to the master-slave clock deviation and the transmission delay to realize the time synchronization or the frequency synchronization with the master clock.
Preferably, the method is applicable to various services in a 5G bearer network, where the various services include: one or more of flexible ethernet FlexE, flexible optical transport network FlexO, OTN traffic, OTU25 traffic, OTU50 traffic, OTUCn traffic, and OSU traffic.
Preferably, the method further comprises: if the first identifier return flag is not detected to be set, the sending module does not execute the return processing of the original PTP message, the compensated sending timestamp and other synchronous information, and directly completes the subsequent sending processing of the message.
Preferably, the normalization receiving module generates a returned PTP message according to the original PTP message, the compensated transmission timestamp, and other synchronization information, and specifically includes:
the transmission PTP message consists of a self-defined message header, an original PTP message and FCS bytes, the original PTP message which does not include the FCS bytes is packaged in an original message domain of the transmission PTP message by the normalization processing module, the self-defined message header is added in front of the original message domain, information contained in the self-defined message header comprises a first identification word transmission mark, a VLAN domain and a compensated transmission timestamp, the VLAN domain is used for storing a virtual port ID, the virtual port ID is used for distinguishing a receiving port of the original PTP message, and the FCS bytes of the transmission PTP message after being assembled are added behind the original message domain.
In a second aspect, the present invention further provides a PTP message backhaul system, where the system includes at least one port, and the port uses the PTP message backhaul method of the first aspect to backhaul PTP messages.
In a third aspect, the present invention further provides a PTP message backhaul device, configured to implement the PTP message backhaul method in the first aspect, where the device includes:
at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor and configured to perform the PTP message backhaul method of the first aspect.
In a fourth aspect, the present invention further provides a non-volatile computer storage medium, where the computer storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, and are configured to perform the PTP message backhaul method according to the first aspect.
According to the invention, the synchronous information is actively returned to the processor in a PTP message returning mode when the first byte of the original PTP message is sent, so that the processor does not need to read the synchronous information from the interrupt register or the timestamp pipeline, the time for the processor to acquire the synchronous information is shortened, the load of the processor is reduced, and the processor is easier to support large-capacity and multi-interface interaction to realize high-precision time synchronization and PTP frequency synchronization.
[ description of the drawings ]
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments of the present invention will be briefly described below. It is obvious that the drawings described below are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 is a flowchart of a PTP message backhaul method according to an embodiment of the present invention;
fig. 2 is a flowchart of a PTP message backhaul method according to an embodiment of the present invention;
fig. 3 is an application scenario diagram of a PTP message returning method according to an embodiment of the present invention;
fig. 4 is a flowchart for implementing time synchronization by applying a PTP message backhaul method according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an architecture of a PTP packet backhaul method according to an embodiment of the present invention;
fig. 6 is a structural diagram of a backhaul PTP message provided in the embodiment of the present invention;
fig. 7 is a flowchart of a PTP message returning method according to an embodiment of the present invention;
fig. 8 is a schematic diagram of an architecture of a PTP packet backhaul method according to an embodiment of the present invention;
fig. 9 is a flowchart of a PTP message backhaul method according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a PTP message backhaul system according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a PTP message backhaul device according to an embodiment of the present invention.
[ detailed description ] embodiments
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the description of the present invention, the terms "inner", "outer", "longitudinal", "lateral", "upper", "lower", "top", "bottom", and the like indicate orientations or positional relationships based on orientations or positional relationships shown in the drawings, and are for convenience in describing the present invention only and do not require that the present invention be constructed and operated in a particular orientation, and therefore should not be construed as limiting the present invention.
In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
Example 1:
embodiment 1 of the present invention provides a method for returning a PTP message, as shown in fig. 1, specifically including:
in step 201, when detecting that the first identifier return flag is set and the first byte of the original PTP packet is being sent, the sending module sends a return completion indication to the return processing module, and continues to read the packet at the same time, thereby completing subsequent sending processing of the original PTP packet.
Wherein, the first identifier word can be represented by pkts _ side in the PTP message. The subsequent content of the embodiment of the invention is also directly presented by using pkts _ side as a representative form of the description of the first identifier word; correspondingly, the indication of completion of the return transmission is also illustratively expressed as finish indication of completion of the return transmission.
The original PTP message is a PTP message which needs to be transmitted back. The sending module and the return processing module are contained in the port, the processor is contained in the service processing side, the sending module is used for sending the message received from the processor to the external port, and the sending module judges whether the message return is needed or not according to the pkts _ side return mark.
There may be a plurality of messages to be sent in one port, where the first byte of the original PTP message being sent is when the port receives a message to be sent to an external port and is sending the first byte of the original PTP message according to the port sending rate requirement.
The pkts _ side return flag may be a flag bit existing in the sending module, and is obtained by reading a cache in the sending module from a port, or may be obtained by other ways, such as obtaining from a processor, or generating a new packet by encapsulating the original packet, where the new packet carries the pkts _ side return flag.
In step 202, the backhaul processing module further receives the compensated transmission timestamp transmitted by the transmitting module, and writes the compensated transmission timestamp, the original PTP packet, and other synchronization information into the backhaul buffer for waiting.
Wherein, the compensated sending timestamp is obtained by compensating the original sending timestamp obtained when the original PTP message is sent, and specifically includes:
the sending module records an original sending timestamp when the original PTP message is sent, and then carries out numerical correction on the original sending timestamp according to a first compensation value preset by a person skilled in the art or a second compensation value calculated according to an IEEE1588 synchronization protocol to obtain a compensated sending timestamp.
The first compensation value is designed by a person skilled in the art according to a clock at the side where the sending module is located, the second compensation value is calculated by a module with a data processing function, such as a register or a processor of the sending module, according to a fixed calculation method, the second compensation value is calculated by the module with the data processing function, different second compensation values can be generated according to different environments, and therefore the first compensation value has certain universality, and the first compensation value can compensate the original sending timestamp according to the design requirements of the person skilled in the art.
The receiving, by the backhaul processing module, the compensated transmission timestamp transmitted by the transmitting module specifically includes: after the sending module receives the custom message from the processor, the sending module reads an original PTP message and other synchronous information in the custom message and sends the original PTP message and other synchronous information to the return processing module, a compensated sending timestamp is generated when the original PTP message is sent, the compensated sending timestamp is sent to the return processing module, and after the original PTP message, other synchronous information and the compensated sending timestamp are sent to the return processing module, the sending module continues to finish the subsequent sending of the original PTP message. The original PTP message and the compensated transmission timestamp all belong to synchronization information, and together with other synchronization information, form all synchronization information required by the processor, where the other synchronization information includes but is not limited to: a receiving port of the original PTP message, a type of the original PTP message, and the like.
In step 203, when the backhaul processing module receives the backhaul completion finish indication sent by the sending module, the backhaul processing module sends the original PTP packet, the compensated sending timestamp, and other synchronization information to the processor, so that the processor completes the corresponding synchronization operation.
The finish indication is generated when the first byte of the original PTP message is sent, so that the return processing module sends the original PTP message, the compensated sending timestamp and the related information to the processor before the original PTP message is sent, and the processor can quickly acquire the original PTP message, the compensated sending timestamp and the related information for time synchronization or frequency synchronization.
The method further comprises the following steps: if the pkts _ side return flag is not detected to be set, the sending module does not execute return processing of the original PTP message, the compensated sending timestamp, and other synchronization information, and directly completes subsequent sending processing of the message.
The step of directly completing the subsequent sending processing of the message specifically comprises: when the message is a PTP message needing to carry the timestamp, the sending module records the original sending timestamp when the original PTP message is sent, the compensated sending timestamp is obtained after timestamp compensation is carried out, the compensated sending timestamp is written into a specific position of the PTP message, the PTP message with the compensated sending timestamp written into is sent out, and when the message is not the PTP message needing to carry the timestamp, the message is directly sent.
The method for completing the corresponding synchronous operation by the processor specifically comprises the following steps:
when the processor is positioned at one side of the master clock, the processor generates a corresponding message according to the original PTP message, the compensated sending timestamp and other synchronization information, and sends the corresponding message to the slave clock, so that the slave clock corrects the local clock, and the time synchronization or the frequency synchronization with the master clock is realized.
When the processor is positioned at one side of the slave clock, the processor obtains the master-slave clock deviation and the transmission delay according to the original PTP message, the compensated sending timestamp and other synchronization information, and corrects the local clock according to the master-slave clock deviation and the transmission delay to realize the time synchronization or the frequency synchronization with the master clock.
The master clock and the slave clock refer to systems which need time synchronization or frequency synchronization, one system is the master clock or the slave clock is configured by technicians which need time synchronization or frequency synchronization, the master clock provides accurate time reference, the slave clock corrects a local clock according to sending and receiving of PTP messages so as to achieve time synchronization or frequency synchronization with the master clock, and the local clock refers to a clock located on one side of the slave clock.
According to the embodiment of the invention, the synchronous information can be acquired by the processor before the PTP message is sent by the port is not finished by actively returning the synchronous information to the processor when the first byte of the original PTP message is sent, so that the speed of acquiring the synchronous information by the processor is improved, and high-frequency and high-precision time synchronization or frequency synchronization can be supported.
In an actual application process, because one processor may correspond to multiple ports, when multiple ports all send synchronization information to the processor, the processor needs to control a receiving sequence of the synchronization information, where one implementation manner is to add a receiving module dedicated to receiving the synchronization information in the processor to process the receiving sequence of the synchronization information, and this implementation manner needs to occupy additional resources of the processor and increase a load of the processor. In order to control the order of reception of the synchronization information, as shown in fig. 2, there are also the following preferred implementations:
in step 301, the backhaul processing module sends the original PTP message, the compensated sending timestamp, and other synchronization information to the normalization receiving module.
In step 302, the normalization receiving module generates a returned PTP message according to the original PTP message, the compensated transmission timestamp, and other synchronization information, and transmits the returned PTP message and the message received in the normal path to the processor according to the priority.
The normalized receiving module is a module for processing multi-port message scheduling in a normal message receiving path, when one processor corresponds to a plurality of ports, the processor needs to receive messages from the plurality of ports, so the normalized receiving module is usually accessed between the processor and the ports to schedule the message receiving of the plurality of ports, the processor does not need to pay attention to which port the message is received, and the load of the processor is reduced.
The normalized receiving module generates a returned PTP message according to the original PTP message, the compensated transmission timestamp, and other synchronization information, and specifically includes:
the transmission PTP message consists of a self-defined message header, an original PTP message and FCS bytes, the original PTP message which does not include the FCS bytes is packaged in an original message domain of the transmission PTP message by the normalization processing module, the self-defined message header is added in front of the original message domain, information contained in the self-defined message header comprises a first identification word transmission mark, a VLAN domain and a compensated transmission timestamp, the VLAN domain is used for storing a virtual port ID, the virtual port ID is used for distinguishing a receiving port of the original PTP message, and the FCS bytes of the transmission PTP message after being assembled are added behind the original message domain.
The FCS byte is a frame check sequence and is used for verifying the integrity of the message in the transmission process, when the original PTP message is packaged into the returned PTP message, the message to be checked changes, and the FCS byte of the original PTP message cannot be used for checking the whole message, so that a new FCS byte is generated according to the returned PTP message and is added to the original message domain.
The subsequent content of the custom message Header in the embodiment of the invention is directly presented by taking the FSL _ Header as a representative form of description.
The realization mode packages the synchronous information into a returned PTP message through the normalization receiving module, and the returned PTP message and the message received by the normal path participate in scheduling and enter the processor together, so that the processor does not need to pay attention to whether the received message or the synchronous information is received, and does not need to add an additional module to schedule and process the synchronous information, thereby reducing the load of the processor.
In the above preferred implementation manner, since the returned PTP message and the message received in the normal path are sent to the processor according to the priority, and there may be a case where the processor receives other messages first and then receives the returned PTP message according to different adopted priorities, when the number of the messages received from the external port is too large or the size is too large, the receiving time of the returned PTP message may be extended, and the speed of the processor acquiring the synchronization information is slowed down, for this problem, the following preferred embodiments exist:
the returned PTP message carries a set pkts _ side return mark, and the normalization receiving module preferentially sends the message carrying the set pkts _ side return mark to the processor.
When a plurality of returned PTP messages exist in the normalization receiving module at the same time, the normalization receiving module determines a priority sequence according to the size of the virtual port ID carried in the returned PTP messages, and sends the returned PTP messages to the processor according to the priority sequence.
The normalization receiving module judges whether the message needing to be scheduled is a returned PTP message or not through the pkts _ side return mark, if the message is the returned PTP message, the returned PTP message is prioritized over the message received by the external interface for scheduling, and when a plurality of returned PTP messages exist, scheduling is executed through the virtual port ID, wherein the virtual port ID is obtained according to port ID mapping of receiving ports in the original PTP message, and one port ID is mapped to obtain one virtual port ID.
In the preferred embodiment, the returned PTP message is preferentially scheduled, so that the processor can acquire the synchronization information more quickly, and the speed of acquiring the synchronization information by the processor is increased, thereby supporting time synchronization with higher frequency and higher accuracy.
In the step 201, the self-defined packet in which the sending module detects that the pkts _ side return flag is set may be a packet generated by the processor and carrying the set pkts _ side return flag, and the sending module performs detection, where the implementation manner specifically includes:
the processor packages the original PTP message into the custom message, sets the pkts _ side return mark in the custom message, and sends the custom message to the sending module, and the sending module detects whether the set pkts _ side return mark is carried in the custom message.
The method for encapsulating the original PTP message into the custom message by the processor specifically comprises the following steps: the processor obtains which PTP messages are messages needing to be returned according to the internal configuration information, and packages the messages needing to be returned into the user-defined messages. The internal configuration information is designed by those skilled in the art according to experience or IEEE1588 synchronization protocol.
Taking time synchronization as an example, according to different synchronization modes used in a synchronization process, PTP messages involved in the synchronization process are different, when a single-step clock mode is adopted, PTP message types involved in the synchronization process include a sync message, a delay _ req message, and a delay _ resp message, when a two-step clock mode is adopted, PTP message types include a sync message, a follow _ up message, a delay _ req message, and a delay _ resp message, wherein the sync message is generated by a master clock, and in the two-step clock mode, synchronization information when the sync message is transmitted needs to be acquired, the acquired synchronization information is added into the follow _ up message to be transmitted to a slave clock, and the delay _ req message is generated by the slave clock.
The method comprises the steps that a person skilled in the art designs internal configuration information for returning a delay _ req message in a single-step clock mode, returning a sync message and a delay _ req message in a two-step clock mode, and when a processor generates a message to be sent, the processor judges whether the current synchronization mode and the message to be sent are the sync message and the delay _ req message according to the internal configuration information, and comprehensively judges whether the sync message and the delay _ req message are packaged into a custom message as original messages or not according to the configuration of a system, such as judging whether a receiving port of the message is a port needing synchronization and whether a synchronous switch in the system is opened, and sets a pkts _ side return mark in the custom message.
There are also preferred implementations of the following, including in particular:
or the processor sends the original PTP message to the sending module, and the sending module judges whether to record the set pkts _ side return mark corresponding to the original PTP message in the register or not according to the original PTP message to be sent.
In this preferred implementation manner, the processor does not set the pkts _ side return flag, but the sending module of the port selects whether to store the set pkts _ side return flag in the register according to the type of the original PTP packet and the configuration in the port, so as to reduce the load of the processor, where one implementation manner is:
the method comprises the steps that a configuration file used for distinguishing messages is stored in a register of a sending module by a person skilled in the art, when the sending module receives an original PTP message from a processor, the original PTP message is read, the type of the original PTP message and receiving ports of the original PTP message are obtained, the configuration file in the register is read at the same time, the type of the PTP message needing to be returned and the PTP messages needing to be sent to which receiving ports are returned are obtained, then according to a synchronous switch in the configuration file, when the synchronous switch is opened, the messages meeting the PTP message type needing to be returned and the receiving ports in the configuration file are used as the original PTP message, and a set pkts _ side return mark is stored in the register so as to carry out returning operation of the original PTP message in the subsequent step.
Under the condition of strict requirement on the synchronization process, the preferred implementation mode can be used together with the implementation mode of generating the pkts _ side return flag carrying the set pkts _ side return flag by the processor, that is, a self-defined message of the pkts _ side return flag set is generated in the processor, the set pkts _ side return flag corresponding to the original message is stored in the original message detected in the sending module of the port, the original PTP message needing to acquire the synchronization information has the set pkts _ side return flag corresponding to the original message through double detection, and the processor can acquire the corresponding synchronization information.
The present embodiment may be applied to various services in a 5G bearer network, including but not limited to: flexible ethernet FlexE, flexible optical transport network FlexO, OTN traffic, OTU25 traffic, OTU50 traffic, OTUCn traffic, OSU traffic.
Example 2:
based on the method described in embodiment 1, the invention combines with a specific application scenario and uses technical expressions in a related scenario to describe an implementation process in a characteristic scenario. As shown in fig. 3, a time synchronization scenario in a two-step clock mode is shown, where ports used for time synchronization on a master clock side and a slave clock side are both FlexE interfaces, the method in embodiment 1 is applied to both the FlexE interfaces, and a flow of performing time synchronization by applying the method in embodiment 1 in the two-step clock mode is shown in fig. 4, and specifically includes:
in step 401, the master clock generates a sync message and sends the sync message to the slave clock, the master clock obtains synchronization information through the sync message, adds the sending time of the sync message in the synchronization information to the follow _ up message, and sends the follow _ up message to the slave clock.
In step 402, when the slave clock receives the sync message, the receiving time is recorded as t 2 When receiving the follow-up message from the clock, the sending time of the sync message read from the follow-up message is t 1
In step 403, the slave clock generates a delay _ req message and sends the delay _ req message to the master clock, the slave clock obtains synchronization information through the return of the delay _ req message, and the sending time of the delay _ req message in the synchronization information is recorded as t 3
In step 404, when the master clock receives the delay _ req message, it records the receiving time as t 4 Will t 4 Adding the delay _ resp message into the delay _ resp message, sending the delay _ resp message to a slave clock, and acquiring the receiving time t of the delay _ req message from the delay _ resp message by the slave clock 4
In step 405, the slave clock calculates a master-slave clock offset
Figure BDA0003722231730000131
Calculating transmission delays
Figure BDA0003722231730000132
And correcting the local clock according to the offset and the delay to realize time synchronization with the main clock.
The PTP packet backhaul method described in embodiment 1 is adopted when the master clock acquires the synchronization information via the sync packet backhaul in step 401 and the slave clock acquires the synchronization information via the delay _ req packet backhaul in step 403, and the process of acquiring the synchronization information via the delay _ req packet backhaul of the slave clock in step 403 will be shown in detail below.
As shown in fig. 5, which is a schematic diagram of a slave clock architecture, a plurality of ports may exist in the slave clock, and the plurality of ports may be used for time synchronization at the same time, and the present embodiment takes time synchronization of the ports 501 as an example, so only one port 501 for time synchronization is shown in fig. 5, where the port 501 includes a sending module 504, a backhaul processing module 505, and a receiving module 506, and the slave clock further includes a service processing side, and is composed of a normalization sending module 503, a normalization receiving module 507, and a processor 502.
When the port 501 is used to transmit a message, the normal transmission path of the message is that the processor 502 transmits a message to be transmitted to the normalized transmission module 503, the normalized transmission module 503 transmits the message to be transmitted to a corresponding port, here, the message to be transmitted is transmitted to the port 501, and the port 501 transmits the message to be transmitted to a port under the master clock through the transmission module 504.
When the port 501 is used for receiving a message, the normal receiving path of the message is that the receiving module 506 receives a message to be received sent by the port under the master clock, the message to be received is sent to the normalization receiving module 507, the normalization receiving module 507 realizes the scheduling of the receiving sequence of the message to be received, and the message to be received is sent to the processor 502.
When a clock processor 502 generates a delay _ req message, the processor 502 encapsulates the delay _ req message into a custom message, so as to facilitate processing during subsequent message return, make the structure of the custom message the same as that of a subsequently generated returned PTP message, the structures of the set custom message and the returned PTP message are as shown in fig. 6, and are composed of a custom message Header FSL _ Header and the structure of an original PTP message with a reserved 4-byte FCS position, the normalization processing module encapsulates the original PTP message without FCS bytes into the original message domain of the returned PTP message, the custom message Header FSL _ Header is added before the original message domain, the assembled FCS bytes of the returned PTP message are added after the original message domain, the custom message Header FSL _ Header is composed of a VLAN field, a pkts _ side flag, a message type, a message length and a compensated transmission time stamp, and the size of each component is 4 bytes, 1 bit, 1 byte, 2 bytes and 10 bytes, respectively, and the size of the Header FSL _ Header is 1 bit + 17. The VLAN domain is used for storing a virtual port ID, and the virtual port ID is used for distinguishing receiving ports of original PTP messages.
It should be noted that the structure of the custom message and the returned PTP message shown in the present embodiment is only a preferred implementation manner of the present invention, and is not intended to limit the present invention, and any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention. If a field for storing other information is added in the custom message Header FSL _ Header, and the size of the field for storing other information is n bytes, the size of the custom message Header FSL _ Header is (17 + n) bytes +1 bit.
After encapsulating the delay _ req packet into the custom message, the processor 502 sets a pkts _ side return flag in the custom message, which specifically includes: when the value of the pkts _ side return flag is set to 0, the pkts _ side return flag is not set, when the value of the pkts _ side return flag is set to 1, the custom message with the set pkts _ side return flag is sent to the port 501 through the normalization sending module 503, and the sending and returning of the message are realized by the port 501 and the normalization receiving module 507.
The process of implementing sending and returning of the packet by the port 501 and the normalized receiving module 507 is shown in fig. 7, and specifically includes:
in step 601, the sending module 504 reads the pkts _ side return flag of the custom packet.
In step 602, it is determined whether the value of the pkts _ side feedback flag is 1, and if the value of the pkts _ side feedback flag is 1, the pkts _ side feedback flag is considered to be set, and the message is returned in step 603 during the sending process, otherwise, the message is returned in step 607, and the subsequent sending process of the message is directly completed.
In step 603, the sending module 504 reads the custom message, takes out the delay _ req message therein, generates an original sending timestamp according to the local clock, latches the original sending timestamp, compensates the original sending timestamp to obtain a compensated sending timestamp, sends the delay _ req message, the compensated sending timestamp, and other synchronization information to the backhaul processing module 505, and the sending module 504 waits for the time of sending the delay _ req message to arrive, and then proceeds to step 604, where the latching is to record the original sending timestamp so that the original sending timestamp does not change with the time change of the local clock.
In step 604, when the time to transmit the delay _ req message arrives, the first byte of the delay _ req message is transmitted, the transmitting module 504 transmits a finish indication to the backhaul processing module 505, continues to transmit the delay _ req message to the master clock, and proceeds to step 605.
In step 605, the backhaul processing module 505 receives the finish indication, sends the delay _ req packet, the compensated sending timestamp, and other synchronization information to the receiving module 506, and the receiving module 506 sends the packet to the normalized receiving module 507, that is, the packet enters the normalized receiving module 507 through the original path for receiving the packet, and then the process goes to step 606.
In step 606, the normalization receiving module 507 generates a returned PTP message according to the delay _ req message, the compensated transmission timestamp, and other synchronization information, transmits the returned PTP message and the message received in the normal path to the processor 502 according to the priority, and the processor 502 performs subsequent processing.
In step 607, the sending module 504 reads the custom message, takes out the delay _ req message, generates an original sending timestamp according to the local clock, latches the original sending timestamp, compensates the original sending timestamp, and proceeds to step 608.
In step 608, when the time to transmit the delay _ req packet arrives, the delay _ req packet is transmitted.
The above steps only show details of sending and backhaul of delay _ req message in two-step clock mode, and when the master clock sends sync message in single-step clock mode, it usually needs to carry compensated sending timestamp in the sent sync message, and the sending and backhaul process is substantially the same as the process from the above step 601 to step 608, the difference is that in step 604, in the process of continuing sending sync message to slave clock, when sending to the position for placing timestamp in sync message, the compensated sending timestamp is put into the position, and sync message is continuously sent, so that the compensated sending timestamp is sent to slave clock side through sync message. The method does not limit the type of the message carrying the compensated transmission timestamp in different modes, for example, in the two-step clock mode, if the delay _ req message still needs to carry the compensated transmission timestamp according to the design requirements of the skilled person in the art, the method can still support.
In the above step 606, the step of generating the returned PTP packet by the normalization receiving module 507 according to the delay _ req packet, the compensated transmission timestamp, and the other synchronization information specifically includes: splitting a delay _ req message into a delay _ req message without FCS bytes and FCS bytes, placing the delay _ req message without FCS bytes into an original message domain of a returned PTP message, obtaining the type of the delay _ req message from other synchronous information, placing the type of the delay _ req message into a message type position in the returned PTP message, placing the length of the delay _ req message into a message length position of the returned PTP message, placing a compensated sending time stamp into a compensated sending time stamp position of the returned PTP message, setting the value of a pkts _ side returned mark position of the PTP message to 1, obtaining the ID and Tag of a virtual port from other synchronous information, placing the ID and Tag of the virtual port into a VLAN domain of the returned PTP message, generating FCS bytes according to the PTP returned message, and placing the FCS bytes in the original message domain.
In the above step 606, the sending the returned PTP packet and the packet received in the normal path to the processor 502 according to the priority specifically includes:
the normalization receiving module 507 performs scheduling on the returned PTP message and the message received by the normal path together, detects whether the message needs to be scheduled preferentially according to the pkts _ side return flag, if it detects that the pkts _ side return flag is set, the message carrying the set pkts _ side return flag is preferentially sent to the processor, if the normalization receiving module 507 generates the returned PTP message according to the delay _ req message, the compensated sending timestamp and other synchronization information, the normalization receiving module has other messages waiting for scheduling, if the received normal message or other PTP messages, the returned PTP message is added to the scheduling queue first, then the normal message and other PTP messages are added to the scheduling queue, and the processor 502 waits for receiving.
When a plurality of returned PTP messages are generated in the normalized receiving module 507, the returned PTP messages are sent to the processor according to the priority order from small to large of the carried virtual port IDs, which specifically is: reading the VLAN field in the returned PTP message, obtaining the virtual port ID of each PTP message, sorting each returned PTP message from small to large according to the included virtual port ID, adding the sorted returned PTP message to the head of the scheduling queue, and waiting for the processor 502 to receive.
After the port 501 and the normalization receiving module 507 realize the return of the message, the processor 502 obtains the synchronization information in the FSL _ Header domain of the returned PTP message, and records the sending time of the delay _ req message in the synchronization information as t 3 For the time synchronization processing of the above-described steps 404 to 405.
In step 603, step 604, and step 605, the sending process of the packet and the returning process of the packet are simultaneously performed, and for these processes, a more detailed structural division manner is adopted to show the work flow inside the port 501, as shown in fig. 8, the sending module 504 is divided into a sending unit 701 and a 1588 protocol processing unit 702, and the sending unit 701, the 1588 protocol processing unit 702, and the returning processing module 505 together implement the sending and returning processes of the packet, as shown in fig. 9, which specifically includes:
in step 801, the 1588 protocol processing unit 702 reads an original message field and an FCS in the custom message to obtain a delay _ req message, sends the delay _ req message to the backhaul processing module 505, the 1588 protocol processing unit 702 maps the delay _ req message to obtain a unique virtual port according to a receiving port of the delay _ req message, and sends synchronization information such as an ID and Tag of the virtual port, a type of the delay _ req message, and a length of the delay _ req message to the backhaul processing module, and meanwhile, the 1588 protocol processing unit generates a sending timestamp backhaul indication and sends the sending timestamp backhaul indication to the sending unit 701.
In step 802, the sending unit 701 generates an original sending timestamp when receiving a sending timestamp backhaul indication and sending a delay _ req packet, latches the original sending timestamp and completes timestamp compensation to generate a compensated sending timestamp, and sends the compensated sending timestamp to the 1588 protocol processing unit 702 and the backhaul processing module 505 at the same time.
In step 803, the 1588 protocol processing unit 702 sends the delay _ req message when waiting for the arrival of the sending location of the delay _ req message, and sends a finish indication to the backhaul processing module 505 when sending the first byte of the delay _ req message; and continuing to send the delay _ req message.
In step 804, when the backhaul processing module 505 receives the finish indication, it sends the delay _ req message, the compensated sending timestamp, the ID and Tag of the virtual port, the type of the delay _ req message, the length of the delay _ req message, and other synchronization information to the receiving module 506, and the receiving module 506 performs the subsequent message backhaul processing.
Example 3:
fig. 10 is a schematic diagram of an architecture of a PTP message backhaul system according to an embodiment of the present invention, where the system includes at least one port, and the port uses the PTP message backhaul methods described in embodiments 1 and 2 to backhaul PTP messages.
It should be noted that, because the information interaction and execution process between the modules and units in the system are based on the same concept as the processing method embodiment of the present invention, specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
Example 4:
fig. 11 is a schematic diagram of an architecture of a PTP message backhaul device according to an embodiment of the present invention. The PTP message backhaul device of this embodiment includes one or more processors 21 and a memory 22. In fig. 11, one processor 21 is taken as an example.
The processor 21 and the memory 22 may be connected by a bus or other means, and fig. 11 illustrates the connection by a bus as an example.
The memory 22 is used as a non-volatile computer-readable storage medium for storing a non-volatile software program and a non-volatile computer-executable program, such as the PTP message passing back method in embodiment 1. The processor 21 executes the PTP messaging method by running non-volatile software programs and instructions stored in the memory 22.
The memory 22 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory 22 may optionally include memory located remotely from the processor 21, and these remote memories may be connected to the processor 21 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The program instructions/modules are stored in the memory 22, and when executed by the one or more processors 21, perform the PTP message passing back method in embodiments 1 and 2 described above, for example, perform the steps shown in fig. 1, fig. 2, fig. 4, fig. 7, and fig. 9 described above.
It should be noted that, for the information interaction, execution process and other contents between the modules and units in the apparatus and system, the specific contents may refer to the description in the embodiment of the method of the present invention because the same concept is used as the embodiment of the processing method of the present invention, and are not described herein again.
Those of ordinary skill in the art will appreciate that all or part of the steps of the various methods of the embodiments may be implemented by associated hardware as instructed by a program, which may be stored on a computer-readable storage medium, which may include: read Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, and the like.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (10)

1. A PTP message returning method is characterized by comprising the following steps:
when detecting that the first identifier word return mark is set and the first byte of the original PTP message is being sent, the sending module sends a return completion indication to the return processing module, and continues to read the message at the same time, thereby completing the subsequent sending processing of the original PTP message;
the return processing module also receives the compensated sending timestamp sent by the sending module, and writes the compensated sending timestamp, the original PTP message and other synchronous information into a return cache for waiting;
when the return processing module receives the return completion indication sent by the sending module, the return processing module sends the original PTP message, the compensated sending timestamp and other synchronous information to the processor, so that the processor completes corresponding synchronous operation.
2. The PTP message backhaul method according to claim 1, wherein the backhaul processing module sends the original PTP message, the compensated transmission timestamp, and other synchronization information to the processor, and specifically includes:
the return processing module sends the original PTP message, the compensated sending timestamp and other synchronous information to the normalization receiving module, the normalization receiving module generates a return PTP message according to the original PTP message, the compensated sending timestamp and other synchronous information, and sends the return PTP message and the message received by a normal path to the processor according to the priority.
3. The PTP message return method according to claim 1, wherein the sending module, when detecting that the first identifier word return flag is set, specifically includes:
the method comprises the steps that a processor packages an original PTP message into a custom message, sets a first identifier word return mark in the custom message, and sends the custom message to a sending module, wherein the sending module detects whether the set first identifier word return mark is carried in the custom message or not;
or the processor sends the original PTP message to the sending module, and the sending module judges whether to record the set first marker word return mark corresponding to the original PTP message in the register or not according to the original PTP message to be sent.
4. The PTP message returning method according to claim 2, wherein the sending the returned PTP message and the message received in the normal path to the processor in priority includes:
the return PTP message carries a set first marker word return mark, and the normalization receiving module preferentially sends the message carrying the set first marker word return mark to the processor;
when a plurality of returned PTP messages exist in the normalization receiving module at the same time, the normalization receiving module determines a priority sequence according to the size of the virtual port ID carried in the returned PTP messages, and sends the returned PTP messages to the processor according to the priority sequence.
5. The PTP message feedback method according to claim 1, wherein the compensated transmission timestamp is obtained by compensating an original transmission timestamp obtained when an original PTP message is transmitted, and specifically includes:
the sending module records an original sending timestamp when an original PTP message is sent, and then performs numerical correction on the original sending timestamp according to a first compensation value preset by a person skilled in the art or a second compensation value calculated according to an accurate time synchronization protocol to obtain a compensated sending timestamp.
6. The PTP message backtransmission method according to claim 1, wherein the processor completes the corresponding synchronization operation, specifically including:
when the processor is positioned on one side of the master clock, the processor generates a corresponding message according to the original PTP message, the compensated sending timestamp and other synchronization information, and sends the corresponding message to the slave clock, so that the slave clock corrects the local clock, and the time synchronization or the frequency synchronization with the master clock is realized;
when the processor is positioned at one side of the slave clock, the processor obtains the master-slave clock deviation and the transmission delay according to the original PTP message, the compensated sending timestamp and other synchronization information, and corrects the local clock according to the master-slave clock deviation and the transmission delay to realize the time synchronization or the frequency synchronization with the master clock.
7. The PTP message backhaul method according to claim 1, wherein the method is applicable to various services in a 5G bearer network, and the various services include: one or more of flexible ethernet FlexE, flexible optical transport network FlexO, OTN traffic, OTU25 traffic, OTU50 traffic, OTUCn traffic, and OSU traffic.
8. The PTP message backtransmission method according to any one of claims 1-7, characterized in that the method further comprises: if the first identifier return flag is not detected to be set, the sending module does not execute the return processing of the original PTP message, the compensated sending timestamp and other synchronous information, and directly completes the subsequent sending processing of the message.
9. The PTP message feedback method according to claim 2, wherein the normalization receiving module generates the feedback PTP message according to the original PTP message, the compensated transmission timestamp, and other synchronization information, and specifically includes:
the transmission PTP message consists of a self-defined message header, an original PTP message and FCS bytes, the original PTP message which does not include the FCS bytes is packaged in an original message domain of the transmission PTP message by the normalization processing module, the self-defined message header is added in front of the original message domain, information contained in the self-defined message header comprises a first identification word transmission mark, a VLAN domain and a compensated transmission timestamp, the VLAN domain is used for storing a virtual port ID, the virtual port ID is used for distinguishing a receiving port of the original PTP message, and the FCS bytes of the transmission PTP message after being assembled are added behind the original message domain.
10. A PTP message return system, characterized in that the system comprises at least one port, wherein the port performs the return of PTP messages using the PTP message return method according to any one of claims 1-9.
CN202210755182.8A 2022-06-30 2022-06-30 PTP message returning method and device Pending CN115150017A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210755182.8A CN115150017A (en) 2022-06-30 2022-06-30 PTP message returning method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210755182.8A CN115150017A (en) 2022-06-30 2022-06-30 PTP message returning method and device

Publications (1)

Publication Number Publication Date
CN115150017A true CN115150017A (en) 2022-10-04

Family

ID=83410406

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210755182.8A Pending CN115150017A (en) 2022-06-30 2022-06-30 PTP message returning method and device

Country Status (1)

Country Link
CN (1) CN115150017A (en)

Similar Documents

Publication Publication Date Title
CN111800213B (en) High-speed TTE (time to live) cascade network 1588 synchronization method, system and device
US20150063375A1 (en) Communication device with peer-to-peer assist to provide synchronization
CN111555834B (en) Clock synchronization method and system of wireless network based on IEEE1588 protocol
WO2010057398A1 (en) Device and method for implementing clock transparent transmission
US20140177653A1 (en) Inband Timestamping
CN110546926B (en) Reducing packet delay variation of time sensitive packets
US10248615B2 (en) Distributed processing in a network
EP2448168A1 (en) Method and system for bearing time synchronization protocol in optical transport network
US10104206B2 (en) Network module for sending and/or receiving of data packages from a network arrangement and method
WO2021057756A1 (en) Delay measurement method, system and storage medium
WO2015131626A1 (en) Time synchronization method and apparatus for network devices and time synchronization server
CN111585862A (en) Method and device for realizing network intercommunication between EtherCAT and TSN
CN113067799B (en) Method for realizing TTP/C communication node compatible with Ethernet communication
WO2022027666A1 (en) Time synchronization method and apparatus
WO2022040847A1 (en) Communication data processing method and apparatus
WO2023124427A1 (en) Data processing method, network node, computer readable storage medium
WO2021233313A1 (en) Port state configuration method, apparatus, system, and storage medium
WO2014075260A1 (en) Time delay compensation method and apparatus
CN115150017A (en) PTP message returning method and device
WO2022100110A1 (en) Network synchronization method and apparatus, and device, system and readable storage medium
CN114338831B (en) Gateway communication method, communication equipment and storage medium
CN102546112B (en) Data packaging method and device
US9236968B2 (en) Communication device and communication method
CN111478958B (en) Network interface for synchronizing resources of network clock on chip and synchronization parameter configuration method
CN114553356A (en) Device and method for realizing transparent transmission clock in wireless HUB

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination