Network latency measurement method, electronic device, and computer program product
By introducing a message processing device into the measurement equipment and using the method of timestamp parameter generation and processing, the problem of inaccurate network latency measurement in the 5G core network is solved, and high-precision network latency measurement is achieved, especially the processing latency measurement between network elements in the 5G core network.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZTE CORP
- Filing Date
- 2024-12-24
- Publication Date
- 2026-06-26
AI Technical Summary
Existing technologies do not provide high accuracy for network latency measurement in 5G core networks, especially in the measurement of transmission latency at the nanosecond level. This is mainly because the latency of the measurement equipment itself in processing packets is included in the network latency, leading to inaccurate measurements.
By introducing a message processing device into the measuring equipment, a timestamp parameter is carried in the extended header of the first measuring message. The timestamp information is first generated by the message generation device, and then the second measuring message is generated by the message processing device. Finally, a receiving timestamp is added at the target device, which eliminates the error of the measuring equipment's own processing and improves the measurement accuracy.
By eliminating errors in the measurement equipment's own message processing, the accuracy of network latency measurement is improved, achieving nanosecond-level measurement accuracy, which is suitable for measuring the processing latency between network elements in the 5G core network.
Smart Images

Figure CN122293553A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a method for measuring network latency, an electronic device, and a computer program product. Background Technology
[0002] In related technologies, network latency measurement primarily involves sending ICMP (Internet Control Message Protocol) echo requests to the target host and waiting for an echo reply. Latency is calculated based on the time difference between sending and receiving. This method combines the functions of Ping (Packet Internet Grope) and traceroute, allowing for continuous sending of ICMP requests and statistical analysis of the success rate and latency of each hop. However, this approach includes the processing time of the protocol stack software in the latency measurement, resulting in low accuracy, especially in 5G core networks where the required accuracy for network forwarding latency is typically at the nanosecond (ns) level. This method cannot meet the demands of current network latency measurement technologies. Summary of the Invention
[0003] This disclosure provides a network latency measurement method, an electronic device, and a computer program product.
[0004] In a first aspect, embodiments of this disclosure provide a network latency measurement method, the method being applied to a message processing device, the method comprising:
[0005] Receive the first measurement message sent by the message generation device, and obtain the timestamp parameter from the extended header of the first measurement message;
[0006] Timestamp information is generated based on the timestamp parameters, and a second measurement message is generated based on the timestamp parameters and the timestamp information;
[0007] The second measurement message is sent to the target device, which instructs the target device to forward the message to measure the network latency between the measurement device to which the message processing device and the message generation device belong and the target device.
[0008] Secondly, embodiments of this disclosure also provide a network latency measurement method, the method being applied to a packet generation device, the method comprising:
[0009] Generate a first measurement message, the extended header of which carries a timestamp parameter;
[0010] The first measurement message is sent to the message processing device; the first measurement message is used to instruct the message processing device to generate timestamp information according to the timestamp parameter, generate a second measurement message according to the timestamp parameter and the timestamp information, and send the second measurement message to the target device; the second measurement message is used to instruct the target device to forward the message to measure the network latency between the measurement device to which the message processing device and the message generation device belong and the target device.
[0011] Thirdly, embodiments of this disclosure also provide an electronic device, including a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements the network latency measurement method.
[0012] Fourthly, this disclosure also provides a computer program product comprising a computer program that, when executed by a processor, implements the network latency measurement method as described above.
[0013] The network latency measurement method in this embodiment is applied to a message processing device and includes: receiving a first measurement message sent by a message generation device; obtaining timestamp parameters from the extended header of the first measurement message; generating timestamp information based on the timestamp parameters; and generating a second measurement message based on the timestamp parameters and the timestamp information; sending the second measurement message to a target device, wherein the second measurement message is used to instruct the target device to forward the message, so as to measure the network latency between the network latency measurement system to which the message processing device and the message generation device belong and the target device; this embodiment can eliminate the measurement error caused by the measurement device itself processing the measurement message and improve the accuracy of network latency measurement. Attached Figure Description
[0014] In the accompanying drawings of the embodiments disclosed herein:
[0015] Figure 1 This is a schematic diagram of network latency in related technologies;
[0016] Figure 2 This is a schematic diagram of the system architecture of the network latency measurement method according to an embodiment of this disclosure;
[0017] Figure 3 A schematic diagram of a network latency measurement process, with the message processing apparatus as the execution subject, provided in this embodiment of the disclosure. Figure 1 ;
[0018] Figure 4 Schematic diagrams of the first and fourth measurement message formats provided in embodiments of this disclosure;
[0019] Figure 5A schematic diagram of a network latency measurement process, with the message processing apparatus as the execution subject, provided in this embodiment of the disclosure. Figure 2 ;
[0020] Figure 6 A schematic diagram of the extended header format of the fourth measurement message provided in this embodiment of the disclosure;
[0021] Figure 7 A schematic diagram of the extended header format of the first measurement message provided in an embodiment of this disclosure;
[0022] Figure 8 A schematic diagram showing the timestamp information format corresponding to the CRC16 checksum algorithm and the CRC32 checksum algorithm;
[0023] Figure 9a This is a schematic diagram showing the location of the timestamp information in the second measurement message in an embodiment of this disclosure;
[0024] Figure 9b This is a schematic diagram illustrating the position of timestamps in measurement messages in related technologies;
[0025] Figure 10 A schematic diagram of a network latency measurement process with a message generation device as the execution subject provided in this embodiment of the disclosure;
[0026] Figure 11 A schematic diagram of a network latency measurement process provided as a specific example of this disclosure;
[0027] Figure 12 A schematic diagram illustrating UPF user plane packet delay measurement provided in an embodiment of this disclosure;
[0028] Figure 13 This is a schematic diagram of the module composition of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0029] To enable those skilled in the art to better understand the technical solutions of this disclosure, the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings.
[0030] The present disclosure will be described more fully below with reference to the accompanying drawings; however, the embodiments shown may be embodied in different forms, and the present disclosure should not be construed as limited to the embodiments set forth below. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will enable those skilled in the art to fully understand the scope of the disclosure.
[0031] The accompanying drawings of the embodiments disclosed herein are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the detailed embodiments to explain this disclosure and do not constitute a limitation thereof. The above and other features and advantages will become more apparent to those skilled in the art from the description of the detailed embodiments with reference to the accompanying drawings.
[0032] This disclosure may be described with reference to plan and / or cross-sectional views using the ideal schematic diagrams of this disclosure. Therefore, the example illustrations may be modified according to manufacturing techniques and / or tolerances.
[0033] Where there is no conflict, the various embodiments of this disclosure and the features thereof in the embodiments may be combined with each other.
[0034] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to limit the disclosure. The term "and / or" as used in this disclosure includes any and all combinations of one or more of the associated enumerated entries. The singular forms "a" and "the" as used in this disclosure are also intended to include the plural forms, unless the context clearly indicates otherwise. The terms "comprising," "made of," etc., as used in this disclosure specify the presence of the stated feature, integral, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof.
[0035] Unless otherwise specified, all terms used in this disclosure (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined in this disclosure.
[0036] This disclosure is not limited to the embodiments shown in the accompanying drawings, but includes modifications to the configuration based on the manufacturing process. Therefore, the areas illustrated in the drawings are schematic, and the shapes of the areas shown illustrate specific shapes of the areas of an element, but are not intended to be limiting.
[0037] Figure 1 This is a diagram illustrating network latency in related technologies, such as... Figure 1 As shown, the measuring device 101 needs to accurately measure the delay of a message along all paths through the target device 102, that is, to accurately measure the network delay: t1+t2+t3+t4+t5+t6+t7. The measurement process is as follows: The measuring message sent by the measuring device 101 carries a high-precision transmission timestamp. After passing through link 201, it reaches the switch 103 for processing, then passes through link 202 to the target device 102 for processing, then passes through link 203 to the switch 103 for processing, and finally passes through link 204 to the measuring device 101. The measuring device 101 compares the receiving timestamp carried by the received measuring message with the transmission timestamp carried by the sent measuring message to calculate the network delay. The main error in this network delay measurement is that the delay t0 of the measuring device 101 itself in processing the message is included in the network delay.
[0038] To address the aforementioned issues, this disclosure provides a method for measuring network latency. Figure 2 This is a schematic diagram of the system architecture of the network latency measurement method according to an embodiment of this disclosure, as shown below. Figure 2 As shown, the system includes a measurement device 101 and a target device 102. The measurement device 101 includes a message generation device 301 and a message processing device 302. The message generation device 301 includes a software processing system for managing and running test cases, generating raw measurement messages, calculating network latency, and generating measurement reports. The message processing device 302 can be an FPGA (Field Programmable Gate Array) network processing unit for sending and receiving measurement messages and generating accurate timestamps.
[0039] Figure 3 A schematic diagram of a network latency measurement process, with the message processing apparatus as the execution subject, provided in this embodiment of the disclosure. Figure 1 ,like Figure 3 As shown, the network latency measurement method is applied to a message processing device and includes the following steps:
[0040] Step S1: Receive the first measurement message sent by the message generation device, and obtain the timestamp parameter from the extended header of the first measurement message.
[0041] The message generation device 301 generates a first measurement message and sends the first measurement message to the message processing device 302. The first measurement message may include, but is not limited to, TCP (Transmission Control Protocol) / UDP (User Datagram Protocol) standard messages.
[0042] Figure 4 This is a schematic diagram of the first measurement message format provided in an embodiment of the present disclosure, such as... Figure 4 As shown, the first measurement message includes: an extension header, a Layer 2 header, an IP header, a protocol header, and a payload. The extension header of the first measurement message carries a timestamp parameter, which is used to instruct the message processing device 302 to generate timestamp information. The extension header of the first measurement message is 8 bytes, and the timestamp parameter occupies 8 bytes of the extension header.
[0043] Step S2: Generate timestamp information based on timestamp parameters, and generate a second measurement message based on timestamp parameters and timestamp information.
[0044] The timestamp parameter serves as reference information for generating timestamp information. For example, the timestamp parameter can characterize the size and storage location of the timestamp information. The message processing device 302 generates timestamp information based on the timestamp parameter, and the timestamp information includes at least a transmission timestamp. The message processing device 302 can determine the target address based on the timestamp parameter and the timestamp information, write the timestamp information to the target address, fill in the layer 2 header of the message, and generate a second measurement message. The target address is the storage address of the timestamp information in the first measurement message.
[0045] Step S3: Send a second measurement message to the target device. The second measurement message is used to instruct the target device to forward the message in order to measure the network latency between the network latency measurement system to which the message processing device and the message generation device belong and the target device.
[0046] The message processing device 302 sends a second measurement message to the target device 102. The second measurement message can be forwarded to the target device 102 through a forwarding device (such as switch 103). After being processed by the target device 102, it is forwarded to the message processing device 302 through the forwarding device. The message processing device 302 adds a receiving timestamp and sends it to the message generation device 301. The message generation device 301 calculates the network latency based on the receiving timestamp and the sending timestamp.
[0047] In related technologies, the measurement device 101 includes a message generation device 301 but not a message processing device 302. The message generation device 301 first generates a transmission timestamp, then performs protocol stack encapsulation to generate a measurement message, which is then sent to the target device 102. The protocol stack encapsulation time is also included in the network latency calculation, and the long protocol stack encapsulation time leads to inaccurate network latency measurements. In this embodiment, the measurement device 101 additionally includes a message processing device 302. The message generation device 301 first completes the protocol stack message encapsulation and sends the timestamp parameter in the extended header of the first measurement message to the message processing device 302. The message processing device 302 then generates timestamp information based on the timestamp parameter and generates a second measurement message based on the timestamp information and timestamp parameter. This embodiment adds the transmission timestamp at the final stage of the measurement message transmission, which can eliminate measurement errors caused by the measurement device itself processing the measurement message and improve the accuracy of network latency measurements.
[0048] The network latency measurement method in this embodiment is applied to a message processing device and includes: receiving a first measurement message sent by a message generation device; obtaining timestamp parameters from the extended header of the first measurement message; generating timestamp information based on the timestamp parameters; and generating a second measurement message based on the timestamp parameters and the timestamp information; sending the second measurement message to a target device, wherein the second measurement message is used to instruct the target device to forward the message, so as to measure the network latency between the measurement device to which the message processing device and the message generation device belong and the target device; this embodiment can eliminate the measurement error caused by the measurement device itself processing the measurement message and improve the accuracy of network latency measurement.
[0049] In some embodiments, the timestamp information includes the sending timestamp. Figure 5 A schematic diagram of a network latency measurement process, with the message processing apparatus as the execution subject, provided in this embodiment of the disclosure. Figure 2 ,like Figure 5 As shown, after sending the second measurement message to the target device (i.e., step S3), the network latency measurement method may further include the following steps:
[0050] Step S4: Receive the third measurement message sent by the target device and record the timestamp of receiving the third measurement message; wherein, the third measurement message is the message forwarded by the target device from the second measurement message.
[0051] Step S5: Generate a fourth measurement message based on the third measurement message, wherein the extended header of the fourth measurement message carries a receiving timestamp.
[0052] The format of the fourth measurement message is as follows: Figure 4 As shown, the fourth measurement message may include: an extension header, a Layer 2 header, an IP header, a protocol header, and a payload.
[0053] Figure 6 This is a schematic diagram of the extended header format of the fourth measurement message provided in an embodiment of this disclosure, as shown below. Figure 6 As shown, the extended header of the fourth measurement message carries a received timestamp. In some embodiments, the length of the received timestamp can be 6 bytes, with the remaining 2 bytes in the extended header being reserved bits.
[0054] Step S6: Send the fourth measurement message to the message generation device. The fourth measurement message is used to instruct the message generation device to calculate the network delay based on the receiving timestamp and the sending timestamp.
[0055] The message processing unit 302 sends a fourth measurement message carrying a reception timestamp to the message generation unit 301. The message generation unit 301 can obtain the transmission timestamp from the payload of the fourth measurement message and the reception timestamp from the extended header of the third measurement message, and calculate the network delay based on the reception timestamp and the transmission timestamp. Figure 1 In the scenario shown, the calculated network latency is t1+t2+t3+t4+t5+t6+t7, excluding the time t0 taken by the packet generation device 301 to encapsulate and generate the first measurement packet. Therefore, the network latency measurement is more accurate.
[0056] In some embodiments, the timestamp information includes checksum information, which is used to keep the checksum information of the second measurement message unchanged.
[0057] In some embodiments, the timestamp parameter includes at least the timestamp length and the timestamp position. Accordingly, the step of generating timestamp information based on the timestamp parameter (i.e., step S2) may include the following steps: generating a sending timestamp based on the timestamp length; and generating verification and neutralization information based on the timestamp position and the sending timestamp.
[0058] Figure 7 This is a schematic diagram of the extended header format of the first measurement message provided in an embodiment of this disclosure. In some embodiments, such as... Figure 7 As shown, the timestamp parameters can include: timestamp enable flag (tflag), timestamp length (tplen), and timestamp location (location). The timestamp enable flag and timestamp length are each 2 bytes, and the timestamp location is 4 bytes.
[0059] The first two bytes of the 8-byte extended header of the first measurement message are the timestamp enable flag (tflag), which indicates whether a timestamp is inserted in the measurement message; the two bytes after the timestamp enable flag (tflag) are the timestamp length (tplen); and the last four bytes of the extended header are the timestamp location, which indicates the location where the timestamp was sent.
[0060] The format of the extended header in the first measurement message is as follows: Figure 7 In the case shown, generating timestamp information based on the timestamp parameter (i.e., step S2) includes the following steps: when the timestamp enable flag is set to a preset value, generating the sending timestamp based on the timestamp length; generating verification and neutralization information based on the timestamp position and the sending timestamp; wherein, the preset value is a preset value representing the enabled timestamp.
[0061] In some embodiments, the timestamp position is the starting offset position of the payload in the first measurement message, i.e., the number of bytes offset from the start of the IP header. Generating checksum information based on the timestamp position and the transmission timestamp includes the following steps:
[0062] Step S221: Determine the target address based on the timestamp position and preset length, and obtain the target data from the target address.
[0063] In this embodiment of the disclosure, the preset length is 8 bytes. Starting from the IP header of the first measurement message, the target address is obtained by offsetting the preset length of bytes. The original data of the first measurement message, i.e., the target data, is obtained from the target address.
[0064] Step S222: Calculate the verification and neutralization information based on the target data and the sending timestamp.
[0065] In some embodiments, calculating the verification neutralization information based on the target data and the sending timestamp (i.e., step S222) includes the following steps:
[0066] Step S2221: Calculate the verification parameters based on the target data and the sending timestamp.
[0067] The verification algorithm can be selected to calculate the verification parameters based on the CRC verification method of the measurement message. The CRC verification algorithm can include the CRC16 verification algorithm and the CRC32 verification algorithm.
[0068] Step S2222: Calculate the verification neutralization information based on the verification parameters.
[0069] In some embodiments, calculating the verification neutralization information based on the verification parameters includes: performing an inverse operation on the verification parameters to obtain the verification neutralization information.
[0070] The total length of the timestamp information is the preset length. In this embodiment, the timestamp and verification information are sent in a total of 8 bytes. Figure 8 This is a diagram illustrating the timestamp information formats corresponding to the CRC16 and CRC32 checksum algorithms, as shown below. Figure 8 As shown in the left-middle figure, the CRC16 checksum algorithm can generate 2 bytes of checksum information, i.e., 2 bytes of CRC16 neutral bits. Correspondingly, the sending timestamp is 6 bytes. Figure 8 As shown in the middle right figure, the CRC32 checksum algorithm can generate 4 bytes of checksum information, that is, 4 bytes of CRC16 checksum bits. Correspondingly, the sending timestamp is 4 bytes.
[0071] Taking the CRC16 checksum algorithm as an example, the target data (8 bytes) is obtained based on the location field and preset length in the extended header of the first measurement message. A 6-byte transmission timestamp is generated based on the local clock. Based on the target data and the transmission timestamp, the checksum parameter is calculated using the CRC16 checksum algorithm. This checksum parameter is the CRC16 checksum result CRC16_RESULT. The CRC16 checksum result CRC16_RESULT is then inverted to obtain the CRC16 checksum bit, i.e., CRC16 checksum bit = [0xFF&(~CRC16_RESULT), 0xFF&((~CRC16_RESULT)>>8)].
[0072] The process of calculating the checksum information using the CRC32 checksum algorithm is the same as that using the CRC16 checksum algorithm. Based on the target data and the transmission timestamp, the checksum parameter is calculated using the CRC32 checksum algorithm. This checksum parameter is the CRC32 checksum result CRC32_RESULT. The CRC32 checksum result CRC32_RESULT is then inverted to obtain the CRC32 checksum bit, i.e., CRC32 checksum bit = ...
[0073] [0xFF&(~CRC32_RESULT),0xFF&((~CRC32_RESULT)>>8),0xFF&((~CRC32_RESULT)>16),0xFF&((~CRC32_RESULT)>>24)].
[0074] In some embodiments, generating a second measurement message based on timestamp parameters and timestamp information includes the following steps: deleting the extended header of the first measurement message and writing the timestamp information into the payload of the first measurement message according to the timestamp parameters to obtain the second measurement message.
[0075] In some embodiments, the timestamp parameter includes the position of the timestamp, which is the starting offset position of the payload in the first measurement message. The step of writing the timestamp information into the payload of the first measurement message according to the timestamp parameter includes the following steps: determining the target address based on the timestamp position and a preset length; and writing the timestamp information into the target address.
[0076] Figure 9a This is a schematic diagram illustrating the location of the timestamp information in the second measurement message in an embodiment of this disclosure, as shown below. Figure 9aAs shown, the target data in the first measurement message is replaced by the sending timestamp and checksum information. The target data is obtained from the target address of the first measurement message. The target address = the position indicated by the location field in the extension header (i.e., the position of the timestamp) + the preset length. The generated second measurement message has no extension header, does not need to add protocol extension, and the payload length remains unchanged, that is, the message length is not changed. In addition, the CRC checksum information is carried to ensure the CRC check bit of the message protocol layer.
[0077] Figure 9b This is a schematic diagram illustrating the position of timestamps in measurement messages in related technologies, such as... Figure 9b As shown, in related technologies, the sending timestamp is an additional field carried after the IPv6 (Internet Protocol Version 6) message header and before the transport layer (e.g., TCP or UDP) header, namely the IFIT (Information Flow Informatization Telemetry) field. This requires writing the sending timestamp before protocol encapsulation, which results in errors in the measurement device's own message processing.
[0078] This disclosure also provides a method for measuring network latency. Figure 10 This is a schematic diagram of a network latency measurement process with a message generation device as the execution subject, as provided in the embodiments of this disclosure. Figure 10 As shown, the network latency measurement method is applied to a message processing device and includes the following steps:
[0079] Step S1': Generate a first measurement message, the extended header of which carries a timestamp parameter.
[0080] Step S2': Send a first measurement message to the message processing device; the first measurement message is used to instruct the message processing device to generate timestamp information according to the timestamp parameters, generate a second measurement message according to the timestamp parameters and timestamp information, and send the second measurement message to the target device; the second measurement message is used to instruct the target device to forward the message to measure the network latency between the measurement device to which the message processing device and the message generation device belong and the target device.
[0081] The message generation device 301 writes the timestamp parameter into the extended header of the first measurement message and sends the first measurement message to the message processing device 302. The first measurement message may include, but is not limited to, a TCP / UDP standard message.
[0082] Figure 4 This is a schematic diagram of the first measurement message format provided in an embodiment of the present disclosure, such as... Figure 4As shown, the first measurement message includes: an extension header, a Layer 2 header, an IP header, a protocol header, and a payload. The extension header of the first measurement message carries a timestamp parameter, which is used to instruct the message processing device 302 to generate timestamp information. The extension header of the first measurement message is 8 bytes long, and the timestamp parameter occupies all 8 bytes of the extension header.
[0083] In this embodiment, the message generation device 301 first completes the protocol stack message encapsulation and sends the timestamp parameter in the extended header of the first measurement message to the message processing device 302. The message processing device 302 then generates timestamp information based on the timestamp parameter and generates a second measurement message based on the timestamp information and the timestamp parameter. This embodiment adds the transmission timestamp only at the final stage of measurement message transmission, which can eliminate measurement errors caused by the measurement device's own processing of the measurement message and improve the accuracy of network latency measurement.
[0084] In some embodiments, the timestamp information includes a transmission timestamp. After sending the first measurement message to the message processing device (i.e., step S2'), the network latency measurement method may further include the following steps:
[0085] Step S3': Receive the fourth measurement message sent by the message processing device. The fourth measurement message is a message forwarded by the message processing device from the third measurement message. The third measurement message is a message forwarded by the target device from the second measurement message.
[0086] Step S4': Obtain the receive timestamp of the received third measurement message from the extended header of the fourth measurement message, and obtain the send timestamp from the payload of the fourth measurement message.
[0087] Step S5': Calculate the network delay based on the received timestamp and the sent timestamp.
[0088] In this embodiment of the disclosure, the measurement messages transmitted between the message generation device 301 and the message processing device 302 carry extended headers, that is, both the first measurement message and the fourth measurement message carry extended headers, while the measurement messages sent by the message processing device 302 to the target device 102 and the measurement messages received by the target device 102 do not have extended headers.
[0089] To clearly illustrate the solutions of the embodiments of this disclosure, the following is combined with... Figure 11 This will be illustrated with a specific example. For example... Figure 11 As shown, the measuring device 101 includes a message generation device 301 and a message processing device 302. The network latency measurement method is used to measure the network latency between the measuring device 101 and the target device 102. The network latency measurement method includes the following steps:
[0090] In step S101, the message generation device 301 generates a first measurement message and sends the first measurement message to the message processing device 302. The extended header of the first measurement message carries a timestamp parameter.
[0091] In step S102, the message processing device 302 obtains the timestamp parameter from the extended header of the first measurement message, generates timestamp information including the sending timestamp and checksum information based on the timestamp parameter, writes the timestamp information into the payload of the first measurement message, and deletes the extended header of the first measurement message to obtain the second measurement message.
[0092] In step S103, the message processing device 302 sends the second measurement message to the target device 102.
[0093] In step S104, the target device 102 generates a third measurement message based on the second measurement message and returns the third measurement message to the message processing device 302.
[0094] In step S105, the message processing device 302 records the receiving timestamp of the third measurement message and writes the receiving timestamp into the extended header to obtain the fourth measurement message.
[0095] In step S106, the message processing device 302 sends the fourth measurement message to the message generation device 301.
[0096] In step S107, the message generation device 301 obtains the sending timestamp and receiving timestamp from the fourth measurement message, and calculates the network delay based on the sending timestamp and receiving timestamp.
[0097] This disclosed embodiment can be applied to user plane packet service testing scenarios of UPF (User Plane Function, user plane network element), using measurement equipment to insert timestamps for delay measurement. Figure 12 A schematic diagram for measuring UPF user plane message delay, as shown below. Figure 12 As shown, the message generation device of the measurement device 101 simulates a terminal UE to generate service messages, inserts a transmission timestamp through the FPGA network processing unit (i.e., the message processing device), and sends the service message carrying the transmission timestamp to the UPF. During the transmission of the service message, the CRC check of the service message protocol layer does not change, so it will not affect the service processing of the UPF and the network devices in the transmission path. After the UPF completes the service processing, it sends the message to the PDN (Public Data Network) unit simulated by the measurement device 101. The FPGA network processing unit carries the reception timestamp in the message extension header and reports it to the message generation device, which then calculates the delay measurement result.
[0098] In related technologies, inserting a transmission timestamp into the business software affects the accuracy of network latency measurement, as network latency includes the processing time of the measurement device on the measurement message. In this embodiment, the message processing device 302 generates a transmission timestamp at the final stage of sending the measurement message, eliminating the processing time of the measurement device on the measurement message and improving the accuracy of network latency measurement. By carrying checksum information in the measurement message, it ensures that inserting the transmission timestamp does not damage the measurement message, eliminating the need to process the entire measurement message to generate checksums, message length, protocol headers, and other related fields. This has no impact on the network elements in the measured network path, shortens the processing time of the measurement device, and reduces the error introduced by the measurement device itself.
[0099] This disclosure provides a precise network latency measurement scheme applicable to the accurate measurement of processing latency between various network elements in the communication field, particularly suitable for 5G core network element forwarding latency measurement, especially the forwarding latency measurement of the user plane UPF. This disclosure uses an FPGA device to generate precise transmission timestamps and fills them into the measurement message for transmission. Message service testing is unaffected, minimizing errors introduced by measurement tools and software, and achieving network latency measurement at the nanosecond level.
[0100] This disclosure also provides an electronic device, such as... Figure 13 As shown, it includes a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements any of the network latency measurement methods of the present disclosure embodiments.
[0101] Among them, the processor is a device with data processing capabilities, including but not limited to the central processing unit (CPU); the memory is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read-write interface) is connected between the processor and the memory, enabling information exchange between the memory and the processor, including but not limited to the data bus (Bus).
[0102] This disclosure also provides a computer-readable medium having a computer program stored thereon, wherein the program, when executed, implements the network latency measurement method as described above.
[0103] This disclosure also provides a computer program product, which includes a computer program that, when executed by a processor, implements the network latency measurement method as described above.
[0104] Those skilled in the art will understand that all or some of the steps, systems, and devices disclosed above, as functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0105] In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be executed by several physical components working together.
[0106] Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technique for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH) or other disk storage; read-only optical disc (CD-ROM), digital versatile disc (DVD) or other optical disc storage; magnetic cartridges, magnetic tapes, disk storage or other magnetic storage; and any other media that can be used to store desired information and can be accessed by a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0107] This disclosure has disclosed exemplary embodiments, and although specific terminology has been used, it is for general illustrative purposes only and should not be construed as limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in conjunction with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this disclosure as set forth by the appended claims.
Claims
1. A method for measuring network latency, the method being applied to a message processing device, the method comprising: Receive the first measurement message sent by the message generation device, and obtain the timestamp parameter from the extended header of the first measurement message; Timestamp information is generated based on the timestamp parameters, and a second measurement message is generated based on the timestamp parameters and the timestamp information; The second measurement message is sent to the target device, which instructs the target device to forward the message to measure the network latency between the measurement device to which the message processing device and the message generation device belong and the target device.
2. The method of claim 1, wherein, The timestamp information includes a transmission timestamp. After sending the second measurement message to the target device, the method further includes: Receive a third measurement message sent by the target device and record the timestamp of receiving the third measurement message; wherein, the third measurement message is a message forwarded by the target device from the second measurement message; A fourth measurement message is generated based on the third measurement message, wherein the extended header of the fourth measurement message carries the received timestamp; The fourth measurement message is sent to the message generation device, and the fourth measurement message is used to instruct the message generation device to calculate the network delay based on the receiving timestamp and the sending timestamp.
3. The method of claim 1, wherein, The timestamp information includes checksum information, which is used to keep the checksum information of the second measurement message unchanged.
4. The method of claim 3, wherein, The timestamp parameters include the timestamp length and the timestamp position. The timestamp information also includes a sending timestamp. Generating timestamp information based on the timestamp parameters includes: The sending timestamp is generated based on the length of the timestamp; The verification and neutralization information is generated based on the position of the timestamp and the sending timestamp.
5. The method of claim 4, wherein, The timestamp is located at the starting offset of the payload in the first measurement message. Generating the checksum information based on the timestamp's location and the transmission timestamp includes: The target address is determined based on the position and preset length of the timestamp, and the target data is obtained from the target address; The verification and neutralization information is calculated based on the target data and the sending timestamp.
6. The method of claim 1, wherein, The step of generating a second measurement message based on the timestamp parameter and the timestamp information includes: The extended header of the first measurement message is deleted, and the timestamp information is written into the payload of the first measurement message according to the timestamp parameter to obtain the second measurement message.
7. The method of claim 6, wherein, The timestamp parameter includes the position of the timestamp, which is the starting offset position of the payload in the first measurement message; The step of writing the timestamp information into the payload of the first measurement message according to the timestamp parameter includes: The target address is determined based on the position and preset length of the timestamp; Write the timestamp information to the target address.
8. A method for measuring network latency, the method being applied to a message generation device, the method comprising: Generate a first measurement message, the extended header of which carries a timestamp parameter; sending the first measurement packet to a packet processing device; the first measurement packet is used to instruct the packet processing device to generate timestamp information according to the timestamp parameter, generate a second measurement packet according to the timestamp parameter and the timestamp information, and send the second measurement packet to a target device; the second measurement packet is used to instruct the target device to perform forwarding to measure network delay between the packet processing device and the packet generating device and the target device.
9. The method of claim 8, wherein, The timestamp information includes a sending timestamp, and after sending the first measurement packet to the packet processing device, the method further comprises: receiving a fourth measurement packet sent by the packet processing device, the fourth measurement packet being a packet forwarded by the packet processing device to the target device, the third measurement packet being a packet forwarded by the target device to the second measurement packet; obtaining a receiving timestamp of receiving the third measurement packet from an extension header of the fourth measurement packet, and obtaining the sending timestamp from a payload of the fourth measurement packet; calculating network delay according to the receiving timestamp and the sending timestamp.
10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program capable of being executed by the processor, and the computer program is executed by the processor to implement the network delay measurement method in any one of claims 1-7, or the network delay measurement method in claim 8 or 9.
11. A computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the network delay measurement method in any one of claims 1-7, or the network delay measurement method in claim 8 or 9.