Delay information measurement method, 1588 time synchronization method and equipment
By measuring the delay information between the switching chip and the PHY chip in the transparent transmission device, the problem of difficulty in measuring delay in 1588 time synchronization is solved, which improves synchronization accuracy and reduces costs.
Patent Information
- Application Number
- CN202311125390.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2025-02-28
AI Technical Summary
When measuring the delay of the 1588 master-slave device, it is difficult to accurately measure the delay of the physical link and chip processing signals, resulting in inaccurate time synchronization of 1588.
By measuring the message issuance time and the entry time of the loop return message in the transparent transmission device, the delay information between the switching chip and the PHY chip is calculated and stored in the port medium delay information table for correction during 1588 time synchronization.
Improves the accuracy of 1588 time synchronization, avoids delay superposition due to differences in port media morphology, reduces measurement costs and time, and is suitable for a variety of equipment and port morphology.
Smart Images

Figure CN119544129A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a delay information measurement method, a 1588 time synchronization method and a device. Background Art
[0002] 1588 clock synchronization is usually used in power, base stations and other fields. With the increasing demand for real-time time information, in order to adapt to higher standards and application scenarios, the time synchronization of 1588 layer-by-layer devices needs to be more accurate, so it is necessary to find possible errors and compensate for them to improve the accuracy of time synchronization.
[0003] When measuring the delay between 1588 master and slave devices, the master and slave devices usually calculate the time deviation through the master and slave time information carried in the message. However, this method can only be applied to the case where the link delay between the master and slave devices is equal. In actual applications, the link delay between the master and slave devices is not the same.
[0004] In the E2ETC (End-to-End Transparent Clock) measurement scenario, the Path-delay cannot be measured because the device will terminate and discard the Peer-delay measurement message. If there are multiple levels of E2ETC in the network, the delay will be superimposed due to the difference in the port media form, which will undoubtedly seriously affect the clock accuracy of 1588.
[0005] The existing technology usually chooses to ignore the delay caused by the difference in port media morphology or obtain it by measuring the message signal with an oscilloscope; however, with the development of equipment data centers and networks, the device forms and ports are increasing, and the delay caused by the difference in port media morphology can no longer be ignored. The method of obtaining the delay by measuring the message signal with an oscilloscope not only wastes time and manpower costs, but may also cause the test results to be inaccurate. Summary of the invention
[0006] The purpose of this application is to provide a delay information measurement method, a 1588 time synchronization method and a device to address the deficiencies in the above-mentioned prior art, so as to solve the problem of inaccurate 1588 time synchronization caused by the difficulty in measuring the delay between physical links and the delay of chip processing signals in the prior art.
[0007] To achieve the above objectives, the technical solutions adopted in this application are as follows:
[0008] In a first aspect, the present application provides a delay information measurement method, which is applied to a transparent transmission device, wherein the transparent transmission device includes: a central processing unit, a switching chip, and a PHY chip, and the method includes:
[0009] When the port medium state of the current port changes, the central processor determines whether there is delay information of the current port medium in the local port medium delay information table;
[0010] If the delay information of the current port medium does not exist in the port medium delay information table, the delay information between the switching chip and the PHY chip is measured based on the sending time of the measurement message from the switching chip and the entry time of the loopback message corresponding to the measurement message into the switching chip via the PHY chip, and the delay information is added to the port medium delay information table, and the delay information of the current port medium is stored in the port register of the current port.
[0011] Optionally, the measuring and obtaining delay information between the switching chip and the PHY chip according to the sending time of the measurement message from the switching chip and the entering time of the loopback message corresponding to the measurement message entering the switching chip via the PHY chip includes:
[0012] The central processor sends a measurement message to the switching chip;
[0013] When forwarding the measurement message to the PHY chip, the switching chip adds a first timestamp to the measurement message, where the first timestamp is a sending time when the measurement message is sent from the switching chip;
[0014] After receiving the loopback message corresponding to the measurement message, the switching chip sends the loopback message and a second timestamp to the central processor, where the second timestamp is the entry time of the loopback message entering the switching chip via the PHY chip;
[0015] The central processor measures and obtains the delay information of the current port medium according to the second timestamp and the first timestamp in the loopback message.
[0016] Optionally, before the central processor sends the measurement message to the switching chip, the method further includes:
[0017] The current port is configured so that the current port enters a loopback state, wherein the port configuration includes: self-loop configuration or loopback configuration.
[0018] Optionally, the central processor measures and obtains the delay information of the current port medium according to the second timestamp and the first timestamp in the loopback message, including:
[0019] determining a difference between the first timestamp and the second timestamp;
[0020] According to the difference, the delay information of the current port medium is obtained.
[0021] Optionally, the first timestamp is recorded in a timestamp field of the measurement message.
[0022] Optionally, determining whether the delay information of the current port medium exists in the local port medium delay information table includes:
[0023] Obtaining the media type number of the current port;
[0024] Searching the port media delay information table for delay information corresponding to the media type number according to the media type number;
[0025] If the delay information corresponding to the medium type number is found, it is determined that the delay information of the current port medium exists in the port medium delay information table; otherwise, it is determined that the delay information of the current port medium does not exist in the port medium delay information table.
[0026] In a second aspect, the present application provides a 1588 time synchronization method, which is applied to a 1588 communication system, wherein the system includes: a master device, a slave device, and at least one transparent transmission device, and the method includes:
[0027] The master device sends a 1588 synchronization message to the slave device;
[0028] After receiving the 1588 synchronization message, the at least one transparent transmission device adds the residence time of the at least one transparent transmission device to the correction domain field of the 1588 synchronization message, wherein the residence time includes: delay information between the switching chip and the PHY chip of the transparent transmission device, and the delay information is measured by the method described in the first aspect above;
[0029] After receiving the 1588 synchronization message transparently transmitted by the at least one transparent transmission device, the slave device adjusts the time difference with the master device based on the residence time in the 1588 synchronization message, and performs time synchronization based on the time difference.
[0030] In a third aspect, the present application provides a transparent transmission device, which includes: the central processing unit, a switching chip and a PHY chip, and the transparent transmission device is used to execute the steps of the method described in the first aspect above.
[0031] In a fourth aspect, the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the method described in the first aspect above.
[0032] In a fifth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect are executed.
[0033] The beneficial effects of the present application are: when the port medium state of the current port changes, it is determined whether there is delay information of the current port medium in the port medium delay information table, and when there is no delay information of the current port medium in the port medium delay information table, the delay information of the current port medium is measured according to the time when the measurement message is sent from the switching chip and the time when the loopback message corresponding to the measurement message enters the switching chip, so that the accuracy of 1588 time synchronization can be improved when performing 1588 time synchronization on the master and slave devices. Compared with the prior art that uses an oscilloscope to measure the message signal to obtain the potential delay between the switching chip and the PHY chip, the method of the present application is not limited to the form of the device and the number of ports, and does not require additional hardware and labor costs, and can be implemented on the original device, with better measurement accuracy and better universality. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 A schematic diagram of a 1588 clock synchronization process provided by an embodiment of the present application is shown;
[0036] Figure 2 A flowchart of a delay information measurement method provided by an embodiment of the present application is shown;
[0037] Figure 3 A schematic diagram showing a measurement message sent in a transparent transmission device provided in an embodiment of the present application is shown;
[0038] Figure 4 A flowchart of measuring delay information provided by an embodiment of the present application is shown;
[0039] Figure 5 A schematic diagram of calculating delay information provided by an embodiment of the present application is shown;
[0040] Figure 6 A flowchart of searching for delay information provided by an embodiment of the present application is shown;
[0041] Figure 7 A flowchart of a 1588 time synchronization method provided by an embodiment of the present application is shown;
[0042] Figure 8 A schematic diagram of the structure of a transparent transmission device provided in an embodiment of the present application is shown;
[0043] Fig. 9 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0044] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0045] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0046] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0047] The method for measuring the time delay of 1588 master-slave devices in the prior art is as follows: Figure 1 As shown, the time deviation can usually be calculated by carrying the master device clock time information, the slave device clock time information, and the time when the master device and the slave device receive the message sent by the opposite device to arrive at the local device through these time information: offset = ((t4-t3)-(t2-t1)) / 2, refer to Figure 1, where t1 and t3 record the time when the master / slave device sends the message, and t2 and t4 are the time when the master / slave device receives the message. Of course, this can only be used when the link delay between the master and slave devices is equal, that is, the time consumed for the message to be transmitted from the master device to the slave device is the same.
[0048] However, in a large and complex 1588 clock synchronization clock domain, there are many transparent clocks in the middle that are used to transparently transmit most PTP (precise time protocol) messages and update the residence time at the same time. Figure 1 There are multiple transparent transmission devices between the master device and the slave device. When the message passes through the transparent transmission device, the residence time of the message can be updated in the transparent transmission device and the residence time is appended to the CF field of the 1588 message. However, for devices that do not support PHY chip timestamping, the residence time that can be calculated is only the time from the message entering the switch chip to the time it leaves the switch chip. The forwarding domain of a transparent transmission device may contain multiple ports, and the media of each port may be different. This will cause the difference in the residence time of the message in the transparent transmission device to become larger, and the delay measurement messages of the master and slave devices may not necessarily enter and exit from the same port. Therefore, due to the different media of the ports and the different lengths of the physical link lines from the switch chip to the PHY chip, it cannot be assumed that the link delays between the master and the slave are equal.
[0049] In P2PTC (Peer-to-Peer Transparent Clock), the switching chips of two devices can usually be regarded as a link. The path delay between the two set ports can be measured by the peer-delay method, and then corrected by asymmetric delay. The delay introduced by the port medium can be included in the residence time of the device. Therefore, in the P2PTC scenario, the delay from the switching chip to the PHY chip does not need to be specially calculated.
[0050] However, in the E2ETC scenario, the path delay cannot be measured because the device will terminate and discard the Peer-delay measurement message. If there are multiple levels of E2ETC in the network, this delay will be superimposed, which will undoubtedly seriously affect the clock accuracy of 1588. At this time, it is necessary to calculate the delay from the switching chip to the PHY chip in the transparent transmission device and exclude this delay.
[0051] In the scenario where the PHY chip does not support timestamping and appending delays, it is necessary to timestamp on the switch chip. At this time, the physical routing delay from the switch chip to the PHY chip and the potential delay of the time consumed by the PHY chip to process the message are a part that cannot be ignored. Currently, the switch chip supports saving the delay between the switch chip and the PHY chip by filling in the register, identifying the 1588 message type and automatically appending the delay data to the CF field of the message, or adding the delay between the switch chip and the PHY chip when timestamping the switch chip when sending the packet. Finally, this delay is calculated and eliminated through the protocol.
[0052] Reference Figure 1 There are multiple transparent transmission devices between the master device and the slave device. The 1588 synchronization message sent by the master device is transmitted to the slave device through each transparent transmission device. The slave device determines the time difference between itself and the master device based on the multiple 1588 synchronization messages received and performs time synchronization.
[0053] according to Figure 1 It can be seen that the link delay between the master and slave devices is at t2 and t4. By subtracting the CF carried in the message from the t2 time when the slave device receives the message, we can get the actual t2=t2-CF. By subtracting the CF carried in the message from the t4 time when the master device receives the message, we can get the actual t4=t4-CF. Because the CF at this time updates the potential delay between the switch chip and the PHY chip of the transparent transmission device between the master and slave devices, it becomes more accurate. At this time, if we assume that the link delay between the master and slave is equal, by subtracting CF from t2 and t4 and then bringing it into the above offset formula to calculate: offset=((t4-CF–t3)–(t2-CF-t1)) / 2, the accuracy of 1588 can be greatly improved.
[0054] In summary, for transparent transmission devices such as switching and routing devices, hardware is usually used to modify the timestamp when sending 1588 messages. For those that do not support timestamps on the PHY chip, the timestamp is usually modified on the switching chip. Since there is a hardware link between the switching chip and the PHY chip, and the PHY chip needs to encode and decode cache to process messages, the potential delay between the switching chip and the PHY chip has become an important part that cannot be ignored. Therefore, how to accurately obtain the potential delay between the switching chip and the PHY chip of the transparent transmission device has a great impact on improving the accuracy of 1588 time synchronization.
[0055] At present, the potential delay compensation between the switch chip and the PHY chip is usually ignored or obtained by measuring the message signal with an oscilloscope. However, with the development of device data centers and networks, the number of device forms and ports is increasing. At this time, using an oscilloscope to measure the message signal will increase the difficulty and time of measurement exponentially.
[0056] Based on the above problems, the present application proposes a delay information measurement method and a 1588 time synchronization method, which are used to measure the delay information between the switching chip and the PHY chip in the transparent transmission device. Without increasing hardware and labor costs and ignoring the equipment and port forms, the method of the present application can automatically measure the potential delay between the switching chip and the PHY chip, and eliminate this potential delay in the process of 1588 time synchronization.
[0057] The delay information measurement method of the present application can be applied to transparent transmission devices. By timely measuring the potential delay between the switching chip and the PHY chip of the transparent transmission device when the port medium status changes, the potential delay caused by the physical device switching chip and the physical wiring of the PHY chip and the chip processing of the multi-level E2ETC transparent transmission devices in the network in the 1588 time synchronization scenario can be solved, thereby improving the accuracy of 1588 time synchronization during the 1588 time synchronization process.
[0058] Next, the delay information measurement method of the present application is described. The execution subject of the method can be a central processing unit (CPU) of a transparent transmission device, such as a switch, a router, etc. The transparent transmission device includes a CPU, a switching chip and a PHY chip, wherein a MAC chip can be integrated on the switching chip. Figure 2 As shown, the method includes:
[0059] S201: When the port medium state of the current port changes, the central processor determines whether there is delay information of the current port medium in the local port medium delay information table.
[0060] Optionally, the port media state of the current port can indicate whether the media type connected to the current port has changed. For example, assuming that the media type of the current port changes from "MAC+PHY optical port" to "MAC+PHY electrical port", it can be said that the media state of the current port has changed.
[0061] As another possible implementation, when the current port is restarted, it can also be considered that the medium state of the current port is changed.
[0062] Optionally, the port medium delay information table may be a configuration file of the port delay information, which is used to record the delay information corresponding to different medium status types between MAC and PHY in the port.
[0063] As shown in Table 1, this is an example of a port media delay information table provided by the present application. At the beginning, the delay information corresponding to each media type can be set to a default value.
[0064] Table 1 Example of port media delay information table
[0065] Media Type Number Delay (default value is 0xffff, unit is nanosecond) MAC+PHY optical port (0x0) 0xffff MAC+PHY optical port+optical to electrical (0x1) 0xffff
[0066] When the port medium state of the current port changes, the device may determine whether there is delay information corresponding to the changed medium type of the current port in the port medium delay information table shown in Table 1 above.
[0067] Among them, the delay information of the current port medium includes the medium type and delay of the current port, which indicates the transmission delay of any message from the exit of the MAC chip of the current port to the exit of the PHY chip. The medium type of a port may include one or more types. Accordingly, the delay information of a port may include one or more types. A transparent transmission device may include multiple ports.
[0068] S202: If the delay information of the current port medium does not exist in the port medium delay information table, the delay information between the switching chip and the PHY chip is measured according to the sending time of the measurement message from the switching chip and the entering time of the loopback message corresponding to the measurement message into the switching chip via the PHY chip, and the delay information is added to the port medium delay information table, and the delay information of the current port medium is stored in the port register of the current port.
[0069] Optionally, if the delay information of the current port medium does not exist in the port medium delay information table, it means that the delay information of the current port has not been measured. At this time, the current port can be measured to obtain the sending time of the measurement message from the switching chip of the transparent transmission device and the entry time of the loopback message corresponding to the measurement message into the switching chip via the PHY chip, and the delay information of the current port medium is obtained based on the sending time and the entry time.
[0070] It is worth noting that in the embodiment of the present application, the MAC chip is integrated in the switching chip, so the delay information between the switching chip and the PHY chip described later in the present application is the delay information between the MAC chip and the PHY chip.
[0071] like Figure 3 As shown, this is a simplified diagram of sending a measurement message in a transparent transmission device provided by the present application, referring to Figure 3 , the time when the measurement message is sent from the switching chip of the device can be Figure 3 Measurement message arrival Figure 3 The time at position A in the measurement message, the time at which the loopback message corresponding to the measurement message enters the switching chip can be the time at which the loopback message corresponding to the measurement message arrives at Figure 3 The time at position A in .
[0072] It should be noted that the time of issuance can be Figure 3The switching chip shown is added in the measurement message. Exemplarily, the switching chip can be a CTC8180 (CENTEC TSINGMA.MX) chip. The switching chip can add a 1588 timestamp to the measurement message when the measurement message arrives at the switch chip exit, and send the second timestamp and the loopback message to the CPU when the loopback message of the measurement message arrives at the switch chip entrance via the PHY chip.
[0073] Optionally, the measurement message is sent from the switching chip to the PHY chip, and after being sent out by the PHY chip export, it can be sent to the CPU via the inlet loopback of the PHY chip. The loopback message can be a measurement message sent from the inlet loopback of the PHY chip to the CPU, that is, the measurement message and loopback message of the present application are messages with different sending directions and the same format.
[0074] Optionally, the number of measurement messages may be one or more. When the number of measurement messages is multiple, a delay information may be obtained according to the sending time of each measurement message and the entry time of the loopback message corresponding to each measurement message, and the average value of the multiple delay information obtained may be used as the delay information between the switching chip and the PHY chip under the port medium state of the current port.
[0075] After the delay information is measured, the delay information can be added to the port medium delay information table, and the delay information of the current port medium can be stored in the port register of the current port. In this way, when performing 1588 time synchronization, the transparent transmission device can add the delay information stored in the port register to the 1588 synchronization message to eliminate this delay during the 1588 time synchronization process.
[0076] In an embodiment of the present application, when the port medium state of the current port changes, it is determined whether there is delay information of the current port medium in the port medium delay information table. When the delay information of the current port medium does not exist in the port medium delay information table, the central processor measures the delay information of the current port medium based on the sending time of the measurement message from the switching chip of the device and the entry time of the loopback message corresponding to the measurement message into the switching chip.
[0077] Compared with the prior art of measuring the message signal through an oscilloscope to obtain the potential delay between the switching chip and the PHY chip, the method of the present application is not limited to the form of the device and the number of ports, and the method of the present application does not require additional hardware and labor costs, and can be implemented on the original device. It has better measurement accuracy and better universality, and after the delay information is measured based on the method of the present application, the accuracy of subsequent 1588 time synchronization can also be improved.
[0078] Next, the step of measuring and obtaining the delay information of the current port medium according to the sending time of the measurement message from the switch chip of the transparent transmission device and the entry time of the loopback message corresponding to the measurement message into the switch chip is further described. Figure 4 As shown, the above step S202 includes:
[0079] S401: The central processing unit sends a measurement message to the switching chip.
[0080] Reference Figure 3 ,The central processor can send a measurement message to the switch chip, and the measurement message is used to measure the potential delay between the switch chip and the PHY chip.
[0081] S402: When forwarding the measurement message to the PHY chip, the switch chip adds a first timestamp to the measurement message, where the first timestamp is the time when the measurement message is sent from the switch chip.
[0082] Optionally, when the measurement message is sent from the switching chip, the switching chip may add a first timestamp to the measurement message, wherein the first timestamp may be a counter time of the device when the measurement message is sent from the switching chip.
[0083] Optionally, the first timestamp may be added by the switching chip to the TS (Time stamp) field of the measurement message (1588 message) header when the measurement message is sent from the switching chip. This time may be the counter time of the current switching chip.
[0084] It is worth noting that in the present application, the device can be pre-configured for loopback or cable self-loop, and the exit and entrance of the device PHY chip can be connected to form a loopback, so that the measurement message can be looped back to the CPU after being sent from the exit of the PHY chip, so that the CPU can measure the delay information according to the sending time and entry time of the measurement message.
[0085] S403: After receiving the loopback message corresponding to the measurement message, the switch chip sends the loopback message and the second timestamp to the central processor, where the second timestamp is the time when the loopback message enters the switch chip via the PHY chip.
[0086] After the measurement message is sent from the switch chip, it will enter the PHY chip. After being sent from the exit of the PHY chip, the measurement message will be looped back and sent to the switch chip. Figure 3 As shown, when the measurement message enters the inlet of the switch chip, the switch chip may send a second timestamp to the CPU, wherein the second timestamp may be the counter time of the switch chip when the measurement message enters the switch chip.
[0087] In the present application, the device may send multiple measurement messages, and the CPU may receive multiple loopback messages corresponding to the measurement messages, as well as a second timestamp when each loopback message enters the switching chip.
[0088] S404: The central processor measures and obtains delay information of the current port medium according to the second timestamp and the first timestamp in the loopback message.
[0089] Reference Figure 3 The delay information of the current port medium that needs to be measured in this application is the delay from the exit of the switching chip of the current port to the physical layer exit. The first timestamp indicates the time of the timer of the switching chip when the measurement message arrives at the exit of the switching chip. The second timestamp indicates the time of the timer of the switching chip when the measurement message loops back to reach the entrance of the switching chip. The physical link for the transmission of the measurement message in the AM segment and the transmission of the loopback message of the measurement message in the AM segment are the same. Then the transmission delay Engress latency (asymmetric delay in the outbound direction) of the measurement message in the AM segment and the transmission delay Ingress Latency (asymmetric delay in the inbound direction) of the loopback message of the measurement message in the AM segment are also the same. Therefore, the delay information of the current port medium can be obtained according to the first timestamp and the second timestamp.
[0090] The following is a further description of configuring the port before sending the measurement message to the switching chip, and the above step S401 also includes:
[0091] Perform port configuration on the current port to make the current port enter the loopback state. The port configuration includes: self-loop configuration or loopback configuration.
[0092] Optionally, when the current port enters the loopback state, all messages sent from the current port are uploaded to the CPU via the PHY chip of the current port.
[0093] As a possible implementation, when the transparent transmission device does not read the delay information of the current port medium from the port medium delay information table, the administrator may perform self-loop configuration on the current port to make the current port enter a loopback state.
[0094] The current port is configured to have a self-loop, which may be to use an optical module and an optical fiber to form a port self-loop for an optical port, or to use a network cable to form a port self-loop for an electrical port.
[0095] It should be understood that the present application only uses the port self-loop configuration as an example for illustration. The management personnel can also configure the loopback between the transparent transmission device and other devices to measure and obtain the delay information of the transparent transmission device. However, after configuring the loopback with other devices, due to the addition of other devices to form a loopback, the accuracy of the calculated delay information may be lower than that of the self-loop configuration. If automatic configuration is required, the loopback configuration method can be adopted. If high-precision delay information is required, the self-loop configuration method can be selected. The management personnel can choose the configuration loopback method according to the actual execution situation, and the present application does not impose any restrictions here.
[0096] The following is a further explanation of the delay information of the current port medium measured based on the first timestamp in the loopback message and the second timestamp sent by the switching chip to the CPU. Figure 5 As shown, step S404 includes:
[0097] S501: Determine a difference between a first timestamp and a second timestamp.
[0098] Reference Figure 3 The first timestamp indicates the time when the measurement message is sent from the switching chip, and the second timestamp indicates the time when the loopback message corresponding to the measurement message enters the switching chip. Therefore, the total time from the measurement message leaving the switching chip to returning to the switching chip can be obtained by subtracting the first timestamp from the second timestamp.
[0099] S502: Obtain delay information of the current port medium according to the difference.
[0100] In this application, the delay information of the current port medium refers to the delay caused by the hardware link between the switching chip and the PHY chip and the chip processing the signal, so half of the difference can be used as the delay information of the current port medium.
[0101] In the present application, after the delay information of the current port medium is measured and obtained, the delay information of the current port medium can be stored in a port medium delay information table, and the delay information of the current port medium can be stored in a port register of the current port.
[0102] It is worth noting that in the present application, coverage measurement can be performed for the same type of equipment, for example, all possible media types of routers are measured, and the obtained port media delay information table of the router is synchronized to all routers of the same type.
[0103] Optionally, after measuring the delay information of the current port medium, the delay information of the current port medium can also be stored in the port register of the current port, so that when performing 1588 clock synchronization later, the delay information corresponding to the port can be directly read from the port register of the current port.
[0104] Next, the steps of determining whether the delay information of the current port medium exists in the port medium delay information table before measuring the delay information are described. Figure 6 As shown, the above step S201 includes:
[0105] S601: Obtain the media type number of the current port.
[0106] Optionally, when the transparent transmission device is started or the port medium of the running transparent transmission device changes, the transparent transmission device may obtain the number of the media type of the current port, or generate the number of the media type of the current port based on the media type of the current port.
[0107] Exemplarily, assuming that the medium type of the current port is MAC+PHY electrical port, the MAC is numbered 0, and the PHY electrical port is numbered 2, then the medium type number of the current port is 0x2.
[0108] S602: Searching for delay information corresponding to the media type number in the port media delay information table according to the media type number.
[0109] Optionally, by searching in the port media delay information table according to the media type number, the delay corresponding to the media type can be determined, and the delay is used as the delay information corresponding to the media type number.
[0110] Exemplarily, assuming that the medium type of the current port is a MAC+PHY electrical port, and the delay information found in the port medium delay information table according to its medium type number is 15ns, then the delay information of the current port medium is: 15ns.
[0111] S603: If the delay information corresponding to the medium type number is found, it is determined that the delay information of the current port medium exists in the port medium delay information table; otherwise, it is determined that the delay information of the current port medium does not exist in the port medium delay information table.
[0112] As a possible implementation method, the delay information corresponding to each media type number can be set as a default value in the initial port media delay information table. If the delay information found in the port media delay information table according to the media type number is the default value, it means that the delay information of the media type has not been measured. At this time, the above S401-S404 steps can be executed to measure the delay information corresponding to the media type number.
[0113] As another possible implementation, if the delay information found in the port media delay information table according to the media type number is not the default value, it means that the delay information of the media type has been measured. At this time, 1588 clock synchronization can be performed according to the delay information corresponding to the media type.
[0114] Next, the delay information measurement method of the present application is described in general. When the port media state of the device changes, the device can configure a loopback or self-loop and measure the delay information. The delay information between the switching chip and the PHY chip of the transparent transmission device is determined according to the time when the measurement message is sent from the switching chip and the time when the loopback message corresponding to the measurement message enters the switching chip, and the delay information is updated in the port media delay information table.
[0115] In the E2ETC scenario, there are multiple transparent transmission devices between the master device and the slave device. After obtaining the delay information between the switch chip and the PHY chip of each transparent transmission device in the network, the transparent transmission device can add the delay information to the passing 1588 synchronization message when performing 1588 time synchronization, so that the potential delay between the switch chip and the PHY chip can be eliminated when the master device and the slave device perform 1588 time synchronization.
[0116] The following is a description of the method for performing 1588 time synchronization based on the delay information of the transparent transmission device after the delay information is measured. The 1588 time synchronization method can be applied to Figure 1 In the 1588 communication system shown in the figure, the system includes: a master device, a slave device and at least one transparent transmission device. Figure 7 As shown, the method includes:
[0117] S701: The master device sends a 1588 synchronization message to the slave device.
[0118] Reference Figure 1 When there are multiple transparent transmission devices between the master device and the slave device, the master device can first send a 1588 synchronization message to the slave device during 1588 time synchronization.
[0119] To facilitate understanding, the interaction process between the master device and the slave device during the 1588 time synchronization process is first described.
[0120] Reference Figure 1 The master device sends a 1588 synchronization message to the slave device via the transparent transmission device, records the first time t1 of the 1588 synchronization message, and sends the first time t1 to the slave device; the slave device receives the 1588 synchronization message sent by the master device, records the second time t2 of receiving the 1588 synchronization message, and sends a 1588 response message to the master device via the transparent transmission device, and records the third time t3 of sending the 1588 response message; when the master device receives the 1588 response message, it records the fourth time t4 of receiving the 1588 response message, and sends the fourth time t4 to the slave device via the transparent transmission device.
[0121] S702: After receiving the 1588 synchronization message, the transparent transmission device adds the residence time of the transparent transmission device to the correction domain field of the 1588 synchronization message. The residence time includes: the delay information between the switching chip and the PHY chip of the transparent transmission device, and the delay information is measured by the above steps S201-S202.
[0122] Optionally, the correction domain field can be the CF (correction field) field of the 1588 message. In the present application, when the 1588 synchronization message passes through the transparent transmission device in the E2ETC, each transparent transmission device will add the residence time to the CF (correction field) field of the 1588 message, where the residence time includes the delay information between the switching chip and the PHY chip obtained in the above S201-S202 steps.
[0123] exist Figure 1 In the process of 1588 time synchronization between the master device and the slave device shown, the transparent transmission device adds the dwell time to the 1588 synchronization message transparently transmitted by the transparent transmission device, and transparently transmits the 1588 synchronization message to the slave device.
[0124] S703: After receiving the 1588 synchronization message transparently transmitted by at least one transparent transmission device, the slave device determines the time difference with the master device based on the timestamp and residence time in the 1588 synchronization message, and performs time synchronization based on the time difference.
[0125] Optionally, after receiving a 1588 synchronization message transparently transmitted by at least one transparent transmission device, the slave device can determine the time difference with the master device based on the reception time of the 1588 synchronization message and the timestamp and residence time in the 1588 synchronization message, and perform time synchronization based on the time difference.
[0126] For example, refer to Figure 1 After receiving the 1588 synchronization message, the slave device can determine the time difference between the master device and the slave device based on the first time t1, the second time t2, the third time t3, the fourth time t4 and the residence time in the correction domain field, and perform time synchronization.
[0127] The present application also provides a transparent transmission device, such as Figure 8 As shown, it is a schematic diagram of the structure of the transparent transmission device provided in an embodiment of the present application, including: a central processor 801, a switching chip 802, a MAC chip 803 and a PHY chip 804, wherein the MAC chip 803 can be integrated and deployed on the switching chip 802, and the transparent transmission device is used to perform the delay information measurement of the above-mentioned transparent transmission device and the processing of the 1588 time synchronization method, wherein:
[0128] The central processor 801 is used to determine whether there is delay information of the current port medium in the local port medium delay information table when the port medium state of the current port changes;
[0129] The central processing unit 801 is also used to measure the delay information between the switching chip 802 and the PHY chip 804 according to the sending time of the measurement message from the switching chip 802 and the entry time of the loopback message corresponding to the measurement message into the switching chip 802 via the PHY chip 804 if the delay information of the current port medium does not exist in the port medium delay information table, and add the delay information to the port medium delay information table, and store the delay information of the current port medium in the port register of the current port.
[0130] Optionally, the central processor 801 is further configured to:
[0131] The central processor 801 sends a measurement message to the switching chip 802;
[0132] The switching chip 802 is used to add a first timestamp to the measurement message when forwarding the measurement message to the PHY chip 804, where the first timestamp is the sending time of the measurement message from the switching chip 802;
[0133] The switching chip 802 is used to send the loopback message and the second timestamp to the central processor 801 after receiving the loopback message corresponding to the measurement message, where the second timestamp is the entry time of the loopback message into the switching chip 802 via the PHY chip 804;
[0134] The central processor 801 is further configured to measure and obtain delay information of the current port medium according to the second timestamp and the first timestamp in the loopback message.
[0135] Optionally, the central processor 801 is further configured to:
[0136] determining a difference between the first timestamp and the second timestamp;
[0137] Based on the difference, the delay information of the current port medium is obtained.
[0138] Optionally, the first timestamp is recorded in a timestamp field of the measurement message.
[0139] Optionally, the central processor 801 is further configured to:
[0140] Get the media type number of the current port;
[0141] According to the media type number, search for delay information corresponding to the media type number in the port media delay information table;
[0142] If the delay information corresponding to the medium type number is found, it is determined that the delay information of the current port medium exists in the port medium delay information table; otherwise, it is determined that the delay information of the current port medium does not exist in the port medium delay information table.
[0143] Compared with the prior art solution of measuring the message signal through an oscilloscope to obtain the potential delay between the MAC chip and the PHY chip, the embodiment of the present application is not limited by the form of the device and the number of ports, and the method of the present application does not require additional hardware and labor costs, and can be implemented on the original device, with better measurement accuracy and better universality.
[0144] The present application also provides an electronic device, such as Fig. 9 As shown, it includes: a processor 901, a storage medium 902 and a bus, the storage medium 902 stores program instructions executable by the processor 901, when the electronic device is running, the processor 901 communicates with the storage medium 903 through the bus, and the processor executes the program instructions to perform the steps of the delay information measurement method as described above.
[0145] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned delay information measurement method are executed.
[0146] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0147] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the technical solution that contributes to the prior art or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk and other media that can store program code.
[0148] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A delay information measurement method, characterized in that: Applied to a transparent transmission device, the transparent transmission device includes: a central processing unit, a switching chip and a PHY chip, and the method includes: When the port medium state of the current port changes, the central processor determines whether there is delay information of the current port medium in the local port medium delay information table; If the delay information of the current port medium does not exist in the port medium delay information table, the delay information between the switching chip and the PHY chip is measured based on the sending time of the measurement message from the switching chip and the entry time of the loopback message corresponding to the measurement message into the switching chip via the PHY chip, and the delay information is added to the port medium delay information table, and the delay information of the current port medium is stored in the port register of the current port.
2. The method according to claim 1, characterized in that The measuring and obtaining delay information between the switching chip and the PHY chip according to the sending time of the measurement message from the switching chip and the entering time of the loopback message corresponding to the measurement message entering the switching chip via the PHY chip includes: The central processor sends a measurement message to the switching chip; When forwarding the measurement message to the PHY chip, the switching chip adds a first timestamp to the measurement message, where the first timestamp is a sending time when the measurement message is sent from the switching chip; After receiving the loopback message corresponding to the measurement message, the switching chip sends the loopback message and a second timestamp to the central processor, where the second timestamp is the entry time of the loopback message entering the switching chip via the PHY chip; The central processor measures and obtains the delay information of the current port medium according to the second timestamp and the first timestamp in the loopback message.
3. The method according to claim 2, characterized in that Before the central processor sends the measurement message to the switching chip, the method further includes: The current port is configured so that the current port enters a loopback state, wherein the port configuration includes: self-loop configuration or loopback configuration.
4. The method according to claim 3, characterized in that The central processor measures and obtains the delay information of the current port medium according to the second timestamp and the first timestamp in the loopback message, including: determining a difference between the first timestamp and the second timestamp; According to the difference, the delay information of the current port medium is obtained.
5. The method according to any one of claims 2 to 4, characterized in that: The first timestamp is recorded in a timestamp field of the measurement message.
6. The method according to claim 1, characterized in that The determining whether the delay information of the current port medium exists in the local port medium delay information table includes: Obtaining the media type number of the current port; Searching the port media delay information table for delay information corresponding to the media type number according to the media type number; If the delay information corresponding to the medium type number is found, it is determined that the delay information of the current port medium exists in the port medium delay information table; otherwise, it is determined that the delay information of the current port medium does not exist in the port medium delay information table.
7. A 1588 time synchronization method, characterized in that: Applied to a 1588 communication system, the system includes: a master device, a slave device and at least one transparent transmission device, and the method includes: The master device sends a 1588 synchronization message to the slave device; After receiving the 1588 synchronization message, the at least one transparent transmission device adds the residence time of the at least one transparent transmission device to the correction domain field of the 1588 synchronization message, wherein the residence time includes: delay information between the switching chip and the PHY chip of the transparent transmission device, and the delay information is measured by the delay information measurement method according to any one of claims 1 to 6; After receiving the 1588 synchronization message transparently transmitted by the at least one transparent transmission device, the slave device adjusts the time difference with the master device based on the residence time in the 1588 synchronization message, and performs time synchronization based on the time difference.
8. A transparent transmission device, characterized in that: The transparent transmission device includes: a central processing unit, a switching chip and a PHY chip, and the transparent transmission device is used to execute the steps of the delay information measurement method according to any one of claims 1 to 6.
9. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the delay information measurement method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the delay information measurement method according to any one of claims 1 to 6 are executed.