A method and system for verifying the accuracy of timestamp of network equipment

By changing the transmission line length and calculating multiple sets of delay data, the timestamp accuracy during network transmission is verified, and the problem of insufficient reliability of timestamp accuracy verification in the prior art is solved, and the accuracy of time-delay testing is improved.

CN118694462BActive Publication Date: 2025-03-18BEIJING XINERTEL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410739314.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2025-03-18
Estimated Expiration
2044-06-07

AI Technical Summary

Technical Problem

The prior art is difficult to effectively verify the timestamp accuracy during network transmission, resulting in insufficient reliability of delay testing.

Method used

By acquiring multiple sets of delay data, the actual timestamp accuracy is calculated using the change in the transmission line length, and compared with the preset timestamp accuracy to verify the accuracy of timestamp accuracy.

Benefits of technology

Improves the reliability of timestamp accuracy, ensures the accuracy and credibility of time-delay testing, and avoids the possibility of cheating.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118694462B_ABST
    Figure CN118694462B_ABST
Patent Text Reader

Abstract

The present application relates to a method and system for verifying the timestamp accuracy of a network device, which belongs to the field of data processing technology. The method comprises: obtaining n groups of delay data, n≥2, the parameter values ​​of the network channels corresponding to the n groups of delay data are different, the network channels are composed of transmission lines and gateway devices, and the parameter value refers to the length of the transmission line; calculating the actual timestamp accuracy according to the n groups of delay data; and obtaining the verification result according to the actual timestamp accuracy and the preset timestamp accuracy. The present application has the effect of improving the reliability of the timestamp accuracy used in network transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method and system for verifying the timestamp accuracy of a network device. Background Art

[0002] Latency is an important parameter for network testing, and the timestamp mechanism is one of the key elements of time synchronization and latency testing. The accuracy of the timestamp directly corresponds to the accuracy of the latency test.

[0003] In actual application scenarios, the timestamp of the network device belonging to the sender and the timestamp of the network device belonging to the receiver are driven by counters with the same frequency. The network packet is sent from the output port of the sender. Assuming that the timestamp value of the network packet sent by the sender is v1, the network packet reaches the input port of the receiver through the network channel. Assuming that the timestamp value of the network packet received by the receiver is v2, the delay of the network packet is: Δt= (v2-v1)*d, where d is the timestamp accuracy.

[0004] In the above process of calculating the delay of the network packet, Δv is calculated by hardware in the FPGA and stored in the register. After the software system reads the value of Δv, it multiplies it by the timestamp accuracy to obtain Δt.

[0005] Since the calculation of Δv is done inside the FPGA, it is difficult to prove the authenticity of the timestamp accuracy during network transmission. There are currently two known methods. One is to explain the delay test principle and plan verbally or in writing, but this method lacks third-party tool verification, is not convincing, and has low reliability. The other is to lead the counter clock through the FPGA chip pin and then measure it with an oscilloscope. However, there is a frequency-driven clock in the FPGA chip, and it cannot be proved that the delay test uses a clock of the same frequency, so the reliability of the timestamp accuracy cannot be guaranteed. Summary of the invention

[0006] In order to improve the reliability of timestamp accuracy used in network transmission, the present application provides a timestamp accuracy verification method and system for a network device.

[0007] In a first aspect of the present application, a method for verifying the timestamp accuracy of a network device is provided, the method comprising:

[0008] Obtaining n groups of delay data, where n≥2, the parameter values ​​of the network channels corresponding to the n groups of delay data are different, the network channels are composed of a transmission line and a gateway device, and the parameter value refers to the length of the transmission line;

[0009] Calculate the actual timestamp accuracy according to the n groups of delay data;

[0010] A verification result is obtained according to the actual timestamp accuracy and the preset timestamp accuracy.

[0011] In a possible implementation manner: the method for obtaining any one set of delay data among n sets of delay data includes:

[0012] Adjusting the length of the transmission line to obtain a transmission delay, wherein the transmission delay is positively correlated with the length of the transmission line;

[0013] Obtain a forwarding delay, a sending timestamp, and a receiving timestamp, wherein the forwarding delay is related to the forwarding speed of the gateway device, the receiving timestamp is the time when the network packet is sent, and the receiving timestamp is the time when the network packet is received;

[0014] A relational expression is constructed based on the transmission delay, forwarding delay, sending timestamp and receiving timestamp:

[0015] Transmission delay + forwarding delay = (receiving timestamp - sending timestamp) * initial timestamp accuracy, where the initial timestamp accuracy is the timestamp accuracy of any set of delayed data among the n sets of delayed data.

[0016] By adopting the above technical solution, the length of the transmission line is changed to obtain multiple sets of delay data with different increments of transmission delay. Since there is no communication channel between the change of the transmission line length and the process of calculating the difference between the receiving timestamp and the sending timestamp, that is, the change of the transmission line length is not automatically modified or determined in the system for calculating the difference between the receiving timestamp and the sending timestamp, the two are independent processes, so the possibility of cheating is eliminated, and the reliability of the results of verifying the accuracy of the preset timestamp based on multiple sets of delay data can be guaranteed.

[0017] In a possible implementation manner: when the transmission delay is obtained by adjusting the length of the transmission line, an increment of the adjusted transmission delay is greater than the preset timestamp accuracy.

[0018] By adopting the above technical solution, when the increment of transmission delay is less than the timestamp precision, the increment of transmission delay may fall on the non-driver timestamp of the gateway device, so that the gateway device has no network packets to forward on the driver timestamp, and the network packets received in the non-driver timestamp cannot be forwarded, that is, the increment of transmission delay is annihilated by the forwarding delay. Therefore, setting the increment of the adjusted transmission delay to be greater than the preset timestamp precision has the benefit of avoiding the increment of transmission delay from being annihilated, thereby providing technical guarantee for improving the reliability of the timestamp precision used in network transmission.

[0019] In a possible implementation manner, the step of calculating the actual timestamp accuracy according to the n groups of delay data includes:

[0020] The initial timestamp accuracy of each group of delayed data is calculated by the relational expression;

[0021] Calculate the mean of the initial timestamp accuracy of n groups of delayed data;

[0022] The mean value is determined to be the actual timestamp precision.

[0023] In a possible implementation manner, the step of calculating the actual timestamp accuracy according to the n groups of delay data includes:

[0024] The initial timestamp accuracy of each group of delayed data is calculated by the relational expression;

[0025] The mode of the initial timestamp accuracies of the n groups of delayed data is determined to be the actual timestamp accuracy.

[0026] By adopting the above-mentioned technical scheme, the present application provides two methods for calculating the accuracy of the actual timestamp, and both calculation methods comprehensively consider the initial timestamps of multiple groups of delayed data. Therefore, no matter which calculation method is selected, the accuracy of the calculated actual timestamp can be guaranteed. Moreover, a variety of selectable calculation methods can also make the verification method of the present application adapt to a variety of application scenarios, thereby improving the practicality of the present application.

[0027] In a possible implementation manner, obtaining a verification result according to the actual timestamp accuracy and the preset timestamp accuracy includes:

[0028] Calculating the difference between the actual timestamp precision and the preset timestamp precision;

[0029] When the absolute value of the difference is less than or equal to the difference threshold, the verification result is obtained as verification passed;

[0030] When the absolute value of the difference is greater than the difference threshold, the verification result is that the verification fails.

[0031] By adopting the above technical solution, after obtaining the actual timestamp accuracy, it is still necessary to judge the difference between the actual timestamp accuracy and the preset timestamp accuracy. When the difference between the two is not greater than the difference threshold, it is considered that the preset timestamp accuracy verification has passed. That is, the smaller the difference between the actual timestamp accuracy and the preset timestamp accuracy, the higher the reliability of the verification result.

[0032] In a second aspect of the present application, a timestamp accuracy verification system for a network device is provided. The system is applied in a network architecture, wherein the network architecture includes a sending device, a gateway device, and a receiving device. The sending device is used to send a network packet and embed a sending timestamp in the network packet. The gateway device is used to receive and forward the network packet. The receiving device is used to receive the network packet. The gateway device is connected to the sending device and the receiving device respectively via a transmission line. The system includes a network tester for executing any of the above-mentioned timestamp accuracy verification methods for the network device.

[0033] By adopting the above technical solution, on the one hand, the present application designs a verification method based on the existing network architecture, without system cost. On the other hand, there is no communication channel in the process of changing the length of the transmission line and calculating the difference between the receiving timestamp and the sending timestamp, that is, the change of the transmission line length is not modified or determined by itself in the network tester, and the two are independent processes, so the possibility of cheating is excluded, and the reliability of the result of verifying the accuracy of the preset timestamp based on multiple sets of delay data can be guaranteed.

[0034] In a possible implementation manner: the receiving device and the network tester are the same network device.

[0035] By adopting the above technical solution, the receiving device and the network tester are the same network device, which reduces the verification cost, and the verification process is directly performed in the network tester, which reduces the number of data exchanges and reduces verification errors.

[0036] In a possible implementation manner: the transmission line is an optical fiber.

[0037] By adopting the above technical solution, optical fiber is used as the transmission line. On the one hand, it is because optical fiber can adapt to high-speed networks and improve the transmission efficiency of network packets between sending devices and receiving devices. In addition, the transmission delay of network packets in optical fiber is more stable than that of ordinary copper cables, which makes it easy to dynamically set the length of optical fiber according to the needs of transmission delay.

[0038] In a possible implementation, the network tester includes:

[0039] A data acquisition module, used to acquire n groups of delay data, n≥2, the parameter values ​​of the network channels corresponding to the n groups of delay data are different, the network channels are composed of transmission lines and gateway devices, and the parameter values ​​refer to the lengths of the transmission lines;

[0040] A data calculation module, used for calculating the actual timestamp accuracy according to the n groups of delayed data;

[0041] The data determination module is used to obtain a verification result according to the actual timestamp accuracy and the preset timestamp accuracy.

[0042] In summary, the present application includes the following beneficial technical effects:

[0043] First, the increment of the adjusted transmission delay is set to be greater than the preset timestamp accuracy to avoid the increment of the transmission delay falling on the non-driven timestamp of the gateway device, thereby improving the accuracy of the actual timestamp accuracy obtained. Secondly, there is no communication channel in the process of changing the length of the transmission line and calculating the difference between the receiving timestamp and the sending timestamp, that is, the change in the length of the transmission line is not modified or determined by itself in the network tester. The two are independent processes, so the possibility of cheating is eliminated, and the reliability of the verification result can be guaranteed. Therefore, the present application has the effect of doubly guaranteeing the reliability of the verification result, and can improve the reliability of the timestamp accuracy used in network transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a schematic diagram of an exemplary operating environment of an embodiment of the present application.

[0045] Figure 2 This is a flowchart of a method for verifying the timestamp accuracy of a network device of the present application.

[0046] Figure 3 This is an example diagram of a case where the increment of transmission delay is obliterated by forwarding delay in an embodiment of the method of the present application.

[0047] Figure 4 It is a block diagram of a timestamp accuracy verification system for a network device of the present application.

[0048] Explanation of the accompanying drawings: 1. sending device; 2. network channel; 21. transmission line; 22. gateway device; 3. receiving device; 4. network tester; 41. data acquisition module; 42. data calculation module; 43. data determination module. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution 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. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0050] Figure 1 A schematic diagram of an exemplary operating environment in which embodiments of the present application can be implemented is shown, the operating environment comprising a sending device 1, a receiving device 3 and a gateway device 22, and the sending device 1 exchanges information with the receiving device 3 through the gateway device 22.

[0051] The sending device 1 is driven by a high-frequency clock counter, for example, a frequency is selected from MHz-GHz or from GHz-THz as the driving frequency of the counter. The high-frequency clock generates a timestamp, and the sending device 1 is triggered at the timestamp, and a network packet is sent at the same time. The network packet can be the data requested by the receiver, or it can be the data randomly sent by the sending device 1 to the receiving device 3. In addition, the sending device 1 also embeds the binary value of the timestamp into the network packet at the timestamp, and then sends the network packet. In this example, the timestamp corresponding to the time when the network packet is sent is called the sending timestamp.

[0052] The gateway device 22 is arranged between the sending device 1 and the receiving device 3. The gateway device 22 is a switch, a router, etc. The gateway device 22 is connected to the sending device 1 and the receiving device 3 through the transmission line 21. The transmission line 21 is a cable such as an optical fiber, a copper cable, etc. that can transmit network packets. Since the optical fiber can adapt to high-speed networks and the transmission delay of the optical fiber is more stable than the transmission delay of the copper cable, and is less affected by external environmental factors, the optical fiber is used as the transmission line 21 as an example for explanation below. Since the network packet output by the sending device 1 reaches the gateway device 22 through the optical fiber, and is then forwarded to the receiving device 3 by the gateway device 22 through the optical fiber, the transmission channel composed of the gateway device 22 and the optical fiber is also called the network channel 2.

[0053] The receiving device 3 is also driven by the counter of the high-frequency clock, and the selected driving frequency is the same as the driving frequency of the counter of the sending device 1, so that the sending device 1 and the receiving device 3 can perform synchronous signal processing. Specifically, the high-frequency clock generates a timestamp, and the receiving device 3 is triggered on the timestamp. At the same time, the network packet is received when the network packet is triggered. The network packet is the data output by the sending device 1. In this example, the timestamp corresponding to the reception of the network packet is called the reception timestamp. At the receiving device 3 end, the receiving device 3 takes out the transmission timestamp in the network packet, calculates the difference between the reception timestamp and the transmission timestamp, and then multiplies the difference with the timestamp precision to obtain the delay of the network packet, that is, the delay of the network packet = (reception timestamp-transmission timestamp) * timestamp precision. The timestamp precision is related to the driving frequency of the counter of the receiving device 3. Because the driving frequency of the counter of the receiving device 3 is equal to the driving frequency of the counter of the sending device 1, it can also be considered that the timestamp precision is related to the driving frequency of the sending device 1. Specifically, the product of the driving frequency and the period is equal to 1 second. The period refers to the trigger period of the counter, that is, the period of the sending device 1 or the receiving device 3 generating the timestamp.

[0054] Since the receiving device 3 has the function of calculating the delay of the network packet, the receiving device 3 can be a network tester 4, and the relationship between the network tester 4, the sending device 1 and the receiving device 3 is represented by a dotted line. Of course, a network tester 4 can also be set up separately, and the network tester 4 is connected to the receiving device 3 so as to be able to read the receiving timestamp and the sending timestamp, and calculate the delay of the network packet based on the receiving timestamp and the sending timestamp. This application is to verify the accuracy of the timestamp precision involved in the calculated delay of the network packet.

[0055] It should be noted that, in the case where the receiving device 3 is a network tester 4, the sending device 1 and the receiving device 3 can also be the same network tester 4, that is, one network tester 4 plays two roles. For example, one port of the network tester 4 outputs a network packet, and the network packet enters the network tester 4 from another port after passing through the network channel 2 composed of the optical fiber and the gateway device 22.

[0056] The network tester 4 mentioned above refers to a network device having an FPGA chip, which calculates the difference between the receiving timestamp and the sending timestamp and stores the difference in a register, and the software system in the network tester 4 reads the difference and then calculates the product of the difference and the timestamp precision to obtain the network packet delay. In addition, the software system of the network tester 4 also has the function of verifying the timestamp precision.

[0057] It should also be noted that Figure 1 The operating environment shown is only illustrative and is not intended to limit the application or use of the embodiments of the present application. For example, the operating environment may include multiple sending devices 1, multiple receiving devices 3, and multiple gateway devices 22.

[0058] Figure 2 A flow chart of a method for verifying the accuracy of a timestamp of a network device according to an embodiment of the present application is shown, and the method is applied to a network tester 4. Specifically, the main flow of the method for verifying the accuracy of a timestamp of a network device is described as follows.

[0059] Step S1, obtaining n groups of delay data, n≥2, the parameter values ​​of the network channel 2 corresponding to the n groups of delay data are different, the network channel 2 is composed of an optical fiber and a gateway device 22, and the parameter value refers to the length of the optical fiber.

[0060] When a network packet passes through the network channel 2, affected by the length of the optical fiber and the forwarding speed of the gateway device 22, the delay in the transmission process may be different even if the network packet goes from the same sending device 1 to the same receiving device 3.

[0061] In order to verify the accuracy of the timestamp precision, it is necessary to collect n groups of delay data first, specifically: each time the length of the optical fiber is adjusted, a corresponding group of delay data is collected. In order to ensure the accuracy of the verification, the present application reduces the number of variables involved in the verification process, that is, the gateway device 22 used in the verification process is the same, that is, the forwarding speeds corresponding to the gateway devices 22 in the n groups of delay data are the same, then the timestamp accuracy can be verified by only changing the length of the optical fiber and changing the delay increment of the network packet caused by the optical fiber length.

[0062] Specifically, each set of delay data includes transmission delay, forwarding delay, sending timestamp, receiving timestamp and the relationship between the four. The transmission delay is positively correlated with the length of the optical fiber. Generally, for every 0.2 meter increase in the length of the optical fiber, the corresponding transmission delay increases by 1ns. Forwarding delay refers to the delay when the gateway device 22 forwards the network packet. The forwarding delay is generally in the order of milliseconds and is a property defined by the gateway device 22 before leaving the factory. The sending timestamp is the moment when the sending device 1 sends the network packet, and the receiving timestamp is the moment when the receiving device 3 receives the network packet. Specifically, the relationship between the transmission delay, forwarding delay, sending timestamp and receiving timestamp is: transmission delay + forwarding delay = (receiving timestamp - sending timestamp) * initial timestamp accuracy. The initial timestamp accuracy here refers to the timestamp accuracy of any set of delay data in the n sets of delay data.

[0063] In the above relationship, the transmission delay can be calculated by the length of the optical fiber, the forwarding delay can be obtained by reading the properties of the gateway device 22, and then the difference between the receiving timestamp and the sending timestamp is calculated by the receiving device 3. Finally, the network tester 4 constructs the above relationship under the condition that the initial timestamp remains unchanged, thereby obtaining one set of delay data. During the entire test process, similar to the double-blind test in medicine, the increase in the length of the optical fiber and the calculation of the difference between the receiving timestamp and the sending timestamp are not by the same group of people, and there is no communication channel (the length of the optical fiber is input by the tester into the network tester 4, and cannot be modified or determined by the network tester 4 itself), the possibility of cheating is eliminated, thereby ensuring the reliability of the verification result.

[0064] In this example, by increasing or decreasing the length of the optical fiber in sequence, the transmission delay also changes accordingly, thereby changing the size of the difference between the receiving timestamp and the sending timestamp, thereby obtaining multiple sets of delay data, and verifying the timestamp accuracy through multiple sets of delay data. It should be noted that when changing the length of the optical fiber, the optical fiber between the sending device 1 and the gateway device 22 can be changed, or the optical fiber between the gateway device 22 and the receiving device 3 can be changed, or the length of both optical fibers can be changed. The specific change method is not limited here. It should also be noted that, regardless of whether the length of the optical fiber is increased or decreased sequentially, the transmission delay caused by the change in the optical fiber length should be greater than the timestamp accuracy. This is because there is a possibility of clock asynchrony between the receiving device 3 and the gateway device 22. The receiving device 3 and the gateway device 22 are driven by clocks of different driving frequencies. The gateway device 22 is a store-and-forward type, that is, the gateway device 22 forwards a network packet only after receiving all the bytes. When the increment of the transmission delay is less than the timestamp accuracy, the increment of the transmission delay may fall into the non-driven timestamp of the gateway device 22, so that the gateway device 22 has no network packet to forward at the driven timestamp, and the network packet received in the non-driven timestamp cannot be forwarded, that is, the increment of the transmission delay is obliterated by the forwarding delay.

[0065] To illustrate the above annihilation situation, for example Figure 3 As shown, if the driving frequency of the gateway device 22 is 300MHz, then the forwarding delay caused by the asynchronous clock of the gateway device 22 may reach up to 3.3ns. At this time, it is considered that the clock period of the gateway device 22 is 3.3ns, that is, a driving timestamp is reached every 3.3ns, and the timestamp within 3.3ns is a non-driving timestamp. Assuming that the driving frequency of the receiving device 3 is 400MHz, then the time interval corresponding to each bit is 2.5ns, that is, the timestamp accuracy is 2.5ns. If in the first test, 0.5 meters of optical fiber is added, so that the increment of transmission delay is 2.5ns, the time when the gateway device 22 receives the first network packet is 0.2ns, which is slightly later than the first clock edge 0 (driving timestamp) of the gateway device 22, then the first network packet will be in a state of waiting to be forwarded until the time reaches the second clock edge 3.3ns. The network packet is forwarded. By analogy, since the transmission delay of the network packet is 2.5ns, the time when the second network packet arrives at the receiving device 3 is 2.7ns, but 2.7ns is still later than the first clock edge 0 and earlier than the second clock edge 3.3ns, so the second network packet is still forwarded after the clock edge 3.3ns. Therefore, at the driving timestamp of 3.3ns, the first network packet and the second network packet are forwarded at the same time, and it is difficult for the receiving device 3 to know the transmission delay of the two packets, that is, the transmission delay is obliterated.

[0066] To this end, it is necessary to amplify the timestamp accuracy of the receiving device 3 by changing the length of the optical fiber. For example, the initial timestamp accuracy of different groups of delayed data is amplified by 10 times, 20 times, 100 times, etc., or even any larger prime number. The corresponding network packet delay will increase by 25ns, 50ns, 250ns, etc. The larger the increment of the transmission delay, the greater the amplification factor of the corresponding initial timestamp accuracy, and the smaller the impact caused by the above-mentioned cross-clock domain.

[0067] Step S2: Calculate the actual timestamp accuracy according to the n groups of delay data.

[0068] In the above relationship, transmission delay + forwarding delay = (receiving timestamp - sending timestamp) * initial timestamp accuracy. Since the transmission delay is calculated by the length of the optical fiber, the forwarding delay is also obtained by reading the properties of the gateway device 22, and the difference between the receiving timestamp and the sending timestamp is calculated by the receiving device 3, the transmission delay, forwarding delay, and the difference between the receiving timestamp and the sending timestamp are all known numbers. Only the initial timestamp accuracy is an unknown number. The above relationship is used to obtain the initial timestamp accuracy of each set of delay data.

[0069] In a specific example, the process of calculating the actual timestamp accuracy is: after obtaining the initial timestamp accuracy of each group of delayed data in n groups of delayed data, calculate the average of the n initial timestamp accuracies, and use the average as the actual timestamp accuracy of the receiving device 3.

[0070] It should be noted that before calculating the actual timestamp accuracy, it is also necessary to eliminate the maximum and minimum values ​​of the initial timestamp accuracy in the n groups of delay data, or eliminate the initial timestamp accuracy that exceeds the threshold range, so as to ensure the accuracy of the calculated actual timestamp accuracy.

[0071] In another specific example, the process of calculating the actual timestamp precision is: after obtaining the initial timestamp precision of each group of delay data in n groups of delay data, the mode of the n initial timestamp precisions is used as the actual timestamp precision.

[0072] It should also be noted that, in actual testing, this application does not limit which of the above methods for calculating the actual timestamp accuracy is used.

[0073] Step S3: Obtain a verification result according to the actual timestamp accuracy and the preset timestamp accuracy.

[0074] First, calculate the difference between the actual timestamp precision and the preset timestamp precision. The preset timestamp precision is the timestamp precision to be verified. Then, determine the relationship between the absolute value of the difference and the difference threshold. When:

[0075] When the absolute value of the difference is ≤ the difference threshold, the verification result is passed;

[0076] When the absolute value of the difference is greater than the difference threshold, the verification result is verification failure.

[0077] The above difference threshold is a value set in advance. When the absolute value of the difference is ≤ the difference threshold, it can be considered that the actual timestamp accuracy is equal to the preset timestamp accuracy, indicating that the preset timestamp accuracy verification has passed.

[0078] It can be seen that the present application designs a verification method based on the existing network architecture, and achieves the purpose of verifying the timestamp accuracy of the receiving device 3 simply by changing the length of the optical fiber, and accurately controls the increment of the transmission delay through the length of the optical fiber to avoid errors caused by crossing clock domains. At the same time, due to the increase in the length of the optical fiber and the lack of a communication channel in the process of calculating the difference between the receiving timestamp and the sending timestamp, the present application has the effect of doubly ensuring the reliability of the verification results.

[0079] In summary, the implementation principle of the timestamp accuracy verification method of a network device in the embodiment of the present application is as follows: first, the length of the transmission line 21 is changed. Since the change in the length of the transmission line 21 brings about a change in the transmission delay, the difference between the corresponding receiving timestamp and the sending timestamp changes. Then, a relationship is constructed according to the corresponding transmission delay, forwarding delay, difference between the receiving timestamp and the sending timestamp, and initial timestamp accuracy during each adjustment, thereby obtaining multiple groups of delay data. In each group of relationship formulas, the difference between the transmission delay, forwarding delay, receiving timestamp and sending timestamp is a known number, and the initial timestamp accuracy corresponding to each group of delay data can be calculated using the above relationship formula. Finally, the actual timestamp accuracy is comprehensively calculated using the calculated multiple initial timestamp accuracies to ensure the accuracy of the actual timestamp accuracy obtained. Further, the size relationship between the actual timestamp accuracy and the preset timestamp accuracy is determined to obtain the final verification result. When the difference between the actual timestamp accuracy and the preset timestamp accuracy is not greater than the threshold difference, it means that the preset timestamp accuracy verification has passed, thereby improving the reliability of the timestamp accuracy used in network transmission.

[0080] Figure 4 A block diagram of a timestamp accuracy verification system for a network device according to an embodiment of the present application is shown. The system includes a data acquisition module 41, a data calculation module 42 and a data determination module 43.

[0081] The data acquisition module 41 is used to obtain n groups of delay data, n≥2, the parameter values ​​of the network channel 2 corresponding to the n groups of delay data are different, the network channel 2 is composed of a transmission line 21 and a gateway device 22, and the parameter value refers to the length of the transmission line 21.

[0082] The data calculation module 42 is used to calculate the actual timestamp accuracy according to the n groups of delayed data.

[0083] The data determination module 43 is used to obtain a verification result according to the actual timestamp accuracy and the preset timestamp accuracy.

[0084] The modules involved in the embodiments described in the present application may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a data acquisition module 41, a data calculation module 42 and a data determination module 43. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the data acquisition module 41 may also be described as a "module for acquiring n groups of delay data".

[0085] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0086] In order to better execute the program of the above method, the present application also provides a timestamp accuracy verification device for a network device, which includes a memory and a processor.

[0087] The memory may be used to store instructions, programs, codes, code sets or instruction sets. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function, and instructions for implementing the timestamp accuracy verification method of the above-mentioned network device, etc.; the data storage area may store data involved in the timestamp accuracy verification method of the above-mentioned network device, etc.

[0088] The processor may include one or more processing cores. The processor calls the data stored in the memory by running or executing the instructions, programs, code sets or instruction sets stored in the memory, performs various functions of the present application and processes data. The processor may be at least one of a special purpose integrated circuit, a digital signal processor, a digital signal processing device, a programmable logic device, a field programmable gate array, a central processing unit, a controller, a microcontroller and a microprocessor. It is understandable that for different devices, the electronic device used to implement the above-mentioned processor function can also be other, and the embodiments of the present application are not specifically limited.

[0089] The present application also provides a computer-readable storage medium, for example, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes. The computer-readable storage medium stores a computer program that can be loaded by a processor and execute the timestamp accuracy verification method of the above network device.

[0090] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present application (but not limited to) by each other to form a technical solution.

Claims

1. A method for verifying the timestamp accuracy of a network device, characterized in that: include: Obtaining n groups of delay data, where n≥2, the parameter values ​​of the network channel (2) corresponding to the n groups of delay data are different, the network channel (2) is composed of a transmission line (21) and a gateway device (22), and the parameter value refers to the length of the transmission line (21); Calculate the actual timestamp accuracy according to the n groups of delay data; Obtaining a verification result according to the actual timestamp accuracy and the preset timestamp accuracy; in, The method for obtaining any one set of delay data among n sets of delay data comprises: Adjusting the length of the transmission line (21) to obtain a transmission delay, wherein the transmission delay is positively correlated with the length of the transmission line (21); Obtaining a forwarding delay, a sending timestamp and a receiving timestamp, wherein the forwarding delay is related to the forwarding speed of the gateway device (22), the sending timestamp is the time when the network packet is sent, and the receiving timestamp is the time when the network packet is received; A relational expression is constructed based on the transmission delay, forwarding delay, sending timestamp and receiving timestamp: Transmission delay+forwarding delay=(receiving timestamp−sending timestamp)*initial timestamp accuracy, where the initial timestamp accuracy is the timestamp accuracy of any set of delayed data among the n sets of delayed data.

2. The method for verifying the timestamp accuracy of a network device according to claim 1, characterized in that: When the transmission delay is obtained by adjusting the length of the transmission line (21), the increment of the adjusted transmission delay is greater than the preset timestamp accuracy.

3. The method for verifying the timestamp accuracy of a network device according to claim 1, characterized in that: The actual timestamp accuracy is calculated according to the n groups of delay data, including: The initial timestamp accuracy of each group of delayed data is calculated by the relational expression; Calculate the mean of the initial timestamp accuracy of n groups of delayed data; The mean value is determined to be the actual timestamp precision.

4. The method for verifying the timestamp accuracy of a network device according to claim 1, characterized in that: The actual timestamp accuracy is calculated according to the n groups of delay data, including: The initial timestamp accuracy of each group of delayed data is calculated by the relational expression; The mode of the initial timestamp accuracies of the n groups of delayed data is determined to be the actual timestamp accuracy.

5. The method for verifying the timestamp accuracy of a network device according to claim 1, characterized in that: The obtaining of a verification result according to the actual timestamp accuracy and the preset timestamp accuracy includes: Calculating the difference between the actual timestamp precision and the preset timestamp precision; When the absolute value of the difference is less than or equal to the difference threshold, the verification result is obtained as verification passed; When the absolute value of the difference is greater than the difference threshold, the verification result is that the verification fails.

6. A timestamp accuracy verification system for network devices, applied in a network architecture, the network architecture comprising a sending device (1), a gateway device (22) and a receiving device (3), the sending device (1) being used to send a network packet and embed a sending timestamp in the network packet, the gateway device (22) being used to receive and forward the network packet, the receiving device (3) being used to receive the network packet, the gateway device (22) being connected to the sending device (1) and the receiving device (3) respectively via a transmission line (21), characterized in that: include: A network tester (4) for executing the method according to any one of claims 1 to 5.

7. The timestamp accuracy verification system for network devices according to claim 6, characterized in that: The receiving device (3) and the network tester (4) are the same network device.

8. The timestamp accuracy verification system for network devices according to claim 6, characterized in that: The transmission line is an optical fiber.

9. The timestamp accuracy verification system for network devices according to claim 6, characterized in that: The network tester (4) comprises: A data acquisition module (41) is used to acquire n groups of delay data, where n≥2, and the parameter values ​​of the network channel (2) corresponding to the n groups of delay data are different, the network channel (2) is composed of a transmission line (21) and a gateway device (22), and the parameter value refers to the length of the transmission line (21); A data calculation module (42), used for calculating actual timestamp accuracy according to the n groups of delayed data; A data determination module (43) is used to obtain a verification result according to the actual timestamp accuracy and the preset timestamp accuracy.

Citation Information

Patent Citations

  • Optimization method for time synchronization of PTP in asymmetric network

    CN111342926A