Link delay measurement method and device based on TWAMP protocol
By obtaining the delay of the test packets and actual data between the transmitter and reflective ends in the TWAMP protocol and calculating the time delay value, the problem of inaccurate measurement results of the existing TWAMP protocol is solved, and high-precision link delay measurement in 5G network is realized.
Patent Information
- Application Number
- CN202110670611.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-17
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-06-17
AI Technical Summary
The existing TWAMP protocol has problems such as inaccurate results and low test accuracy when measuring links, which cannot meet the high requirements of 5G networks.
By obtaining the link test delay of the test packet between the transmitter and reflector and the actual link delay of the actual data, the time delay value is calculated, and the network delay is accurately measured.
This method can accurately measure link delay in 5G networks, provide higher testing accuracy, and support fast fault positioning and differentiated service traffic scheduling.
Smart Images

Figure CN115580558B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data networks, and in particular to a link delay measurement method and device based on a TWAMP protocol. Background Art
[0002] At present, IP networks integrate communication services such as data services, voice services, and video services, and have high requirements for network service quality. The large traffic and operation and maintenance complexity brought about by the rapid development of 5G technology make timely detection, analysis, and positioning of IP network communication performance particularly important, and it is also a key focus of operators.
[0003] Currently, the Two-Way Active Measurement Protocol (TWAMP) has become a flexible method for measuring the round-trip IP performance between any two devices in the network. In the TWAMP statistical method, network element devices do not need to generate and maintain statistical data. The performance management system only needs to manage the performance statistics initiating node in the network (i.e., the TWAMP client) to obtain the performance statistics of the entire network, thereby realizing the rapid and flexible deployment of performance statistics of IP networks. The existing traditional TWAMP protocol uses measurement messages for link testing, which results in inaccurate measurement results and low test accuracy, and cannot meet the high requirements of 5G network technology.
[0004] Therefore, how to provide a link delay measurement solution that can obtain and analyze the end-to-end service quality of the transmission bearer network when 5G networks are deployed on a large scale, grasp the network operation status, track the quality of network links in real time, and provide data support for rapid fault location and differentiated service traffic scheduling is a technical problem that needs to be urgently solved by technical personnel in this field. Summary of the invention
[0005] The present invention provides a link delay measurement method and device based on the TWAMP protocol, which can obtain and analyze the end-to-end service quality of the transmission bearer network when the 5G network is deployed on a large scale, grasp the network operation status, and track the quality of the network link in real time, so as to provide data support for rapid fault location and differentiated service traffic scheduling.
[0006] In a first aspect, the present invention provides a link delay measurement method based on the TWAMP protocol, comprising:
[0007] Obtain the link test delay of the test message between the transmitter and the reflector;
[0008] Acquire an actual link delay for sending actual data between a transmitting end and a reflecting end, wherein a data type of the actual data is the same as a data type of the test message;
[0009] The delay error value of the same data type is determined based on the link test delay and the actual link delay.
[0010] In one embodiment, obtaining a link test delay of a test message between a transmitting end and a reflecting end includes:
[0011] The transmitting end sends a first test message; wherein the first test message includes a first timestamp;
[0012] The reflector receives the first test message and returns a second test message to the transmitter;
[0013] The transmitting end receives the second test message and records the receiving time;
[0014] A link test delay is determined based on the first timestamp and the receiving time.
[0015] In one embodiment, obtaining the actual link delay for sending actual data between the transmitting end and the reflecting end includes:
[0016] The transmitting end receives the actual data and fragments the message of the actual data to obtain n message fragments;
[0017] Sending the n message fragments to the reflector in sequence, and obtaining the sending time and receiving time of the n message fragments;
[0018] The actual link delay is determined based on the sending time and receiving time of the n message fragments.
[0019] In one embodiment, determining the actual link delay based on the sending time and receiving time of the n message fragments includes:
[0020] Determine n fragment delays based on the sending time and receiving time of the n message fragments by using a fragment delay formula;
[0021] Determine the actual link delay by using a harmonic average formula based on the n slice delays;
[0022] The fragmentation delay is half of the difference between the reception time and the transmission time of the message fragment;
[0023] The harmonic mean formula is:
[0024]
[0025] Where H is the harmonic mean, n is the number of message fragments; x i is the fragmentation delay of the message, i takes a value from 1 to n; the harmonic mean H is equal to the arithmetic mean of the reciprocals of multiple message fragmentation delay data.
[0026] In one embodiment, determining the delay error value of the same data type based on the link test delay and the link actual delay includes:
[0027] Subtract the actual link delay from the link test delay to obtain an absolute error value;
[0028] Difference between the absolute value of the absolute error value and the actual link delay obtains a relative error value;
[0029] The relative error value and the corresponding data type are stored in a delay table.
[0030] In one embodiment, after determining the delay error value of the same data type based on the link test delay and the link actual delay, the method further includes:
[0031] When data is transmitted, the relative error value corresponding to the current data is searched in the delay table based on the data type;
[0032] An actual delay approximation value is determined based on the relative error value and the current TWAMP delay data.
[0033] In a second aspect, the present invention provides a link delay measurement device based on the TWAMP protocol, comprising:
[0034] A first delay acquisition module, used to acquire the link test delay of the test message between the transmitting end and the reflecting end;
[0035] A second delay acquisition module is used to acquire an actual link delay of sending actual data between a transmitting end and a reflecting end, wherein a data type of the actual data is the same as a data type of the test message;
[0036] An error determination module is used to determine the delay error value of the same data type based on the link test delay and the actual link delay.
[0037] In one embodiment, the first delay acquisition module includes:
[0038] A first transmitting unit, configured to send a first test message from a transmitting end; wherein the first test message includes a first timestamp;
[0039] A second transmitting unit, configured to receive the first test message at the reflector end and return the second test message to the transmitting end;
[0040] A message receiving unit, used for the transmitting end to receive the second test message and record the receiving time;
[0041] A delay determination unit is used to determine a link test delay based on the first timestamp and the receiving time.
[0042] In one embodiment, the second delay acquisition module includes:
[0043] A data fragmentation unit, configured to receive actual data at a transmitting end and fragment a message of the actual data to obtain n message fragments;
[0044] A fragment sending unit, used to send the n message fragments to the reflector end in sequence, and obtain the sending time and receiving time of the n message fragments;
[0045] The actual delay determination unit is used to determine the actual link delay based on the sending time and receiving time of the n message fragments.
[0046] In one embodiment, the actual delay determination unit includes:
[0047] A fragment delay determination unit, configured to determine n fragment delays by a fragment delay formula based on the sending time and receiving time of the n message fragments;
[0048] A harmonic averaging unit, configured to determine an actual link delay by a harmonic averaging formula based on the n slice delays;
[0049] The fragmentation delay is half of the difference between the reception time and the transmission time of the message fragment;
[0050] The harmonic mean formula is:
[0051]
[0052] Where H is the harmonic mean, n is the number of message fragments; x i is the fragmentation delay of the message, i takes a value from 1 to n; the harmonic mean H is equal to the arithmetic mean of the reciprocals of multiple message fragmentation delay data.
[0053] In one embodiment, the error determination module includes:
[0054] An absolute error determination unit, configured to obtain an absolute error value by subtracting the actual link delay from the link test delay;
[0055] A relative error determination unit, configured to obtain a relative error value by dividing the absolute value of the absolute error value by the actual link delay;
[0056] The corresponding storage unit is used to store the relative error value and the corresponding data type in the delay table.
[0057] In one embodiment, it further includes:
[0058] An error search module is used to search for a relative error value corresponding to the current data in the delay table based on the data type when data is transmitted;
[0059] The delay determination module is used to determine a value close to the actual delay based on the relative error value and the current TWAMP delay data.
[0060] In a third aspect, the present invention provides an electronic device, comprising a memory and a memory storing a computer program, wherein when the processor executes the program, the steps of the link delay measurement method based on the TWAMP protocol described in the first aspect are implemented.
[0061] In a fourth aspect, the present invention provides a processor-readable storage medium, wherein the processor-readable storage medium stores a computer program, and the computer program is used to enable the processor to execute the steps of the link delay measurement method based on the TWAMP protocol described in the first aspect.
[0062] The present invention provides a link delay measurement method and device based on the TWAMP protocol, which measures the link delay of a test message between a transmitter and a reflector, obtains the actual link delay of sending actual data between the transmitter and the reflector, and thus obtains a delay error value, which can guide and analyze subsequent network delays, obtain and analyze the end-to-end service quality of the transmission bearer network, grasp the network operation status, track the quality of the network link in real time, and provide data support for rapid fault location and differentiated service flow scheduling. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0064] Figure 1 A schematic diagram of a flow chart of a link delay measurement method based on the TWAMP protocol provided in an embodiment of the present invention;
[0065] Figure 2 One of the device interaction diagrams of a link delay measurement method based on the TWAMP protocol provided in an embodiment of the present invention;
[0066] Figure 3 A second schematic diagram of device interaction of a link delay measurement method based on the TWAMP protocol provided in an embodiment of the present invention;
[0067] Figure 4One of the device interaction flow charts of a link delay measurement method based on the TWAMP protocol provided in an embodiment of the present invention;
[0068] Figure 5 A second device interaction flow chart of a link delay measurement method based on the TWAMP protocol provided in an embodiment of the present invention;
[0069] Figure 6 A delay recording diagram of a link delay measurement method based on the TWAMP protocol provided in an embodiment of the present invention;
[0070] Figure 7 A schematic diagram of an IP message carrying timestamp in a link delay measurement method based on the TWAMP protocol provided in an embodiment of the present invention;
[0071] Figure 8 A schematic diagram of an MPLS message carrying timestamp in a link delay measurement method based on the TWAMP protocol provided in an embodiment of the present invention;
[0072] Fig. 9 A schematic diagram of the structure of a link delay measurement device based on the TWAMP protocol provided in an embodiment of the present invention;
[0073] Fig.10 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0074] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0075] Combine the following Figure 1-Figure 8 The present invention describes a link delay measurement method based on the TWAMP protocol.
[0076] Figure 1 A schematic diagram of a flow chart of a link delay measurement method based on the TWAMP protocol provided in an embodiment of the present invention; Figure 2 One of the device interaction diagrams of a link delay measurement method based on the TWAMP protocol provided in an embodiment of the present invention; Figure 3 A second schematic diagram of device interaction of a link delay measurement method based on the TWAMP protocol provided in an embodiment of the present invention; Figure 4 One of the device interaction flow charts of a link delay measurement method based on the TWAMP protocol provided in an embodiment of the present invention; Figure 5 The present invention provides a second device interaction flow chart of a link delay measurement method based on the TWAMP protocol in an embodiment of the present invention.
[0077] In a specific implementation of the present invention, an embodiment of the present invention provides a link delay measurement method based on the TWAMP protocol, the method comprising:
[0078] Step 110: Obtain the link test delay of the test message between the transmitting end and the reflecting end.
[0079] Specifically, Figure 2 As shown, the transmitting end sends a first test message; wherein the first test message includes a first timestamp; the reflecting end receives the first test message and returns a second test message to the transmitting end; the transmitting end receives the second test message and records the receiving time; and the link test delay is determined based on the first timestamp and the receiving time.
[0080] First, the client is responsible for establishing, starting and stopping the TWAMP session, and establishing a connection with the server through the UDP protocol. The transmitter receives the client command and sends a test message to the reflector after the control session is established. The reflector receives the server command and responds to the test message sent by the transmitter. The server responds to the TWAMP control session initiated by the client. The control message is sent by the client and responded by the server. It is based on the TCP connection and includes 9 messages: Server Greeting, Set-Up-Response, ServerStar, Request TW-Session, Accept Session, Start Session, Start ACK, Stop Session, Stop ACK. The test message is sent by the sender and responded by the reflector. It is based on the UDP connection and includes 2 messages: Sender-test and Reflector test.
[0081] Of course, you can also use Figure 3 In the device shown, the transmitter is responsible for establishing, starting and stopping the TWAMP session, establishing a connection with the reflector through the UDP protocol, and sending a test message to the reflector after the control session is established. The reflector responds to the test message sent by the transmitter in response to the TWAMP control session initiated by the transmitter.
[0082] Step 120: Acquire an actual link delay for sending actual data between the transmitting end and the reflecting end, wherein a data type of the actual data is the same as a data type of the test message;
[0083] Specifically, in order to obtain the actual link delay of sending actual data between the transmitting end and the reflecting end, the transmitting end can receive the actual data and fragment the message of the actual data to obtain n message fragments; send the n message fragments to the reflecting end in sequence, and obtain the sending time and receiving time of the n message fragments; determine the actual link delay based on the sending time and receiving time of the n message fragments.
[0084] More specifically, in order to determine the actual link delay based on the sending time and receiving time of the n message fragments, the following steps may be performed:
[0085] Determine n fragment delays based on the sending time and receiving time of the n message fragments by using a fragment delay formula;
[0086] Determine the actual link delay by using a harmonic average formula based on the n slice delays;
[0087] The fragmentation delay is half of the difference between the reception time and the transmission time of the message fragment;
[0088] The harmonic mean formula is:
[0089]
[0090] Where H is the harmonic mean, n is the number of message fragments; x i is the fragmentation delay of the message, i takes a value from 1 to n; the harmonic mean H is equal to the arithmetic mean of the reciprocals of multiple message fragmentation delay data.
[0091] Step 130: Determine the delay error value of the same data type based on the link test delay and the actual link delay.
[0092] Specifically, the link test delay minus the actual link delay can be used to obtain an absolute error value; the absolute value of the absolute error value is divided by the actual link delay to obtain a relative error value; and the relative error value and the corresponding data type are stored in a delay table.
[0093] On the basis of the above embodiments, in this embodiment, after determining the delay error value of the same data type based on the link test delay and the actual link delay, it is also possible to search the delay table for a relative error value corresponding to the current data based on the data type when performing data transmission; and determine a similar value of the actual delay based on the relative error value and the current TWAMP delay data.
[0094] Please refer to Figure 6 , Figure 7 , Figure 8 , Figure 6A delay recording diagram of a link delay measurement method based on the TWAMP protocol provided in an embodiment of the present invention; Figure 7 A schematic diagram of an IP message carrying timestamp in a link delay measurement method based on the TWAMP protocol provided in an embodiment of the present invention; Figure 8 A schematic diagram of an MPLS message carrying timestamp in a link delay measurement method based on the TWAMP protocol provided in an embodiment of the present invention.
[0095] Please refer to Figure 4 In a specific embodiment of the present invention, the specific application is as follows Figure 2 The first device, the second device, the third device, and the fourth device shown have the following interactions:
[0096] Step 1, such as Figure 4 As shown, the first device sends a control message to request to start a TWAMP session, and the second device sends a control message in response.
[0097] Step 2: The second device sends a first test message, which carries a first timestamp, that is, the sending time.
[0098] Step 3: After receiving the first test message, the third device returns a second test message.
[0099] Step 4: After receiving the second test message, the second device records the receiving time and calculates the link test delay using the formula test delay = (receiving time - first timestamp) / 2.
[0100] Step 5: The second device obtains the message to be sent and matches its message type with the message type in the TWAMP delay table. If the match is successful, repeat steps 2, 3, and 4 to obtain a new link test delay, use the relative error value, link test delay, and relative error value calculation formula to derive the latest estimated value of the actual message link delay, and update the TWAMP link delay table, such as Figure 6 shown.
[0101] Step 6: The second device fragments the message, adds a sending timestamp to the message, and sends the first fragment. The sending timestamp information is added to the Options field in the IP message, such as Figure 7 As shown, the MPLS packet header adds a packet header, and the Label field of the new packet header is used to record the sending timestamp information, such as Figure 8 shown.
[0102] Step 7: The third device returns a response message after receiving the first fragment of the message.
[0103] Step 8: After receiving the response message of the first fragment of the message, the second device records the receiving time, and calculates the actual delay of the first fragment of the message by the sending timestamp carried in the message header, and the formula is actual delay = (receiving time-sending timestamp) / 2.
[0104] Step 9: The second type of device sends the next fragment of the message carrying the sending timestamp.
[0105] Step 10: The third device receives the next fragment of the message and returns a response message.
[0106] Step 11, after receiving the response message of the next fragment of the message, the second device records the receiving time, and calculates the actual link delay of the next fragment of the message according to the sending timestamp carried in the message.
[0107] Step 12: Repeat steps 8, 9, and 10 until all fragments of the message are sent. Calculate the actual delay of the message link. The calculation formula is:
[0108]
[0109] Where H is the harmonic mean, x is the packet fragmentation delay, and the harmonic mean is equal to the arithmetic mean of the reciprocals of multiple packet fragmentation delay data.
[0110] Step 13, calculate the relative error value between the TWAMP link test delay and the actual link delay of the message, the calculation formula is: relative error value = (|actual delay - test delay|) / actual delay, record the message type name, the arithmetic mean of the actual link delay and the relative error value in the TWAMP delay table, such as Figure 6 shown.
[0111] Step 14: Repeat steps 5 to 13 until the message sending queue of the second device is empty.
[0112] Of course, in another specific embodiment of the present invention, it is also possible to use Figure 3 The first device and the second device shown in the figure complete the method of the embodiment of the present invention. The specific steps are as follows:
[0113] Step 15, another embodiment of the present invention is Figure 5 As shown, the first device sends a control message to request to start a TWAMP session, and the second device sends a control message in response.
[0114] Step 15: The first device sends a first test message, which carries a first test time.
[0115] Step 16: After receiving the first test message, the second device returns a second test message.
[0116] Step 17, after receiving the second test message, the first device records the receiving time and calculates the link delay by the formula test delay = (receiving time - first test time) / 2.
[0117] Step 18, the first device obtains the message to be sent, matches its message type with the message type in the TWAMP delay table, and if the match is successful, repeats steps 15, 16, and 17 to obtain a new link test delay, uses the relative error value, link test delay, and relative error value calculation formula to derive the latest estimated value of the actual message link delay, and updates the TWAMP link delay table, such as Figure 6 shown.
[0118] Step 19: fragment such messages, add a sending timestamp to the message header, and send the first fragment. For IP messages, add a sending timestamp to the Options field, such as Figure 7 As shown, the MPLS packet header adds a packet header, and the Label field of the new packet header is used to record the sending timestamp information, such as Figure 8 shown.
[0119] Step 20: After receiving the first fragment of the message, the second device returns a response message.
[0120] Step 21, after receiving the response message of the first fragment of the message, the first device records the receiving time, and calculates the actual delay of the first fragment of the message according to the sending timestamp in the message header, and the formula is actual delay = receiving time - sending timestamp.
[0121] Step 22: The first type of device sends the next fragment of the message carrying the sending timestamp.
[0122] Step 23: The second device returns a response message after receiving the next fragment of the message.
[0123] Step 24: After receiving the response message after the next fragment of the message, the first device records the receiving time and calculates the actual link delay of the next fragment of the message.
[0124] Step 25: Repeat steps 21, 22, and 23 until all fragments of the message are sent. Calculate the actual delay of the message link. The calculation formula is:
[0125]
[0126] Where H is the harmonic mean, x is the packet fragmentation delay, and the harmonic mean is equal to the arithmetic mean of the reciprocals of multiple packet fragmentation delay data.
[0127] Step 26, calculate the relative error value between the TWAMP link test delay and the actual link delay of the message, the calculation formula is: relative error value = (|actual delay - test delay|) / actual delay, record the message type name, the arithmetic mean of the actual link delay and the relative error value in the TWAMP delay table, such as Figure 6 shown.
[0128] Step 27, repeat steps 18 to 26 until the message sending queue of the first device is empty.
[0129] The present invention provides a link delay measurement method based on the TWAMP protocol, which measures the link delay of the test message between the transmitter and the reflector; obtains the actual link delay of sending actual data between the transmitter and the reflector, matches the TWAMP delay table, and updates the TWAMP table through calculation if the match is successful; the Option field of the IP message header is used to record the sending timestamp; the MPLS message header adds a message header to record the sending timestamp; and calculates the relative error value based on the test delay value and the actual delay value. It can guide and analyze the subsequent network delay, obtain and analyze the end-to-end service quality of the transmission bearer network, grasp the network operation status, track the quality of the network link in real time, and provide data support for rapid fault location and differentiated service flow scheduling.
[0130] The link delay measurement device based on the TWAMP protocol provided by the present invention is described below. The link delay measurement device based on the TWAMP protocol described below and the link delay measurement method based on the TWAMP protocol described above can refer to each other.
[0131] Please refer to Fig. 9 , Fig. 9 A schematic diagram of the composition structure of a link delay measurement device based on the TWAMP protocol provided in an embodiment of the present invention.
[0132] In another specific implementation manner of the present invention, an embodiment of the present invention provides a link delay measurement device 900 based on the TWAMP protocol, including:
[0133] A first delay acquisition module 910, used to acquire a link test delay of a test message between a transmitting end and a reflecting end;
[0134] A second delay acquisition module 920, configured to acquire an actual link delay for sending actual data between a transmitting end and a reflecting end, wherein a data type of the actual data is the same as a data type of the test message;
[0135] The error determination module 930 is used to determine the delay error value of the same data type based on the link test delay and the actual link delay.
[0136] In one embodiment, the first delay acquisition module includes:
[0137] A first transmitting unit, configured to send a first test message from a transmitting end; wherein the first test message includes a first timestamp;
[0138] A second transmitting unit, configured to receive the first test message at the reflector end and return the second test message to the transmitting end;
[0139] A message receiving unit, used for the transmitting end to receive the second test message and record the receiving time;
[0140] A delay determination unit is used to determine a link test delay based on the first timestamp and the receiving time.
[0141] In one embodiment, the second delay acquisition module includes:
[0142] A data fragmentation unit, configured to receive actual data at a transmitting end and fragment a message of the actual data to obtain n message fragments;
[0143] A fragment sending unit, used to send the n message fragments to the reflector end in sequence, and obtain the sending time and receiving time of the n message fragments;
[0144] The actual delay determination unit is used to determine the actual link delay based on the sending time and receiving time of the n message fragments.
[0145] In one embodiment, the actual delay determination unit includes:
[0146] A fragment delay determination unit, configured to determine n fragment delays by a fragment delay formula based on the sending time and receiving time of the n message fragments;
[0147] A harmonic averaging unit, configured to determine an actual link delay by a harmonic averaging formula based on the n slice delays;
[0148] The fragmentation delay is half of the difference between the reception time and the transmission time of the message fragment;
[0149] The harmonic mean formula is:
[0150]
[0151] Where H is the harmonic mean, n is the number of message fragments; x i is the fragmentation delay of the message, i takes a value from 1 to n; the harmonic mean H is equal to the arithmetic mean of the reciprocals of multiple message fragmentation delay data.
[0152] In one embodiment, the error determination module includes:
[0153] An absolute error determination unit, configured to obtain an absolute error value by subtracting the actual link delay from the link test delay;
[0154] A relative error determination unit, configured to obtain a relative error value by dividing the absolute value of the absolute error value by the actual link delay;
[0155] The corresponding storage unit is used to store the relative error value and the corresponding data type in the delay table.
[0156] In one embodiment, it further includes:
[0157] An error search module is used to search for a relative error value corresponding to the current data in the delay table based on the data type when data is transmitted;
[0158] The delay determination module is used to determine a value close to the actual delay based on the relative error value and the current TWAMP delay data.
[0159] The embodiment of the present invention provides a link delay measurement device based on the TWAMP protocol, which measures the link delay of the test message between the transmitter and the reflector; obtains the actual link delay of sending actual data between the transmitter and the reflector, matches the TWAMP delay table, and updates the TWAMP table through calculation if the match is successful; the Option field of the IP message header is used to record the sending timestamp; the MPLS message header adds a message header to record the sending timestamp; and calculates the relative error value based on the test delay value and the actual delay value. It can guide and analyze the subsequent network delay, obtain and analyze the end-to-end service quality of the transmission bearer network, grasp the network operation status, track the quality of the network link in real time, and provide data support for rapid fault location and differentiated service traffic scheduling.
[0160] Fig.10 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.10As shown, the electronic device may include: a processor 1010, a communication interface 1020, a memory 1030 and a communication bus 1040, wherein the processor 1010, the communication interface 1020 and the memory 1030 complete mutual communication through the communication bus 1040. The processor 1010 may call the computer program in the memory 1030 to execute the steps of the link delay measurement method based on the TWAMP protocol, for example, including: obtaining the link test delay of the test message between the transmitter and the reflector; obtaining the actual link delay of sending actual data between the transmitter and the reflector, wherein the data type of the actual data is the same as the data type of the test message; and determining the delay error value of the same data type based on the link test delay and the actual link delay.
[0161] In addition, the logic instructions in the above-mentioned memory 1030 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes 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: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0162] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the steps of the link delay measurement method based on the TWAMP protocol provided by the above methods, for example, including: obtaining the link test delay of the test message between the transmitter and the reflector; obtaining the actual link delay of sending actual data between the transmitter and the reflector, wherein the data type of the actual data is the same data type as the data type of the test message; determining the delay error value of the same data type based on the link test delay and the actual link delay.
[0163] On the other hand, an embodiment of the present application also provides a processor-readable storage medium, which stores a computer program, and the computer program is used to enable the processor to execute the steps of the link delay measurement method based on the TWAMP protocol provided in the above embodiments, for example, including: obtaining the link test delay of the test message between the transmitter and the reflector; obtaining the actual link delay of sending actual data between the transmitter and the reflector, wherein the data type of the actual data is the same data type as the data type of the test message; determining the delay error value of the same data type based on the link test delay and the actual link delay.
[0164] The processor-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (nAnDFLASH), solid-state drive (SSD)), etc.
[0165] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0166] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0167] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A link delay measurement method based on the TWAMP protocol, characterized in that: include: Obtain the link test delay of the test message between the transmitter and the reflector; Acquire an actual link delay for sending actual data between a transmitting end and a reflecting end, wherein a data type of the actual data is the same as a data type of the test message; Determine the delay error value of the same data type based on the link test delay and the actual link delay; The obtaining of the actual link delay for sending actual data between the transmitting end and the reflecting end includes: The transmitting end receives the actual data and fragments the message of the actual data to obtain n message fragments; Send the n message fragments to the reflector in sequence, and obtain the sending time and receiving time of the n message fragments; the receiving time is the time when the transmitting end receives the response message of the message fragment; Determine the actual link delay based on the sending time and receiving time of the n message fragments; The determining of the actual link delay based on the sending time and receiving time of the n message fragments includes: Determine n fragment delays based on the sending time and receiving time of the n message fragments by using a fragment delay formula; Determine the actual link delay by using a harmonic average formula based on the n slice delays; The fragmentation delay is half of the difference between the reception time and the transmission time of the message fragment; The harmonic mean formula is: ; Where H is the harmonic mean, n is the number of message fragments; x i is the i-th fragment delay of the message, i ranges from 1 to n; the harmonic mean H is equal to the arithmetic mean of the reciprocals of multiple message fragment delay data; Wherein, determining the delay error value of the same data type based on the link test delay and the actual link delay includes: Subtract the actual link delay from the link test delay to obtain an absolute error value; The absolute value of the absolute error value is divided by the actual link delay to obtain a relative error value; Storing the relative error value and the corresponding data type in a delay table; Wherein, after determining the delay error value of the same data type based on the link test delay and the actual link delay, the method further includes: When data is transmitted, the relative error value corresponding to the current data is searched in the delay table based on the data type; The actual delay approximation value is determined based on the relative error value and the current TWAMP delay data.
2. The link delay measurement method based on the TWAMP protocol according to claim 1, characterized in that: The step of obtaining a link test delay of a test message between a transmitting end and a reflecting end includes: The transmitting end sends a first test message; wherein the first test message includes a first timestamp; The reflector receives the first test message and returns a second test message to the transmitter; The transmitting end receives the second test message and records the receiving time; A link test delay is determined based on the first timestamp and the receiving time.
3. A link delay measurement device based on the TWAMP protocol, characterized in that: include: A first delay acquisition module, used to acquire the link test delay of the test message between the transmitting end and the reflecting end; A second delay acquisition module is used to acquire an actual link delay of sending actual data between a transmitting end and a reflecting end, wherein a data type of the actual data is the same as a data type of the test message; An error determination module, configured to determine a delay error value of the same data type based on the link test delay and the link actual delay; Wherein, the second delay acquisition module includes: A data fragmentation unit, configured to receive actual data at a transmitting end and fragment a message of the actual data to obtain n message fragments; A fragment sending unit, used to send the n message fragments to the reflector in sequence, and obtain the sending time and receiving time of the n message fragments; the receiving time is the time when the transmitting end receives the message fragment; An actual delay determination unit, configured to determine an actual link delay based on the sending time and receiving time of the n message fragments; Wherein, the actual delay determination unit includes: A fragment delay determination unit, configured to determine n fragment delays by a fragment delay formula based on the sending time and receiving time of the n message fragments; A harmonic averaging unit, configured to determine an actual link delay by a harmonic averaging formula based on the n slice delays; The fragmentation delay is half of the difference between the reception time and the transmission time of the message fragment; The harmonic mean formula is: ; Where H is the harmonic mean, n is the number of message fragments; x i is the i-th fragment delay of the message, i ranges from 1 to n; the harmonic mean H is equal to the arithmetic mean of the reciprocals of multiple message fragment delay data; Wherein, the error determination module comprises: An absolute error determination unit, configured to obtain an absolute error value by subtracting the actual link delay from the link test delay; A relative error determination unit, configured to obtain a relative error value by dividing the absolute value of the absolute error value by the actual link delay; A corresponding storage unit is used to store the relative error value and the corresponding data type in a delay table; Wherein, the device further comprises: An error search module is used to search for a relative error value corresponding to the current data in the delay table based on the data type when data is transmitted; The delay determination module is used to determine a value close to the actual delay based on the relative error value and the current TWAMP delay data.
4. The link delay measurement device based on the TWAMP protocol according to claim 3, characterized in that: The first delay acquisition module includes: A first transmitting unit, configured to send a first test message from a transmitting end; wherein the first test message includes a first timestamp; A second transmitting unit, configured to receive the first test message at the reflector end and return the second test message to the transmitting end; A message receiving unit, used for the transmitting end to receive the second test message and record the receiving time; A delay determination unit is used to determine a link test delay based on the first timestamp and the receiving time.
5. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the steps of the link delay measurement method based on the TWAMP protocol as described in any one of claims 1 to 2 are implemented.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the link delay measurement method based on the TWAMP protocol as described in any one of claims 1 to 2 are implemented.
Citation Information
Patent Citations
System for data traffic delay time test and error cancelling method
CN101316151A
Link test method, apparatus and system
CN107465565A